/* MOST CHANGED — stage-dark, single theme (deliberate). Every color painted explicitly. */
@property --rot { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

:root {
  --ink: #0b0a13;
  --ink-2: #100e1d;
  --surface: #16142a;
  --surface-2: #1f1c38;
  --surface-3: #2a2649;
  --text: #f3efff;
  --muted: #9a93bd;
  --dim: #5d578a;
  --line: rgba(243, 239, 255, 0.12);
  --line-strong: rgba(243, 239, 255, 0.22);
  --live: #7cf3d2;
  --warn: #ffd166;
  --danger: #ff6b8b;
  --gold: #f5d67a;
  --silver: #d9dce6;
  --bronze: #e0a272;
  --holo: conic-gradient(from var(--rot, 0deg) at 50% 50%, #ff8fa3, #ffd166, #7cf3d2, #7aa7ff, #e58cff, #ff8fa3);
  --holo-flat: linear-gradient(110deg, #ff8fa3, #ffd166, #7cf3d2, #7aa7ff, #e58cff);
  --font-display: 'Unbounded', 'Zen Kaku Gothic New', system-ui, sans-serif;
  --font-jp-display: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-body: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', system-ui, sans-serif;
  --radius: 22px;
  --radius-s: 12px;
  --tabbar-h: 68px;
  --ease-spring: cubic-bezier(0.22, 1.2, 0.36, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(124, 243, 210, 0.35); }

/* ---------- ambient ---------- */
#aurora {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.9;
}
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35; mix-blend-mode: overlay;
  background-image: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- shell ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 680px; margin: 0 auto;
  padding: 18px 18px calc(var(--tabbar-h) + 28px);
}
@media (min-width: 720px) { .app { padding-top: 34px; } }

/* ---------- stage header ---------- */
.stage { margin-bottom: 18px; }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-eyebrow {
  font-family: var(--font-display); font-weight: 900; font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; background: var(--holo-flat); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.me-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(22, 20, 42, 0.7);
  backdrop-filter: blur(8px); font-size: 13px; white-space: nowrap;
}
.me-chip .caret { color: var(--muted); font-size: 11px; }

.roundstrip {
  margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.roundstrip .seg {
  position: relative; padding: 10px 12px 9px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(22, 20, 42, 0.55);
  display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden;
}
.roundstrip .seg .n { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: var(--dim); }
.roundstrip .seg .t { font-size: 12px; color: var(--text); line-height: 1.3; font-weight: 700; }
.roundstrip .seg .w { font-size: 10.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roundstrip .seg.is-upcoming .t { color: var(--muted); }
.roundstrip .seg.is-open { border-color: rgba(124, 243, 210, 0.55); box-shadow: 0 0 0 3px rgba(124, 243, 210, 0.08), 0 0 28px rgba(124, 243, 210, 0.12); }
.roundstrip .seg.is-open .n { color: var(--live); }
.roundstrip .seg.is-closed .n { color: var(--text); }
.roundstrip .seg.is-closed::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--holo-flat);
}
.roundstrip .seg.is-open::after {
  content: ""; position: absolute; right: 10px; top: 10px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 0 rgba(124, 243, 210, 0.6); animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(124,243,210,.6);} 100% { box-shadow: 0 0 0 10px rgba(124,243,210,0);} }

.status {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(31, 28, 56, 0.85), rgba(22, 20, 42, 0.85));
  border: 1px solid var(--line); backdrop-filter: blur(10px);
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center;
}
.status .kicker { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }
.status .headline { font-family: var(--font-jp-display); font-weight: 800; font-size: 22px; line-height: 1.25; margin-top: 2px; text-wrap: balance; }
.status .headline .live { color: var(--live); }
.status .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.status .meta .nw { white-space: nowrap; display: inline-block; margin-right: 10px; }
.progress-dots { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.progress-dots .row { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 128px; }
.progress-dots .avatar { width: 26px; height: 26px; font-size: 11px; opacity: 0.28; filter: grayscale(1); transition: opacity .4s, filter .4s, transform .4s var(--ease-spring); }
.progress-dots .avatar.is-on { opacity: 1; filter: none; transform: translateY(-2px); }
.progress-dots .count { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-dots .count b { color: var(--text); }

@media (max-width: 480px) {
  .status { grid-template-columns: 1fr; }
  .progress-dots { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
  .progress-dots .row { max-width: none; justify-content: flex-start; }
  .section-head .hint { display: none; }
  .status .headline { font-size: 21px; }
}

/* ---------- avatar ---------- */
.avatar {
  --g1: #ff8fa3; --g2: #ffb86b;
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  font-family: var(--font-jp-display); font-weight: 800; font-size: 17px; color: #14122a;
  background: linear-gradient(140deg, var(--g1), var(--g2));
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 2px 10px rgba(0,0,0,.35);
}
.avatar.lg { width: 64px; height: 64px; font-size: 27px; }
.avatar.xl { width: 88px; height: 88px; font-size: 38px; }

/* ---------- sections ---------- */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.section-title .jp { font-family: var(--font-body); font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); font-size: 15px; margin-left: 8px; }
.note { font-size: 13px; color: var(--muted); }
.note b { color: var(--text); font-weight: 700; }
.hint { font-size: 12px; color: var(--dim); }

.panel {
  padding: 18px; border-radius: var(--radius); background: rgba(22, 20, 42, 0.72);
  border: 1px solid var(--line); backdrop-filter: blur(10px);
}
.panel + .panel { margin-top: 12px; }
.panel h3 { margin: 0 0 6px; font-family: var(--font-jp-display); font-weight: 800; font-size: 20px; line-height: 1.3; text-wrap: balance; }
.panel p { margin: 0; }

/* ---------- member cards (voting) ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.mcard {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 16px 14px 14px; border-radius: 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px; min-height: 132px;
  transition: transform .35s var(--ease-spring), border-color .25s, background .25s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.mcard:active { transform: scale(0.98); }
.mcard:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
.mcard .name { font-family: var(--font-jp-display); font-weight: 800; font-size: 20px; line-height: 1.2; }
.mcard .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.mcard .slot {
  margin-top: auto; height: 28px; display: flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.12em; color: var(--dim);
}
.mcard.is-picked { border-color: rgba(255,255,255,0.35); background: var(--surface-2); transform: translateY(-2px); }
.mcard.is-picked .slot, .mcard.is-picked .sub { color: var(--text); text-shadow: 0 1px 6px rgba(11,10,19,0.6); }
.mcard.is-picked .name { text-shadow: 0 1px 8px rgba(11,10,19,0.7); }
.mcard .rankbadge {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  font-family: var(--font-display); font-weight: 900; font-size: 13px; color: #14122a;
  background: var(--holo-flat); box-shadow: 0 4px 14px rgba(255, 143, 163, 0.25);
  animation: pop .45s var(--ease-spring);
}
.mcard .pts { color: var(--text); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* holo foil */
.foil::before {
  content: ""; position: absolute; inset: -60%; z-index: -1;
  background: var(--holo); opacity: 0; mix-blend-mode: color-dodge;
  filter: blur(30px) saturate(1.4); transition: opacity .45s;
}
.foil::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,0.22), transparent 62%);
  opacity: 0; transition: opacity .4s;
}
.foil.is-on::before { opacity: 0.26; animation: spin 7s linear infinite; }
.foil.is-on::after { opacity: 1; }
.foil.is-on.strong::before { opacity: 0.5; }
@keyframes spin { to { --rot: 360deg; } }

