/* =========================================================================
   作問力どっとアップ サイト共通スタイル（トップ・共通認証・ユーザー情報管理・管理者ページ）
   デザインは ver.2 と同じ方針：Figma Community「New Year Deal Web Page」
   (Nickelfox Design) 風 ＋ オレンジベース（ネオ・ブルータリズム）。2px輪郭線＋ソリッドシャドウ。背景は単色。
   フォントサイズは 12/14/16/18/20/24/30/40px の8段階スケールのみ。
   ========================================================================= */
:root {
  --c-orange: #F4711F; --c-orange-hover: #FF8B45; --c-orange-dark: #A83E03;
  --c-orange-soft: #FFE4CE; --c-orange-tint: #FFF2E6;
  --c-ink: #241A12; --c-ink-soft: #635447;
  --c-cream: #FFF8F0; --c-paper: #FFFFFF; --c-line: #E8D8C6;
  --c-yellow: #FFC93C; --c-green: #1F6B44; --c-red: #A63320;
  --gk-bubble: #FFF3D2;
  --sp-xs: 8px; --sp-s: 12px; --sp-m: 16px; --sp-l: 20px; --sp-xl: 24px; --sp-2xl: 32px; --sp-4xl: 56px;
  --r-m: 12px; --r-l: 18px; --r-xl: 26px; --r-full: 9999px;
  --fs-xs: 12px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px; --fs-4xl: 40px;
  --shadow-pop: 5px 5px 0 var(--c-ink);
  --shadow-pop-sm: 3px 3px 0 var(--c-ink);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  font-family: "Noto Sans JP", "Outfit", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", sans-serif;
  font-size: var(--fs-md); line-height: 1.7; color: var(--c-ink);
  background: var(--c-cream);   /* 背景は単色（グラデーションなし） */
  font-feature-settings: "palt";
}
h1 { font-size: var(--fs-3xl); line-height: 1.3; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); line-height: 1.35; }
h3 { font-size: var(--fs-xl); line-height: 1.4; }
h1, h2, h3 { font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 800; margin: 0 0 var(--sp-s); }
p { margin: 0 0 var(--sp-s); }
a { color: var(--c-orange-dark); }
small { font-size: var(--fs-xs); }

/* ---------- ヘッダー ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-m);
  flex-wrap: wrap;
  padding: var(--sp-s) var(--sp-xl);
  background: var(--c-cream); border-bottom: 2px solid var(--c-ink);
}
.brand { font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 800;
         font-size: var(--fs-lg); letter-spacing: -0.02em; }
.brand a { color: var(--c-ink); text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: var(--sp-s); flex-wrap: wrap; }
.site-nav .user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--c-orange-tint); border: 2px solid var(--c-ink); border-radius: var(--r-full);
  padding: 2px var(--sp-s); font-size: var(--fs-sm); font-weight: 700;
  max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--c-ink); border-radius: var(--r-full);
  padding: 4px var(--sp-m); min-height: 34px;
  font-size: var(--fs-sm); font-weight: 800; text-decoration: none; color: var(--c-ink);
  background: var(--c-paper); box-shadow: var(--shadow-pop-sm);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.nav-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--c-ink); background: var(--c-orange-tint); }
.nav-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.nav-btn.primary { background: var(--c-orange); color: var(--c-ink); }
.nav-btn.primary:hover { background: var(--c-orange-hover); }

/* ---------- レイアウト ---------- */
main.container { width: min(1080px, calc(100% - var(--sp-2xl))); margin: 0 auto; padding: var(--sp-2xl) 0 var(--sp-4xl); }
main.container.narrow { width: min(560px, calc(100% - var(--sp-2xl))); }
main.container.medium { width: min(820px, calc(100% - var(--sp-2xl))); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-m); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.page-head p { color: var(--c-ink-soft); margin: 0; }
.page-head .actions { display: flex; gap: var(--sp-xs); flex-wrap: wrap; }

/* ---------- カード ---------- */
.card {
  background: var(--c-paper); border: 2px solid var(--c-ink); border-radius: var(--r-xl);
  padding: var(--sp-xl); box-shadow: var(--shadow-pop); margin-bottom: var(--sp-xl);
}
.card h2 { margin-top: 0; }
.card .lead { color: var(--c-ink-soft); }

