/* =========================================================================
   KDraft — スタイル
   ふだんの画面：K-POPらしい明るいラベンダーの紙面
   指名発表・抽選：プロ野球ドラフト会議の中継のような濃紺のステージ
   ========================================================================= */

:root {
  --bg: #f5f3f9;
  --bg-2: #ece8f4;
  --surface: #ffffff;
  --surface-2: #faf9fd;
  --ink: #191430;
  --ink-2: #463f60;
  --muted: #7a7493;
  --faint: #a9a4bd;
  --line: #e3deed;
  --line-2: #d3cce3;
  --brand: #5b3fe0;
  --brand-ink: #3a22b8;
  --brand-soft: #eeeafe;
  --hot: #f0397f;
  --hot-soft: #ffe8f1;
  --gold: #d6b062;
  --gold-ink: #8a6a24;
  --stage: #0d1330;
  --stage-2: #172150;
  --stage-line: rgba(214, 176, 98, 0.45);
  --ok: #138a5b;
  --danger: #c93451;
  --holo: linear-gradient(100deg, #ff9fd6, #ffd6a0 22%, #b9f3d6 44%, #a0d8ff 66%, #c9b6ff 86%, #ff9fd6);

  --display: "Dela Gothic One", system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sh-1: 0 1px 2px rgba(25, 20, 48, 0.06), 0 2px 8px -4px rgba(60, 40, 150, 0.12);
  --sh-2: 0 1px 2px rgba(25, 20, 48, 0.05), 0 12px 32px -14px rgba(60, 40, 150, 0.28);
  --sh-3: 0 2px 4px rgba(25, 20, 48, 0.06), 0 28px 60px -24px rgba(40, 24, 120, 0.42);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .08 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --appbar-h: 60px;
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1320px;
  color-scheme: light;
  accent-color: var(--brand);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--appbar-h) + 12px); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "palt" 1;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
/* 背景のオーロラとざらつきは固定レイヤー1枚に（スクロールしても再描画しない） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    var(--grain),
    radial-gradient(60rem 38rem at -5% -10%, rgba(255, 159, 214, 0.24), transparent 62%),
    radial-gradient(56rem 40rem at 108% -4%, rgba(160, 216, 255, 0.30), transparent 60%),
    radial-gradient(50rem 36rem at 60% 115%, rgba(201, 182, 255, 0.26), transparent 62%);
  background-size: 160px 160px, auto, auto, auto;
  opacity: 1;
  transform: translateZ(0);
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: 0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid rgba(91, 63, 224, 0.5); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 40px; text-align: center; }

/* ------------------------------------------------------------- 上部バー */
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  min-height: var(--appbar-h);
  padding: max(8px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 8px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(247, 245, 251, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
}
.appbar-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.appbar-brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 1px var(--line), 0 4px 10px -4px rgba(91, 63, 224, 0.5); }
.appbar-wordmark { font-family: var(--display); font-size: 20px; letter-spacing: 0.02em; }
.appbar-context { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.appbar-nav { display: flex; gap: 4px; flex: none; }
.appbar-nav a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  color: var(--ink-2); font-weight: 700; font-size: 14px; text-decoration: none; border-radius: 999px;
}
.appbar-nav a:hover { background: var(--bg-2); color: var(--ink); }
.appbar-nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* ------------------------------------------------------------- 画面の切り替え */
main { position: relative; z-index: 1; display: block; outline: none; }
.view {
  width: min(var(--maxw), 100% - var(--gutter) * 2);
  margin: 0 auto;
  padding: 28px 0 72px;
}
.view.is-entering { animation: view-in 320ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4vw, 40px); }
.page-head p { color: var(--muted); margin-top: 6px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  color: var(--ink-2); font-weight: 700; font-size: 14px; text-decoration: none;
  background: none; border: 0; padding: 6px 0;
}
.back-link::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
.back-link:hover { color: var(--ink); }

/* ------------------------------------------------------------- 共通部品 */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  font-weight: 700; font-size: 15px; line-height: 1.2; letter-spacing: 0.02em; text-decoration: none; text-align: center;
  border: 1px solid transparent; border-radius: var(--r-md);
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
  -webkit-user-select: none; user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, #6a4ff0, var(--brand) 45%, var(--brand-ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(20, 8, 90, 0.25), 0 10px 22px -12px rgba(70, 40, 210, 0.9);
}
.btn-primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -2px 0 rgba(20, 8, 90, 0.25), 0 14px 28px -12px rgba(70, 40, 210, 1); }
.btn-hot {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 60%), linear-gradient(135deg, #ff5a98, var(--hot) 55%, #cf1f68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(110, 0, 40, 0.25), 0 10px 22px -12px rgba(220, 30, 110, 0.9);
}
.btn-secondary { color: var(--ink); background: var(--surface); border-color: var(--line-2); box-shadow: var(--sh-1); }
.btn-secondary:hover:not(:disabled) { border-color: rgba(91, 63, 224, 0.45); }
.btn-ghost { color: var(--ink-2); background: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); color: var(--ink); }
.btn-danger { color: var(--danger); background: var(--surface); border-color: rgba(201, 52, 81, 0.35); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 17px; border-radius: 18px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn .icon { width: 18px; height: 18px; flex: none; }

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.field { display: grid; gap: 8px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.input, .select {
  width: 100%; min-height: 48px; padding: 0 16px;
  font-size: 16px; font-weight: 700;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(25, 20, 48, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease;
  -webkit-appearance: none; appearance: none;
}
.select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%235b3fe0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:hover, .select:hover { border-color: rgba(91, 63, 224, 0.4); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 63, 224, 0.15); }
.input::placeholder { color: var(--faint); font-weight: 500; }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  padding: 4px; border-radius: 16px; background: var(--bg-2);
  box-shadow: inset 0 1px 3px rgba(25, 20, 48, 0.07);
}
.segmented button {
  position: relative; min-height: 42px; padding: 6px 10px;
  font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--ink-2);
  border: 0; border-radius: 12px; background: transparent;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}
.segmented button:hover:not([aria-checked="true"]):not(:disabled) { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.segmented button[aria-checked="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(25, 20, 48, 0.1), 0 6px 14px -8px rgba(60, 40, 150, 0.5); }
.segmented button[aria-checked="true"]::after { content: ""; position: absolute; left: 28%; right: 28%; bottom: 5px; height: 2px; border-radius: 2px; background: var(--holo); }
.segmented button:disabled { cursor: not-allowed; opacity: 0.6; }
.segmented small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); overflow: hidden; width: max-content; }
.stepper button { width: 48px; height: 48px; border: 0; background: transparent; font-size: 20px; font-weight: 700; color: var(--brand-ink); }
.stepper button:hover:not(:disabled) { background: var(--brand-soft); }
.stepper button:disabled { color: var(--faint); cursor: not-allowed; }
.stepper output { min-width: 84px; text-align: center; font-family: var(--display); font-size: 22px; }
.stepper output small { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.chip-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.chip-hot { color: #fff; background: var(--hot); border-color: var(--hot); }
.chip-brand { color: var(--brand-ink); background: var(--brand-soft); border-color: transparent; }

.panel {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 #fff, var(--sh-2);
}
.panel-title { font-size: 17px; font-weight: 900; }
.panel-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.stars { color: #f0b23a; letter-spacing: 0.05em; white-space: nowrap; }
.stars .off { color: #e2dcec; }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ------------------------------------------------------------- ホーム */

/* ヒーロー右：フォトカード風のロゴ */

@keyframes holo-sweep { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 100%; } }

.section { margin-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 2.6vw, 28px); }
.section-head p { color: var(--muted); font-size: 14px; }

.resume-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 20px; padding: 18px 20px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2);
}
.resume-card-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--hot-soft); color: var(--hot); }
.resume-card-copy { flex: 1; min-width: 200px; }
.resume-card-copy strong { display: block; font-size: 15px; }
.resume-card-copy span { color: var(--muted); font-size: 13px; }
.resume-card-actions { display: flex; gap: 8px; }