/* order summary */
.order { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; min-height: 30px; }
.order .chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; animation: pop .4s var(--ease-spring);
}
.order .chip .k { font-family: var(--font-display); font-weight: 900; font-size: 11px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #14122a; background: var(--holo-flat); }
.order .chip .p { color: var(--muted); font-variant-numeric: tabular-nums; }
.order .empty { font-size: 13px; color: var(--dim); align-self: center; }

.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field label b { color: var(--text); }
.textarea, .input {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(11, 10, 19, 0.6); color: var(--text); resize: none; line-height: 1.5;
}
.textarea { min-height: 76px; }
.textarea:focus, .input:focus { outline: none; border-color: rgba(124, 243, 210, 0.6); box-shadow: 0 0 0 3px rgba(124,243,210,0.12); }
.field .counter { text-align: right; font-size: 11px; color: var(--dim); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px;
  transition: transform .25s var(--ease-spring), opacity .2s, background .2s, border-color .2s;
  min-height: 46px;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255,107,139,0.5); color: var(--danger); }
.btn.live { border-color: rgba(124,243,210,0.6); color: var(--live); }
.btn.primary {
  position: relative; overflow: hidden; isolation: isolate; border: none; color: #14122a;
  background: var(--holo-flat); background-size: 200% 100%; animation: shimmer 5s linear infinite;
  box-shadow: 0 8px 30px rgba(229, 140, 255, 0.25), 0 2px 8px rgba(0,0,0,0.4);
  font-family: var(--font-body); font-weight: 900; letter-spacing: 0.02em; font-size: 15px; min-height: 52px;
}
.btn.primary:disabled { animation: none; filter: saturate(0.4); box-shadow: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- results ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; transition: all .2s;
}
.chip-btn.is-active { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip-btn .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 6px; vertical-align: middle; background: var(--dim); }
.chip-btn .dot.open { background: var(--live); }
.chip-btn .dot.closed { background: var(--holo-flat); }
.chip-btn.is-active .dot.closed { background: var(--ink); }