/* ---------- ボタン ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--c-paper); color: var(--c-ink);
  border: 2px solid var(--c-ink); border-radius: var(--r-full);
  min-height: 40px; padding: 4px var(--sp-l);
  font-size: var(--fs-sm); font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: var(--shadow-pop-sm);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  font-family: inherit;
}
.button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--c-ink); background: var(--c-orange-tint); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.button.primary { background: var(--c-orange); }
.button.primary:hover { background: var(--c-orange-hover); }
.button.danger { background: #FBE3DC; }
.button.small { min-height: 30px; padding: 0 var(--sp-s); font-size: var(--fs-xs); box-shadow: 2px 2px 0 var(--c-ink); }

/* ---------- フォーム ---------- */
.form { display: grid; gap: var(--sp-m); }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: var(--fs-sm); }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="file"], .form select, .form textarea {
  font-family: inherit; font-size: var(--fs-md);
  border: 2px solid var(--c-ink); border-radius: var(--r-m);
  padding: 10px var(--sp-s); background: var(--c-paper); color: var(--c-ink);
  min-width: 0; width: 100%;
}
.form input:focus, .form select:focus { outline: 3px solid var(--c-yellow); outline-offset: 1px; }
.form small { font-weight: 400; color: var(--c-ink-soft); font-size: var(--fs-xs); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
.inline-form select {
  font-family: inherit; font-size: var(--fs-xs);
  border: 2px solid var(--c-ink); border-radius: var(--r-m); padding: 3px 6px; background: var(--c-paper);
}
.check-line { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 700; }
.check-line input { width: 18px; height: 18px; accent-color: var(--c-orange); }

/* ---------- 通知・バッジ ---------- */
.notice {
  border: 2px solid var(--c-ink); border-radius: var(--r-m);
  padding: var(--sp-s) var(--sp-m); margin-bottom: var(--sp-m);
  font-size: var(--fs-sm); font-weight: 700; background: var(--c-orange-tint);
}
.notice.ok { background: #E2F2E7; }
.notice.error { background: #FBE3DC; }
.notice.info { background: var(--gk-bubble); }
.badge {
  display: inline-block; border: 2px solid var(--c-ink); border-radius: var(--r-full);
  padding: 0 10px; font-size: var(--fs-xs); font-weight: 800; white-space: nowrap;
}
.badge.ok { background: #E2F2E7; color: var(--c-green); }
.badge.warn { background: #FBE3DC; color: var(--c-red); }
.badge.role-admin { background: var(--c-orange); color: var(--c-ink); }
.badge.role-trainer { background: var(--c-yellow); color: var(--c-ink); }
.badge.role-user { background: var(--c-paper); color: var(--c-ink); }

/* ---------- テーブル ---------- */
.table-wrap { overflow-x: auto; border: 2px solid var(--c-ink); border-radius: var(--r-l);
              background: var(--c-paper); box-shadow: var(--shadow-pop); margin-bottom: var(--sp-xl); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 720px; }
table.table th, table.table td { padding: 10px var(--sp-s); text-align: left; vertical-align: top; }
table.table thead th {
  background: var(--c-orange-tint); border-bottom: 2px solid var(--c-ink);
  font-size: var(--fs-xs); letter-spacing: 0.04em; white-space: nowrap;
}
table.table tbody tr + tr td { border-top: 1px solid var(--c-line); }
table.table td.wide { min-width: 220px; }
table.table td small { color: var(--c-ink-soft); }
table.table td.nowrap { white-space: nowrap; }

/* ---------- 統計 ---------- */
.stat-row { display: flex; gap: var(--sp-m); flex-wrap: wrap; margin-bottom: var(--sp-xl); }
.stat {
  flex: 1; min-width: 130px; background: var(--c-paper); border: 2px solid var(--c-ink);
  border-radius: var(--r-l); padding: var(--sp-m); box-shadow: var(--shadow-pop-sm);
  display: grid; gap: 2px; justify-items: start;
}
.stat-num { font-family: "Outfit", sans-serif; font-size: var(--fs-3xl); font-weight: 800; line-height: 1.1; }
.stat-label { font-size: var(--fs-xs); color: var(--c-ink-soft); font-weight: 700; }

/* ---------- 管理メニューカード ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-l); }
.menu-card {
  display: grid; gap: 6px; text-decoration: none; color: var(--c-ink);
  background: var(--c-paper); border: 2px solid var(--c-ink); border-radius: var(--r-l);
  padding: var(--sp-l); box-shadow: var(--shadow-pop);
  transition: transform 0.14s, box-shadow 0.14s;
}
.menu-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--c-orange); }
.menu-card .menu-title { font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 800; font-size: var(--fs-lg); }
.menu-card .menu-desc { font-size: var(--fs-sm); color: var(--c-ink-soft); }

/* ---------- パスワード表示 ---------- */
.password-box {
  font-family: "Consolas", "Menlo", monospace; font-size: var(--fs-2xl); font-weight: 700;
  background: var(--gk-bubble); border: 2px dashed var(--c-ink); border-radius: var(--r-m);
  padding: var(--sp-m) var(--sp-l); display: inline-block; letter-spacing: 0.08em;
  user-select: all;
}

/* ---------- トップページ（機能カード） ---------- */
.hero-title {
  font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 900;
  font-size: clamp(46px, 10vw, 96px); line-height: 0.94; letter-spacing: -0.045em;
  margin: 0; color: var(--c-ink);
}
.tools { display: grid; gap: var(--sp-xl); }
.tool {
  position: relative; display: flex; align-items: center; gap: var(--sp-xl);
  text-decoration: none; color: var(--c-ink);
  background: var(--c-paper); border: 2px solid var(--c-ink); border-radius: var(--r-xl);
  padding: var(--sp-xl); box-shadow: var(--shadow-pop);
  transition: transform 0.14s, box-shadow 0.14s;
}
.tool:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--c-orange); }
.tool-visual { flex-shrink: 0; width: 104px; display: grid; place-items: center; }
.tool-visual svg { width: 100%; height: auto; }
.tool-visual.gakumo svg { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(0.4deg); } 50% { transform: translateY(-8px) rotate(-1.2deg); } }
.tool-body { flex: 1; display: grid; gap: var(--sp-s); min-width: 0; }
.tool-name {
  font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 800;
  font-size: clamp(var(--fs-xl), 2.6vw, var(--fs-2xl)); line-height: 1.3; letter-spacing: -0.025em;
}
.tool-name .ver {
  display: inline-block; background: var(--c-ink); color: var(--c-cream);
  border-radius: var(--r-full); padding: 0 var(--sp-s); margin-left: var(--sp-xs);
  font-size: var(--fs-sm); vertical-align: 0.24em; letter-spacing: 0;
}
.tool.is-new .tool-name .ver { background: var(--c-orange); color: var(--c-ink); }
.badge-new {
  position: absolute; top: -15px; right: var(--sp-2xl); background: var(--c-yellow); color: var(--c-ink);
  border: 2px solid var(--c-ink); border-radius: var(--r-full); padding: 1px var(--sp-s);
  font-family: "Outfit", sans-serif; font-weight: 800; font-size: var(--fs-xs); letter-spacing: 0.1em;
  box-shadow: var(--shadow-pop-sm); transform: rotate(-3deg);
}
.speech {
  position: relative; align-self: start; justify-self: start; background: var(--gk-bubble);
  border: 2px solid var(--c-ink); border-radius: var(--r-m);
  padding: var(--sp-xs) var(--sp-s); box-shadow: var(--shadow-pop-sm);
  font-size: var(--fs-sm); font-weight: 700; color: var(--c-ink); max-width: 100%; margin-top: var(--sp-xs);
}
.speech::before {
  content: ""; position: absolute; left: -13px; top: 13px; border-width: 7px 14px 7px 0;
  border-style: solid; border-color: transparent var(--c-ink) transparent transparent;
}
.tool-go {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--c-orange); color: var(--c-ink); border: 2px solid var(--c-ink); border-radius: var(--r-full);
  min-height: 46px; padding: 0 var(--sp-xl); font-weight: 800; font-size: var(--fs-md);
  box-shadow: var(--shadow-pop-sm);
}
.tool:hover .tool-go { background: var(--c-orange-hover); }

/* ---------- 非公開のシステム（管理者ページ「各システムの公開」で「公開しない」にしたもの）
   カードは消さずにグレー表示・クリック不可にし，「つかう →」の位置に
   設定した文字（例：調整中）をスタンプ風に表示する。 ---------- */
.tool-slot.is-closed { cursor: not-allowed; }
.tool-slot.is-closed .tool {
  pointer-events: none; user-select: none; transform: none;
  background: #F2EEE9; border-color: #8A8079; color: #8A8079;
  box-shadow: 5px 5px 0 #B9B1A9;
}
.tool-slot.is-closed .tool-visual,
.tool-slot.is-closed .tool-body,
.tool-slot.is-closed .badge-new { filter: grayscale(1); opacity: 0.55; }
.tool-slot.is-closed .tool-visual svg { animation: none; }
.tool-go.closed-go {
  background: var(--c-paper); color: var(--c-ink);
  border-width: 3px; border-radius: var(--r-l); box-shadow: var(--shadow-pop);
  transform: rotate(-3deg);
  flex-shrink: 1; max-width: 46%; min-height: 52px; padding: 6px var(--sp-xl);
  font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 900;
  font-size: var(--fs-xl); line-height: 1.3; letter-spacing: 0.06em;
  text-align: center; white-space: normal; overflow-wrap: anywhere;
}
.closed-admin { margin: var(--sp-xs) 0 0; font-size: var(--fs-xs); color: var(--c-ink-soft); }
.closed-admin .badge { margin-right: 4px; }

/* 管理者ページ「各システムの公開」 */
.system-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-s); flex-wrap: wrap; margin-bottom: var(--sp-xs); }
.system-head h2 { margin: 0; font-size: var(--fs-xl); }
.system-card .check-line { margin-bottom: var(--sp-xs); }
.menu-card .menu-status { font-size: var(--fs-xs); font-weight: 700; color: var(--c-orange-dark); }
.plain-list { margin: 0; padding-left: 1.4em; font-size: var(--fs-sm); }
.plain-list li { margin-bottom: 6px; }