.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-tile {
  position: relative;
  display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px;
  min-height: 236px; padding: 22px;
  text-align: left; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: inset 0 1px 0 #fff, var(--sh-1);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden; isolation: isolate;
}
.mode-tile::before {
  content: ""; position: absolute; inset: auto -30% -50% auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: var(--tile-glow, rgba(91, 63, 224, 0.12)); filter: blur(30px); z-index: -1; transition: transform 300ms ease;
}
.mode-tile:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, var(--sh-2); border-color: rgba(91, 63, 224, 0.3); }
.mode-tile:hover::before { transform: scale(1.25); }
.mode-tile-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--tile-color, var(--brand)); box-shadow: 0 10px 20px -10px var(--tile-color, var(--brand)); }
.mode-tile-icon .icon { width: 26px; height: 26px; }
.mode-tile h3 { font-size: 20px; font-weight: 900; }
.mode-tile p { color: var(--ink-2); font-size: 14px; line-height: 1.75; }
.mode-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.mode-tile-go { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-ink); font-size: 14px; }
.mode-tile-go::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.mode-tile[data-mode="ai"] { --tile-color: #5b3fe0; --tile-glow: rgba(91, 63, 224, 0.18); }
.mode-tile[data-mode="local"] { --tile-color: #e0458a; --tile-glow: rgba(240, 57, 127, 0.16); }
.mode-tile[data-mode="online"] { --tile-color: #1d8fc4; --tile-glow: rgba(29, 143, 196, 0.16); }

.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: rule; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.rule { position: relative; padding: 22px 22px 24px; counter-increment: rule; }
.rule + .rule { border-left: 1px solid var(--line); }
.rule::before { content: counter(rule); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 50%; font-family: var(--display); font-size: 15px; color: #fff; background: var(--ink); }
.rule h3 { font-size: 15px; font-weight: 900; margin-bottom: 6px; }
.rule p { color: var(--ink-2); font-size: 13px; line-height: 1.8; }

.recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.recent-item {
  display: grid; gap: 6px; padding: 16px 18px; text-align: left; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1);
}
.recent-item:hover { border-color: rgba(91, 63, 224, 0.35); }
.recent-item time { color: var(--muted); font-size: 12px; font-weight: 700; }
.recent-item strong { font-size: 15px; }
.recent-item span { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-foot { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.site-foot a { color: var(--ink-2); font-weight: 700; }

/* ------------------------------------------------------------- 設定 */
.setup { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.setup-aside {
  position: sticky; top: calc(var(--appbar-h) + 20px);
  display: grid; gap: 16px; padding: 28px;
  color: #fff; border-radius: var(--r-xl);
  background: var(--grain), linear-gradient(150deg, var(--tile-a, #23185a), var(--tile-b, #4a2fc0));
  background-size: 160px 160px, auto;
  box-shadow: var(--sh-3); overflow: hidden;
}
.setup-aside[data-mode="local"] { --tile-a: #4a1438; --tile-b: #d93c82; }
.setup-aside[data-mode="online"] { --tile-a: #0c2d4a; --tile-b: #1d8fc4; }
.setup-aside h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); }
.setup-aside p { color: rgba(255, 255, 255, 0.82); line-height: 1.85; }
.setup-aside ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.setup-aside li { display: flex; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.setup-aside li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--holo); }
.setup-form { display: grid; gap: 22px; }
.setup-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.setup-section { display: grid; gap: 14px; }
.setup-section + .setup-section { padding-top: 22px; border-top: 1px solid var(--line); }
.setup-section h2 { font-size: 15px; font-weight: 900; }
.team-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.team-name-input { position: relative; }
.team-name-input .input { padding-left: 40px; min-height: 44px; font-size: 15px; }
.team-name-input i { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 4px; background: var(--team-color); }
.setup-start { position: sticky; bottom: 12px; z-index: 5; display: grid; gap: 8px; }
.setup-start .btn { width: 100%; }
.setup-start p { text-align: center; font-size: 12px; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--bg-2); color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.notice-warn { background: #fff4e5; color: #7a4a00; }
.status-line { min-height: 22px; font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.status-line.is-error { color: var(--danger); }

.online-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.online-choice .panel { padding: 20px; display: grid; gap: 14px; align-content: start; }
.code-input { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 0.18em; text-transform: uppercase; }

/* ------------------------------------------------------------- ルーム */
.room { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.room-code-card {
  display: grid; gap: 16px; padding: 28px; color: #fff; border-radius: var(--r-xl);
  background: var(--grain), linear-gradient(150deg, #0c2d4a, #1d6fb0 60%, #1d8fc4);
  background-size: 160px 160px, auto; box-shadow: var(--sh-3);
}
.room-code-card small { color: rgba(255, 255, 255, 0.75); font-weight: 700; font-size: 13px; }
.room-code { font-family: var(--display); font-size: clamp(34px, 5vw, 52px); letter-spacing: 0.16em; line-height: 1; word-break: break-all; }
.room-code-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.room-code-actions .btn { background: #fff; color: #0c2d4a; }
.room-code-actions .btn-ghost { background: rgba(255, 255, 255, 0.1); color: #fff; }
.player-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.player { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.player-dot { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 900; font-size: 14px; background: var(--team-color, var(--brand)); }
.player strong { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.player.is-departed { opacity: 0.5; }
.player-tag { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ------------------------------------------------------------- ドラフト画面 */
.draft-status { display: flex; align-items: center; gap: 10px; min-width: 0; }
.round-badge {
  flex: none; display: inline-grid; place-items: center; min-width: 54px; height: 34px; padding: 0 12px;
  font-family: var(--display); font-size: 15px; color: #fff; border-radius: 10px; background: var(--ink);
}
.draft-status-text { min-width: 0; font-weight: 900; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-status-sub { flex: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.draft-menu-btn { flex: none; }

.view[data-view="draft"] { width: min(1480px, 100% - var(--gutter) * 2); padding-top: 18px; }
.turn-banner {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 16px 20px; margin-bottom: 16px;
  border-radius: var(--r-lg); color: #fff;
  background: var(--grain), linear-gradient(110deg, var(--stage) 0%, var(--stage-2) 100%);
  background-size: 160px 160px, auto;
  box-shadow: var(--sh-2); overflow: hidden;
}
.turn-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--turn-color, var(--gold)); }
.turn-banner.is-mine { background: var(--grain), linear-gradient(110deg, #3d0f2b 0%, #b0205f 100%); background-size: 160px 160px, auto; }
.turn-banner.is-mine::before { background: var(--holo); }
.turn-round { font-family: var(--display); font-size: 26px; line-height: 1; padding-right: 18px; border-right: 1px solid rgba(255, 255, 255, 0.18); }
.turn-round small { display: block; margin-top: 6px; font-family: var(--sans); font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.6); }
.turn-main { min-width: 0; }
.turn-main strong { display: block; font-size: clamp(17px, 2vw, 22px); font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }
.turn-main span { display: block; margin-top: 2px; color: rgba(255, 255, 255, 0.72); font-size: 13px; }
.turn-side { display: flex; align-items: center; gap: 12px; }
.turn-progress { display: grid; justify-items: end; gap: 6px; }
.turn-progress b { font-family: var(--display); font-weight: 400; font-size: 20px; }
.turn-progress b small { font-family: var(--sans); font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-left: 2px; }
.progress-bar { width: 140px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.progress-bar i { display: block; height: 100%; border-radius: inherit; background: var(--holo); transition: width 400ms ease; }
.turn-banner .btn-light { color: var(--stage); background: #fff; }
.turn-banner.is-waiting .turn-main strong::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.draft-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.62fr); gap: 18px; align-items: start; }
.draft-tabs { display: none; }
.pool, .board-panel { min-width: 0; }
.board-panel { position: sticky; top: calc(var(--appbar-h) + 14px); max-height: calc(100dvh - var(--appbar-h) - 28px); display: flex; flex-direction: column; }

/* 候補 */
.pool-tools { position: sticky; top: var(--appbar-h); z-index: 10; display: grid; gap: 10px; padding: 12px 0 10px; margin-bottom: 6px; background: var(--bg); }
.pool-tools::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--bg), rgba(245, 243, 249, 0)); pointer-events: none; }
.filter-bar { -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); padding-right: 24px; }
.search { position: relative; }
.search .icon { position: absolute; left: 16px; top: 50%; margin-top: -10px; color: var(--brand); pointer-events: none; }
.search .input { padding-left: 46px; padding-right: 44px; border-radius: 999px; min-height: 50px; }
.search-clear { position: absolute; right: 8px; top: 50%; margin-top: -17px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); font-size: 17px; line-height: 1; }
.filter-bar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip { position: relative; flex: none; }
.filter-chip select {
  min-height: 38px; padding: 0 34px 0 14px; max-width: 220px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; background-color: var(--surface);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' fill='none'%3E%3Cpath d='M1 1.2 5 5.4l4-4.2' stroke='%237a7493' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.filter-chip select.is-set { color: #fff; border-color: var(--ink); background-color: var(--ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' fill='none'%3E%3Cpath d='M1 1.2 5 5.4l4-4.2' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.toggle-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); white-space: nowrap;
}
.toggle-chip[aria-pressed="true"] { color: var(--brand-ink); border-color: rgba(91, 63, 224, 0.45); background: var(--brand-soft); }
.toggle-chip .icon { width: 16px; height: 16px; }
.pool-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pool-count { color: var(--muted); font-size: 13px; font-weight: 700; }
.pool-count b { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 17px; margin-right: 2px; }
.sort-select { min-height: 34px; padding: 0 30px 0 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); border: 0; border-radius: 10px; background-color: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' fill='none'%3E%3Cpath d='M1 1.2 5 5.4l4-4.2' stroke='%237a7493' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.sort-select:hover { background-color: var(--bg-2); }
.pool-links { display: flex; gap: 2px; align-items: center; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 #fff, var(--sh-1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  content-visibility: auto; contain-intrinsic-size: auto 214px;
  isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: 21px; padding: 2px;
  background: var(--holo); opacity: 0; transition: opacity 160ms ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 #fff, var(--sh-2); }
}
.card.is-selected { border-color: transparent; box-shadow: inset 0 1px 0 #fff, var(--sh-3); transform: translateY(-2px); }
.card.is-selected::before { opacity: 1; }
.card.is-drafted { opacity: 0.55; }
.card.is-excluded { opacity: 0.45; filter: grayscale(0.7); }
.card-main {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "tile group" "tile name" "meta meta" "foot foot";
  column-gap: 12px; row-gap: 2px; align-items: center;
  flex: 1; width: 100%; padding: 14px 14px 8px; text-align: left;
  border: 0; border-radius: 20px 20px 0 0; background: none;
}
.card-main:focus-visible { outline-offset: -3px; border-radius: 18px; }
.monogram {
  grid-area: tile; position: relative;
  width: 48px; height: 60px; display: grid; place-items: center;
  font-family: var(--display); font-size: 22px; color: #fff;
  border-radius: 12px;
  background: linear-gradient(160deg, hsl(var(--h) 75% 70%), hsl(calc(var(--h) + 40) 70% 52%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 14px -8px hsl(var(--h) 60% 40%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.monogram::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 45%, transparent 60%); }
.card-group { grid-area: group; align-self: end; font-size: 11px; font-weight: 700; color: var(--brand-ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-name { grid-area: name; align-self: start; font-size: 20px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.card-meta { grid-area: meta; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.card-meta .chip { min-height: 22px; padding: 0 8px; font-size: 11px; }
.card-foot { grid-area: foot; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.card-foot .stars { font-size: 12px; }
.card-tools { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 0 8px 8px 14px; }
.card-agency { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-tools-buttons { display: flex; gap: 2px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  color: var(--faint); border: 0; border-radius: 10px; background: transparent;
}
.icon-btn:hover { color: var(--ink-2); background: var(--bg-2); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"].is-heart { color: var(--hot); }
.icon-btn[aria-pressed="true"].is-heart .icon { fill: currentColor; }
.card-state { position: absolute; top: 10px; right: 10px; z-index: 1; }
.load-more { grid-column: 1 / -1; justify-self: center; margin-top: 8px; }

/* 指名確認ドック */
.dock {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  width: min(760px, calc(100% - 24px));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 14px 14px 14px 16px;
  color: #fff; border-radius: 24px;
  background: var(--grain), linear-gradient(120deg, var(--stage), var(--stage-2));
  background-size: 160px 160px, auto;
  box-shadow: 0 30px 60px -20px rgba(13, 19, 48, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
  animation: dock-in 260ms cubic-bezier(.2, .8, .2, 1);
}
.dock::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--holo); }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translateX(-50%); } }
.dock .monogram { grid-area: auto; width: 46px; height: 58px; }
.dock-copy { min-width: 0; }
.dock-copy small { display: block; color: rgba(255, 255, 255, 0.62); font-size: 12px; font-weight: 700; }
.dock-copy strong { display: block; font-size: 20px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.dock-copy span { display: block; color: rgba(255, 255, 255, 0.72); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-actions { display: flex; gap: 8px; align-items: center; }
.dock .btn-ghost { color: rgba(255, 255, 255, 0.82); }
.dock .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.dock-note { font-size: 12px; color: rgba(255, 255, 255, 0.7); max-width: 12em; text-align: right; }

/* 指名ボード（会場の指名一覧ボード風） */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.board-head h2 { font-size: 17px; font-weight: 900; }
.board-box { flex: 1; min-height: 0; overflow: auto; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); overscroll-behavior: contain; scrollbar-width: thin; }
.board-table { table-layout: fixed; border-collapse: separate; border-spacing: 0; width: 100%; min-width: calc(56px + var(--teams, 4) * 132px); font-size: 13px; }
.board-table th, .board-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board-table td + td, .board-table th + th, .board-table th + td { border-left: 1px solid var(--line); }
.board-table tbody tr:last-child > * { border-bottom: 0; }
.board-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.board-table .round-col { position: sticky; left: 0; z-index: 1; width: 52px; min-width: 52px; text-align: center; font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--ink-2); background: var(--surface-2); }
.board-table thead .round-col { z-index: 3; font-family: var(--sans); font-weight: 700; font-size: 11px; color: var(--muted); }
.board-team { padding: 10px 8px 8px !important; text-align: center; box-shadow: inset 0 4px 0 var(--team-color); }
.board-team strong { display: block; font-size: 14px; font-weight: 900; line-height: 1.3; overflow-wrap: anywhere; }
.board-team small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.board-team em { display: block; font-style: normal; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--team-color) 75%, #000); }
.board-team.is-current { background: color-mix(in srgb, var(--team-color) 10%, #fff) !important; }
.board-team.is-me strong::after { content: "あなた"; display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; font-size: 11px; vertical-align: 2px; color: #fff; background: var(--hot); }
.pick-slot { display: grid; gap: 1px; min-height: 46px; place-content: center; padding: 6px 8px; text-align: center; border-radius: 10px; }
.pick-slot.is-filled { background: linear-gradient(180deg, #fff, var(--surface-2)); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(25, 20, 48, 0.04); }
.pick-slot strong { font-size: 13px; font-weight: 900; line-height: 1.3; }
.pick-slot small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.pick-slot.is-empty { color: var(--line-2); }
.pick-slot.is-sealed { color: var(--brand-ink); background: var(--brand-soft); font-size: 11px; font-weight: 700; }
.pick-slot.is-now { border: 1.5px dashed var(--hot); color: var(--hot); font-size: 11px; font-weight: 700; animation: pulse 1.6s ease-in-out infinite; }
.pick-slot.is-new { animation: slot-in 600ms cubic-bezier(.2, .8, .2, 1); }
@keyframes slot-in { from { transform: scale(0.8); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { background: var(--hot-soft); } }
.pick-loss { display: block; font-size: 11px; color: var(--faint); text-decoration: line-through; line-height: 1.4; }

.team-stack { display: grid; gap: 10px; }
.team-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--sh-1); }
.team-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; box-shadow: inset 4px 0 0 var(--team-color); background: color-mix(in srgb, var(--team-color) 6%, #fff); }
.team-card-head strong { flex: 1; min-width: 0; font-weight: 900; overflow-wrap: anywhere; }
.team-card-head small { font-size: 12px; font-weight: 700; color: var(--muted); }
.team-card ol { margin: 0; padding: 4px 0; list-style: none; }
.team-card li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 14px; }
.team-card li + li { border-top: 1px dashed var(--line); }
.team-card li b { font-family: var(--display); font-weight: 400; font-size: 12px; color: var(--muted); }
.team-card li span strong { display: block; font-weight: 900; }
.team-card li span small { display: block; font-size: 11px; color: var(--muted); }
.team-card li.is-empty span { color: var(--faint); }

.ticker { margin-top: 12px; display: grid; gap: 6px; }
.ticker-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ticker-item i { width: 8px; height: 8px; flex: none; border-radius: 3px; background: var(--team-color); }
.ticker-item strong { font-weight: 900; color: var(--ink); }

/* ------------------------------------------------------------- 指名発表（中継ステージ） */
.reveal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  color: #fff;
  background:
    var(--grain),
    radial-gradient(60rem 30rem at 50% -10%, rgba(214, 176, 98, 0.22), transparent 60%),
    radial-gradient(40rem 30rem at 50% 120%, rgba(91, 63, 224, 0.35), transparent 70%),
    linear-gradient(180deg, #070b1f, var(--stage) 40%, #0a0f28);
  background-size: 160px 160px, auto, auto, auto;
  overflow-y: auto;
  animation: fade-in 220ms ease both;
}
@keyframes fade-in { from { opacity: 0; } }
.stage { width: min(720px, 100%); display: grid; gap: 18px; justify-items: center; text-align: center; }
.stage-kicker { display: inline-flex; align-items: center; gap: 12px; color: var(--gold); font-weight: 700; font-size: 14px; letter-spacing: 0.24em; }
.stage-kicker::before, .stage-kicker::after { content: ""; width: 40px; height: 1px; background: var(--stage-line); }
.stage-title { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3.6vw, 32px); letter-spacing: 0.08em; }
.stage-team {
  position: relative; width: 100%;
  display: grid; gap: 4px; padding: 14px 20px;
  border-radius: 16px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--team-color) 85%, #000) 18%, color-mix(in srgb, var(--team-color) 85%, #000) 82%, transparent);
  animation: band-in 500ms cubic-bezier(.2, .8, .2, 1) both;
}
.stage-team small { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.2em; }
.stage-team strong { font-size: clamp(22px, 4vw, 34px); font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
@keyframes band-in { from { opacity: 0; transform: scaleX(0.6); } to { opacity: 1; transform: none; } }

.nameplate { width: min(520px, 100%); perspective: 1200px; }
.nameplate-inner { position: relative; display: grid; transform-style: preserve-3d; transition: transform 900ms cubic-bezier(.3, .9, .25, 1); }
.nameplate.is-shown .nameplate-inner { transform: rotateY(180deg); }
.nameplate-face {
  grid-area: 1 / 1; display: grid; place-items: center; align-content: center; gap: 10px;
  min-height: clamp(220px, 34vh, 300px); padding: 28px 24px;
  border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.nameplate-back {
  color: var(--gold);
  background: var(--grain), repeating-linear-gradient(45deg, rgba(214, 176, 98, 0.08) 0 2px, transparent 2px 14px), linear-gradient(160deg, #1b2556, #0e1434);
  background-size: 160px 160px, auto, auto;
  border: 1px solid var(--stage-line);
  box-shadow: inset 0 0 0 8px rgba(214, 176, 98, 0.06), 0 30px 60px -24px rgba(0, 0, 0, 0.8);
}
.nameplate-back img { width: 84px; border-radius: 22px; opacity: 0.95; }
.nameplate-back span { font-family: var(--display); font-size: 17px; letter-spacing: 0.3em; }
.nameplate-front {
  transform: rotateY(180deg);
  color: var(--stage);
  background: linear-gradient(180deg, #ffffff, #f4f1ea);
  border: 1px solid rgba(214, 176, 98, 0.7);
  box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px rgba(214, 176, 98, 0.5), 0 30px 70px -24px rgba(0, 0, 0, 0.85);
}
.nameplate-front small { font-size: 13px; font-weight: 700; color: var(--gold-ink); letter-spacing: 0.16em; }
.nameplate-name { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 9vw, 72px); line-height: 1.1; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.nameplate-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; color: #4a4560; font-weight: 700; }
.nameplate-meta span + span::before { content: "／"; margin-right: 14px; color: #c9c2d8; }

.stage-foot { display: grid; gap: 10px; justify-items: center; width: 100%; }
.stage-hint { color: rgba(255, 255, 255, 0.6); font-size: 13px; min-height: 1.6em; }
.stage-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stage-actions .btn-light { color: var(--stage); background: #fff; min-width: 200px; }
.stage-actions .btn-ghost { color: rgba(255, 255, 255, 0.75); }
.stage-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.stage-progress { display: flex; gap: 6px; }
.stage-progress i { width: 18px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.stage-progress i.is-done { background: var(--gold); }
.stage-progress i.is-now { background: #fff; }
.stage-skip { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; }
.stage-skip .btn { color: rgba(255, 255, 255, 0.85); border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); }

/* 抽選（くじ） */
.lottery-member { display: grid; gap: 6px; padding: 18px 26px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f4f1ea); color: var(--stage); box-shadow: inset 0 0 0 1px rgba(214, 176, 98, 0.6); }
.lottery-member small { font-size: 12px; font-weight: 700; color: var(--gold-ink); letter-spacing: 0.14em; }
.lottery-member strong { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 6vw, 48px); line-height: 1.1; }
.lottery-member span { font-weight: 700; color: #4a4560; font-size: 14px; }
.lottery-teams { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lottery-teams span { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: color-mix(in srgb, var(--team-color) 70%, #000); }
.envelopes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 140px)); justify-content: center; gap: 30px 16px; width: 100%; padding: 44px 0 16px; }
.envelope { position: relative; aspect-ratio: 3 / 4; padding: 0; border: 0; background: none; color: var(--stage); border-radius: 10px; }
.env { position: absolute; inset: 0; }
.env-back { position: absolute; inset: 0; border-radius: 10px; background: linear-gradient(180deg, #d9cba4, #e9dfc4); box-shadow: 0 18px 30px -16px rgba(0, 0, 0, 0.85); }
.env-paper {
  position: absolute; left: 9%; right: 9%; top: 8%; height: 84%; z-index: 1;
  display: grid; place-items: center;
  border-radius: 6px; background: #fffdf7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), inset 0 0 0 1px #ece4cf;
  transition: transform 650ms cubic-bezier(.3, .9, .3, 1.15);
}
.env-paper-inner { display: grid; place-items: center; gap: 4px; text-align: center; }
.paper-q { font-family: var(--display); font-size: 22px; color: #e3dac2; }
.env-pocket {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74%; z-index: 2;
  display: grid; place-items: end center; padding-bottom: 14%;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #f6f0de, #ebe1c4);
  clip-path: polygon(0 0, 50% 30%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -1px 0 rgba(138, 106, 36, 0.25);
}
.env-pocket b { font-family: var(--display); font-weight: 400; font-size: 20px; color: #8a6a24; }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 52%; z-index: 3;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #efe6cc, #ddd0aa);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform 520ms cubic-bezier(.4, 0, .2, 1), z-index 0s;
}
.env-seal {
  position: absolute; top: 42%; left: 50%; z-index: 4; width: 26px; height: 26px; margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ef7180, #b31d36 60%, #8c1428);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  transition: opacity 200ms ease, transform 200ms ease;
}
.envelope-owner { position: absolute; left: 50%; bottom: -13px; z-index: 6; transform: translateX(-50%); max-width: 150%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: var(--team-color); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.6); animation: band-in 300ms ease both; }

/* 選べる封筒 */
.envelope:not(:disabled) { cursor: pointer; }
.envelope:not(:disabled) .env { animation: env-float 2.2s ease-in-out infinite; }
.envelope:not(:disabled) .env-back { box-shadow: 0 0 0 3px rgba(214, 176, 98, 0.65), 0 18px 30px -16px rgba(0, 0, 0, 0.85); }
.envelope:not(:disabled):hover .env { animation: none; transform: translateY(-6px) rotate(-2deg); transition: transform 160ms ease; }
@keyframes env-float { 50% { transform: translateY(-4px); } }
.envelope.is-taken .env { transform: none; }
.envelope.is-taken .env-back { box-shadow: 0 0 0 2px var(--team-color, transparent), 0 18px 30px -16px rgba(0, 0, 0, 0.85); }
.envelope:disabled:not(.is-taken) { opacity: 0.55; }
.stage[data-stage="opening"] .envelope:disabled:not(.is-taken), .stage[data-stage="result"] .envelope:disabled:not(.is-taken) { opacity: 0.2; }

/* 開封：ゆれる → 封を切る → ふたが開く → 紙が出る */
.envelope.is-opening .env { animation: env-shake 420ms ease-in-out 2; }
.envelope.is-opening .env-seal { opacity: 0; transform: scale(1.6); transition-delay: 820ms; }
.envelope.is-opening .env-flap { transform: rotateX(180deg); z-index: 0; transition-delay: 900ms, 1150ms; }
.envelope.is-opening .env-paper { transform: translateY(-22%); transition-delay: 1450ms; }
@keyframes env-shake { 20% { transform: rotate(-4deg); } 40% { transform: rotate(4deg); } 60% { transform: rotate(-3deg); } 80% { transform: rotate(2deg); } }
.envelope.is-result .env { animation: none; }
.envelope.is-result .env-seal { opacity: 0; }
.envelope.is-result .env-flap { transform: rotateX(180deg); z-index: 0; transition-delay: 0s; }
.envelope.is-result .env-paper { z-index: 5; transform: translateY(-26%) scale(1.06); transition-delay: 0s; box-shadow: 0 16px 30px -10px rgba(0, 0, 0, 0.6), inset 0 0 0 1px #ece4cf; }
.envelope.is-result .env-paper-inner > * { animation: stamp-in 520ms cubic-bezier(.2, 1.4, .4, 1) both; }
.envelope.is-winner .env-paper { transform: translateY(-30%) scale(1.16); box-shadow: 0 0 0 3px var(--gold), 0 0 50px rgba(214, 176, 98, 0.75), 0 20px 30px -10px rgba(0, 0, 0, 0.6); }
.envelope.is-loser { opacity: 0.55; transition: opacity 400ms ease 500ms; }
.stamp { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.15; color: #c8102e; padding: 6px 7px; border: 2.5px solid #c8102e; border-radius: 6px; transform: rotate(-9deg); box-shadow: inset 0 0 0 1px rgba(200, 16, 46, 0.25); }
.miss { font-weight: 900; font-size: 14px; color: #9a94aa; letter-spacing: 0.2em; }
@keyframes stamp-in { from { opacity: 0; transform: scale(2.2) rotate(-9deg); } to { opacity: 1; } }
.miss { animation-name: fade-up !important; }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
.lottery-result { display: grid; gap: 6px; padding: 14px 22px; border-radius: 16px; background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.85) 15%, rgba(200, 16, 46, 0.85) 85%, transparent); animation: band-in 500ms cubic-bezier(.2, .8, .2, 1) both; }
.lottery-result small { font-size: 12px; font-weight: 700; letter-spacing: 0.24em; color: rgba(255, 255, 255, 0.8); }
.lottery-result strong { font-size: clamp(20px, 3.4vw, 28px); font-weight: 900; }

/* ------------------------------------------------------------- 結果 */
.results-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end;
  padding: clamp(24px, 4vw, 40px); margin-bottom: 20px;
  color: #fff; border-radius: 32px;
  background: var(--grain), radial-gradient(40rem 20rem at 100% 0%, rgba(214, 176, 98, 0.3), transparent 70%), linear-gradient(130deg, var(--stage), #22306e);
  background-size: 160px 160px, auto, auto;
  box-shadow: var(--sh-3);
}
.results-hero small { color: var(--gold); font-weight: 700; letter-spacing: 0.2em; font-size: 13px; }
.results-hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 5vw, 54px); margin: 6px 0 8px; }
.results-hero p { color: rgba(255, 255, 255, 0.75); }
.results-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.results-actions .btn-light { color: var(--stage); background: #fff; }
.results-actions .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.results-actions .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.results-tabs { width: max-content; margin-bottom: 16px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.result-team { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.result-team-head { position: relative; padding: 18px 18px 14px; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--team-color) 92%, #000), color-mix(in srgb, var(--team-color) 70%, #fff)); }
.result-team-head small { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.8); letter-spacing: 0.08em; }
.result-team-head h3 { font-size: 20px; font-weight: 900; overflow-wrap: anywhere; }
.result-team-head.is-me::after { content: "あなた"; position: absolute; top: 14px; right: 14px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--hot); background: #fff; }
.result-team ol { margin: 0; padding: 6px 0; list-style: none; }
.result-team li { display: grid; grid-template-columns: 36px 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 16px; }
.result-team li + li { border-top: 1px dashed var(--line); }
.result-team li b { font-family: var(--display); font-weight: 400; font-size: 12px; color: var(--muted); }
.result-team li .monogram { grid-area: auto; width: 40px; height: 48px; font-size: 17px; border-radius: 10px; }
.result-team li strong { display: block; font-weight: 900; }
.result-team li small { display: block; font-size: 11px; color: var(--muted); }
.result-team li .lost { display: block; font-size: 11px; color: var(--faint); }
.result-team-stats { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.share-status { margin-top: 10px; color: var(--brand-ink); font-weight: 700; font-size: 13px; }

/* ------------------------------------------------------------- 履歴 */
.history-list { display: grid; gap: 10px; }
.history-entry { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); overflow: hidden; }
.history-entry summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.history-entry summary::-webkit-details-marker { display: none; }
.history-entry summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 180ms ease; margin-left: 4px; }
.history-entry[open] summary::after { transform: rotate(-135deg); }
.history-entry summary div { flex: 1; min-width: 0; }
.history-entry summary strong { display: block; }
.history-entry summary span { color: var(--muted); font-size: 13px; }
.history-body { padding: 0 18px 18px; display: grid; gap: 12px; }

/* ------------------------------------------------------------- サイト情報 */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.about .panel { display: grid; gap: 12px; align-content: start; }
.about .panel h2 { font-size: 17px; font-weight: 900; }
.about .panel p { color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.about-wide { grid-column: 1 / -1; }
.source-links { display: flex; flex-wrap: wrap; gap: 6px; }
.source-links a { padding: 4px 10px; font-size: 12px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.install-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
.install-card img { width: 56px; height: 56px; border-radius: 14px; box-shadow: var(--sh-1); }

/* ------------------------------------------------------------- トースト・モーダル */
.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 300; display: grid; gap: 8px; width: min(480px, calc(100% - 24px)); transform: translateX(-50%); pointer-events: none; }
body.has-dock .toasts { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 110px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; font-size: 14px; font-weight: 700; border-radius: 16px; background: rgba(25, 20, 48, 0.94); box-shadow: 0 16px 36px -16px rgba(25, 20, 48, 0.8); animation: toast-in 240ms cubic-bezier(.2, .8, .2, 1); pointer-events: auto; }
.toast i { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--team-color, var(--holo)); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: 220ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.modal { width: min(460px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 40px 100px -30px rgba(25, 20, 48, 0.6); }
.modal::backdrop { background: rgba(25, 20, 48, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-body { display: grid; gap: 14px; padding: 26px; }
.modal-body h2 { font-size: 20px; font-weight: 900; }
.modal-body p { color: var(--ink-2); line-height: 1.8; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sheet-list { display: grid; gap: 4px; }
.sheet-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; text-align: left; font-weight: 700; border: 0; border-radius: 12px; background: transparent; color: var(--ink); }
.sheet-list button:hover { background: var(--bg-2); }
.sheet-list button.is-danger { color: var(--danger); }

/* ------------------------------------------------------------- レスポンシブ */
@media (max-width: 1100px) {
  .draft-layout { grid-template-columns: minmax(0, 1fr); }
  .board-panel { position: static; max-height: none; }
  .draft-tabs { display: grid; position: sticky; top: calc(var(--appbar-h) + 6px); z-index: 20; margin-bottom: 12px; background: var(--bg-2); }
  .draft-layout[data-tab="pool"] .board-panel { display: none; }
  .draft-layout[data-tab="board"] .pool { display: none; }
  .pool-tools { top: calc(var(--appbar-h) + 60px); }
  .mode-grid { grid-template-columns: minmax(0, 1fr); }
  .mode-tile { min-height: 0; }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule:nth-child(3) { border-left: 0; }
  .rule:nth-child(n+3) { border-top: 1px solid var(--line); }
  .setup, .room { grid-template-columns: minmax(0, 1fr); }
  .setup-aside { position: relative; top: auto; }
}

@media (max-width: 720px) {
  :root { --appbar-h: 54px; }
  body { font-size: 14px; }
  .appbar { gap: 10px; }
  .appbar-wordmark { font-size: 17px; }
  .appbar-brand img { width: 32px; height: 32px; }
  .appbar-nav a { padding: 0 10px; font-size: 13px; min-height: 34px; }
  .view { padding: 18px 0 56px; }
  
  
  
  
  
  
  
  
  
  
  .section { margin-top: 36px; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .rule + .rule { border-left: 0; border-top: 1px solid var(--line); }
  .rule { padding: 18px; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; }
  .rule::before { margin: 0; grid-row: span 2; }
  .setup-row { grid-template-columns: minmax(0, 1fr); }
  .setup-aside { padding: 22px; }
  .online-choice { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 18px; border-radius: 24px; }
  .view[data-view="draft"] { padding-top: 10px; }
  .turn-banner { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; padding: 12px 14px; margin-bottom: 10px; border-radius: 18px; }
  .turn-round { font-size: 20px; padding-right: 12px; }
  .turn-side { grid-column: 1 / -1; justify-content: space-between; }
  .turn-side:empty { display: none; }
  .progress-bar { width: 100px; }
  .turn-main strong { font-size: 15px; }
  .turn-main span { font-size: 12px; }
  .draft-tabs { top: calc(var(--appbar-h) + 4px); }
  .pool-tools { top: calc(var(--appbar-h) + 56px); padding-top: 8px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { border-radius: 16px; contain-intrinsic-size: auto 190px; }
  .card-main { grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; padding: 12px 10px 6px; border-radius: 16px 16px 0 0; }
  .card-main .monogram { width: 40px; height: 50px; font-size: 17px; border-radius: 10px; }
  .card-name { font-size: 15px; }
  .card-tools { padding: 0 4px 4px 10px; }
  .card-agency { display: none; }
  .card-tools { justify-content: flex-end; }
  .dock { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; border-radius: 22px; bottom: max(10px, env(safe-area-inset-bottom)); }
  .dock-actions { grid-column: 1 / -1; }
  .dock-actions .btn { flex: 1; }
  .dock-copy strong { font-size: 17px; }
  .dock-note { max-width: none; text-align: left; flex: 1; }
  .board-table { min-width: calc(44px + var(--teams, 4) * 116px); }
  .board-table .round-col { width: 40px; min-width: 40px; font-size: 11px; }
  .results-hero { grid-template-columns: minmax(0, 1fr); border-radius: 26px; }
  .results-actions { justify-content: stretch; }
  .results-actions .btn { flex: 1; }
  .about { grid-template-columns: minmax(0, 1fr); }
  .envelopes { grid-template-columns: repeat(auto-fit, minmax(84px, 104px)); gap: 26px 12px; padding-top: 34px; }
  .env-pocket b { font-size: 15px; }
  .stamp { font-size: 12px; padding: 4px 5px; }
  .stage { gap: 14px; }
  .nameplate-face { min-height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------- 調整（スマホの詰まり対策） */
.btn-sm, .chip, .toggle-chip { white-space: nowrap; }
.appbar-context .chip { flex: none; }
.pool-links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pool-links::-webkit-scrollbar { display: none; }
@media (max-width: 720px) {
  body[data-view="draft"] .appbar-nav,
  body[data-view="results"] .appbar-nav { display: none; }
  body[data-view="draft"] .appbar-wordmark { display: none; }
  .appbar-context { gap: 6px; }
  .draft-menu-btn span { display: none; }
  .draft-menu-btn { width: 40px; padding: 0; }
  
  
  
  
  
  
  .pool-links .btn-sm { padding: 0 8px; font-size: 12px; }
  .pool-links [data-action="save-preset"] { display: none; }
  .pool-meta { flex-wrap: nowrap; }
  .pool-count { flex: none; }
  .pool-count b { font-size: 15px; }
  .sort-select { padding-left: 8px; font-size: 12px; }
  .card-meta { margin-top: 8px; }
  .card-foot { margin-top: 6px; }
}
.turn-line { display: none; }
@media (max-width: 720px) {
  .turn-banner { grid-template-columns: auto minmax(0, 1fr); padding-bottom: 16px; }
  .turn-progress { display: none; }
  .turn-side:not(:has(.btn)) { display: none; }
  .turn-line { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.12); }
  .turn-line i { display: block; height: 100%; background: var(--holo); transition: width 400ms ease; }
  .turn-main span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  
  
  
}

/* ------------------------------------------------------------- 押したときの反応 */
a, button, select, summary, label { touch-action: manipulation; }
.card-main { transition: transform 120ms ease; }
.card-main:active:not(:disabled) { transform: scale(0.97); }
.segmented button:active:not(:disabled), .toggle-chip:active, .icon-btn:active, .appbar-nav a:active, .sheet-list button:active { transform: scale(0.95); }
.segmented button, .toggle-chip, .icon-btn, .appbar-nav a, .sheet-list button { transition: transform 100ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease; }
.mode-tile:active { transform: scale(0.985); }
.envelope:active:not(:disabled) .env { transform: scale(0.94); }
.stepper button:active:not(:disabled) { background: var(--brand-soft); transform: scale(0.92); }
.btn:focus-visible, .card-main:focus-visible { outline: 3px solid rgba(91, 63, 224, 0.55); outline-offset: 2px; }
@media (hover: none) {
  .card:hover { transform: none; }
  .mode-tile:hover { transform: none; }
}
.room-actions { display: grid; gap: 8px; }
.room-actions .btn { width: 100%; }
@media (max-width: 720px) {
  .results-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-actions .btn { min-width: 0; white-space: nowrap; min-height: 44px; padding: 0 8px; font-size: 13px; gap: 6px; }
  .results-actions .btn .icon { width: 16px; height: 16px; }
  .results-actions .btn-light { grid-column: 1 / -1; min-height: 50px; font-size: 15px; }
}
.rules { margin: 0; padding: 0; list-style: none; }
@media (max-width: 1100px) {
  .pool-tools { position: static; padding-top: 4px; }
  .pool-tools::after { display: none; }
}
.about .panel p { max-width: 78ch; }
.page-head > div p { max-width: 60ch; }
.results-room { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.results-room span { flex: 1; min-width: 220px; }

/* ------------------------------------------------------------- 修正（2026-10-18） */
/* iPhone Safari：画面切り替えの動きが固定表示（指名確認バー）をずらさないよう、不透明度だけで切り替える */
.view.is-entering { animation: view-fade 260ms ease backwards; }
@keyframes view-fade { from { opacity: 0; } }
/* Safari でタップが効かなくなることがある content-visibility は使わない */
.card { content-visibility: visible; contain-intrinsic-size: none; }

/* 頭文字アイコンなし */
.card-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "group" "name" "meta" "foot"; row-gap: 2px; }
.card-name { font-size: 20px; }
.dock { grid-template-columns: minmax(0, 1fr) auto; }
.result-team li { grid-template-columns: 40px minmax(0, 1fr); }
.result-team li span small, .team-card li span small { display: block; }
@media (max-width: 720px) {
  .card-main { padding: 12px 12px 6px; }
  .card-name { font-size: 17px; }
  .dock { grid-template-columns: minmax(0, 1fr); }
}

/* 指名発表：事務所・グループを縦に */
.nameplate-meta { flex-direction: column; align-items: center; gap: 2px; }
.nameplate-meta span + span::before { content: none; }
.nameplate-meta span:first-child { font-size: 15px; color: #4a4560; }
.nameplate-meta span:last-child { font-size: 17px; color: var(--stage); }

/* 抽選外れ：名前・事務所・グループを縦に、薄く */
.pick-loss { display: grid; gap: 0; margin: 0 0 6px; padding: 4px 6px; text-align: center; text-decoration: none; color: var(--faint); border-radius: 8px; background: var(--surface-2); }
.pick-loss b { font-size: 12px; font-weight: 700; text-decoration: line-through; text-decoration-color: rgba(169, 164, 189, 0.7); }
.pick-loss small { font-size: 11px; line-height: 1.35; }
.pick-slot small { display: block; }
.lost { display: grid; margin-bottom: 6px; padding: 4px 8px; color: var(--faint); border-left: 2px solid var(--line-2); }
.lost em { font-style: normal; font-size: 11px; font-weight: 700; }
.lost b { font-size: 13px; text-decoration: line-through; text-decoration-color: rgba(169, 164, 189, 0.7); }
.lost small { font-size: 11px; color: var(--faint) !important; }
@media (max-width: 720px) {
  body.has-dock .toasts { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 170px); }
  .dock-actions .btn-hot { white-space: nowrap; font-size: 15px; padding: 0 14px; }
}

/* 指名一覧表を全画面で見る */
.board-expand-row { display: flex; justify-content: flex-end; margin: -6px 0 10px; }
.board-head .icon-btn { color: var(--ink-2); }
.board-full {
  position: fixed; inset: 0; z-index: 250;
  display: flex; flex-direction: column;
  background: rgba(245, 243, 249, 0.98);
  animation: fade-in 180ms ease both;
}
.board-full-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  color: #fff; background: linear-gradient(110deg, var(--stage), var(--stage-2));
}
.board-full-bar strong { font-size: 15px; font-weight: 900; }
.board-full-hint { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.board-full-bar .btn-light { color: var(--stage); background: #fff; }
.board-full-bar .btn-ghost { color: rgba(255, 255, 255, 0.85); border: 1px solid rgba(255, 255, 255, 0.25); }
.board-full-scroll { flex: 1; min-height: 0; overflow: auto; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.board-full-stage { margin: 0 auto; }
.board-full-stage .board-table { transform-origin: 0 0; width: max-content; min-width: calc(56px + var(--teams, 4) * 150px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
@media (orientation: portrait) and (max-width: 720px) { .board-full-hint { display: inline; } }
@media (orientation: landscape), (min-width: 721px) { .board-full-hint { display: none; } }

/* ------------------------------------------------------------- 改善（2026-10-18 夕） */
/* 1. 絞り込み：4項目は2列（PCは4列）、切り替えは折り返して並べる */
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.filter-grid .filter-chip select { width: 100%; max-width: none; min-height: 42px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.toggle-row .filter-chip select { min-height: 38px; }
@media (max-width: 720px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toggle-chip { min-height: 36px; padding: 0 12px; font-size: 12px; }
}

/* 6. さらに表示 */
.load-more { display: inline-flex; flex-direction: column; gap: 2px; min-width: 240px; min-height: 52px; }
.load-more small { font-size: 11px; font-weight: 700; color: var(--muted); }

/* 7. 指名順（画面上部に固定） */
.order-strip {
  position: sticky; top: var(--appbar-h); z-index: 25;
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 16px;
  background: #fff;
  box-shadow: var(--sh-1);
  overflow-x: auto; scrollbar-width: none;
}
.order-strip::-webkit-scrollbar { display: none; }
.order-label { flex: none; font-size: 12px; font-weight: 900; color: var(--muted); }
.order-list { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; flex: none; }
.order-item { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; border-radius: 999px; background: var(--bg-2); }
.order-item i { width: 8px; height: 8px; border-radius: 3px; background: var(--team-color); }
.order-item b { font-size: 11px; color: var(--ok); }
.order-item.is-done { opacity: 0.55; }
.order-item.is-now { color: #fff; background: var(--team-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--team-color) 30%, transparent); }
.order-item.is-now i { background: #fff; }
.order-item.is-me span::after { content: "（あなた）"; font-size: 11px; }
.order-arrow { flex: none; color: var(--faint); font-weight: 900; font-size: 13px; }
.order-note { flex: none; font-size: 11px; font-weight: 700; color: var(--faint); }
.pool-tools { top: calc(var(--appbar-h) + 56px); }
@media (max-width: 720px) { .order-strip { margin: 0 0 10px; padding: 6px 10px; border-radius: 14px; } }

/* 8. ホストが押すボタンを目立たせる */
.btn-attention { position: relative; animation: attn-ring 1.6s ease-out infinite; font-weight: 900; }
.btn-attention::after {
  content: "▼"; position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  font-size: 13px; color: var(--gold); animation: attn-bob 1s ease-in-out infinite;
}
@keyframes attn-ring { 0% { box-shadow: 0 0 0 0 rgba(214, 176, 98, 0.75); } 70% { box-shadow: 0 0 0 14px rgba(214, 176, 98, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 176, 98, 0); } }
@keyframes attn-bob { 50% { transform: translate(-50%, 4px); } }
.turn-banner.is-host-action { background: var(--grain), linear-gradient(110deg, #3b2a05 0%, #8a6416 100%); background-size: 160px 160px, auto; }
.turn-banner.is-host-action::before { background: var(--gold); }
.turn-banner .btn-attention { min-height: 50px; padding: 0 22px; font-size: 16px; }
.host-callout { display: block; width: 100%; margin-bottom: 18px; color: var(--gold); font-size: 13px; font-weight: 900; letter-spacing: 0.08em; }
.stage-hint.is-attention { color: var(--gold); font-weight: 900; font-size: 15px; }
@media (max-width: 720px) {
  .turn-banner.is-host-action .turn-side { display: flex; }
  .turn-banner .btn-attention { width: 100%; margin-top: 16px; }
}

/* 5. 戻るボタン */
.back-link-strong { padding: 8px 14px 8px 12px; margin-bottom: 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); box-shadow: var(--sh-1); }
.back-link-strong:hover { border-color: rgba(91, 63, 224, 0.4); }

/* 9. ホームの最初の画面をコンパクトに（スマホ） */
@media (max-width: 720px) {
  
  
  
  
  
  
  
  
  
  
  
  
  .section { margin-top: 26px; }
  .section-head { margin-bottom: 10px; }
  .mode-grid { gap: 10px; }
  .mode-tile { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 14px; row-gap: 4px; padding: 16px; border-radius: 20px; }
  .mode-tile-icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 14px; }
  .mode-tile-icon .icon { width: 22px; height: 22px; }
  .mode-tile h3 { font-size: 17px; align-self: end; }
  .mode-tile p { grid-column: 2; font-size: 13px; line-height: 1.6; }
  .mode-tile-foot { grid-column: 1 / -1; margin-top: 4px; }
}
.order-item.is-me span::after { content: none; }
.order-item small { font-size: 11px; }
.order-label { position: sticky; left: -12px; z-index: 1; padding: 0 8px 0 2px; background: inherit; background: rgba(255, 255, 255, 0.97); }
@media (max-width: 1100px) { .draft-tabs { top: calc(var(--appbar-h) + 54px); } }
@media (max-width: 720px) {
  .draft-tabs { top: calc(var(--appbar-h) + 50px); }
  
}
.board-full { background: var(--bg); }
@media (max-width: 720px) {
  .board-full-bar { gap: 8px; }
  .board-full-bar strong { flex: 1 1 100%; }
  .board-full-hint { flex: 1; }
  .board-full-bar > span[style] { display: none; }
}

/* ------------------------------------------------------------- キービジュアル（ホーム） */
.kv {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: center; gap: 24px;
  min-height: clamp(300px, 34vw, 400px);
  padding: clamp(28px, 5vw, 60px);
  border-radius: 32px;
  color: #fff;
  background:
    var(--grain),
    radial-gradient(40% 70% at 78% 40%, rgba(196, 160, 255, 0.55), transparent 70%),
    radial-gradient(30% 50% at 95% 95%, rgba(255, 150, 214, 0.35), transparent 70%),
    radial-gradient(45% 60% at 0% 0%, rgba(80, 110, 255, 0.35), transparent 70%),
    linear-gradient(115deg, #0c0a2e 0%, #1d1658 38%, #3a2894 70%, #5a3fc0 100%);
  background-size: 160px 160px, auto, auto, auto, auto;
  box-shadow: 0 2px 4px rgba(20, 14, 60, 0.12), 0 30px 60px -28px rgba(30, 18, 110, 0.6);
}
.kv::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.kv-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* ぼかしたフォトカードの並び */
.kv-tile {
  position: absolute; width: 13%; aspect-ratio: 3 / 4; border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04) 60%), linear-gradient(200deg, rgba(186, 160, 255, 0.5), rgba(90, 70, 200, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.22);
  filter: blur(1.5px); opacity: 0.55;
}
.kv-tile::before { content: ""; position: absolute; left: 22%; right: 22%; top: 18%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.kv-tile::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -1px; height: 38%; border-radius: 50% 50% 8px 8px; background: rgba(255, 255, 255, 0.12); }
.kv-tile.t1 { right: 38%; top: -10%; transform: rotate(-8deg); opacity: 0.35; }
.kv-tile.t2 { right: 24%; top: -16%; transform: rotate(4deg); filter: blur(3px); opacity: 0.3; }
.kv-tile.t3 { right: 2%; top: -6%; transform: rotate(10deg); }
.kv-tile.t4 { right: 44%; bottom: -18%; transform: rotate(6deg); filter: blur(3px); opacity: 0.3; }
.kv-tile.t5 { right: -3%; bottom: -14%; transform: rotate(-10deg); opacity: 0.45; }
.kv-tile.t6 { right: 30%; top: 30%; width: 9%; transform: rotate(-14deg); filter: blur(4px); opacity: 0.25; }
/* 光のリボン */
.kv-ribbon { position: absolute; inset: 0; width: 100%; height: 100%; }
.kv-ribbon path { fill: none; stroke: url(#kvRib); stroke-width: 3; stroke-linecap: round; }
.kv-ribbon path.glow { stroke-width: 14; opacity: 0.35; filter: blur(6px); }
.kv-ribbon path.thin { stroke-width: 1.2; opacity: 0.7; }

.kv-copy { position: relative; z-index: 2; display: grid; gap: 14px; }
.kv-kicker { white-space: nowrap; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.22em; color: rgba(236, 228, 255, 0.82); }
.kv-kicker b { font-weight: 700; color: #ffc7ea; }
.kv-kicker i { flex: 0 1 72px; height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.7), transparent); }
.kv h1 {
  margin: 0; font-family: var(--sans); font-weight: 900;
  font-size: clamp(34px, 5.4vw, 64px); line-height: 1.16; letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(20, 10, 80, 0.45);
}
.kv h1 span { display: block; }
.kv-shine {
  background: linear-gradient(100deg, #ffffff 0%, #f1e8ff 30%, #d9c9ff 55%, #ffc4e6 80%, #ffe1f2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px rgba(255, 170, 230, 0.35));
  text-shadow: none;
}
.kv-lead { margin: 2px 0 0; font-size: clamp(13px, 1.4vw, 16px); font-weight: 700; line-height: 1.8; color: rgba(240, 236, 255, 0.86); }

/* ガラスのカード */
.kv-card { position: relative; z-index: 1; justify-self: center; width: min(100%, 260px); aspect-ratio: 4 / 5; transform: perspective(900px) rotateY(-14deg) rotateZ(4deg); }
.kv-card-inner {
  position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 12% 10% 10%;
  border-radius: 22px;
  background:
    linear-gradient(135deg, #fbf9ff 0%, #ece4ff 45%, #e2d6ff 70%, #fde3f3 100%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    inset 0 -20px 40px -20px rgba(150, 110, 255, 0.5),
    0 30px 50px -20px rgba(10, 6, 50, 0.7),
    0 0 60px -10px rgba(210, 180, 255, 0.6);
  overflow: hidden;
}
.kv-card-inner::before { /* 斜めの光 */
  content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.75) 48%, transparent 54%);
  animation: kv-sheen 6s ease-in-out infinite;
}
.kv-card-inner img { position: relative; width: 100%; height: auto; mix-blend-mode: multiply; }
.kv-card-inner small { position: relative; font-size: 9px; font-weight: 700; letter-spacing: 0.24em; color: #6a5aa8; white-space: nowrap; }
.kv-spark { position: absolute; z-index: 2; fill: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 14px rgba(230, 190, 255, 0.8)); animation: kv-twinkle 3.2s ease-in-out infinite; }
.kv-spark.s1 { width: 34px; top: -6%; right: -4%; }
.kv-spark.s2 { width: 18px; top: 12%; right: -14%; animation-delay: 1.1s; }
.kv-spark.s3 { width: 22px; bottom: 8%; left: -12%; animation-delay: 2s; }
.kv-spark.s4 { width: 16px; top: 18%; left: 52%; animation-delay: 0.6s; opacity: 0.8; }
@keyframes kv-twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(0.6) rotate(20deg); opacity: 0.55; } }
@keyframes kv-sheen { 0%, 60% { transform: translateX(-30%); } 100% { transform: translateX(30%); } }
@media (prefers-reduced-motion: reduce) { .kv-spark, .kv-card-inner::before { animation: none; } }

@media (max-width: 720px) {
  .kv { grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; min-height: 0; padding: 22px 18px 22px 20px; border-radius: 24px; }
  .kv-copy { gap: 8px; }
  .kv-kicker { font-size: 10px; letter-spacing: 0.16em; gap: 8px; }
  .kv-kicker { letter-spacing: 0.12em; }
  .kv-kicker i { display: none; }
  .kv h1 { font-size: clamp(22px, 7vw, 32px); line-height: 1.22; }
  .kv h1 span { white-space: nowrap; }
  .kv-lead { font-size: 12px; line-height: 1.7; }
  .kv-card { width: 88px; margin-right: -2px; }
  .kv-card-inner { border-radius: 14px; padding: 14% 8% 10%; }
  .kv-card-inner small { display: none; }
  .kv-spark.s1 { width: 22px; }
  .kv-spark.s2 { width: 12px; right: -10%; }
  .kv-spark.s3 { width: 14px; left: -16%; }
  .kv-spark.s4 { display: none; }
  .kv-ribbon { transform: translateY(16%); }
  .kv-tile { width: 22%; }
  .kv-tile.t1, .kv-tile.t4, .kv-tile.t6 { display: none; }
}

/* ------------------------------------------------------------- ホーム画面に追加（上部バー） */
.appbar-install {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; flex: none;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid rgba(91, 63, 224, 0.22); border-radius: 999px; cursor: pointer;
  transition: transform 100ms ease, background-color 140ms ease;
}
.appbar-install:hover { background: #e3dcfd; }
.appbar-install:active { transform: scale(0.95); }
.appbar-install .icon { width: 17px; height: 17px; }
.appbar-install[hidden] { display: none; }
@media (max-width: 480px) {
  .appbar { gap: 8px; }
  .appbar-install .label-long { display: none; }
  .appbar-nav a { padding: 0 8px; }
  body:has(.appbar-install:not([hidden])) .appbar-wordmark { display: none; }
}
@media (min-width: 481px) { .appbar-install .label-short { display: none; } }
.install-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: st; }
.install-steps li { position: relative; padding: 12px 14px 12px 48px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; counter-increment: st; }
.install-steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 900; }
.install-steps .icon { width: 18px; height: 18px; vertical-align: -4px; margin: 0 2px; color: var(--brand); }
body[data-view="draft"] .appbar-install, body[data-view="results"] .appbar-install, body[data-view="room"] .appbar-install { display: none; }
.results-actions .btn-room-exit { color: #ffb3c4; border-color: rgba(255, 140, 170, 0.5); background: rgba(240, 57, 110, 0.12); }
.results-actions .btn-room-exit:hover { background: rgba(240, 57, 110, 0.24); color: #fff; }

/* ------------------------------------------------------------- 縛り */
.setup-section h2 small { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--bg-2); vertical-align: 2px; }
.limits { display: grid; gap: 14px; }
.limit-group { display: grid; gap: 8px; }
.limit-group .field-label b { margin-left: 8px; font-size: 11px; color: var(--brand-ink); background: var(--brand-soft); padding: 1px 8px; border-radius: 999px; }
.limit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.limit-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer;
  transition: transform 100ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
.limit-chip small { font-size: 11px; font-weight: 700; color: var(--faint); }
.limit-chip:hover { border-color: rgba(91, 63, 224, 0.45); }
.limit-chip:active { transform: scale(0.95); }
.limit-chip[aria-pressed="true"] { color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 14px -8px rgba(91, 63, 224, 0.8); }
.limit-chip[aria-pressed="true"] small { color: rgba(255, 255, 255, 0.75); }
.limit-chip:disabled { cursor: default; opacity: 0.6; }
.limit-more { min-height: 36px; padding: 0 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--brand-ink); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.limit-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--ink-2); font-size: 13px; }
.limit-summary strong { color: var(--brand-ink); }
.limit-summary .btn { margin-left: auto; }
.limit-summary.is-short { background: #fff1f3; }
.limit-summary.is-short strong { color: var(--danger); }
.limit-readonly { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--bg-2); font-weight: 700; font-size: 14px; }
.pool-limits { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pool-limits b { flex: none; font-size: 11px; color: #fff; background: var(--brand); padding: 2px 8px; border-radius: 999px; }
.results-hero .results-limits { margin-top: 4px; color: var(--gold); font-weight: 700; font-size: 14px; }

/* ------------------------------------------------------------- 公開ルーム */
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.check-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.check-row span { display: grid; gap: 2px; }
.check-row strong { font-size: 14px; }
.check-row small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.public-rooms { display: grid; gap: 12px; }
.public-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.public-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.public-room { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--sh-1); }
.public-room-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.public-room-main strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-room-main span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.public-room .btn { flex: none; }
.public-empty { margin: 0; padding: 14px; border-radius: 14px; background: var(--bg-2); color: var(--muted); font-size: 13px; line-height: 1.7; }
.room-name { margin: 0 0 10px; font-size: 18px; font-weight: 900; color: #fff; line-height: 1.4; word-break: break-all; }

/* ------------------------------------------------------------- 人気投票 */
.poll-banner {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px 18px;
  border-radius: 22px; color: var(--ink); text-decoration: none;
  background: linear-gradient(120deg, #fff 0%, #fff4fa 55%, #f1ecff 100%);
  border: 1px solid var(--line); box-shadow: var(--sh-2);
  transition: transform 120ms ease, box-shadow 160ms ease;
}
.poll-banner:hover { box-shadow: var(--sh-3); }
.poll-banner:active { transform: scale(0.985); }
.poll-banner-mark { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 22px; color: #fff; background: linear-gradient(140deg, #ff6fa8, #8b5cf6); box-shadow: 0 10px 20px -10px rgba(240, 57, 127, 0.8); }
.poll-banner-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.poll-banner-copy strong { font-size: 17px; font-weight: 900; }
.poll-banner-copy small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.poll-banner-go { flex: none; font-size: 13px; font-weight: 900; color: var(--hot); }
.poll-banner-go::after { content: " ›"; }

.poll { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; }
.poll-hero {
  position: relative; overflow: hidden; padding: clamp(22px, 4vw, 34px); border-radius: 26px; color: #fff;
  background: var(--grain), radial-gradient(40% 80% at 90% 10%, rgba(255, 150, 210, 0.45), transparent 70%), linear-gradient(120deg, #1a1450, #4a2fb0 60%, #b0458f);
  background-size: 160px 160px, auto, auto;
  box-shadow: var(--sh-3);
}
.poll-kicker { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.24em; color: rgba(255, 220, 240, 0.85); }
.poll-hero h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 38px); font-weight: 900; }
.poll-hero p { margin: 0; font-size: 14px; line-height: 1.8; color: rgba(255, 255, 255, 0.86); }
.poll-hero b { color: #fff; }
.poll-controls { display: grid; gap: 10px; }
.poll-kind button small { font-weight: 700; }
.poll-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-2); }
.poll-tabs button { min-height: 40px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2); background: none; border: 0; border-radius: 10px; cursor: pointer; transition: background-color 140ms ease, color 140ms ease, transform 100ms ease; }
.poll-tabs button:active { transform: scale(0.96); }
.poll-tabs button[aria-selected="true"] { color: var(--ink); background: var(--surface); box-shadow: var(--sh-1); font-weight: 900; }
.poll-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.poll-head small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.poll-head strong { font-size: 16px; font-weight: 900; }
.poll-head strong b { font-size: 26px; color: var(--brand-ink); margin: 0 2px; }
.poll-left { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; background: var(--hot-soft); }
.poll-left b { color: var(--hot); font-size: 16px; }
.poll-left.is-empty { background: var(--bg-2); color: var(--muted); }
.poll-left.is-empty b { color: var(--muted); }
.poll-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.poll-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.poll-rank { text-align: center; font-family: var(--display); font-size: 18px; color: var(--faint); }
.poll-row.is-top .poll-rank { color: #fff; width: 32px; height: 32px; line-height: 32px; border-radius: 50%; justify-self: center; font-size: 15px; }
.poll-row.is-top1 .poll-rank { background: linear-gradient(140deg, #f5cf6b, #c7952b); }
.poll-row.is-top2 .poll-rank { background: linear-gradient(140deg, #d9dde6, #9aa3b5); }
.poll-row.is-top3 .poll-rank { background: linear-gradient(140deg, #f0b08a, #b8693f); }
.poll-row.is-top1 { border-color: rgba(214, 176, 98, 0.6); box-shadow: 0 8px 20px -14px rgba(180, 130, 30, 0.6); }
.poll-main { min-width: 0; display: grid; gap: 2px; }
.poll-main strong { font-size: 15px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poll-bar { display: block; height: 4px; margin-top: 4px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.poll-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #ff6fa8); transition: width 300ms ease; }
.poll-votes { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.poll-votes b { font-size: 17px; color: var(--ink); margin-right: 1px; }
.poll-row .btn { min-width: 64px; }
.poll-row .btn.is-voted { animation: vote-pop 360ms ease; }
@keyframes vote-pop { 40% { transform: scale(1.12); } }
.poll-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; border-radius: 16px; background: var(--bg-2); }
.poll-more { text-align: center; }
@media (max-width: 520px) {
  .poll-row { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "rank main btn" "rank main votes"; row-gap: 2px; }
  .poll-rank { grid-area: rank; }
  .poll-main { grid-area: main; }
  .poll-votes { grid-area: votes; text-align: center; }
  .poll-row .btn { grid-area: btn; }
}
.poll-filters { position: relative; }
.poll-filter-clear { grid-column: 1 / -1; justify-self: end; }
@media (max-width: 720px) { .poll-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* =============================================================
   上部メニューとホーム（見やすさ重視：白＋濃紺、アクセントにピンク・紫）
   ============================================================= */
:root { --navy: #17205a; --navy-2: #24338a; --navy-soft: #eef0fa; --gold-soft: #fbf3dc; --gold-line: #ead39a; --gold-text: #8a6110; }

/* ---- 上部メニュー ---- */
.appbar { gap: 12px; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid #e4e6f0; box-shadow: 0 1px 0 rgba(23, 32, 90, 0.03), 0 6px 18px -16px rgba(23, 32, 90, 0.4); }
.appbar-wordmark { color: var(--navy); }
.appbar-nav { display: flex; align-items: stretch; gap: 2px; margin-left: auto; }
.appbar-nav a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  color: var(--navy); font-size: 14px; font-weight: 700; text-decoration: none; border-radius: 12px;
  transition: background-color 140ms ease, color 140ms ease, transform 100ms ease;
}
.appbar-nav a .icon { width: 18px; height: 18px; flex: none; }
.appbar-nav a:hover { background: var(--navy-soft); color: var(--navy); }
.appbar-nav a:active { transform: scale(0.95); }
.appbar-nav a[aria-current="page"] { background: var(--navy); color: #fff; }
.appbar-nav br.sp { display: none; }
.appbar-menu {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; flex: none;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--navy);
  background: #fff; border: 1px solid #dfe2ee; border-radius: 12px; cursor: pointer;
  transition: background-color 140ms ease, transform 100ms ease;
}
.appbar-menu .icon { width: 20px; height: 20px; }
.appbar-menu:hover { background: var(--navy-soft); }
.appbar-menu:active { transform: scale(0.94); }
body[data-view="draft"] .appbar-menu { display: none; }
body[data-view="draft"] .appbar-nav { display: none; }

@media (max-width: 760px) {
  .appbar { gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: 6px; }
  .appbar-wordmark { display: none; }
  .appbar-nav { flex: 1; justify-content: space-between; margin-left: 4px; gap: 0; }
  .appbar-nav .pc-only { display: none; }
  .appbar-nav a { flex: 1; flex-direction: column; justify-content: center; gap: 2px; min-height: 48px; padding: 4px 2px; font-size: 10.5px; line-height: 1.2; text-align: center; border-radius: 10px; }
  .appbar-nav a .icon { width: 18px; height: 18px; }
  .appbar-nav br.sp { display: inline; }
  .appbar-nav a span { white-space: nowrap; }
  .appbar-menu { flex-direction: column; justify-content: center; gap: 1px; min-height: 48px; min-width: 48px; padding: 4px 6px; font-size: 10px; border: 0; border-left: 1px solid #e4e6f0; border-radius: 0; background: none; }
  body[data-view="results"] .appbar-nav, body[data-view="room"] .appbar-nav { display: flex; }
}
@media (max-width: 760px) and (min-width: 0px) {
  body[data-view="draft"] .appbar-nav, body[data-view="draft"] .appbar-menu { display: none; }
}

/* ---- お知らせの帯 ---- */
.news-strip {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 18px;
  border-radius: 16px; border: 1px solid var(--gold-line); text-decoration: none;
  background: linear-gradient(100deg, var(--gold-soft), #fffaf0 60%, var(--gold-soft));
  color: var(--gold-text); box-shadow: 0 6px 16px -14px rgba(138, 97, 16, 0.7);
  transition: transform 100ms ease, box-shadow 140ms ease;
}
.news-strip b { flex: none; font-size: 16px; font-weight: 900; letter-spacing: 0.06em; }
.news-strip span { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: #6d5523; }
.news-strip i { flex: none; font-style: normal; font-size: 22px; font-weight: 700; line-height: 1; }
.news-strip:hover { box-shadow: 0 10px 22px -14px rgba(138, 97, 16, 0.8); }
.news-strip:active { transform: scale(0.99); }

/* ---- ホームのブロック ---- */
.home-block { margin-top: 30px; display: grid; gap: 14px; }
.block-head { display: grid; justify-items: center; gap: 2px; text-align: center; position: relative; }
.block-head p { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.24em; color: #8a90ad; }
.block-head h2 { margin: 0; font-family: var(--sans); font-size: clamp(22px, 4vw, 28px); font-weight: 900; color: var(--navy); letter-spacing: 0.02em; }
.block-head > span { font-size: 13px; color: #6f7593; }
.block-more { position: absolute; right: 0; bottom: 2px; font-size: 13px; font-weight: 700; color: var(--navy-2); text-decoration: none; }

/* 3つのモード（大きいボタン） */
.mode-big-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-big {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: 132px; padding: 16px 10px 14px; text-align: center; text-decoration: none; color: var(--navy);
  background: #fff; border: 1px solid #e1e4ef; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(23, 32, 90, 0.05), 0 10px 22px -18px rgba(23, 32, 90, 0.45);
  transition: transform 110ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.mode-big:hover { border-color: #c9cee6; box-shadow: 0 2px 4px rgba(23, 32, 90, 0.06), 0 16px 30px -18px rgba(23, 32, 90, 0.55); }
.mode-big:active { transform: scale(0.97); }
.mode-big-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 4px; border-radius: 12px; color: #fff; background: var(--navy); }
.mode-big[data-mode="local"] .mode-big-icon { background: linear-gradient(140deg, #e8457f, #c42d6c); }
.mode-big[data-mode="online"] .mode-big-icon { background: linear-gradient(140deg, #6a4be6, #4b31c4); }
.mode-big[data-mode="ai"] .mode-big-icon { background: linear-gradient(140deg, #26398f, #17205a); }
.mode-big-icon .icon { width: 22px; height: 22px; }
.mode-big strong { font-family: var(--sans); font-size: clamp(17px, 3vw, 22px); font-weight: 900; letter-spacing: 0.04em; line-height: 1.1; }
.mode-big-ja { font-size: 13px; font-weight: 900; color: var(--navy-2); }
.mode-big small { font-size: 11px; color: #7a809c; line-height: 1.4; }

/* 4つの小さいメニュー */
.menu-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.menu-tile {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 10px 12px;
  font: inherit; color: var(--navy); text-decoration: none; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid #e1e4ef; border-radius: 16px;
  transition: transform 110ms ease, background-color 140ms ease, border-color 140ms ease;
}
.menu-tile .icon { flex: none; width: 22px; height: 22px; color: var(--navy-2); }
.menu-tile span { display: grid; gap: 1px; min-width: 0; }
.menu-tile b { font-size: 14px; font-weight: 900; white-space: nowrap; }
.menu-tile small { font-size: 11px; color: #7a809c; white-space: nowrap; }
.menu-tile:hover { border-color: #c9cee6; background: #fafbff; }
.menu-tile:active { transform: scale(0.97); }
.menu-tile.is-hot { color: #fff; border-color: transparent; background: linear-gradient(135deg, #f0397f, #c42d8a 60%, #7a3fd6); box-shadow: 0 10px 22px -14px rgba(240, 57, 127, 0.9); }
.menu-tile.is-hot .icon, .menu-tile.is-hot small { color: rgba(255, 255, 255, 0.9); }

.home-block .rules { margin-top: 2px; }

@media (max-width: 720px) {
  .news-strip { margin-top: 12px; padding: 11px 14px; gap: 10px; }
  .news-strip b { font-size: 14px; }
  .news-strip span { font-size: 12px; }
  .home-block { margin-top: 24px; gap: 12px; }
  .mode-big-grid { gap: 8px; }
  .mode-big { min-height: 118px; padding: 12px 4px 10px; border-radius: 16px; }
  .mode-big-icon { width: 34px; height: 34px; border-radius: 10px; }
  .mode-big-icon .icon { width: 19px; height: 19px; }
  .mode-big-ja { font-size: 12px; }
  .mode-big small { font-size: 10px; }
  .menu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .menu-tile { justify-content: flex-start; min-height: 58px; }
  .block-more { position: static; }
}
.appbar-context:empty { display: none; }
@media (max-width: 760px) { .appbar-nav a { font-size: 11px; } }
@media (max-width: 400px) { .news-strip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
/* 上部メニュー：人気投票＋メニューだけ */
@media (max-width: 760px) {
  .appbar-wordmark { display: inline; }
  .appbar-nav { flex: none; margin-left: auto; }
  .appbar-nav a { flex: none; flex-direction: row; gap: 6px; min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
  .appbar-nav a .icon { width: 17px; height: 17px; }
  .appbar-menu { flex-direction: row; gap: 5px; min-height: 40px; padding: 0 10px 0 12px; font-size: 12px; }
}
.poll-back { justify-self: start; margin-bottom: 0; }
.appbar-menu { margin-left: auto; }
body[data-view="draft"] .appbar-menu { display: none; }
@media (max-width: 760px) { .appbar-menu { border: 1px solid #dfe2ee; border-radius: 12px; background: #fff; } }