.ranklist { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rankrow {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 34px 44px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  animation: rise .5s var(--ease-out) both;
}
.rankrow:nth-child(2) { animation-delay: .06s } .rankrow:nth-child(3) { animation-delay: .12s } .rankrow:nth-child(4) { animation-delay: .18s } .rankrow:nth-child(5) { animation-delay: .24s } .rankrow:nth-child(6) { animation-delay: .3s }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rankrow .rk { font-family: var(--font-display); font-weight: 900; font-size: 20px; color: var(--dim); font-variant-numeric: tabular-nums; text-align: center; }
.rankrow.r1 .rk { color: var(--gold); } .rankrow.r2 .rk { color: var(--silver); } .rankrow.r3 .rk { color: var(--bronze); }
.rankrow .who { min-width: 0; }
.rankrow .who .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: 19px; line-height: 1.2; }
.rankrow .who .bar { margin-top: 7px; height: 6px; border-radius: 6px; background: rgba(243,239,255,0.08); overflow: hidden; }
.rankrow .who .bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--muted); transition: width 1.1s var(--ease-out); }
.rankrow.r1 .who .bar i { background: var(--holo-flat); }
.rankrow .who .firsts { font-size: 11px; color: var(--muted); margin-top: 5px; letter-spacing: 0.04em; }
.rankrow .pts { text-align: right; font-family: var(--font-display); font-weight: 900; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1; }
.rankrow .pts small { display: block; font-size: 10px; letter-spacing: 0.18em; color: var(--muted); font-weight: 700; margin-top: 4px; }
.rankrow.r1 { border-color: rgba(245, 214, 122, 0.35); }