/* 「調整中」ページ（非公開のシステムのURLを直接開いたとき） */
.closed-page { text-align: center; }
.closed-page-mascot { width: 150px; margin: 0 auto; }
.closed-page-stamp {
  display: inline-block; background: var(--gk-bubble); border: 3px solid var(--c-ink); border-radius: var(--r-l);
  box-shadow: var(--shadow-pop-sm); padding: 6px var(--sp-xl); margin: var(--sp-m) 0 var(--sp-s);
  font-family: "Outfit", "Noto Sans JP", sans-serif; font-weight: 900; font-size: var(--fs-2xl); letter-spacing: 0.06em;
  transform: rotate(-3deg);
}
.closed-page h1 { font-size: var(--fs-xl); }
.closed-page p { color: var(--c-ink-soft); font-size: var(--fs-sm); }

/* ---------- 定義リスト（アカウント情報） ---------- */
.info-grid { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px var(--sp-l); font-size: var(--fs-sm); }
.info-grid dt { font-weight: 800; color: var(--c-ink-soft); }
.info-grid dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .tool { flex-direction: column; align-items: flex-start; }
  .tool-go.closed-go { max-width: 100%; transform: rotate(-1.5deg); }
  .tool-visual { width: 84px; }
  .tool-go { width: 100%; }
  .speech::before { display: none; }
  .topbar { padding: var(--sp-s) var(--sp-m); }
  main.container { width: calc(100% - var(--sp-m) * 2); }
}