.comments { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.comment {
  padding: 12px 14px 12px 16px; border-radius: 14px; background: rgba(22, 20, 42, 0.7); border: 1px solid var(--line);
  position: relative;
}
.comment::before { content: "“"; position: absolute; left: 10px; top: 2px; font-family: var(--font-jp-display); font-size: 30px; color: var(--dim); line-height: 1; }
.comment .body { font-family: var(--font-jp-display); font-weight: 600; font-size: 15px; line-height: 1.6; padding-left: 10px; }
.comment .from { margin-top: 6px; padding-left: 10px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.comment .from .avatar { width: 18px; height: 18px; font-size: 9px; }

.matrix { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.matrix th, .matrix td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix th { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.06em; }
.matrix td .k { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-family: var(--font-display); font-size: 9px; font-weight: 900; color: #14122a; background: var(--holo-flat); margin-right: 5px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

details.fold { margin-top: 12px; }
details.fold summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 6px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: "＋"; font-size: 12px; }
details.fold[open] summary::before { content: "－"; }

/* ---------- standings / podium ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin-top: 8px; }
.pod {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 18px 18px 8px 8px;
  border: 1px solid var(--line); background: var(--surface); text-align: center;
  padding: 16px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: rise .6s var(--ease-out) both;
}
.pod.p1 { min-height: 214px; border-color: rgba(245,214,122,0.45); }
.pod.p2 { min-height: 178px; animation-delay: .1s; }
.pod.p3 { min-height: 156px; animation-delay: .2s; }
.pod .medal { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: 0.16em; }
.pod.p1 .medal { color: var(--gold); } .pod.p2 .medal { color: var(--silver); } .pod.p3 .medal { color: var(--bronze); }
.pod .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: 18px; line-height: 1.2; }
.pod.p1 .nm { font-size: 22px; }
.pod .pt { font-family: var(--font-display); font-weight: 900; font-size: 22px; font-variant-numeric: tabular-nums; margin-top: auto; line-height: 1; }
.pod .pt small { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); margin-left: 2px; }
.pod .crown { width: 34px; height: 26px; margin-bottom: -6px; filter: drop-shadow(0 4px 10px rgba(245,214,122,0.5)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-3px) rotate(3deg);} }
.pod .tag { font-size: 10px; letter-spacing: 0.12em; color: var(--muted); }
.pod.empty { opacity: 0.55; }

.table { width: 100%; border-collapse: collapse; margin-top: 16px; font-variant-numeric: tabular-nums; }
.table th { text-align: right; font-family: var(--font-display); font-size: 10px; letter-spacing: 0.16em; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table th:first-child, .table th.l { text-align: left; }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: right; font-size: 15px; }
.table td.l { text-align: left; }
.table td.rk { font-family: var(--font-display); font-weight: 900; color: var(--dim); width: 30px; text-align: left; }
.table tr.r1 td.rk { color: var(--gold); } .table tr.r2 td.rk { color: var(--silver); } .table tr.r3 td.rk { color: var(--bronze); }
.table td .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 10px; }
.table td.tot { font-family: var(--font-display); font-weight: 900; font-size: 18px; }
.table td.dim { color: var(--dim); }
.delta { display: inline-block; min-width: 32px; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.delta.up { color: var(--live); } .delta.down { color: var(--danger); } .delta.flat { color: var(--dim); } .delta.new { color: var(--warn); }

.final-banner {
  margin-top: 14px; padding: 18px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(180deg, rgba(245,214,122,0.12), rgba(22,20,42,0.6)); border: 1px solid rgba(245,214,122,0.4);
}
.final-banner .k { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.24em; font-size: 12px; color: var(--gold); }
.final-banner .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: 30px; margin-top: 4px; }

.empty-state { text-align: center; padding: 30px 18px; color: var(--muted); }
.empty-state .big { font-family: var(--font-jp-display); font-weight: 800; font-size: 22px; color: var(--text); margin-bottom: 6px; text-wrap: balance; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 20;
  width: min(420px, calc(100% - 28px)); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; gap: 4px;
  background: rgba(22, 20, 42, 0.78); border: 1px solid var(--line-strong); border-radius: 26px;
  backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.tabbar button {
  border: none; background: transparent; color: var(--muted); border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; transition: background .25s, color .25s;
}
.tabbar button .en { font-family: var(--font-display); font-size: 9px; letter-spacing: 0.18em; font-weight: 700; opacity: 0.7; }
.tabbar button.is-active { background: var(--surface-3); color: var(--text); }
.tabbar button .n { position: relative; }
.tabbar button .n .badge { position: absolute; top: -4px; right: -12px; width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); }

/* ---------- gate (who are you) ---------- */
.gate { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(11, 10, 19, 0.86); backdrop-filter: blur(14px); }
.gate .box { width: min(520px, 100%); }
.gate .kicker { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.22em; font-size: 12px; background: var(--holo-flat); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate h1 { font-family: var(--font-jp-display); font-weight: 800; font-size: 32px; margin: 6px 0 4px; line-height: 1.2; }
.gate p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.gate .grid { margin-bottom: 14px; }

/* ---------- host sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(11,10,19,0.6); backdrop-filter: blur(6px); }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 51;
  width: min(680px, 100%); max-height: 88dvh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--line-strong); border-bottom: none; border-radius: 26px 26px 0 0;
  padding: 14px 18px 30px; animation: sheetup .4s var(--ease-out);
}
@keyframes sheetup { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet .handle { width: 42px; height: 5px; border-radius: 5px; background: var(--dim); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.2em; margin: 0; color: var(--muted); }
.sheet h2 .jp { font-family: var(--font-jp-display); font-size: 20px; letter-spacing: 0; color: var(--text); margin-left: 10px; }
.sheet .group { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sheet .group h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.roundctl { display: grid; grid-template-columns: 1fr; gap: 8px; }
.roundctl .rc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.roundctl .rc .lbl { flex: 1 1 auto; min-width: 120px; }
.roundctl .rc .lbl .n { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; color: var(--muted); }
.roundctl .rc .lbl .t { font-weight: 700; }
.roundctl .rc .st { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.roundctl .rc .st.open { color: var(--live); border-color: rgba(124,243,210,0.5); }
.roundctl .rc .st.closed { color: var(--gold); border-color: rgba(245,214,122,0.4); }
.roundctl .rc .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.memlist { display: flex; flex-direction: column; gap: 8px; }
.memlist .mrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; }
.memlist .mrow .input { padding: 9px 12px; }
.pinrow { display: flex; gap: 8px; align-items: center; }
.pinrow .input { max-width: 160px; letter-spacing: 0.3em; font-family: var(--font-display); text-align: center; }
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; }
.seg-toggle button { border: none; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.seg-toggle button.is-active { background: var(--text); color: var(--ink); }
.host-link { display: block; margin: 22px auto 0; background: none; border: none; color: var(--dim); font-size: 12px; letter-spacing: 0.1em; text-decoration: underline dotted; }
.host-link:hover { color: var(--muted); }

/* ---------- ceremony ---------- */
.ceremony {
  position: fixed; inset: 0; z-index: 60; overflow-y: auto;
  background: radial-gradient(120% 80% at 50% 0%, rgba(42, 38, 73, 0.9), rgba(11, 10, 19, 0.97) 60%);
  display: flex; flex-direction: column; align-items: center; padding: 40px 20px 60px; animation: fade .5s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.ceremony .inner { width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; }
.ceremony .title { text-align: center; margin-bottom: 8px; }
.ceremony .title .round { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 9vw, 56px); letter-spacing: 0.06em; line-height: 1; display: inline-block; }
.ceremony .title .round span { display: inline-block; animation: letter .7s var(--ease-spring) both; }
@keyframes letter { from { opacity: 0; transform: translateY(24px) rotate(-6deg); } to { opacity: 1; transform: none; } }
.ceremony .title .sub { font-family: var(--font-jp-display); font-weight: 700; font-size: 16px; color: var(--muted); margin-top: 8px; animation: fade 1s .4s both; }
.ceremony .reveal-row {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 44px 52px 1fr auto; gap: 12px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  animation: slam .6s var(--ease-spring) both;
}
@keyframes slam { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: none; } }
.ceremony .reveal-row .rk { font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }
.ceremony .reveal-row .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: 22px; line-height: 1.2; }
.ceremony .reveal-row .cm { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ceremony .reveal-row .pts { font-family: var(--font-display); font-weight: 900; font-size: 26px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.ceremony .reveal-row .pts small { display: block; font-size: 9px; letter-spacing: 0.2em; color: var(--muted); margin-top: 4px; }
.ceremony .reveal-row.r3 .rk { color: var(--bronze); } .ceremony .reveal-row.r2 .rk { color: var(--silver); }
.ceremony .winner {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: 28px 20px 24px; border-radius: 24px; background: var(--surface-2); border: 1px solid rgba(245,214,122,0.5);
  animation: slam .8s var(--ease-spring) both; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.ceremony .winner .k { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.26em; font-size: 12px; color: var(--gold); }
.ceremony .winner .crown { width: 54px; height: 42px; filter: drop-shadow(0 6px 16px rgba(245,214,122,0.55)); animation: drop .9s var(--ease-spring) both; }
@keyframes drop { from { opacity: 0; transform: translateY(-40px) scale(0.6); } to { opacity: 1; transform: none; } }
.ceremony .winner .nm { font-family: var(--font-jp-display); font-weight: 800; font-size: clamp(34px, 9vw, 48px); line-height: 1.15; }
.ceremony .winner .pts { font-family: var(--font-display); font-weight: 900; font-size: 36px; font-variant-numeric: tabular-nums; line-height: 1; }
.ceremony .winner .pts small { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); margin-left: 4px; }
.ceremony .winner .quotes { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.ceremony .wait { text-align: center; color: var(--muted); font-family: var(--font-jp-display); font-size: 18px; letter-spacing: 0.2em; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.ceremony .cta { display: flex; gap: 10px; justify-content: center; margin-top: 10px; animation: fade .6s both; flex-wrap: wrap; }
.ceremony .skip { position: fixed; top: 14px; right: 16px; }
#confetti { position: fixed; inset: 0; z-index: 61; pointer-events: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px); transform: translate(-50%, 20px); z-index: 70;
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--ink); font-weight: 700; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--ease-spring); white-space: nowrap; max-width: calc(100% - 40px);
  overflow: hidden; text-overflow: ellipsis;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }

.offline { font-size: 11px; color: var(--warn); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .foil.is-on::before { animation: none; }
  #aurora { display: none; }
}