/* ---------- トップページのバッジ「学習指導案の書き方」（/guide/shidoan へのリンク）
   丸い書類アイコンのまわりに文字がぐるっと回る。最初は画面の右下。ドラッグで画面のどこへでも動かせる
   （位置は landing.html のスクリプトが localStorage に保存。left/top はスクリプトが付ける）。 ---------- */
.guide-badge {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  display: block; width: 152px; height: 152px; border-radius: 50%;
  box-shadow: var(--shadow-pop); background: var(--c-yellow);
  transition: transform 0.14s, box-shadow 0.14s;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: transparent;
}
.guide-badge svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.guide-badge:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--c-orange); }
.guide-badge:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--c-ink); }
.guide-badge:focus-visible { outline: 3px solid var(--c-orange); outline-offset: 3px; }
.guide-badge.dragging { transition: none; cursor: grabbing; transform: scale(1.04); box-shadow: 10px 10px 0 var(--c-orange); }
.guide-badge .ring-text { transform-origin: 80px 80px; animation: guide-badge-spin 26s linear infinite; }
.guide-badge:hover .ring-text, .guide-badge.dragging .ring-text { animation-play-state: paused; }
@keyframes guide-badge-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .guide-badge .ring-text { animation: none; } }
@media (max-width: 1120px) { .guide-badge { width: 124px; height: 124px; right: 16px; bottom: 16px; } }
@media (max-width: 560px) { .guide-badge { width: 104px; height: 104px; right: 12px; bottom: 12px; } }
/* 狭い画面では，いちばん下までスクロールしたときにバッジが最後のカードに重ならないよう，カードの下に余白を置く */
.guide-badge-space { height: 0; }
@media (max-width: 1120px) { .guide-badge-space { height: 150px; } }
