/* ═══════════ SPIN ARENA — 黑白線條 × 機甲 ═══════════ */
:root {
  --bg: #f2f2ee;
  --panel: #ffffff;
  --fg: #0a0a0a;
  --muted: #6a6a66;
  --line: #0a0a0a;
  --line-soft: rgba(10, 10, 10, .12);
  --grid: rgba(10, 10, 10, .05);
  --inv-bg: #0a0a0a;
  --inv-fg: #f2f2ee;
  --font-display: 'Orbitron', 'Noto Sans TC', sans-serif;
  --font-body: 'Noto Sans TC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --cut: 12px;
  --line-invert: 0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --panel: #111111; --fg: #ededea; --muted: #8d8d88; --line: #ededea;
    --line-soft: rgba(237, 237, 234, .14); --grid: rgba(237, 237, 234, .045);
    --inv-bg: #ededea; --inv-fg: #0a0a0a; --line-invert: 1; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --panel: #111111; --fg: #ededea; --muted: #8d8d88; --line: #ededea;
  --line-soft: rgba(237, 237, 234, .14); --grid: rgba(237, 237, 234, .045);
  --inv-bg: #ededea; --inv-fg: #0a0a0a; --line-invert: 1; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo svg { width: 32px; height: 32px; fill: none; stroke: var(--fg); stroke-width: 2; animation: spin 6s linear infinite; }
.logo svg .fill { fill: var(--fg); }
.logo .logo-mark { width: 44px; height: 44px; border-radius: 8px; display: block; }
.logo span { font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; font-size: 15px; }
.logo i { font-style: normal; color: var(--muted); margin: 0 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .logo svg { animation: none; } }
.nav { display: flex; gap: 2px; align-items: center; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a, .nav button {
  white-space: nowrap; text-decoration: none; padding: 6px 10px; border: 1px solid transparent; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.nav a:hover, .nav button:hover { border-color: var(--line); }
.nav a.on { background: var(--fg); color: var(--bg); }
.nav .sep { width: 1px; height: 20px; background: var(--line-soft); margin: 0 6px; flex-shrink: 0; }
.hazard { height: 6px; background: repeating-linear-gradient(-45deg, var(--fg) 0 6px, transparent 6px 12px); border-bottom: 1px solid var(--line); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 20px;
  border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; }

/* ── typography ── */
h1, h2, h3 { margin: 0; line-height: 1.25; }
.h-display { font-family: var(--font-display); font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.title { font-size: clamp(26px, 5vw, 40px); font-weight: 900; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ''; width: 10px; height: 10px; background: var(--fg); transform: rotate(45deg); }
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tag::before { content: '◢ '; }

/* ── frames (corner brackets) ── */
.frame { position: relative; background: var(--panel); border: 1px solid var(--line); padding: 20px; }
.frame::before, .frame::after { content: ''; position: absolute; width: 16px; height: 16px; pointer-events: none; }
.frame::before { top: -5px; left: -5px; border-top: 3px solid var(--fg); border-left: 3px solid var(--fg); }
.frame::after { bottom: -5px; right: -5px; border-bottom: 3px solid var(--fg); border-right: 3px solid var(--fg); }
.frame.inv { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.frame.inv .muted, .frame.inv .tag { color: color-mix(in srgb, var(--inv-fg) 60%, transparent); }
.panel { background: var(--panel); border: 1px solid var(--line); }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 18px;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; text-decoration: none;
  font-weight: 700; letter-spacing: .06em; font-size: 14px; white-space: nowrap;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  transition: transform .08s ease, opacity .15s;
}
.btn:hover { opacity: .86; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); clip-path: none; }
.btn.ghost:hover { background: var(--fg); color: var(--bg); opacity: 1; }
.btn.sm { min-height: 30px; padding: 4px 12px; font-size: 12px; --cut: 8px; }
.btn.danger { background: transparent; color: var(--fg); border-style: dashed; clip-path: none; }
.btn.danger:hover { background: var(--fg); color: var(--bg); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ── chips ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.chip.solid { background: var(--fg); color: var(--bg); }
.chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chip.dashed { border-style: dashed; color: var(--muted); }

/* ── forms ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; outline: none;
}
.input:focus { box-shadow: 4px 4px 0 var(--fg); }
.input:disabled { opacity: .5; }
textarea.input { min-height: 90px; resize: vertical; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--fg); }

/* ── auth ── */
.auth { max-width: 420px; margin: 40px auto; }

/* ── hero ── */
.hero { display: grid; gap: 24px; grid-template-columns: 1.4fr 1fr; align-items: stretch; }
.hero .frame { padding: 32px; }
.hero h1 { font-size: clamp(36px, 7vw, 68px); line-height: 1; margin: 10px 0 14px; }
.hero h1 small { display: block; font-family: var(--font-body); font-size: clamp(16px, 2.4vw, 22px); letter-spacing: .3em; margin-top: 12px; font-weight: 700; }
.hero-scope { position: relative; display: grid; place-items: center; min-height: 260px; overflow: hidden; }
.hero-scope svg { width: min(100%, 300px); fill: none; stroke: currentColor; stroke-width: 1; }
.hero-scope .rot { transform-origin: 150px 150px; animation: spin 14s linear infinite; }
.hero-scope .rot2 { transform-origin: 150px 150px; animation: spin 9s linear infinite reverse; }
.hero-scope .readout { position: absolute; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-scope { min-height: 200px; } }

/* ── tournament cards ── */
.tcard { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: transform .12s; }
.tcard:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--fg); }
.tcard h3 { font-size: 18px; font-weight: 900; }
.tcard .meta { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.tcard .bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 10px; font-family: var(--font-mono); font-size: 12px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.filters button { cursor: pointer; background: transparent; }
.filters button.on { background: var(--fg); color: var(--bg); }

/* ── tables ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; background: var(--fg); color: var(--bg); }
td.num, th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--line-soft); }
.rank { font-family: var(--font-display); font-weight: 900; font-size: 16px; }
.rank-1 td:first-child, .rank-2 td:first-child, .rank-3 td:first-child { position: relative; }
.rank-1 .rank::after { content: ' ▲'; font-size: 11px; }
/* 積分排行前三名：名字金、銀、銅金屬字＋掃過的閃光（同大螢幕頒獎台） */
.lb-metal { position: relative; display: inline-block; font-weight: 900; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-image: linear-gradient(180deg, #fff6d0 0%, #ffd95a 22%, #c7951f 48%, #fff1b0 52%, #e0ad2a 72%, #fff3c4 100%); }
.lb-metal.m2 { background-image: linear-gradient(180deg, #ffffff 0%, #e3e7ec 22%, #9aa2ab 48%, #f4f6f8 52%, #bcc3cb 72%, #eef1f4 100%); }
.lb-metal.m3 { background-image: linear-gradient(180deg, #ffe2c8 0%, #e8a874 22%, #b0652f 48%, #ffd2ad 52%, #c47c45 72%, #ffdcbf 100%); }
.lb-metal a { color: transparent; text-decoration-color: rgba(255,255,255,.35); }
.lb-metal::after { content: attr(data-text); position: absolute; inset: 0; color: transparent; pointer-events: none; white-space: nowrap;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 48%, rgba(255,255,255,.2) 52%, transparent 62%) no-repeat;
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: bd-shine 3.2s ease-in-out infinite; }
.lb-metal.m2::after { animation-delay: .6s; } .lb-metal.m3::after { animation-delay: 1.2s; }
.lb-metal { filter: drop-shadow(0 1px 0 rgba(0,0,0,.55)); }
@media (prefers-reduced-motion: reduce) { .lb-metal::after { animation: none; } }
td a { text-decoration: none; font-weight: 700; }
td a:hover { text-decoration: underline; }

/* ── detail header ── */
.dhead { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: end; }   /* 按鈕放在標題下面，避免按鈕多時把標題擠成兩行 */
.dhead .facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin: 28px 0 18px; overflow-x: auto; }
.tabs button { background: none; border: 1px solid transparent; border-bottom: 0; padding: 10px 18px; cursor: pointer; font-weight: 700; letter-spacing: .06em; white-space: nowrap; }
.tabs button.on { background: var(--fg); color: var(--bg); }

/* ── match cards ── */
.round { margin-bottom: 26px; }
.round-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.round-head h3 { font-family: var(--font-display); font-size: 14px; letter-spacing: .14em; }
.mlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.mcard {
  display: grid; grid-template-columns: 34px 1fr auto 14px auto 1fr; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px;
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; position: relative;
}
.mcard:hover { box-shadow: 4px 4px 0 var(--fg); }
.mcard .no { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mcard .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mcard .p.b { text-align: right; }
.mcard .p.win { font-weight: 900; }
.mcard .p.win::before { content: '▸ '; }
.mcard .p.b.win::before { content: ''; }
.mcard .p.b.win::after { content: ' ◂'; }
.mcard .p.lose { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.mcard .sc { font-family: var(--font-display); font-weight: 900; font-size: 20px; min-width: 18px; text-align: center; }
.mcard .vs { text-align: center; color: var(--muted); }
.mcard.live { border-width: 2px; }
.mcard.live::after { content: 'LIVE'; position: absolute; top: -9px; right: 10px; background: var(--fg); color: var(--bg); font-family: var(--font-mono); font-size: 10px; padding: 0 6px; letter-spacing: .14em; }
.mcard.bye { border-style: dashed; grid-template-columns: 34px 1fr auto; }
.mcard.tbd { border-style: dashed; color: var(--muted); pointer-events: none; }

/* bracket */
.bracket { display: flex; gap: 28px; overflow-x: auto; padding: 6px 4px 14px; }
.bracket .col { display: flex; flex-direction: column; gap: 10px; min-width: 250px; flex: 1; }
.bracket .col-body { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.bracket .col > h4 { font-family: var(--font-display); font-size: 12px; letter-spacing: .16em; margin: 0 0 4px; text-align: center; padding: 4px; border: 1px solid var(--line); }
.bracket .mcard { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 2px 10px; padding: 6px 10px; min-height: 0; }
.bracket .mcard .no, .bracket .mcard .vs { display: none; }
.bracket .mcard .p.b { text-align: left; }
.bracket .mcard .p.b.win::after { content: ''; }
.bracket .mcard .p.b.win::before { content: '▸ '; }
.bracket .mcard .pa { grid-row: 1; grid-column: 1; } .bracket .mcard .sa { grid-row: 1; grid-column: 2; }
.bracket .mcard .pb { grid-row: 2; grid-column: 1; } .bracket .mcard .sb { grid-row: 2; grid-column: 2; }
.bracket .mcard .sc { font-size: 15px; }
.bracket .champ { text-align: center; padding: 14px; }

/* ── scoreboard (referee) ── */
.sb-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.scoreboard { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 0; border: 2px solid var(--line); background: var(--panel); position: relative; }
.side { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side.b { background: var(--inv-bg); color: var(--inv-fg); }
.side .who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.side .name { font-size: clamp(20px, 3.4vw, 30px); font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .score { font-family: var(--font-display); font-weight: 900; font-size: clamp(96px, 16vw, 180px); line-height: .9; font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 4px; }
.pips span { flex: 1; height: 10px; border: 1px solid currentColor; transform: skewX(-20deg); }
.pips span.on { background: currentColor; }
.fbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.fbtn {
  min-height: 72px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1.5px solid currentColor; background: transparent; cursor: pointer; touch-action: manipulation; user-select: none;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.fbtn b { font-family: var(--font-display); font-size: 17px; letter-spacing: .1em; }
.fbtn small { font-size: 12px; opacity: .75; }
.fbtn em { font-style: normal; font-family: var(--font-display); font-weight: 900; font-size: 13px; }
.fbtn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.fbtn:active { background: currentColor; }
.side.a .fbtn:active * { color: var(--panel); }
.side.b .fbtn:active * { color: var(--inv-bg); }
.fbtn:disabled { opacity: .3; cursor: not-allowed; }
.fbtn kbd { font-family: var(--font-mono); font-size: 10px; opacity: .5; }
.mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border-left: 2px solid var(--line); border-right: 2px solid var(--line);
  background: repeating-linear-gradient(-45deg, var(--line-soft) 0 2px, transparent 2px 10px); padding: 12px 6px; }
.mid .vs { font-family: var(--font-display); font-weight: 900; font-size: 28px; writing-mode: vertical-rl; letter-spacing: .3em; }
.mid .target { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-align: center; }
.winner-band { position: absolute; inset: auto 0 50%; transform: translateY(50%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; z-index: 2;
  background: var(--fg); color: var(--bg); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--bg) 0 6px, var(--fg) 6px 12px) 6; text-align: center; }
.winner-band .w { font-family: var(--font-display); font-size: clamp(26px, 5vw, 44px); font-weight: 900; letter-spacing: .08em; }
.winner-band .btn { background: var(--bg); color: var(--fg); border-color: var(--bg); }
.winner-band .btn.ghost { background: transparent; color: var(--bg); }
@media (max-width: 760px) {
  .scoreboard { grid-template-columns: 1fr; }
  .mid { flex-direction: row; border: 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); padding: 10px; }
  .mid .vs { writing-mode: horizontal-tb; font-size: 20px; }
  .side { padding: 16px; }
  .side .score { font-size: 88px; }
  .fbtn { min-height: 64px; }
}
.log { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 13px; }
.log li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line-soft); }
.log li:last-child { border-bottom: 0; }

/* ── stats ── */
.stats { display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--line); background: var(--panel); }
.stat { padding: 14px 16px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stat .v { font-family: var(--font-display); font-size: 28px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.fbar { display: grid; grid-template-columns: 90px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.fbar .track { height: 14px; border: 1px solid var(--line); position: relative; }
.fbar .track i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(-45deg, var(--fg) 0 3px, transparent 3px 6px); }
.fbar .track i.solid { background: var(--fg); }

/* ── steps ── */
.steps { display: flex; gap: 0; flex-wrap: wrap; }
.steps span { flex: 1; min-width: 90px; padding: 8px 10px; border: 1px solid var(--line); margin-right: -1px; font-size: 13px; font-weight: 700; text-align: center; position: relative; }
.steps span.done { color: var(--muted); background: repeating-linear-gradient(-45deg, var(--line-soft) 0 2px, transparent 2px 8px); }
.steps span.cur { background: var(--fg); color: var(--bg); }

/* ── empty / loading / toast ── */
.empty { padding: 36px 16px; text-align: center; border: 1px dashed var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; }
.loading { padding: 60px 0; text-align: center; font-family: var(--font-mono); letter-spacing: .3em; color: var(--muted); }
.loading::after { content: '▮▮▮'; animation: blink 1s steps(2) infinite; margin-left: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
  background: var(--fg); color: var(--bg); padding: 10px 18px; font-weight: 700; border: 1px solid var(--bg); outline: 1px solid var(--fg); transition: .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err::before { content: '⚠ '; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding-bottom: 6px; }
  .nav { width: 100%; margin-left: 0; border-top: 1px solid var(--line-soft); padding-top: 6px; }
}
@media (max-width: 760px) {
  .side { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 14px; }
  .side .who, .side .name { grid-column: 1; }
  .side .score { grid-column: 2; grid-row: 1 / span 2; font-size: 64px; align-self: center; }
  .side .pips, .side .fbtns { grid-column: 1 / -1; }
  .fbtns { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .fbtn { min-height: 64px; padding: 4px 2px; }
  .fbtn b { font-size: 12px; letter-spacing: .04em; }
  .fbtn small { font-size: 10px; }
  .fbtn kbd { display: none; }
  .mid { padding: 6px 10px; gap: 10px; }
}
@media (max-width: 760px) { .kbd-hint { display: none; } }

/* ── QR 報到 ── */
.qr-wrap { display: inline-block; background: #fff; padding: 10px; border: 1px solid var(--line); margin: 6px auto 0; width: min(100%, 300px); }
.qr { display: block; width: 100%; height: auto; }
.scan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .scan-grid { grid-template-columns: 1fr; gap: 14px; } }
.scanner { position: relative; aspect-ratio: 1; background: #000; border: 2px solid var(--line); overflow: hidden; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reticle { position: absolute; inset: 18%; pointer-events: none;
  background:
    linear-gradient(#fff, #fff) top left / 28px 3px, linear-gradient(#fff, #fff) top left / 3px 28px,
    linear-gradient(#fff, #fff) top right / 28px 3px, linear-gradient(#fff, #fff) top right / 3px 28px,
    linear-gradient(#fff, #fff) bottom left / 28px 3px, linear-gradient(#fff, #fff) bottom left / 3px 28px,
    linear-gradient(#fff, #fff) bottom right / 28px 3px, linear-gradient(#fff, #fff) bottom right / 3px 28px;
  background-repeat: no-repeat; }
.reticle i { position: absolute; left: 4%; right: 4%; height: 2px; background: #fff; box-shadow: 0 0 8px #fff; animation: scanline 2s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 4%; } to { top: 96%; } }
@media (prefers-reduced-motion: reduce) { .reticle i { animation: none; top: 50%; } }
.cam-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #fff; font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em;
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 10px), #000; }
.scan-photo { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px;
  background: #fff; color: #000; border: 2px solid #000; font-weight: 800; font-size: 15px; letter-spacing: .04em; cursor: pointer; white-space: nowrap; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.scan-photo:active { transform: translateX(-50%) scale(.97); }
.scan-result { padding: 22px 18px; text-align: center; border: 2px solid var(--line); background: var(--panel); display: grid; gap: 6px; min-height: 170px; align-content: center; }
.scan-result .big { font-size: clamp(24px, 4vw, 32px); font-weight: 900; }
.scan-result .who { font-size: 20px; font-weight: 700; }
.scan-result.ok { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.scan-result.ok .tag, .scan-result.ok .muted { color: inherit; opacity: .7; }
.scan-result.warn { border-style: dashed; border-width: 3px; }
.scan-result.err { border-width: 4px; background: repeating-linear-gradient(-45deg, var(--line-soft) 0 3px, transparent 3px 12px), var(--panel); }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(2px); }
.modal-box { width: min(100%, 380px); max-height: calc(100vh - 32px); overflow: auto; }
/* ── 對戰報到 ── */
.vs-check { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.vs-check .vs { align-self: center; font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.vs-check .pc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 2px dashed var(--line); text-align: center; min-width: 0; }
.vs-check .pc b { font-size: clamp(18px, 3vw, 26px); font-weight: 900; overflow-wrap: anywhere; }
.vs-check .pc.ok { border-style: solid; background: var(--fg); color: var(--bg); }
.vs-check .pc.ok .tag { color: inherit; opacity: .7; }
.vs-check .pc.ok .chip.solid { background: var(--bg); color: var(--fg); }
@media (max-width: 520px) { .vs-check { grid-template-columns: 1fr; } .vs-check .vs { justify-self: center; } }
.mcard .ck { font-family: var(--font-mono); font-size: 12px; margin: 0 4px; opacity: .8; }

@media print {
  body > *:not(.modal) { display: none !important; }
  body { background: #fff; color: #000; }
  .modal { position: static; background: none; backdrop-filter: none; }
  .modal-box { border: 1px solid #000; }
  .modal .btn { display: none; }
}

/* ── 戰鬥場 ── */
.arena-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.arena { padding: 16px; }
.arena-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.arena-head h3 { font-family: var(--font-display); font-size: 16px; letter-spacing: .1em; }
.arena-now .mcard { border-width: 3px; min-height: 64px; }
.arena-now .mcard .p { font-weight: 900; font-size: 16px; }
.arena details summary { cursor: pointer; list-style: none; }
.arena details summary::-webkit-details-marker { display: none; }
.mcard.static { opacity: .55; cursor: default; }
.mcard.static:hover { box-shadow: none; }
.arena-solo { max-width: 640px; }
.arena-solo .arena-now .mcard { min-height: 84px; }
.arena-solo .arena-now .mcard .p { font-size: 19px; }
.arena-solo .arena-now .mcard .sc { font-size: 26px; }

/* ── 首頁：旋轉陀螺（單一 SVG 座標系，各瀏覽器比例一致） ── */
.hero-tops { position: relative; overflow: hidden; padding: 0; min-height: 340px; width: 100%;
  background-image: radial-gradient(circle at 66% 64%, var(--line-soft) 0 1px, transparent 1px); background-size: 14px 14px; }
.tops-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: invert(var(--line-invert)); }
.tops-svg image { transform-box: fill-box; will-change: transform; }
.tops-svg .spin { transform-origin: 50% 50%; animation: top-spin 1.6s linear infinite; }
.tops-svg .wob { transform-origin: 50% 92%; animation: top-wobble var(--spd, 1s) linear infinite; }
.tops-svg .ring { fill: none; stroke: #0a0a0a; vector-effect: non-scaling-stroke; animation: ring-flow .4s linear infinite; }
.tops-svg .ring.big { stroke-width: 1.2; stroke-dasharray: 4 10; opacity: .4; }
.tops-svg .ring.small { stroke-width: 1.6; stroke-dasharray: 7 6; opacity: .55; }
@keyframes top-spin { to { transform: rotate(360deg); } }
@keyframes top-wobble {
  0%   { transform: rotate(calc(var(--tilt, 4deg) * -1)) translateY(0); }
  25%  { transform: rotate(0deg) translateY(-1.2%) scaleX(.985); }
  50%  { transform: rotate(var(--tilt, 4deg)) translateY(0); }
  75%  { transform: rotate(0deg) translateY(-1.2%) scaleX(1.015); }
  100% { transform: rotate(calc(var(--tilt, 4deg) * -1)) translateY(0); }
}
@keyframes ring-flow { to { stroke-dashoffset: -26; } }
.hero-tops:hover .spin { animation-duration: .7s; }
.hero-tops .readout { position: absolute; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; z-index: 2; color: var(--fg); background: var(--panel); padding: 2px 6px; border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .tops-svg image, .tops-svg .ring { animation: none !important; } }
/* 手機：用 padding 撐出正方形（iOS Safari／LINE 內建瀏覽器對 grid 內的 aspect-ratio 支援不穩） */
@media (max-width: 760px) {
  .hero-tops { width: 100%; min-height: 0; height: 0 !important; padding: 100% 0 0 !important; justify-self: stretch; }
  .hero-tops .readout + .readout { display: none; }
}

/* LINE 按鈕（維持黑白，但標示清楚） */
.btn.line-btn { background: var(--fg); color: var(--bg); }
.btn.line-btn::before { content: 'LINE'; font-family: var(--font-display); font-size: 11px; font-weight: 900; letter-spacing: .06em; padding: 2px 5px; border: 1.5px solid currentColor; border-radius: 6px; margin-right: 4px; }
.line-hint { margin: 10px 0 0 !important; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.6; }
.line-hint b { color: var(--fg); }
.line-card { border-width: 2px; }
.line-card-body { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.line-card-body > div { flex: 1; min-width: 220px; }

/* 首頁標題 */
.hero-title { font-family: var(--font-body); font-weight: 900; font-size: clamp(30px, 6vw, 64px); white-space: nowrap; line-height: 1.05; margin: 10px 0 14px; letter-spacing: .04em; }
.hero-title small { display: block; font-family: var(--font-display); font-size: clamp(12px, 1.6vw, 15px); letter-spacing: .3em; margin-top: 14px; font-weight: 700; color: var(--muted); }

/* 報到 QR 卡（固定黑白，方便掃描與列印） */
.qr-card { position: relative; width: min(100%, 360px); margin: 0 auto; padding: 18px 18px 26px; background: #fff; color: #0a0a0a; border: 3px solid #0a0a0a; overflow: hidden; text-align: center;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.qr-card .qc-art { position: absolute; pointer-events: none; user-select: none; --tone: #0a0a0a; }
.qr-card .qc-art img { display: block; width: 100%; opacity: 0; }   /* 只用來撐出線稿比例 */
.qr-card .qc-art::after { content: ''; position: absolute; inset: 0; background: var(--tone);
  -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat; }
/* 彩蛋配色 */
.qr-card.t-gold .qc-art { --tone: linear-gradient(135deg, #7a5a0c 0%, #f6d36b 28%, #b8860b 48%, #ffeaa0 68%, #9a7414 100%); }
.qr-card.t-blue .qc-art { --tone: linear-gradient(135deg, #2b8fd0, #8fd3ff 50%, #3aa0e0); }
.qr-card.t-red .qc-art { --tone: linear-gradient(135deg, #b3141b, #ff6b6b 50%, #d62828); }
.qr-card.t-green .qc-art { --tone: linear-gradient(135deg, #12804a, #6fe0a0 50%, #1b9a5a); }
.qr-card[class*=" t-"] .qc-a, .qr-card[class*=" t-"] .qc-b { opacity: .9; }
.qr-card[class*=" t-"] .qc-bg { opacity: .22; }
.qc-bg { width: 120%; left: -10%; top: 18%; opacity: .1; }
.qc-a { width: 42%; left: -10%; top: -6%; opacity: .55; transform: rotate(-12deg); }
.qc-b { width: 36%; right: -8%; bottom: 6%; opacity: .55; transform: rotate(10deg); }
.qr-card > div { position: relative; z-index: 1; }
.qc-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; border-bottom: 2px solid #0a0a0a; padding-bottom: 6px; }
.qc-head span:first-child { font-family: var(--font-body); font-weight: 900; font-size: 13px; letter-spacing: .1em; }
.qc-crowns { display: flex; justify-content: center; gap: 3px; margin-top: 12px; margin-bottom: -8px; }
.qc-crowns i { width: 26px; height: 20px; display: block; }
.qc-crowns svg { width: 100%; height: 100%; display: block; stroke: rgba(0,0,0,.35); stroke-width: .8; stroke-linejoin: round; }
.qc-crowns .cr-g svg { fill: #f2c230; }
.qc-crowns .cr-s svg { fill: #c9cdd3; }
.qc-crowns .cr-b svg { fill: #c9803f; }
/* 皇冠金屬質感＋掃過的閃光（同大螢幕頒獎台） */
.qc-crowns i { position: relative; }
.qc-crowns i::before, .qc-crowns i::after { content: ''; position: absolute; inset: 0; pointer-events: none; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 5l5 4 5-7 5 7 5-4-2 11H4z'/%3E%3Crect x='4' y='15.2' width='16' height='2.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 18'%3E%3Cpath d='M2 5l5 4 5-7 5 7 5-4-2 11H4z'/%3E%3Crect x='4' y='15.2' width='16' height='2.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.qc-crowns .cr-g::before { background: linear-gradient(180deg, #fff6d0 0%, #ffd95a 30%, #a8750f 55%, #fff1b0 62%, #d9a520 100%); }
.qc-crowns .cr-s::before { background: linear-gradient(180deg, #ffffff 0%, #d9dee4 30%, #7d858f 55%, #f4f6f8 62%, #aab2bb 100%); }
.qc-crowns .cr-b::before { background: linear-gradient(180deg, #ffe2c8 0%, #e3a06a 30%, #7a4219 55%, #ffd2ad 62%, #b8703c 100%); }
.qc-crowns i::after { background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 48%, rgba(255,255,255,.2) 52%, transparent 62%) no-repeat;
  background-size: 250% 100%; animation: bd-shine 3.2s ease-in-out infinite; }
.qc-crowns i:nth-child(2n)::after { animation-delay: .3s; } .qc-crowns i:nth-child(3n)::after { animation-delay: .6s; }
.qc-crowns i { filter: drop-shadow(0 0 4px rgba(255,220,120,.35)); }
@media (prefers-reduced-motion: reduce) { .qc-crowns i::after { animation: none; } }
.qc-name { font-size: 26px; font-weight: 900; margin-top: 14px; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; }
.qc-user { font-family: var(--font-mono); font-size: 12px; color: #555; }
.qc-qr { width: 72%; margin: 12px auto 10px; background: #fff; padding: 8px; border: 2px solid #0a0a0a; box-shadow: 6px 6px 0 #0a0a0a; }
.qc-qr .qr { width: 100%; height: auto; display: block; }
.qc-foot { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; margin-top: 12px; }
.qc-stripe { position: absolute !important; left: 0; right: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(-45deg, #0a0a0a 0 6px, transparent 6px 12px); }

/* 賽程樹：顯示場地、標示自己的對戰 */
.bracket .mcard { grid-template-rows: auto auto auto; }
.bracket .mcard .no { display: block; grid-row: 3; grid-column: 1 / -1; font-size: 10px; letter-spacing: .1em; border-top: 1px dashed var(--line-soft); padding-top: 2px; }
.mcard.mine { outline: 3px solid var(--fg); outline-offset: 2px; }
.mcard.mine::before { content: 'YOU'; position: absolute; top: -9px; left: 10px; background: var(--fg); color: var(--bg); font-family: var(--font-mono); font-size: 10px; padding: 0 6px; letter-spacing: .14em; }
.my-match { display: block; margin-top: 18px; text-decoration: none; }
.mm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.mm-big { font-size: 26px; font-weight: 900; }
.mm-state { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; border: 1px solid currentColor; padding: 4px 10px; }
.side .name-input { font-size: clamp(18px, 3vw, 24px); font-weight: 900; background: transparent; color: inherit; border-color: currentColor; min-height: 40px; }
.side.b .name-input { border-color: var(--inv-fg); }
.prize-list { display: grid; gap: 8px; }
.prize-row { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 520px) { .prize-row { grid-template-columns: 90px 1fr auto; } }
.prizes-box { display: grid; gap: 6px; }
.prizes-box .pz { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); }
.prizes-box .pz b { font-family: var(--font-display); letter-spacing: .06em; }
.prizes-box .pz:first-child { border-width: 2px; }

/* ── 計分板：陀螺線稿 ── */
.scoreboard .side { position: relative; overflow: hidden; isolation: isolate; }
.scoreboard .side > :not(.side-art):not(.side-art2) { position: relative; z-index: 1; }
.side-art, .side-art2 { position: absolute; pointer-events: none; user-select: none; z-index: 0; }
.side-art { width: 62%; right: -12%; top: 6%; opacity: .32; animation: art-wobble 3.2s ease-in-out infinite alternate; transform-origin: 50% 92%; }
.side-art2 { width: 34%; right: 30%; top: 2%; opacity: .16; transform: rotate(-14deg); }
.side.a .side-art, .side.a .side-art2 { filter: invert(var(--line-invert)); }
.side.b .side-art, .side.b .side-art2 { filter: invert(calc(1 - var(--line-invert))); }
@keyframes art-wobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg) translateY(-2%); } }
.mid { position: relative; overflow: hidden; }
.mid > * { position: relative; z-index: 1; }
.mid-top { position: absolute !important; z-index: 0 !important; width: 150%; max-width: none; left: 50%; top: 50%; margin: -75% 0 0 -75%; opacity: .3; filter: invert(var(--line-invert)); animation: top-spin 2.4s linear infinite; pointer-events: none; }
.scoreboard .fbtn { background: color-mix(in srgb, var(--panel) 55%, transparent); }
.side.b .fbtn { background: color-mix(in srgb, var(--inv-bg) 55%, transparent); }
@media (max-width: 760px) {
  .side-art { width: 46%; right: -6%; top: -4%; }
  .side-art2 { display: none; }
  .mid-top { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}
@media (prefers-reduced-motion: reduce) { .side-art, .mid-top { animation: none; } }

/* ── 對戰流程：準備完成／戰鬥開始／倒數 ── */
.fbtn:disabled { opacity: .28; }
.battle-state { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-align: center; line-height: 1.5; padding: 6px 4px; border: 1px dashed var(--line); background: var(--bg); }
.battle-state.live { border-style: solid; background: var(--fg); color: var(--bg); animation: blink 1s steps(2) infinite; }
.skip-btn, .snd-btn { background: var(--bg); border: 1px solid var(--line-soft); color: var(--muted); font-size: 11px; padding: 3px 8px; cursor: pointer; font-family: var(--font-mono); }
.snd-btn { font-size: 14px; padding: 2px 8px; }
@media (max-width: 760px) {
  .mid { flex-wrap: wrap; justify-content: center; }
}

.countdown { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10, 10, 10, .92); color: #f2f2ee; overflow: hidden;
  background-image: repeating-linear-gradient(-45deg, rgba(242,242,238,.05) 0 2px, transparent 2px 14px); }
.countdown.out { opacity: 0; transition: opacity .35s; }
.cd-ring { position: absolute; width: min(80vw, 80vh); aspect-ratio: 1 / 1; border-radius: 50%; border: 3px dashed rgba(242,242,238,.35); animation: top-spin 1.2s linear infinite; }
.cd-ring::after { content: ''; position: absolute; inset: 12%; border-radius: 50%; border: 2px solid rgba(242,242,238,.2); }
.cd-text { position: relative; font-family: var(--font-display); font-weight: 900; font-size: min(42vw, 52vh); line-height: .9; text-align: center; letter-spacing: .02em; }
.countdown.go .cd-text { font-size: min(17vw, 22vh); }
.countdown.go { background-color: #f2f2ee; color: #0a0a0a; background-image: repeating-linear-gradient(-45deg, rgba(10,10,10,.08) 0 3px, transparent 3px 16px); }
.countdown.go .cd-ring { border-color: rgba(10,10,10,.4); animation-duration: .35s; }
.cd-text.pop { animation: cd-pop .85s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes cd-pop { 0% { transform: scale(2.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.85); opacity: .2; } }
.countdown.go .cd-text.pop { animation: cd-go 1.1s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes cd-go { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 30% { transform: scale(1.08) rotate(0); opacity: 1; } 100% { transform: scale(1.15); opacity: 1; } }
.cd-sub { position: absolute; bottom: 12%; font-family: var(--font-mono); letter-spacing: .5em; font-size: 14px; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .cd-ring, .ready-cover, .start-cover { animation: none; } .cd-text.pop, .countdown.go .cd-text.pop { animation: none; } }

/* 準備完成：覆蓋在該選手分數板上 */
.scoreboard { position: relative; }
.ready-cover { position: absolute !important; inset: 0; z-index: 5 !important; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 0; cursor: pointer; touch-action: manipulation; color: inherit;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, currentColor 7%, transparent) 0 3px, transparent 3px 14px), color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.side.b .ready-cover { background: repeating-linear-gradient(-45deg, color-mix(in srgb, currentColor 8%, transparent) 0 3px, transparent 3px 14px), color-mix(in srgb, var(--inv-bg) 80%, transparent); }
.rc-main { font-size: clamp(30px, 5vw, 46px); font-weight: 900; letter-spacing: .16em; padding: 14px 28px; border: 3px solid currentColor;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); animation: rc-pulse 1.4s ease-in-out infinite; }
.rc-sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: .24em; opacity: .7; }
.ready-cover:hover .rc-main, .ready-cover:active .rc-main { background: currentColor; }
.side.a .ready-cover:hover .rc-main, .side.a .ready-cover:active .rc-main { color: var(--fg); -webkit-text-fill-color: var(--panel); }
.side.b .ready-cover:hover .rc-main, .side.b .ready-cover:active .rc-main { -webkit-text-fill-color: var(--inv-bg); }
@keyframes rc-pulse { 50% { transform: scale(1.05); } }
.ready-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .2em; text-align: center; padding: 6px; border: 2px solid currentColor; font-weight: 700; }

/* 戰鬥開始：覆蓋整個分數板 */
.start-cover { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border: 0; cursor: pointer; touch-action: manipulation; color: #f2f2ee;
  background: repeating-linear-gradient(-45deg, rgba(242,242,238,.07) 0 3px, transparent 3px 16px), rgba(10,10,10,.86); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sc-main { font-size: clamp(40px, 8vw, 84px); font-weight: 900; letter-spacing: .2em; padding: 18px 40px; background: #f2f2ee; color: #0a0a0a;
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px); box-shadow: 0 0 0 4px #0a0a0a; animation: rc-pulse 1s ease-in-out infinite; }
.sc-sub { font-family: var(--font-mono); font-size: 12px; letter-spacing: .24em; opacity: .75; }
.start-cover:active .sc-main { transform: scale(.96); }
.btn.recording { animation: blink 1s steps(2) infinite; }
.voice-row { flex-wrap: wrap; }

/* ═══════ 終結動畫（線稿，依得分方鏡像：--dir = 1 勝方在左，-1 勝方在右） ═══════ */
.fx { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  color: #f2f2ee; background: repeating-linear-gradient(-45deg, rgba(242,242,238,.04) 0 2px, transparent 2px 14px), rgba(10,10,10,.97); }
.fx.out { opacity: 0; transition: opacity .3s; }
.fx-stage { position: relative; width: min(94vw, 820px); height: 0; padding-top: min(47vw, 410px); }
.fx-arena { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fx-arena ellipse { fill: none; stroke: rgba(242,242,238,.55); stroke-width: .6; vector-effect: non-scaling-stroke; }
.fx-arena ellipse.in { stroke-dasharray: 4 6; stroke: rgba(242,242,238,.25); }
.fx-arena path, .fx-arena .rim, .fx-arena .rail, .fx-arena .core { fill: none; stroke: rgba(242,242,238,.45); stroke-width: .8; vector-effect: non-scaling-stroke; }
.fx-arena .wall { fill: rgba(242,242,238,.05); stroke: rgba(242,242,238,.55); }
.fx-arena .rim { stroke: rgba(242,242,238,.3); }
.fx-arena .rail { stroke: rgba(242,242,238,.5); stroke-width: 3; stroke-dasharray: 2 4; }
.fx-arena .core { stroke: rgba(242,242,238,.3); }
.fx-arena .over-zone { fill: rgba(242,242,238,.1); stroke: rgba(242,242,238,.5); }
.fx-arena .gate-hole { fill: #000; stroke: rgba(242,242,238,.7); stroke-width: 1.2; }
.fx-arena .gate-frame { stroke: rgba(242,242,238,.55); stroke-width: 1.2; }
.fx-over .over-zone { fill: rgba(242,242,238,.3); animation: fx-glow .5s .85s 3 alternate; }
.fx-xtreme .gate-hole { animation: fx-gate 3.2s forwards; }
.fx-xtreme .gate-frame { stroke: #f2f2ee; stroke-width: 1.8; }
@keyframes fx-gate { 0%, 30% { fill: #000; } 34% { fill: rgba(242,242,238,.9); } 50%, 100% { fill: rgba(242,242,238,.15); } }
@keyframes fx-glow { to { fill: rgba(242,242,238,.8); } }
.fx-arena .pocket-x { fill: rgba(242,242,238,.6); font: 900 9px 'Orbitron', sans-serif; }
.fx:not(.fx-xtreme) .pocket-x { display: none; }

.fx-top, .fx-parts { position: absolute; width: 22%; top: 26%; }
.fx[data-w="a"] .fx-win, .fx[data-w="b"] .fx-lose, .fx[data-w="b"] .fx-parts { left: 18%; }
.fx[data-w="b"] .fx-win, .fx[data-w="a"] .fx-lose, .fx[data-w="a"] .fx-parts { left: 60%; }
.fx[data-w="a"] .fx-ghost { left: 18%; } .fx[data-w="b"] .fx-ghost { left: 60%; }
.fx .spinner { transform-origin: 50% 90%; animation: fx-wob .13s linear infinite alternate; }
.fx img { display: block; width: 100%; filter: invert(1); }
.fx[data-w="a"] .fx-win img, .fx[data-w="a"] .fx-ghost img, .fx[data-w="b"] .fx-lose img { transform: scaleX(-1); }
/* 旋轉特效：底部氣流＋周圍速度線 */
.fx-top .spinner { position: relative; z-index: 1; }
.fx-swirl { position: absolute; left: -18%; width: 136%; top: 52%; overflow: visible; pointer-events: none; }
.fx-swirl ellipse { fill: none; stroke: #f2f2ee; vector-effect: non-scaling-stroke; }
.fx-swirl .s1 { stroke-width: 2; stroke-dasharray: 22 14 6 14; opacity: .7; animation: fx-sw .32s linear infinite; }
.fx-swirl .s2 { stroke-width: 1.4; stroke-dasharray: 10 8; opacity: .5; animation: fx-sw .22s linear infinite reverse; }
.fx-swirl .s3 { stroke-width: 1.2; stroke-dasharray: 30 50; opacity: .45; animation: fx-sw .4s linear infinite; }
[data-w="b"] .fx-win .fx-swirl ellipse, [data-w="a"] .fx-lose .fx-swirl ellipse { animation-direction: reverse; }
@keyframes fx-sw { to { stroke-dashoffset: -112; } }
.fx-win .spinner img { filter: invert(1) drop-shadow(0 0 6px rgba(242,242,238,.55)); }
.fx-ghost .fx-swirl { display: none; }
@keyframes fx-wob { from { transform: rotate(-5deg); } to { transform: rotate(5deg) translateY(-2%); } }

.fx-title { position: relative; margin-top: min(4vh, 24px); text-align: center; opacity: 0; animation: fx-title .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.fx-title b { display: block; font-family: var(--font-display); font-weight: 900; font-size: clamp(24px, min(7.5vw, 11vh), 66px); letter-spacing: .05em; line-height: 1; }
.fx-title span { display: block; margin-top: min(10px, 1.5vh); font-family: var(--font-mono); font-size: clamp(11px, min(2.4vw, 3.6vh), 18px); letter-spacing: .2em; }
.fx-skip { position: absolute; bottom: calc(8px + env(safe-area-inset-bottom)); font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; opacity: .45; }
@keyframes fx-title { from { opacity: 0; transform: scale(1.7); } to { opacity: 1; transform: scale(1); } }

.fx-flash { position: absolute; top: 10%; width: 40%; height: 0; padding-top: 40%; margin-left: -20%; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 12%, rgba(255,255,255,.5) 30%, transparent 62%); }
.fx[data-w="a"] .fx-flash { left: 60%; } .fx[data-w="b"] .fx-flash { left: 40%; }
.fx-ring { position: absolute; top: 40%; width: 8%; height: 0; padding-top: 8%; margin: -4% 0 0 -4%; border-radius: 50%; border: 3px solid #f2f2ee; opacity: 0; pointer-events: none; }
.fx[data-w="a"] .fx-ring { left: 60%; } .fx[data-w="b"] .fx-ring { left: 40%; }
@keyframes fx-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-ring { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }

/* SPIN：輸家轉速變慢、晃動加大、倒地 */
.fx-spin .fx-title { animation-delay: 1.8s; }
.fx-spin .fx-lose { transform-origin: 50% 95%; animation: fx-spin-lose 2.6s ease-in forwards; }
.fx-spin .fx-lose .spinner { animation-iteration-count: 12; }
.fx-spin .fx-lose .fx-swirl { animation: fx-swirl-die 2.6s ease-in forwards; }
.fx-spin .fx-lose .fx-swirl ellipse { animation-duration: .5s; }
@keyframes fx-swirl-die { 0%, 30% { opacity: 1; } 62%, 100% { opacity: 0; transform: scale(.7, .5); } }
.fx-spin .fx-win .fx-swirl { animation: fx-swirl-up 2.6s ease-out forwards; }
@keyframes fx-swirl-up { 0%, 60% { transform: none; } 75% { transform: scale(1.25); } 100% { transform: scale(1.1); } }
@keyframes fx-spin-lose {
  0%, 38% { transform: none; }
  50% { transform: rotate(calc(var(--dir) * -8deg)); }
  58% { transform: rotate(calc(var(--dir) * 11deg)); }
  64% { transform: translateY(2%) rotate(calc(var(--dir) * -15deg)); }
  70% { transform: translateY(5%) rotate(calc(var(--dir) * 24deg)); }
  78%, 100% { transform: translateY(26%) rotate(calc(var(--dir) * 84deg)); }
}
.fx-spin .fx-flash { display: none; }
.fx-spin .fx-ring { top: 66%; border-style: dashed; animation: fx-ring .7s 1.75s ease-out forwards; }
.fx-spin[data-w="a"] .fx-ring { left: 71%; } .fx-spin[data-w="b"] .fx-ring { left: 29%; }

/* 衝刺撞擊（OVER／BURST） */
.fx-over .fx-win, .fx-burst .fx-win { animation: fx-dash 2.3s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes fx-dash {
  0% { transform: none; } 28% { transform: translateX(calc(var(--dir) * -14%)); }
  37% { transform: translateX(calc(var(--dir) * 92%)); } 47% { transform: translateX(calc(var(--dir) * 62%)); }
  100% { transform: translateX(calc(var(--dir) * 42%)); }
}
.fx-over .fx-flash, .fx-burst .fx-flash { animation: fx-flash .5s .85s ease-out forwards; }
.fx-over .fx-ring, .fx-burst .fx-ring { animation: fx-ring .6s .85s ease-out forwards; }
.fx-over .fx-title, .fx-burst .fx-title { animation-delay: .95s; }

/* OVER：輸家被撞飛出場外 */
.fx-over .fx-lose { animation: fx-over-lose 2.3s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes fx-over-lose {
  0%, 36% { transform: none; opacity: 1; }
  40% { transform: translateX(calc(var(--dir) * 24%)) rotate(calc(var(--dir) * 25deg)); }
  100% { transform: translate(calc(var(--dir) * 430%), -150%) rotate(calc(var(--dir) * 960deg)) scale(.3); opacity: 0; }
}

/* BURST：輸家零件解體（上蓋／固鎖／軸心） */
.fx-burst .fx-lose { animation: fx-hide 2.3s steps(1) forwards; }
@keyframes fx-hide { 0%, 37% { opacity: 1; } 38%, 100% { opacity: 0; } }
.fx-parts { aspect-ratio: 1; pointer-events: none; z-index: 4; }
.fx-burst .fx-stage { animation: fx-shake .5s .85s linear; }
.fx-burst .fx-lose { animation: fx-burst-lose 2.3s steps(1) forwards; }
.fx-burst .fx-lose .spinner { animation-duration: .05s; }
@keyframes fx-burst-lose { 0%, 37% { opacity: 1; } 38%, 100% { opacity: 0; } }
.fx-burst .fx-flash { width: 64%; padding-top: 64%; margin-left: -32%; top: -6%; }
.fx-parts .pt { position: absolute; left: 0; width: 100%; overflow: visible; opacity: 0; fill: #0a0a0a; stroke: #f2f2ee; stroke-width: 2.2; stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(242,242,238,.7)); animation: 2.3s linear forwards; }
.fx-parts .pt * { vector-effect: non-scaling-stroke; }
.pt-blade { top: 18%; animation-name: fx-pt-blade !important; }
.pt-ratchet { top: 46%; width: 70% !important; left: 15% !important; animation-name: fx-pt-ratchet !important; }
.pt-bit { top: 58%; width: 46% !important; left: 27% !important; animation-name: fx-pt-bit !important; }
.pt-chip { top: 40%; width: 18% !important; left: 41% !important; }
.pt-chip.c1 { animation-name: fx-pt-c1 !important; } .pt-chip.c2 { animation-name: fx-pt-c2 !important; } .pt-chip.c3 { animation-name: fx-pt-c3 !important; }
/* 38% 撞擊 → 40–45% 零件彈開的慢動作 → 之後高速飛散 */
@keyframes fx-pt-blade {
  0%, 37% { opacity: 0; transform: none; } 38% { opacity: 1; transform: none; }
  45% { transform: translate(calc(var(--dir) * 10%), -38%) rotate(calc(var(--dir) * 24deg)) scale(1.15); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  70% { transform: translate(calc(var(--dir) * 120%), -230%) rotate(calc(var(--dir) * 760deg)) scale(1.9); }
  100% { opacity: 0; transform: translate(calc(var(--dir) * 220%), -330%) rotate(calc(var(--dir) * 1300deg)) scale(2.4); }
}
@keyframes fx-pt-ratchet {
  0%, 37% { opacity: 0; transform: none; } 38% { opacity: 1; transform: none; }
  45% { transform: translate(calc(var(--dir) * 18%), -6%) rotate(calc(var(--dir) * -20deg)); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  62% { transform: translate(calc(var(--dir) * 260%), -150%) rotate(calc(var(--dir) * -540deg)) scale(1.3); animation-timing-function: ease-in; }
  82% { transform: translate(calc(var(--dir) * 380%), 110%) rotate(calc(var(--dir) * -860deg)) scale(1.3); }
  100% { opacity: 0; transform: translate(calc(var(--dir) * 410%), 80%) rotate(calc(var(--dir) * -960deg)) scale(1.3); }
}
@keyframes fx-pt-bit {
  0%, 37% { opacity: 0; transform: none; } 38% { opacity: 1; transform: none; }
  45% { transform: translate(calc(var(--dir) * 6%), 12%) rotate(calc(var(--dir) * 30deg)); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  55% { transform: translate(calc(var(--dir) * 70%), -150%) rotate(calc(var(--dir) * 380deg)) scale(1.2); animation-timing-function: ease-in; }
  66% { transform: translate(calc(var(--dir) * 130%), 70%) rotate(calc(var(--dir) * 620deg)) scale(1.2); animation-timing-function: ease-out; }
  74% { transform: translate(calc(var(--dir) * 160%), 0%) rotate(calc(var(--dir) * 700deg)) scale(1.2); animation-timing-function: ease-in; }
  82% { transform: translate(calc(var(--dir) * 185%), 70%) rotate(calc(var(--dir) * 760deg)) scale(1.2); }
  100% { opacity: 0; transform: translate(calc(var(--dir) * 200%), 70%) rotate(calc(var(--dir) * 790deg)) scale(1.2); }
}
@keyframes fx-pt-c1 { 0%, 37% { opacity: 0; transform: none; } 39% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--dir) * -260%), -420%) rotate(900deg); } }
@keyframes fx-pt-c2 { 0%, 37% { opacity: 0; transform: none; } 39% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--dir) * 520%), -380%) rotate(-1100deg); } }
@keyframes fx-pt-c3 { 0%, 37% { opacity: 0; transform: none; } 39% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--dir) * 160%), 420%) rotate(700deg); } }
.fx-parts .spark { position: absolute; left: 50%; top: 45%; width: 4px; height: 22%; background: #f2f2ee; opacity: 0; transform-origin: 50% 0; box-shadow: 0 0 6px #f2f2ee; animation: fx-spark .6s .85s ease-out forwards; }
.fx-parts .k1 { --r: -20deg; } .fx-parts .k2 { --r: 40deg; } .fx-parts .k3 { --r: 100deg; } .fx-parts .k4 { --r: 170deg; } .fx-parts .k5 { --r: 240deg; }
.fx-parts .k6 { --r: 290deg; } .fx-parts .k7 { --r: 70deg; } .fx-parts .k8 { --r: 200deg; }
@keyframes fx-spark { 0% { opacity: 1; transform: rotate(var(--r)) translateY(10%) scaleY(.3); } 100% { opacity: 0; transform: rotate(var(--r)) translateY(380%) scaleY(1.4); } }
/* 爆裂瞬間的放射速度線 */
.fx-burstlines { position: absolute; width: 140%; left: -20%; top: -30%; aspect-ratio: 1; overflow: visible; opacity: 0; stroke: #f2f2ee; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: fx-blines .7s .85s cubic-bezier(.1, .8, .3, 1) forwards; }
@keyframes fx-blines { 0% { opacity: 1; transform: scale(.3) rotate(0); } 100% { opacity: 0; transform: scale(2.2) rotate(calc(var(--dir) * 25deg)); } }

/* XTREME：殘影高速衝刺，撞進極限區 */
.fx-xtreme .fx-win, .fx-xtreme .fx-ghost { animation: fx-x-dash 2.5s cubic-bezier(.6, 0, .2, 1) forwards; }
.fx-xtreme .fx-ghost.g1 { opacity: .35; animation-delay: .05s; }
.fx-xtreme .fx-ghost.g2 { opacity: .16; animation-delay: .1s; }
@keyframes fx-x-dash {
  0% { transform: translateX(calc(var(--dir) * -150%)); } 24% { transform: translateX(calc(var(--dir) * -120%)); }
  40% { transform: translateX(calc(var(--dir) * 95%)); } 55% { transform: translateX(calc(var(--dir) * 70%)); }
  100% { transform: translateX(calc(var(--dir) * 48%)); }
}
.fx-xtreme .fx-stage { z-index: 2; }
.fx-xtreme .fx-lose { z-index: 5; animation: fx-x-lose 3.2s cubic-bezier(.3, .6, .3, 1) forwards; }
.fx-xtreme .fx-lose .spinner { animation-iteration-count: infinite; animation-duration: .07s; }
@keyframes fx-x-lose {
  0%, 31% { transform: none; filter: none; opacity: 1; }
  35% { transform: translateX(calc(var(--dir) * 70%)) rotate(calc(var(--dir) * 30deg)); }
  42% { transform: translateX(calc(var(--dir) * 132%)) translateY(8%) scale(.75) rotate(calc(var(--dir) * 80deg)); }
  52% { transform: translateX(calc(var(--dir) * 138%)) translateY(8%) scale(.55) rotate(calc(var(--dir) * 200deg)); opacity: .7; }
  60% { transform: translateX(calc(var(--dir) * 100%)) translateY(-4%) scale(1.4) rotate(calc(var(--dir) * 380deg)); opacity: 1; filter: blur(1px); }
  71.8% { transform: translateX(calc(var(--dir) * -95%)) translateY(-14%) scale(9) rotate(calc(var(--dir) * 720deg)); filter: blur(0); }
  80% { transform: translateX(calc(var(--dir) * -95%)) translateY(-14%) scale(9.3) rotate(calc(var(--dir) * 740deg)); opacity: 1; }
  100% { transform: translateX(calc(var(--dir) * -95%)) translateY(-14%) scale(10) rotate(calc(var(--dir) * 750deg)); opacity: 0; }
}
.fx-xtreme .fx-lose .fx-swirl { animation: fx-hide-x 3.2s steps(1) forwards; }
@keyframes fx-hide-x { 0%, 40% { opacity: 1; } 41%, 100% { opacity: 0; } }
.fx-crack { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; pointer-events: none; opacity: 0; fill: none; stroke: #f2f2ee; stroke-width: 2; vector-effect: non-scaling-stroke; animation: fx-crack 3.2s forwards; }
.fx-crack path { vector-effect: non-scaling-stroke; stroke-dasharray: 600; stroke-dashoffset: 600; animation: fx-crack-draw .25s 2.3s ease-out forwards; }
@keyframes fx-crack { 0%, 71.7% { opacity: 0; } 72%, 90% { opacity: 1; } 100% { opacity: .6; } }
@keyframes fx-crack-draw { to { stroke-dashoffset: 0; } }
.fx-xtreme::after { content: ''; position: absolute; inset: 0; z-index: 7; background: #f2f2ee; opacity: 0; pointer-events: none; animation: fx-flash .45s 2.3s ease-out forwards; }
.fx-xtreme .fx-flash { width: 70%; padding-top: 70%; margin-left: -35%; top: -10%; animation: fx-flash .7s 1s ease-out forwards; }
.fx-xtreme .fx-ring { animation: fx-ring .8s 1s ease-out forwards; border-width: 5px; }
.fx-xtreme .fx-stage { animation: fx-shake .55s 1s linear, fx-shake .7s 2.3s linear; }
.fx-xtreme.fx { animation: fx-shake .6s 2.3s linear; }
.fx-xtreme .fx-title { animation-delay: 2.45s; z-index: 8; }
.fx-xtreme .fx-title b { font-size: clamp(28px, min(9vw, 13vh), 80px); }
@keyframes fx-shake {
  0%, 100% { transform: none; } 10% { transform: translate(-2%, 1%); } 20% { transform: translate(2%, -2%); } 30% { transform: translate(-3%, 2%); }
  40% { transform: translate(3%, 0); } 55% { transform: translate(-2%, -1%); } 70% { transform: translate(1%, 1%); } 85% { transform: translate(-1%, 0); }
}
.snd-btn.off { opacity: .35; }

/* ═══════ 手機：全螢幕計分模式 ═══════ */
.sb-bar { display: none; }
@media (max-width: 760px) {
  body.sb-full .topbar, body.sb-full .hazard, body.sb-full .foot { display: none; }
  body.sb-full main.wrap { padding: 0; max-width: none; }
  body.sb-full #app > :not(.sb-bar):not(.scoreboard) { display: none !important; }
  body.sb-full .sb-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 8;
    height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
  .sb-bar button { width: 40px; height: 36px; background: none; border: 1px solid var(--line-soft); color: var(--fg); font-size: 18px; cursor: pointer; }
  .sb-title { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; }

  body.sb-full .scoreboard { display: flex; flex-direction: column; height: calc(100dvh - 44px - env(safe-area-inset-top)); border: 0; }
  body.sb-full .scoreboard > .side { flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr); gap: 6px 12px; padding: 10px 12px 12px; }
  body.sb-full .side .who { grid-row: 1; grid-column: 1; }
  body.sb-full .side .name, body.sb-full .side .name-input { grid-row: 2; grid-column: 1; font-size: 20px; min-height: 36px; }
  body.sb-full .side .score { grid-row: 1 / span 3; grid-column: 2; font-size: 72px; align-self: center; }
  body.sb-full .side .pips { grid-row: 3; grid-column: 1; }
  body.sb-full .side .ready-tag { grid-row: 4; grid-column: 1 / -1; padding: 3px; font-size: 11px; }
  body.sb-full .side .fbtns { grid-row: 6; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 8px; height: 100%; margin: 0; }
  body.sb-full .side .fbtn { min-height: 0; height: 100%; padding: 6px; }
  body.sb-full .side .fbtn b { font-size: clamp(16px, 5vw, 22px); }
  body.sb-full .side .fbtn small { font-size: 12px; }
  body.sb-full .side .fbtn em { font-size: 16px; }

  body.sb-full .mid { flex: 0 0 auto; flex-direction: row; flex-wrap: nowrap; justify-content: center; gap: 14px; padding: 6px 10px; border: 0;
    border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
  body.sb-full .mid .battle-state, body.sb-full .mid .skip-btn, body.sb-full .mid .snd-btn { display: none; }
  body.sb-full .mid .vs { font-size: 20px; }
  body.sb-full .mid-top { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  body.sb-full .rc-main { font-size: 34px; padding: 12px 24px; }
  body.sb-full .sc-main { font-size: 46px; padding: 16px 30px; }
}
.battle-live { width: 10px; height: 10px; border-radius: 50%; background: var(--fg); animation: blink 1s steps(2) infinite; }

/* ═══════ 手機橫向：A 左、B 右，全螢幕 ═══════ */
@media (orientation: landscape) and (max-height: 520px) {
  body.sb-full .topbar, body.sb-full .hazard, body.sb-full .foot { display: none; }
  body.sb-full main.wrap { padding: 0; max-width: none; }
  body.sb-full #app > :not(.sb-bar):not(.scoreboard) { display: none !important; }
  body.sb-full .sb-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; z-index: 8;
    height: 34px; padding: 0 calc(8px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left)); background: var(--bg); border-bottom: 1px solid var(--line); }
  body.sb-full .sb-bar button { width: 36px; height: 28px; font-size: 15px; background: none; border: 1px solid var(--line-soft); color: var(--fg); }
  body.sb-full .sb-title { flex: 1; text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; }

  body.sb-full .scoreboard { display: grid !important; grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    height: calc(100dvh - 34px); border: 0; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  body.sb-full .scoreboard > .side { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    gap: 4px 10px; padding: 8px 10px 10px; min-height: 0; }
  body.sb-full .side .who { grid-row: 1; grid-column: 1; }
  body.sb-full .side .who .tag { font-size: 9px; }
  body.sb-full .side .name, body.sb-full .side .name-input { grid-row: 2; grid-column: 1; font-size: 17px; min-height: 30px; padding: 2px 8px; }
  body.sb-full .side .score { grid-row: 1 / span 3; grid-column: 2; font-size: 54px; align-self: center; }
  body.sb-full .side .pips { grid-row: 3; grid-column: 1; }
  body.sb-full .side .pips span { height: 7px; }
  body.sb-full .side .ready-tag { grid-row: 4; grid-column: 1 / -1; padding: 2px; font-size: 10px; }
  body.sb-full .side .fbtns { grid-row: 6; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 6px; height: 100%; margin: 0; }
  body.sb-full .side .fbtn { min-height: 0; height: 100%; padding: 4px; gap: 0; }
  body.sb-full .side .fbtn b { font-size: clamp(14px, 2.6vw, 20px); }
  body.sb-full .side .fbtn small { font-size: 11px; }
  body.sb-full .side .fbtn em { font-size: 14px; }
  body.sb-full .side .fbtn kbd { display: none; }
  body.sb-full .side-art2 { display: none; }
  body.sb-full .side-art { width: 40%; right: -6%; top: -6%; }

  body.sb-full .mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 6px 2px;
    border: 0; border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
  body.sb-full .mid .vs { writing-mode: vertical-rl; font-size: 20px; }
  body.sb-full .mid .target { font-size: 9px; }
  body.sb-full .mid .btn { padding: 4px 6px; font-size: 11px; min-height: 0; }
  body.sb-full .mid-top { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  body.sb-full .rc-main { font-size: 28px; padding: 10px 20px; }
  body.sb-full .rc-sub { font-size: 9px; }
  body.sb-full .sc-main { font-size: 40px; padding: 12px 28px; }
  body.sb-full .winner-band { padding: 10px; gap: 6px; }
  body.sb-full .winner-band .w { font-size: 28px; }
}

/* 加入主畫面（App 模式）：避開瀏海與狀態列 */
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
.sb-bar [data-fullscreen] { font-size: 16px; }
@media (max-height: 520px) { .fx-skip { display: none; } }

/* 積分榜 */
.my-points { margin-bottom: 6px; }
.mp-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.mp-big { font-family: var(--font-display); font-weight: 900; font-size: clamp(24px, 5vw, 38px); line-height: 1.1; }
@media (max-width: 520px) { .mp-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
tr.me-row td { background: var(--line-soft); font-weight: 700; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; border: 1px solid var(--line); }
.rule { padding: 12px 14px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.rule .rv { font-family: var(--font-display); font-weight: 900; font-size: 28px; }
.rule .rk { font-size: 13px; color: var(--muted); }
.rule-list { margin: 0; padding-left: 20px; line-height: 1.9; }

/* ───────────── 陀螺圖鑑 ───────────── */
.dex-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.dex-panel { display: grid; gap: 4px; padding: 14px 16px; }
.dex-filter { margin-bottom: 6px; align-items: center; }
.dex-filter .tag { min-width: 3em; }
.dex-tools { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }
.dex-tools select { width: auto; }
.dex-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.dex-card { display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; background: var(--bg); transition: transform .12s, box-shadow .12s; }
.dex-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--fg); }
.dex-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-bottom: 1px solid var(--line);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 12.5% 12.5%; overflow: hidden; }
.dex-art.big { border: 1px solid var(--line); max-width: 300px; width: 100%; margin: 0 auto; }
.dex-art .readout { position: absolute; top: 8px; left: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; background: var(--bg); padding: 0 4px; }
.dex-art .readout.r { left: auto; right: 10px; }
.bey-photo { width: 88%; height: 88%; object-fit: contain; position: relative; }
.bey-noimg { width: 70%; aspect-ratio: 1; display: grid; place-content: center; gap: 4px; text-align: center; border: 1px dashed var(--muted); color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; background: var(--bg); }
.bey-noimg b { font-size: 14px; color: var(--fg); }
.dex-info { display: grid; gap: 2px; padding: 10px 12px 12px; flex: 1; }
.dex-info h3 { font-size: 17px; font-weight: 900; margin: 0; }
.dex-en { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.modal-box.wide { width: min(100%, 520px); }
.dex-table th { text-align: left; width: 9em; color: var(--muted); font-weight: 400; }
.dex-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dex-form .full { grid-column: 1 / -1; }
.dex-form .field span, .modal .field > span { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 560px) {
  .dex-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dex-info h3 { font-size: 15px; }
  .dex-tools { grid-template-columns: 1fr; }
  .dex-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}
.dex-tabs { margin: 8px 0 0; }
.dex-tabs button.on .muted { color: inherit; opacity: .7; }
.dex-tabs + .dex-panel { border-top: 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.dex-uses { display: flex; flex-wrap: wrap; gap: 6px; }
.dex-uses .chip { cursor: pointer; background: transparent; text-transform: none; }
.dex-uses .chip:hover { background: var(--fg); color: var(--bg); }
.dex-stats { display: grid; gap: 6px; }
.ds-row { display: grid; grid-template-columns: 98px 1fr 34px; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; }
.ds-row i { display: block; height: 8px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--fg) var(--v), transparent var(--v)); }
.ds-row b { text-align: right; font-family: var(--font-display); font-size: 13px; }
.dex-src { margin-top: 24px; font-size: 12px; }
.dex-src a { color: inherit; }

/* ───────────── 我的陀螺 ───────────── */
.mb-entry { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 14px; border-style: dashed; }
.mb-entry b { font-size: 15px; }
.mb-entry .muted { font-size: 13px; }
.mb-deck { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mb-card, .mb-item { padding: 0; text-align: left; font: inherit; color: inherit; background: var(--bg); cursor: pointer; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; min-width: 0; }
.mb-card.on { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--fg); }
.mb-card.empty-slot { border-style: dashed; }
.mb-pic { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-bottom: 1px solid var(--line); overflow: hidden;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 12.5% 12.5%; }
.mb-pic.big { border: 1px solid var(--line); max-width: 260px; width: 100%; margin: 0 auto; }
.mb-art { width: 80%; height: 80%; object-fit: contain; filter: invert(var(--line-invert)); }
.mb-no { position: absolute; top: 6px; left: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; background: var(--bg); padding: 0 4px; z-index: 1; }
.mb-plus { font-family: var(--font-display); font-size: 32px; color: var(--muted); }
.mb-info { display: grid; gap: 1px; padding: 8px 10px 10px; min-width: 0; }
.mb-info b { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-combo { font-family: var(--font-display); font-weight: 900; font-size: 16px; letter-spacing: .03em; }
.mb-wr { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mb-detail { margin-top: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mb-title { font-family: var(--font-display); font-weight: 900; font-size: 22px; }
.mb-title span { margin-left: 6px; }
.mb-layers { display: grid; gap: 4px; }
.mb-layers .layer { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 5px 10px; font-size: 13px; }
.mb-layers .layer .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.mb-layers .l2 { margin: 0 12px; } .mb-layers .l3 { margin: 0 26px; }
.mb-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.mb-stats div { padding: 6px 10px; border-right: 1px solid var(--line-soft); } .mb-stats div:last-child { border-right: 0; }
.mb-stats b { display: block; font-family: var(--font-display); font-size: 18px; }
.mb-stats span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.mb-fin { display: grid; gap: 5px; margin-top: 10px; }
.mb-fin div { display: grid; grid-template-columns: 62px 1fr 26px; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 11px; }
.mb-fin i { display: block; height: 7px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--fg) var(--v), transparent var(--v)); }
.mb-fin em { font-style: normal; text-align: right; }
.mb-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 150px), 1fr)); gap: 10px; }
.mb-shelf.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 60vh; overflow: auto; }
.mb-add { align-items: center; justify-content: center; border-style: dashed; min-height: 150px; gap: 4px; }
.mb-preview { display: grid; grid-template-columns: 180px 1fr; gap: 14px; align-items: start; }
.mb-preview .mb-pic.big { aspect-ratio: auto; display: block; }
.mb-preview .mb-pic.big .mb-art { display: block; width: 100%; height: auto; aspect-ratio: 1; padding: 10%; }
.mb-name-under { border-top: 1px solid var(--line); padding: 6px 8px; display: grid; text-align: center; background: var(--bg); }
.mb-name-under b { font-size: 14px; } .mb-name-under span { font-family: var(--font-display); font-weight: 900; font-size: 14px; }
.mb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mb-arts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mb-art-pick { border: 1px solid var(--line-soft); background: transparent; color: inherit; padding: 4px; cursor: pointer; display: grid; gap: 2px; font-family: var(--font-mono); font-size: 10px; }
.mb-art-pick img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: invert(var(--line-invert)); }
.mb-art-pick.on { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
@media (max-width: 640px) {
  .mb-deck { gap: 8px; }
  .mb-info { padding: 6px 7px 8px; }
  .mb-info b { font-size: 12px; }
  .mb-combo { font-size: 12px; }
  .mb-wr { font-size: 9px; }
  .mb-no { font-size: 8px; }
  .mb-detail { grid-template-columns: 1fr; }
  .mb-preview { grid-template-columns: 120px 1fr; }
}
/* 裁判計分：這回合使用的陀螺 */
.sb-beys { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; position: relative; z-index: 2; }
.sb-bey { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border: 1px solid currentColor; background: transparent; color: inherit; font: 600 12px var(--font-body); cursor: pointer; opacity: .5; max-width: 100%; }
.sb-bey img { width: 26px; height: 26px; object-fit: contain; filter: invert(var(--line-invert)); }
.sb-bey span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-bey.on { opacity: 1; box-shadow: inset 0 0 0 1px currentColor; }
.mb-results { display: grid; border: 1px solid var(--line); max-height: 260px; overflow: auto; margin-top: -6px; }
.mb-results button { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.mb-results button:hover { background: var(--fg); color: var(--bg); }
.mb-results .mono { font-family: var(--font-mono); font-size: 12px; opacity: .7; }
.mb-r-combo { margin-left: auto; font-family: var(--font-display); font-weight: 900; font-size: 13px; }
.mb-series { margin: -4px 0 0; }
.mb-series .chip { cursor: pointer; background: transparent; }
.mb-series .chip.on { background: var(--fg); color: var(--bg); }
.mb-results { max-height: 300px; margin-top: 0; }
.mb-results button.on { background: var(--fg); color: var(--bg); }
.mb-r-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; border: 1px solid currentColor; padding: 0 4px; opacity: .6; white-space: nowrap; }
@media (max-width: 640px) { .mb-results { max-height: 240px; } .mb-results button { flex-wrap: wrap; } }
.sb-bey.scan { opacity: 1; border-style: dashed; padding: 4px 10px; text-decoration: none; }

/* ───────────── 準備階段：選陀螺（三角形） ───────────── */
.bey-setup { display: grid; gap: 10px; position: relative; z-index: 2; }
.bey-tri { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 8px; align-items: center; }
.bey-tri.a .t0 { grid-column: 2; grid-row: 1; } .bey-tri.a .t1 { grid-column: 2; grid-row: 2; } .bey-tri.a .t2 { grid-column: 1; grid-row: 1 / 3; }
.bey-tri.b .t0 { grid-column: 1; grid-row: 1; } .bey-tri.b .t1 { grid-column: 1; grid-row: 2; } .bey-tri.b .t2 { grid-column: 2; grid-row: 1 / 3; }
.tri-bey { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border: 2px solid currentColor; background: transparent; color: inherit; cursor: pointer; opacity: .5; min-width: 0; font: inherit; transition: opacity .15s, background .15s; }
.tri-bey img { width: min(84px, 17vw); aspect-ratio: 1; object-fit: contain; }
.side.a .tri-bey img, .side.a .cur-bey img { filter: invert(var(--line-invert)); }
.side.b .tri-bey img, .side.b .cur-bey img { filter: invert(calc(1 - var(--line-invert))); }
.tri-bey b { font-size: 14px; font-weight: 900; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tri-bey small { font-family: var(--font-display); font-weight: 900; font-size: 12px; letter-spacing: .03em; }
.tri-bey.on { opacity: 1; box-shadow: inset 0 0 0 2px currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.setup-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.setup-actions:empty { display: none; }
.setup-hint { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-align: center; opacity: .7; }
.ready-inline { width: 100%; padding: 14px; font: 900 clamp(18px, 2.6vw, 24px) var(--font-body); letter-spacing: .12em; border: 2px solid currentColor; cursor: pointer; }
.side.a .ready-inline { background: var(--fg); color: var(--panel); }
.side.b .ready-inline { background: var(--inv-fg); color: var(--inv-bg); }
.cur-bey { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; position: relative; z-index: 2; min-width: 0; }
.cur-bey img { width: 36px; height: 36px; object-fit: contain; }
.cur-bey span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-bey.picked { padding: 6px 8px; border: 2px solid currentColor; font-size: 15px; }
.cur-bey.picked img { width: 44px; height: 44px; }
.cur-bey .bey-change { margin-left: auto; flex-shrink: 0; border: 1px solid currentColor; background: transparent; color: inherit; font: 700 12px var(--font-body); padding: 4px 10px; cursor: pointer; }
/* 兩邊準備區等高：選陀螺區撐滿，提示與「準備完成」貼齊底部，分數位置左右一致 */
.side .bey-setup { flex: 1; display: flex; flex-direction: column; }
.side .bey-setup .setup-hint { margin-top: auto; }

/* 選陀螺區固定尺寸＋過場動畫 */
:root { --tri-cell: 124px; --slot-tri: calc(var(--tri-cell) * 2 + 8px); --slot-set: 60px; --score-big: clamp(96px, 16vw, 180px); --score-small: clamp(48px, 7vw, 84px); }
.tri-bey { height: var(--tri-cell); align-content: center; overflow: hidden; }
.tri-bey img { width: auto; height: calc(var(--tri-cell) - 52px); }
.bey-tri .t2 { height: calc(var(--slot-tri)); }
.bey-slot { overflow: hidden; }
.bey-slot.tri { height: var(--slot-tri); }
.bey-slot.set { height: var(--slot-set); display: flex; align-items: center; }
.bey-slot.set .cur-bey { flex: 1; }
.side .score { transition: none; }
.side.picking .score { font-size: var(--score-small); }
.side.anim-close .bey-slot.set { animation: slot-close .5s cubic-bezier(.2, .8, .2, 1); }
.side.anim-close .score { animation: score-grow .5s cubic-bezier(.2, .8, .2, 1); }
.side.anim-open .bey-slot.tri { animation: slot-open .5s cubic-bezier(.2, .8, .2, 1); }
.side.anim-open .score { animation: score-shrink .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes slot-close { from { height: var(--slot-tri); opacity: .3; } to { height: var(--slot-set); opacity: 1; } }
@keyframes slot-open { from { height: var(--slot-set); opacity: .3; } to { height: var(--slot-tri); opacity: 1; } }
@keyframes score-grow { from { font-size: var(--score-small); } to { font-size: var(--score-big); } }
@keyframes score-shrink { from { font-size: var(--score-big); } to { font-size: var(--score-small); } }
@media (max-width: 640px) { :root { --tri-cell: 104px; } }
@media (prefers-reduced-motion: reduce) { .side[class*="anim-"] .bey-slot, .side[class*="anim-"] .score { animation: none !important; } }
.cur-bey-slot { height: 44px; display: flex; align-items: center; min-width: 0; }
.cur-bey-slot .cur-bey { flex: 1; }
/* 練習紀錄：每回合陀螺對戰 */
.prac-log { display: grid; gap: 0; border: 1px solid var(--line); }
.prac-rec { border-bottom: 1px solid var(--line-soft); }
.prac-rec:last-child { border-bottom: 0; }
.prac-rec summary { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.prac-rec summary::-webkit-details-marker { display: none; }
.prac-rec[open] summary { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.prac-used { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 14px 0; font-size: 13px; }
.prac-rounds { list-style: none; margin: 0; padding: 8px 14px 14px; display: grid; gap: 6px; }
.prac-rounds li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: baseline; font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--line-soft); }
.prac-rounds .mono { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.prac-vs i { font-style: normal; font-family: var(--font-display); font-size: 11px; color: var(--muted); margin: 0 4px; }
.prac-res { font-size: 13px; white-space: nowrap; }
@media (max-width: 640px) {
  .prac-rec summary { grid-template-columns: 1fr; gap: 2px; }
  .prac-rounds li { grid-template-columns: 30px 1fr; }
  .prac-res { grid-column: 2; white-space: normal; }
}
.mb-en { font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-r-en { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mb-results button.on .mb-r-en, .mb-results button:hover .mb-r-en { color: inherit; opacity: .7; }
@media (max-width: 640px) { .mb-en { font-size: 9px; } }
/* 格子內：圖片佔剩餘空間、名稱與配置固定兩行，不再被切掉 */
:root { --tri-cell: 132px; }
.tri-bey { grid-template-rows: minmax(0, 1fr) auto auto; align-content: stretch; padding: 6px 6px 8px; gap: 3px; }
.tri-bey img { height: 100%; width: auto; max-width: 100%; min-height: 0; }
.tri-bey b, .tri-bey small { line-height: 1.25; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tri-bey small { font-size: 11px; }
@media (max-width: 640px) { :root { --tri-cell: 112px; } .tri-bey b { font-size: 12px; } .tri-bey small { font-size: 10px; } }
/* 後排那顆格子比較高，但圖片和文字維持跟前排一樣大，置中 */
.bey-tri .t2 { grid-template-rows: auto auto auto; align-content: center; }
.bey-tri .t2 img { height: calc(var(--tri-cell) - 55px); }
.tri-code { font-family: var(--font-mono); font-size: 11px; font-weight: 600; opacity: .75; }
/* 加入陀螺表單：區塊不被壓縮（避免搜尋框、系列按鈕、清單疊在一起），太長就整個表單捲動 */
.mb-form > * { flex-shrink: 0; }
.mb-form .mb-series { margin: 0 !important; }
.mb-form .mb-results { margin-top: 0 !important; }
.mb-form .mb-series { margin: 10px 0 8px !important; }
.dex-art .readout.own { background: var(--fg); color: var(--bg); }
.mb-own { font-size: 12px; text-transform: none; letter-spacing: 0; }
/* 我的零件 */
.mb-parts { display: grid; gap: 14px; padding: 14px 16px; }
.mp-group { display: grid; gap: 6px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 3px 4px 3px 10px; font-size: 13px; }
.mp-chip b { font-weight: 700; }
.mp-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; }
.mp-chip button:hover { background: var(--fg); color: var(--bg); }
/* 陀螺排行榜 */
.bey-board td b { white-space: nowrap; }
.bey-board tbody tr { cursor: pointer; }
.bey-board tbody tr:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
/* 我的零件：縮圖卡片 */
.mp-cards, .build-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.build-grid { max-height: 320px; overflow: auto; padding: 2px; }
.mp-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; text-align: center; min-width: 0; }
.mp-card.pick { cursor: pointer; opacity: .75; }
.mp-card.pick:hover { opacity: 1; }
.mp-card.pick.on { opacity: 1; box-shadow: inset 0 0 0 2px var(--fg); background: color-mix(in srgb, var(--fg) 10%, transparent); }
.mp-thumb { width: 46px; height: 46px; display: grid; place-items: center; }
.mp-thumb svg { width: 100%; height: 100%; fill: none; stroke: var(--fg); stroke-width: 1.6; stroke-linejoin: round; }
.mp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.mp-card b { font-size: 13px; font-weight: 900; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-card small { font-family: var(--font-mono); font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-x { position: absolute; top: 2px; right: 2px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; }
.mp-x:hover { background: var(--fg); color: var(--bg); }
/* 組裝陀螺 */
.build-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 6px; }
.build-step { display: grid; gap: 2px; text-align: left; padding: 6px 10px; border: 1px solid var(--line-soft); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.build-step span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.build-step b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.build-step.set { border-color: var(--line); }
.build-step.on { box-shadow: inset 0 0 0 2px var(--fg); }
.build-preview { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line); }
/* 圖鑑零件：醒目的加入我的零件 */
.own-big { display: block; width: 100%; padding: 14px; text-align: center; font: 900 18px var(--font-body); letter-spacing: .08em; border: 2px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; text-decoration: none; }
.own-big.on { background: transparent; color: var(--fg); border-style: dashed; font-size: 15px; }
.mb-add small { font-size: 11px; text-align: center; padding: 0 8px; }
/* 彈出視窗：內容剛好符合寬度，不能左右滑動 */
.modal-box { overflow-x: hidden; overscroll-behavior: contain; }
.modal-box .table-wrap { overflow-x: visible; }
.modal-box table { width: 100%; table-layout: fixed; }
.modal-box th, .modal-box td { word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.modal-box .btn-row { flex-wrap: wrap; }
.modal-box img, .modal-box svg { max-width: 100%; }
.dex-table th { width: 38%; }
.modal { overflow: hidden; touch-action: pan-y; }
.modal-box { overflow-x: hidden; overflow-x: clip; overflow-y: auto; touch-action: pan-y; }
.mp-card.open { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.mp-card.open:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--fg); }
/* 彈出視窗的角飾改貼在框內：突出框外 5px 會讓視窗可以被左右拖動 */
.modal-box.frame::before { top: 0; left: 0; }
.modal-box.frame::after { bottom: 0; right: 0; }
/* 整頁只能上下捲，不能左右晃（iPhone 斜滑時避免整頁跟著橫移） */
html, body { overscroll-behavior-x: none; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }   /* clip 不會讓頂部固定選單失效（hidden 會） */
#app { max-width: 100%; }
/* 可以左右滑的列（分頁、篩選、導覽）：自己滑就好，不帶動整頁 */
.tabs, .filters, .dex-filter, .nav, .deck, .mb-deck { overscroll-behavior-x: contain; }
/* 首頁：我的賽程 */
.home-schedule { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.hs-item { display: grid; gap: 8px; }
.hs-card { text-decoration: none; color: inherit; padding: 16px 18px; }
.hs-big { font-family: var(--font-display); font-weight: 900; font-size: clamp(20px, 3vw, 26px); }
.hs-item > .my-match { margin: 0; }
/* 拍照辨識 */
.scan-shot { align-self: flex-start; cursor: pointer; }
.scan-wait { padding: 14px; border: 1px dashed var(--line); font-family: var(--font-mono); font-size: 12px; text-align: center; }
.scan-photo { max-width: 200px; margin: 0 auto; border: 1px solid var(--line); }
.scan-photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.scan-hits { display: grid; gap: 6px; }
.scan-hit { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.scan-hit:first-child { border-width: 2px; }
.scan-hit:hover { background: var(--fg); color: var(--bg); }
.scan-hit .mono { font-family: var(--font-mono); font-size: 11px; opacity: .7; }
.scan-hit em { font-style: normal; font-family: var(--font-display); font-weight: 900; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.ref-item { display: grid; gap: 4px; padding: 12px; }
.ref-item .mono { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ref-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ref-thumb { position: relative; width: 56px; height: 56px; border: 1px solid var(--line-soft); display: grid; place-items: center; font-size: 10px; color: var(--muted); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ref-thumb button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 10px; cursor: pointer; }
/* 標題「戰鬥陀螺競技場」不換行，但英文小字照常換行；版面欄寬不被內容撐開 */
.hero-title small { white-space: normal; }
.hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.ref-manage { padding: 14px 16px; }
.ref-manage > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.ref-manage > summary::-webkit-details-marker { display: none; }
.ref-manage > summary::before { content: '▸'; transition: transform .2s; display: inline-block; }
.ref-manage[open] > summary::before { transform: rotate(90deg); }
.ref-manage .muted { font-size: 12px; }
/* 拍照辨識：圓圈對準 */
.scan-stage { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; background: #111 center / cover no-repeat; border: 1px solid var(--line); touch-action: none; }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-stage [data-still] { position: absolute; left: 50%; top: 50%; max-width: none; cursor: grab; user-select: none; -webkit-user-drag: none; }
.scan-stage [data-still]:active { cursor: grabbing; }
.scan-ring { position: absolute; left: 50%; top: 50%; width: var(--ring); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 2px dashed #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); pointer-events: none; }
.scan-ring::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); background: linear-gradient(#fff, #fff) center / 100% 1px no-repeat, linear-gradient(#fff, #fff) center / 1px 100% no-repeat; opacity: .7; }
.scan-stage.done .scan-ring { border-style: solid; box-shadow: 0 0 0 999px var(--bg); }
.scan-stage.done .scan-ring::after { display: none; }
.scan-stage-msg { position: absolute; inset: auto 8px 8px; text-align: center; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; pointer-events: none; }
.scan-stage-msg:empty { display: none; }
.scan-zoom { display: flex; align-items: center; gap: 10px; }
.scan-zoom input { flex: 1; min-width: 0; }
.scan-actions { justify-content: center; }
.scan-box [hidden] { display: none !important; }
.ref-thumb { margin-bottom: 14px; }
.ref-thumb small { position: absolute; left: 0; right: 0; bottom: -15px; text-align: center; font-family: var(--font-mono); font-size: 9px; color: var(--muted); white-space: nowrap; }
/* 批次上傳：確認對應 */
.bu-list { display: grid; gap: 8px; max-height: 60vh; overflow-y: auto; }
.bu-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line-soft); }
.bu-row.need { border: 2px dashed var(--fg); }
.bu-row img { width: 56px; height: 56px; object-fit: contain; background: #fff; }
.bu-main { display: grid; gap: 4px; min-width: 0; }
.bu-main .mono { font-family: var(--font-mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bu-why { font-size: 12px; font-weight: 700; }
.bu-main select { min-width: 0; width: 100%; }
.dex-info > .tag { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.dex-hot { flex-shrink: 0; margin-left: auto; padding: 1px 6px; border: 1px solid var(--fg); color: var(--fg); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.4; }
/* 零件其他顏色 */
.dex-colors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.dc-item { position: relative; display: grid; gap: 2px; width: 64px; }
.dc-thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line-soft); background: #fff; cursor: pointer; }
.dc-thumb.on { outline: 2px solid var(--fg); outline-offset: 2px; }
.dc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dc-item small { font-size: 10px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 10px; cursor: pointer; }
.dc-add { width: 64px; height: 64px; display: grid; place-items: center; border: 1px dashed var(--line); font-size: 24px; cursor: pointer; }
.dc-nav { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 36px; height: 48px; border: 1px solid var(--fg); background: var(--bg); color: var(--fg); font-size: 26px; line-height: 1; cursor: pointer; opacity: .85; }
.dc-nav:hover { background: var(--fg); color: var(--bg); opacity: 1; }
.dc-nav.prev { left: 8px; }
.dc-nav.next { right: 8px; }
.dc-cap { display: none; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 2; padding: 2px 8px; background: var(--bg); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; max-width: 80%; overflow: hidden; text-overflow: ellipsis; }
.dex-art.big.multi .dc-nav, .dex-art.big.multi .dc-cap { display: block; }
.dex-art.big { touch-action: pan-y; }
.dex-art .readout.b { top: auto; bottom: 8px; left: 10px; border: 1px solid var(--line); font-size: 10px; }
.dex-art.big.multi .readout.b { bottom: 36px; }
/* 照片準備中：線稿 */
.bey-noimg.line { width: 100%; height: 100%; border: 0; background: transparent; position: relative; display: grid; place-items: center; }
.bey-noimg.line img { width: 78%; height: 78%; object-fit: contain; filter: invert(var(--line-invert)); opacity: .85; }
.bey-noimg.line.part svg { width: 46%; height: 46%; opacity: .8; fill: none; stroke: currentColor; stroke-width: 1.4; color: var(--fg); }
.bey-noimg.line .noimg-tag { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 10px; letter-spacing: .1em; color: var(--muted); white-space: nowrap; }
.scan-hit { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
.scan-ref-pic { width: 48px; height: 48px; background: #fff; border: 1px solid var(--line-soft); display: grid; place-items: center; overflow: hidden; }
.scan-ref-pic:empty { visibility: hidden; }
.scan-ref-pic img { width: 100%; height: 100%; object-fit: contain; }
.scan-ref-pic svg { width: 70%; height: 70%; fill: none; stroke: #111; stroke-width: 1.4; }
.scan-hit > small.mono { grid-column: 1 / -1; }
@media (max-width: 480px) { .scan-ref-pic { width: 40px; height: 40px; } }
.mb-weight { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); }
.mb-weight .k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); min-width: 64px; }
.mb-weight b { font-family: var(--font-display); font-size: 18px; }
.mb-weight .muted { font-size: 12px; }
.mb-weight .btn { margin-left: auto; }
/* 準備完成可以取消 */
button.ready-tag { background: transparent; color: inherit; cursor: pointer; display: grid; gap: 2px; width: 100%; }
button.ready-tag small { font-size: 9px; letter-spacing: .08em; opacity: .6; font-weight: 400; }
button.ready-tag:active { transform: scale(.98); }
.unready-bar { position: absolute; z-index: 7; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; }
.unready-bar button { font: inherit; font-size: 12px; padding: 6px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; white-space: nowrap; }
/* 首頁：熱門陀螺 */
.home-hot { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.home-hot a { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); text-decoration: none; color: inherit; background: var(--panel); }
.home-hot a:hover { border-color: var(--fg); }
.home-hot .hh-pic { aspect-ratio: 1; background: #fff; display: grid; place-items: center; overflow: hidden; }
.home-hot .hh-pic img { width: 88%; height: 88%; object-fit: contain; }
.home-hot .hh-pic .bey-noimg { background: var(--bg); }
.home-hot b { font-size: 15px; }
.home-hot span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* 手機橫向全螢幕：選陀螺改成一排三張小卡，準備按鈕不被擠出畫面 */
@media (orientation: landscape) and (max-height: 520px) {
  body.sb-full .side .bey-setup { grid-row: 4 / -1; grid-column: 1 / -1; min-height: 0; gap: 6px; display: flex; flex-direction: column; }
  body.sb-full .side .bey-slot.tri { height: auto; overflow: visible; }
  body.sb-full .side .bey-tri { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; gap: 6px; }
  body.sb-full .side .bey-tri .tri-bey { grid-column: auto !important; grid-row: auto !important; height: auto; padding: 4px 4px 5px; gap: 0; }
  body.sb-full .side .tri-bey img { height: clamp(30px, 15vh, 70px); width: auto; }
  body.sb-full .side .tri-bey b { font-size: 12px; }
  body.sb-full .side .tri-bey .tri-code { display: none; }
  body.sb-full .side .tri-bey small { font-size: 9px; }
  body.sb-full .side .bey-slot.set { height: 40px; }
  body.sb-full .side .setup-hint { display: none; }
  body.sb-full .side .setup-actions .sb-bey { padding: 4px 10px; font-size: 12px; min-height: 0; }
  body.sb-full .side .ready-inline { padding: 8px; font-size: 16px; margin-top: auto; }
  body.sb-full .side .cur-bey-slot { height: 30px; }
  body.sb-full .side .cur-bey img { width: 26px; height: 26px; }
  body.sb-full .side .cur-bey span { font-size: 11px; }
  body.sb-full .side-art { opacity: .35; }
  body.sb-full .unready-bar { bottom: 8px; }
  body.sb-full .unready-bar button { padding: 4px 8px; font-size: 11px; }
}

/* 手機直式：選陀螺也改成一排三顆小卡（不再用大三角形），準備完成按鈕維持在畫面內 */
@media (max-width: 760px) {
  .side .bey-slot.tri { height: auto; overflow: visible; }
  .side .bey-tri { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; gap: 6px; }
  .side .bey-tri .tri-bey { grid-column: auto !important; grid-row: auto !important; height: auto; padding: 6px 4px; gap: 2px; }
  .side .tri-bey img { height: 52px; width: auto; }
  .side .tri-bey b { font-size: 12px; }
  .side .tri-bey .tri-code { display: none; }
  .side .tri-bey small { font-size: 10px; }
  .side.anim-open .bey-slot.tri, .side.anim-close .bey-slot.set { animation: none; }
}
.feedback-box textarea { resize: vertical; min-height: 72px; }
.fb-item { padding: 12px; }
.fb-item.done { opacity: .55; }
/* 兒童帳號 */
.acct-switch { margin: 0 0 12px; }
.acct-switch .chip { cursor: pointer; }
.entrant { gap: 10px; }
.entrant.off > span { opacity: .45; }
.entrant.off .btn[disabled] { opacity: .35; cursor: not-allowed; }
.kid-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.kid-links .chip { text-decoration: none; }
.mb-pic .mb-photo { width: 84%; height: 84%; object-fit: contain; background: #fff; }
.mb-pic.big .mb-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; padding: 6%; }
/* 比賽畫面：陀螺用圖鑑照片（不套線稿的反白濾鏡） */
.side .tri-bey img.bey-ph, .side .cur-bey img.bey-ph, .tri-bey img.bey-ph, .cur-bey img.bey-ph { filter: none !important; background: #fff; object-fit: contain; border-radius: 2px; }

/* 選陀螺：所有裝置都改成一排三顆（電腦版卡片大一點） */
.side .bey-slot.tri { height: auto; overflow: visible; }
.side .bey-tri { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; gap: 10px; }
.side .bey-tri .tri-bey { grid-column: auto !important; grid-row: auto !important; height: auto; padding: 10px 6px; gap: 4px; }
.side .tri-bey img { height: clamp(64px, 9vw, 110px); width: auto; }
.side.anim-open .bey-slot.tri, .side.anim-close .bey-slot.set { animation: none; }
@media (max-width: 760px) {
  .side .bey-tri { gap: 6px; }
  .side .bey-tri .tri-bey { padding: 6px 4px; gap: 2px; }
  .side .tri-bey img { height: 52px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  body.sb-full .side .tri-bey img { height: clamp(30px, 15vh, 70px); }
  body.sb-full .side .bey-tri .tri-bey { padding: 4px 4px 5px; gap: 0; }
}
/* 積分商城 Coming Soon */
.shop-soon { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 24px; align-items: center; padding: 28px; overflow: hidden; }
.shop-soon img { width: 100%; filter: invert(var(--line-invert)); opacity: .8; animation: shop-spin 12s linear infinite; }
.shop-soon-text { display: grid; gap: 12px; }
.shop-soon-title { font-size: clamp(34px, 7vw, 72px); letter-spacing: .06em; line-height: 1; }
@keyframes shop-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .shop-soon { grid-template-columns: 1fr; text-align: center; } .shop-soon img { width: 140px; margin: 0 auto; } .shop-soon .btn { align-self: center !important; } }
@media (prefers-reduced-motion: reduce) { .shop-soon img { animation: none; } }
.fix-box > summary { cursor: pointer; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.fix-box .muted { font-size: 12px; }
.fix-scores { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.fix-scores b { font-size: 24px; padding-bottom: 8px; }
.fix-scores input { font-size: 22px; text-align: center; }
/* 賽程樹：連接線、賽別標籤、季殿軍賽在冠亞軍賽下方 */
.bracket { gap: 28px; align-items: stretch; scroll-snap-type: x proximity; }
.bracket .col { min-width: 230px; scroll-snap-align: start; }
.bracket .col-body { justify-content: space-around; gap: 0; position: relative; }
.bk-pair { flex: 1; display: flex; flex-direction: column; position: relative; }
.bk-m { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 5px 0; }
.bk-m > .mcard { width: 100%; }
/* 一組兩場往右收成 ] 形，再接到下一輪 */
.bk-pair::after { content: ''; position: absolute; right: -14px; top: 25%; bottom: 25%; width: 14px; border: 2px solid var(--line); border-left: 0; pointer-events: none; }
.bracket .col:not(.first) .bk-m::before { content: ''; position: absolute; left: -14px; top: 50%; width: 14px; border-top: 2px solid var(--line); pointer-events: none; }
.bracket .col.last .col-body { justify-content: center; }
.bracket .col.last .bk-m { flex: 0 0 auto; }
.bracket .col.last .bk-third .bk-m::before, .bracket .champ-col .bk-m::before { display: none; }
.bk-third { position: absolute; left: 0; right: 0; top: calc(50% + 70px); }
.bk-tag { align-self: flex-start; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; padding: 1px 6px; margin-bottom: 4px; background: var(--fg); color: var(--bg); }
.bk-tag.inline { display: inline-block; margin: 6px 0 -2px; }
.bk-third .bk-tag { background: transparent; color: var(--fg); border: 1px solid var(--fg); }
.bk-switch { margin: 0 0 10px; }
.bk-switch .chip, .bk-rounds .chip { cursor: pointer; }
.bk-rounds { margin: 0 0 10px; }
.arena-queue { border-style: dashed; }
@media (max-width: 760px) {
  .bracket { gap: 22px; }
  .bracket .col { min-width: 200px; }
  .bk-pair::after { right: -11px; width: 11px; }
  .bracket .col:not(.first) .bk-m::before { left: -11px; width: 11px; }
}
/* 大頭貼 */
.avatar-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.avatar-big { width: 72px; height: 72px; flex: 0 0 72px; border: 2px solid var(--fg); display: grid; place-items: center; font-family: var(--font-display); font-size: 28px; overflow: hidden; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.name .avatar.sm { width: 1.3em; height: 1.3em; object-fit: cover; vertical-align: -0.2em; margin-right: 8px; border: 1px solid currentColor; }
.fx .fx-avatar { display: block; width: clamp(80px, 18vw, 140px); height: clamp(80px, 18vw, 140px); aspect-ratio: 1; filter: none; object-fit: cover; margin: 0 auto 10px; border: 3px solid currentColor; box-shadow: 0 0 0 4px var(--bg); }
/* 裁判交換左右位置（只換畫面，不影響計分） */
.scoreboard.flip > .side.a { order: 3; }
.scoreboard.flip > .mid { order: 2; }
.scoreboard.flip > .side.b { order: 1; }
/* 積分商城 */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.shop-item { display: grid; gap: 6px; padding: 12px; align-content: start; }
.shop-item.off { opacity: .55; }
.shop-item p { margin: 0; font-size: 12px; }
.shop-pic { aspect-ratio: 1; background: #fff; display: grid; place-items: center; overflow: hidden; }
.shop-pic img { width: 90%; height: 90%; object-fit: contain; }
.shop-pic img.line { filter: none; opacity: .4; }
.shop-pic.small { width: 96px; margin-top: 6px; }
.shop-pic.small:empty { display: none; }
.shop-foot { display: flex; justify-content: space-between; align-items: baseline; }
.shop-pts { font-family: var(--font-display); font-size: 22px; font-weight: 900; }
.shop-pts small { font-size: 12px; font-family: var(--font-body); }
.t-pts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.t-pts .tag b { font-size: 15px; color: var(--fg, inherit); letter-spacing: 0; }
.t-pts small { font-size: 11px; white-space: nowrap; }
.t-pts .tag { white-space: nowrap; }
/* 積分商城訂單 */
.chip.warn { border-color: #e8b931; color: #e8b931; }
.order-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line, #333); color: inherit; font: inherit; cursor: pointer; }
.order-row:last-child { border-bottom: 0; }
.order-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-tbl th { text-align: left; font-weight: 400; color: var(--muted, #999); padding: 6px 10px 6px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.order-tbl td { padding: 6px 0; word-break: break-all; }
.order-bank { display: flex; flex-direction: column; gap: 6px; }
.order-acct { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; letter-spacing: .04em; }
.order-card { display: flex; flex-direction: column; gap: 8px; }
.order-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.filters label.chip { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.si-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.si-nums .field label { white-space: nowrap; }
.si-dates { display: grid; grid-template-columns: 1fr; gap: 12px 14px; }
.si-dates .input { min-width: 0; width: 100%; }
@media (min-width: 640px) { .si-dates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bc-row { background: #fff; padding: 4px; display: flex; justify-content: center; overflow-x: auto; }
.bc-row svg { max-width: 100%; height: auto; }
.order-dl { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line, #333); }
.order-dl > div { display: grid; grid-template-columns: 5.5em 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line, #333); }
.order-dl dt { color: var(--muted, #999); font-size: 13px; letter-spacing: .08em; padding-top: 2px; }
.order-dl dd { margin: 0; overflow-wrap: anywhere; }
.orders-box > summary { cursor: pointer; list-style: none; }
.orders-box > summary::-webkit-details-marker { display: none; }
/* 手機：商品兩欄並排 */
@media (max-width: 560px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shop-item { padding: 8px; gap: 5px; }
  .shop-item > b { font-size: 14px; line-height: 1.35; }
  .shop-item p { font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .shop-foot { flex-wrap: wrap; gap: 2px 8px; }
  .shop-pts { font-size: 16px; }
  .shop-pts small { font-size: 10px; }
  .shop-item .btn.sm { padding-left: 6px; padding-right: 6px; }
}
/* 報到編號（現場叫號） */
.ckno { display: inline-block; min-width: 1.9em; padding: 0 4px; margin: 0 5px 0 0; font-style: normal; font-family: var(--font-mono, monospace); font-size: .78em; font-weight: 700; line-height: 1.5; text-align: center; background: var(--fg, #eee); color: var(--bg, #0a0a0a); border-radius: 2px; vertical-align: 1px; }
/* 只有一方還在準備（對方已準備完成）：不要撐高，避免中間大片空白、分數被擠到畫面外 */
.side .bey-setup.solo { flex: 0 0 auto; }
.side .bey-setup.solo .setup-hint { margin-top: 10px; }
/* 伺服器預先產生的圖鑑／比賽內容（前端載入後會被取代） */
.seo-pre { padding: 24px 0; line-height: 1.7; }
.seo-pre h1 { font-size: 28px; font-weight: 900; margin: 8px 0; }
.seo-pre h2 { font-size: 18px; margin: 20px 0 8px; }
.seo-pre table { border-collapse: collapse; margin: 12px 0; }
.seo-pre th, .seo-pre td { text-align: left; padding: 6px 14px 6px 0; border-bottom: 1px solid var(--line, #333); }
.seo-pre ul { columns: 2 220px; padding-left: 18px; }
.seo-crumbs a { color: inherit; }
/* 後台設定區塊：設定好就收起來 */
.cfg-box { margin-top: 24px; }
.cfg-box > summary { cursor: pointer; list-style: none; flex-wrap: wrap; gap: 8px; }
.cfg-box > summary::-webkit-details-marker { display: none; }
.cfg-box .cfg-tg::after { content: '展開 ▾'; }
.cfg-box[open] .cfg-tg::after { content: '收起 ▴'; }
/* 熱門商品標籤（左上）、最後 N 組 */
.shop-item { position: relative; }
.shop-hot { position: absolute; top: 0; left: 0; z-index: 2; background: #e8452c; color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .1em; padding: 4px 10px; }
.shop-last { color: #e8452c; font-weight: 700; }
/* 商品資訊（點圖片） */
.shop-item .shop-pic[data-shop-view] { cursor: zoom-in; }
.shop-detail .shop-pic.big { aspect-ratio: 1; max-height: 60vh; margin: 0 auto; width: 100%; }
.shop-hot.static { position: static; align-self: flex-start; }
.shop-detail > .btn { width: 100%; }
/* 積分格子 */
.shop-bal { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 20px; margin-bottom: 16px; padding: 14px 16px; }
.shop-bal .sb-main { display: flex; flex-direction: column; gap: 2px; }
.shop-bal .sb-main b { font-family: var(--font-display); font-size: 44px; font-weight: 900; line-height: 1; }
.shop-bal .sb-sub { display: flex; gap: 18px; justify-content: flex-end; flex-wrap: wrap; }
.shop-bal .sb-sub div { display: flex; flex-direction: column; align-items: flex-end; }
.shop-bal .sb-sub span { font-size: 11px; letter-spacing: .12em; opacity: .65; }
.shop-bal .sb-sub b { font-family: var(--font-display); font-size: 20px; }
.shop-bal .sb-orders { grid-column: 1 / -1; width: 100%; justify-content: center; }
.shop-text { cursor: pointer; display: grid; gap: 6px; }
.pager { justify-content: center; margin-top: 10px; }
.hero-title .hero-sub { font-size: .62em; letter-spacing: .06em; }
@media (max-width: 560px) { .hero-title .hero-sub { font-size: .7em; white-space: normal; } }
/* 比賽文宣圖：列表卡片左側（高度跟著卡片）、比賽頁完整顯示 */
.tcard.has-poster { display: grid; grid-template-columns: minmax(84px, 30%) 1fr; gap: 0 16px; align-items: stretch; }
.tcard .tc-poster { width: 100%; height: auto; align-self: center; display: block; border: 1px solid var(--line, #333); }   /* 保持海報原比例，不裁切 */
.tcard .tc-body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tcard:not(.has-poster) .tc-body { display: contents; }
.t-poster { margin-top: 18px; }
.t-poster img { display: block; max-width: min(100%, 560px); max-height: 80vh; height: auto; cursor: zoom-in; border: 1px solid var(--line, #333); }
.poster-admin { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: start; margin-bottom: 8px; }
.poster-admin .pa-pic { aspect-ratio: 4 / 5; display: grid; place-items: center; border: 1px dashed var(--line, #333); overflow: hidden; }
.poster-admin .pa-pic img { width: 100%; height: 100%; object-fit: cover; }
.tcard.has-poster .meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tcard.has-poster h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.tcard.has-poster .bar { gap: 6px; }
/* 已結束的比賽：縮小、降低亮度（滑過時恢復） */
.tcard.done { padding: 12px 14px; gap: 6px; opacity: .5; filter: grayscale(1); transition: opacity .15s, transform .12s; }
.tcard.done h3 { font-size: 15px; }
.tcard.done .meta { font-size: 12px; }
.tcard.done .bar { padding-top: 6px; font-size: 11px; }
.tcard.done .tc-body { gap: 6px; }
.tcard.done.has-poster { grid-template-columns: minmax(64px, 22%) 1fr; }
.tcard.done:hover, .tcard.done:focus-visible { opacity: .85; }
.done-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.tcard.done { align-self: start; }
/* 重複參賽提醒 */
.scan-multi { display: inline-block; margin-top: 8px; padding: 6px 12px; background: #e8b931; color: #111; font-weight: 900; font-size: 16px; }
.scan-multi.big { font-size: 28px; padding: 10px 18px; align-self: center; }
.entry-tag { font-size: 11px; padding: 1px 6px; border-color: #e8b931; color: #e8b931; }
/* 已取消的比賽 */
.chip.cancel { border-color: #e8452c; color: #e8452c; }
.cancel-box { margin-top: 12px; padding: 12px 14px; border: 2px solid #e8452c; color: #e8452c; font-weight: 900; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.cancel-box span { font-weight: 500; color: var(--fg); }
.cancel-box.big { font-size: 20px; flex-direction: column; margin-top: 18px; }
.cancel-box.big span { font-size: 15px; }
.tcard.cancelled { opacity: .7; }
.tcard.cancelled h3 { text-decoration: line-through; text-decoration-color: #e8452c; }
/* 主辦方規章 */
.rules { max-width: 760px; line-height: 1.8; }
.rules h2 { font-size: 20px; margin: 26px 0 10px; }
.rules ol { padding-left: 22px; display: grid; gap: 8px; }
.rules-fee { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rules-fee div { border: 1px solid var(--line, #333); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.rules-fee b { font-family: var(--font-display); font-size: 26px; }
.rules-fee span { font-size: 12px; opacity: .7; line-height: 1.4; }
.warn-text { color: #e8452c; font-weight: 700; }
.rules-box { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line, #333); padding: 4px 14px 14px; font-size: 14px; }
.rules-box h2 { font-size: 17px; }
/* 條款與實名認證 */
.terms-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.terms-head span { font-size: 13px; opacity: .75; }
.terms-signer { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 14px; border: 2px solid var(--fg); padding: 10px 12px; margin: 8px 0; }
.terms-signer div { display: flex; flex-direction: column; }
.terms-signer span { font-size: 11px; opacity: .65; letter-spacing: .08em; }
.kyc-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kyc-shot { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.kyc-pic { aspect-ratio: 4 / 3; border: 1px dashed var(--line, #333); display: grid; place-items: center; overflow: hidden; font-size: 13px; opacity: .9; }
.kyc-pic img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.cam-view { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.cam-view video, .cam-view canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.cam-guide { position: absolute; border: 3px dashed rgba(255,255,255,.75); pointer-events: none; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cam-guide.card { width: 78%; aspect-ratio: 1.585; border-radius: 10px; }
.cam-guide.face { width: 46%; aspect-ratio: .78; border-radius: 50%; }
.cam-view canvas:not([hidden]) ~ .cam-guide { display: none; }
/* ───── A4 現場告示（白底黑字、網站黑白警示風格） ───── */
.notice-bar { justify-content: space-between; margin: 6px 0 14px; }
.a4-wrap { width: 100%; max-width: 794px; margin: 0 auto 30px; overflow: hidden; }
.a4 { width: 794px; height: 1123px; transform-origin: top left; background: #fff; color: #0a0a0a; position: relative; display: flex; flex-direction: column; font-family: var(--font-body, 'Noto Sans TC', sans-serif); box-shadow: 0 0 0 1px #333; --fg: #0a0a0a; }
.a4 .a4-hazard { height: 14px; flex: none; background: repeating-linear-gradient(-45deg, #0a0a0a 0 14px, #fff 14px 28px); }
.a4 > *:not(.a4-hazard) { margin-left: 46px; margin-right: 46px; }
.a4-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 22px; border-bottom: 3px solid #0a0a0a; padding-bottom: 8px; }
.a4-logo { font-family: 'Orbitron', var(--font-display), sans-serif; font-size: 22px; font-weight: 900; letter-spacing: .06em; }
.a4-logo i { color: #888; font-style: normal; margin: 0 2px; }
.a4-logo { display: flex; align-items: center; gap: 10px; }
.a4-logo img { width: 56px; height: 56px; border-radius: 8px; display: block; }
.a4-head span { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .12em; }
.a4-title { font-size: calc(46px * var(--fit, 1)); font-weight: 900; margin-top: 18px !important; margin-bottom: 4px !important; letter-spacing: .04em; line-height: 1.15; }
.a4-intro { font-size: calc(14px * var(--fit, 1)); line-height: 1.6; margin-top: 4px; margin-bottom: calc(10px * var(--fit, 1)); color: #333; }
.a4-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 3px solid #0a0a0a; margin-top: 6px; margin-bottom: 12px; }
.a4-info > div { display: flex; flex-direction: column; padding: calc(7px * var(--fit, 1)) 12px; border-bottom: 1px solid #0a0a0a; border-right: 1px solid #0a0a0a; }
.a4-info > div:nth-child(2n) { border-right: 0; }
.a4-info span { font-size: 11px; letter-spacing: .12em; color: #555; }
.a4-info b { font-size: calc(17px * var(--fit, 1)); font-weight: 900; line-height: 1.35; }
.a4-info .a4-prizes { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
.a4-info .a4-prizes b { font-size: 14px; }
.a4-secs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(12px * var(--fit, 1)) 18px; flex: 1; align-content: start; }
.a4-secs section { border: 2px solid #0a0a0a; padding: calc(10px * var(--fit, 1)) 12px; }
.a4-secs section:last-child:nth-child(odd) { grid-column: 1 / -1; }
.a4-secs h2 { font-size: calc(19px * var(--fit, 1)); font-weight: 900; display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.a4-secs h2 em { font-style: normal; font-family: 'Orbitron', sans-serif; background: #0a0a0a; color: #fff; font-size: 13px; padding: 2px 6px; }
.a4-secs ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: calc(13.5px * var(--fit, 1)); line-height: 1.55; }
.a4-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 14px; margin-bottom: 18px; gap: 16px; }
.a4-foot-l { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #444; }
.a4-foot-l b { font-size: 13px; color: #0a0a0a; font-weight: 700; }
.a4-qr { display: flex; align-items: flex-end; gap: 8px; }
.a4-qr .qr { width: 132px; height: 132px; border: 3px solid #0a0a0a; }
.a4-qr span { font-size: 12px; font-weight: 700; line-height: 1.4; text-align: right; }
@media print {
  @page { size: A4; margin: 0; }
  body.print-a4 > *:not(main), body.print-a4 main > *:not(.a4-wrap) { display: none !important; }
  body.print-a4, body.print-a4 main { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body.print-a4 .a4-wrap { max-width: none; height: auto !important; overflow: visible; margin: 0; }
  body.print-a4 .a4 { transform: none !important; box-shadow: none; width: 210mm; height: 297mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.terms-edit { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
/* A4 固定版條款：兩欄、小字 */
.a4-terms .a4-title { font-size: 34px; }
.a4-terms .a4-intro { font-size: 12.5px; }
.a4-terms .a4-secs { display: block; columns: 2; column-gap: 16px; font-size: 12.5px; overflow: hidden; }
.a4-terms .a4-secs section { break-inside: avoid; margin-bottom: 10px; padding: 8px 10px; }
.a4-terms .a4-secs h2 { font-size: 1.25em; margin-bottom: 4px; }
.a4-terms .a4-secs ol { margin: 0; padding-left: 1.4em; display: grid; gap: 3px; line-height: 1.5; }
.tabs .tab-link { display: inline-flex; align-items: center; padding: 0 12px; font-size: 13px; text-decoration: none; color: inherit; opacity: .85; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.doc-card b { font-size: 16px; }
.doc-card span { font-size: 13px; opacity: .75; line-height: 1.6; }
a.doc-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--fg); }
.a4-qrs { display: flex; gap: 14px; align-items: flex-end; }
.a4-qr { flex-direction: column; align-items: center !important; }
.a4-qr span { text-align: center !important; }
.a4-qr.line .qr { border-color: #06c755; }
.a4-qr.line span { color: #06a648; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 10px; padding: 6px 12px 6px 8px; border: 1px solid var(--line, #333); text-decoration: none; color: inherit; font-size: 14px; font-weight: 700; }
.back-link:hover { background: var(--fg); color: var(--bg); }
@media print { .back-link { display: none !important; } }
.host-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.host-box > div:first-child { flex: 1 1 320px; }

/* 首頁：提醒舊會員補填居住地區 */
.area-nudge { display: block; padding: 12px 14px; margin-bottom: 16px; text-decoration: none; font-size: 14px; border-color: var(--fg); }

/* 比賽列表：地區篩選 */
.area-filter { align-items: center; margin-top: -6px; }
.area-filter.area-sub { margin-top: -4px; padding-left: 12px; border-left: 2px solid var(--line, #333); }

/* ───────────── 大螢幕賽程表（外接螢幕） ───────────── */
body.board-mode .topbar, body.board-mode .hazard, body.board-mode .foot { display: none; }
body.board-mode #app { max-width: none; padding: 0; margin: 0; }
.board { height: 100vh; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px; box-sizing: border-box; overflow: hidden; position: relative; }
.bd-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--fg); padding-bottom: 10px; }
.bd-head img { width: 56px; height: 56px; border-radius: 8px; }
.bd-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bd-title b { font-size: clamp(22px, 2.6vw, 40px); font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-title span { color: var(--muted); font-size: clamp(13px, 1.2vw, 18px); }
.bd-clock { font-family: var(--font-display); font-size: clamp(24px, 2.8vw, 44px); letter-spacing: .08em; }
:fullscreen .bd-fs { display: none; }
.bd-arenas { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.bd-arena { border: 1px solid var(--line); padding: 8px 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 10px; }
.bd-arena.live { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg) inset; }
.bd-an { grid-column: 1 / -1; font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.bd-an b { color: #ff5a4f; font-weight: 700; } .bd-an i { font-style: normal; }
.bd-pl { font-size: clamp(16px, 1.5vw, 24px); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-pl:last-child { text-align: right; }
.bd-sc { font-family: var(--font-display); font-size: clamp(20px, 2vw, 32px); }
.bd-main { flex: 1; min-height: 0; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.bd-main .bk-switch { display: none; }
.bd-main .bracket { overflow: visible; transform-origin: top center; flex-shrink: 0; }
.bd-main .mcard { pointer-events: none; }
.bd-main .mcard.live { background: var(--fg); border-color: var(--fg); outline: 3px solid #ff5a4f; outline-offset: 2px; }   /* 正在比賽：反白 */
.bd-main .mcard.live, .bd-main .mcard.live * { color: var(--bg) !important; }
.bd-wait { margin: auto; text-align: center; }
.bd-wait .h-display { font-size: clamp(32px, 5vw, 72px); }
.bd-wait p { font-size: 22px; color: var(--muted); }
.bd-names { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; max-width: 80vw; font-size: 20px; }
.bd-names span { border: 1px solid var(--line); padding: 4px 10px; }
.bd-qr { position: absolute; right: 16px; bottom: 16px; width: 110px; background: #fff; padding: 6px; }
.bd-qr:empty { display: none; }
.bd-qr svg { display: block; width: 100%; height: auto; }

/* 大螢幕：左右對開賽程樹（右半區整塊水平翻轉，連線方向就會朝中間；文字再翻回來） */
.bd-split { gap: 22px; align-items: stretch; }
.bd-half { display: flex; gap: 22px; }
.bd-mirror { transform: scaleX(-1); }
.bd-mirror .bd-un, .bd-mirror .bk-tag { transform: scaleX(-1); display: block; }
.bd-final { justify-content: center; min-width: 260px; }
.bd-final .col-body { justify-content: center; gap: 18px; }
.bd-final .champ .h-display { font-size: 26px; }
.bd-main .mcard .p { font-size: 15px; }

/* 場地：選手同時在別的場地比賽的提醒 */
.skip-warn { margin: 8px 0 6px; padding: 6px 10px; border: 1px solid #ffb02e; color: #ffb02e; font-size: 13px; }
[data-skip-m] { margin-top: 8px; }

.bd-next { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 4px; color: var(--muted); font-size: clamp(13px, 1.1vw, 17px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 大螢幕：比賽結束的前三名（機甲風格：斜切角、警示條紋、掃描線、發光） */
.bd-podium { display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-items: end; gap: 16px; }
.bd-place { --c: #9aa3ad; position: relative; text-align: center; display: flex; flex-direction: column; gap: 2px; padding: 0 22px 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,0) 60%), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 4px), #101214;
  border: 2px solid var(--c); clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 0 30px rgba(0,0,0,.6); }
.bd-place.p2 { --c: #c8d0da; } .bd-place.p3 { --c: #d08a4e; }
.bd-place.p1 { --c: #f5c542; padding-bottom: 12px; box-shadow: inset 0 0 40px rgba(245,197,66,.18), 0 0 30px rgba(245,197,66,.35); }
.bd-hz { display: block; height: 8px; margin: 0 -22px; background: repeating-linear-gradient(-45deg, var(--c) 0 10px, #101214 10px 20px); opacity: .9; }
.bd-hz:last-child { margin-top: 6px; height: 5px; opacity: .5; }
.bd-medal { margin-top: 6px; font-family: 'Orbitron', var(--font-display), sans-serif; font-size: clamp(12px, 1.05vw, 18px); letter-spacing: .22em; color: var(--c); }
.bd-medal em { font-style: normal; padding: 1px 8px; background: var(--c); color: #101214; font-weight: 900; letter-spacing: .12em; }
.bd-place b { font-size: clamp(24px, 2.8vw, 48px); font-weight: 900; line-height: 1.15; color: #fff; text-shadow: 0 0 12px rgba(255,255,255,.18); }
.bd-place.p1 b { font-size: clamp(34px, 4.4vw, 76px); color: #ffe08a; text-shadow: 0 0 18px rgba(245,197,66,.65), 0 2px 0 #8a6a12; }
.bd-zh { font-size: clamp(12px, 1vw, 16px); letter-spacing: .5em; color: var(--muted); }

/* 頒獎台名字：金屬質感＋掃過的閃光 */
.bd-place b.bd-metal { position: relative; display: inline-block; align-self: center; color: transparent; text-shadow: none;
  background: linear-gradient(180deg, #ffffff 0%, #d9dee4 22%, #7d858f 48%, #f4f6f8 52%, #aab2bb 72%, #e9edf1 100%);
  -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)) drop-shadow(0 0 8px rgba(255,255,255,.15)); }
.bd-place.p1 b.bd-metal { background-image: linear-gradient(180deg, #fff6d0 0%, #ffd95a 22%, #a8750f 48%, #fff1b0 52%, #d9a520 72%, #fff3c4 100%);
  filter: drop-shadow(0 2px 0 #5a420a) drop-shadow(0 0 16px rgba(245,197,66,.55)); }
.bd-place.p3 b.bd-metal { background-image: linear-gradient(180deg, #ffe2c8 0%, #e3a06a 22%, #7a4219 48%, #ffd2ad 52%, #b8703c 72%, #ffdcbf 100%); }
.bd-place b.bd-metal::after { content: attr(data-text); position: absolute; inset: 0; color: transparent; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 48%, rgba(255,255,255,.2) 52%, transparent 62%) no-repeat;
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: bd-shine 3.2s ease-in-out infinite; }
.bd-place.p2 b.bd-metal::after { animation-delay: .6s; } .bd-place.p3 b.bd-metal::after { animation-delay: 1.2s; }
@keyframes bd-shine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -130% 0; } }
@media (prefers-reduced-motion: reduce) { .bd-place b.bd-metal::after { animation: none; } }
:fullscreen .bd-close { display: inline-flex; }

/* 大螢幕告示：兩張 A4 並排 */
.nb { height: 100vh; display: flex; flex-direction: column; background: #1a1a1a; overflow: hidden; }
.nb-bar { position: fixed; top: 10px; right: 12px; display: flex; gap: 8px; z-index: 5; opacity: .35; transition: opacity .2s; }
.nb-bar:hover { opacity: 1; }
.nb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.nb-pair { display: flex; gap: 28px; transform-origin: center center; flex-shrink: 0; }
.nb-pair .a4 { position: relative; transform: none !important; box-shadow: 0 10px 40px rgba(0,0,0,.5); flex-shrink: 0; }

/* A4 抬頭：中英文全名 */
.a4-brand { display: flex; flex-direction: column; gap: 2px; line-height: 1.15; }
.a4-brand b { font-family: var(--font-body, 'Noto Sans TC', sans-serif); font-size: 21px; font-weight: 900; letter-spacing: .02em; }
.a4-brand small { font-family: 'Orbitron', var(--font-display), sans-serif; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: #555; white-space: nowrap; }
.a4-head > span { white-space: nowrap; }

/* 大螢幕告示：直立螢幕輪播（一次一張，10 秒換） */
.nb-dots { display: none; }
.nb.portrait .nb-pair .a4:not(.on) { display: none; }
.nb.portrait .nb-pair .a4.on { animation: nb-in .6s ease; }
@keyframes nb-in { from { opacity: 0; } to { opacity: 1; } }
.nb.portrait .nb-dots { display: flex; gap: 10px; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }
.nb-dots i { width: 10px; height: 10px; border-radius: 50%; background: #555; }
.nb-dots i.on { background: #fff; }
.nb-stage { position: relative; }

/* 大螢幕海報 */
.poster-bd { height: 100vh; background: #000; overflow: hidden; position: relative; }
.pb-stage { position: absolute; inset: 0; overflow: hidden; }
.pb-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .8s ease; display: flex; align-items: center; justify-content: center; }
.pb-slide.on { opacity: 1; }
.pb-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(30px) brightness(.45); }
.pb-slide img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 60px rgba(0,0,0,.6); }
.poster-bd .bd-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.pb-dots { display: flex !important; gap: 10px; position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2; }

/* 計分板左右滑動交換 */
.scoreboard { touch-action: pan-y; }
.scoreboard.swiping > .side { transition: transform .16s ease, opacity .16s ease; opacity: .3; transform: scaleX(.85); }

/* 流量統計 */
.traffic-stats { grid-template-columns: repeat(4, 1fr); }
.traffic-stats b { font-size: 26px; }
@media (max-width: 560px) { .traffic-stats { grid-template-columns: repeat(2, 1fr); } .traffic-stats div:nth-child(2) { border-right: 0; } .traffic-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); } }
.traffic-days { display: grid; gap: 6px; }
.td-row { display: grid; grid-template-columns: 46px 1fr 74px; gap: 10px; align-items: center; font-size: 12px; }
.td-row i { display: block; height: 10px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--fg) var(--v), transparent var(--v)); }
.td-row em { font-style: normal; text-align: right; font-family: var(--font-mono); }
.td-row small { color: var(--muted); }

/* 約戰邀請 */
.inv-btn { display: inline-grid; place-items: center; margin-right: 6px; padding: 1px 4px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1; cursor: pointer; vertical-align: middle; }
.inv-btn:hover { background: var(--fg); color: var(--bg); }
.inv-list { display: grid; gap: 8px; }
.inv-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel, var(--bg)); color: var(--fg); font: inherit; cursor: pointer; }
.inv-opt:disabled { opacity: .45; cursor: default; }
.inv-opt:not(:disabled):hover { background: var(--fg); color: var(--bg); }
.inv-opt small { display: block; font-family: var(--font-mono); font-size: 11px; opacity: .75; }
.home-invites { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.inv-card { text-decoration: none; color: inherit; border-width: 2px; }
.inv-card .hs-big { font-size: 17px; }
.inv-banner { margin-top: 16px; padding: 10px 14px; border: 2px solid var(--line); font-weight: 700; }
.app-dl { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.map-chip { text-decoration: none; color: inherit; } .map-chip:hover { background: var(--fg); color: var(--bg); }
.inv-btn.sent { opacity: .4; border-style: dashed; }

/* 活動抽獎 */
.raffle-win { text-align: center; padding: 14px; border: 2px solid var(--line); display: grid; gap: 10px; }
.raffle-name { font-family: var(--font-display); font-size: clamp(28px, 6vw, 48px); font-weight: 900; overflow-wrap: anywhere; }
.raffle-modal .modal-box { width: min(100%, 720px); }
.raffle-stage { text-align: center; display: grid; gap: 18px; padding: 24px 8px; }
.raffle-roll { font-family: var(--font-display); font-size: clamp(40px, 10vw, 96px); font-weight: 900; line-height: 1.1; min-height: 1.2em; overflow-wrap: anywhere; }
.raffle-roll.won { animation: raffle-pop .5s ease-out; }
.raffle-sub { font-size: 18px; }
@keyframes raffle-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .raffle-roll.won { animation: none; } }

/* 多人抽獎 */
.lot-bar { height: 8px; border: 1px solid var(--line); background: var(--bg); }
.lot-bar > i { display: block; height: 100%; background: var(--fg); }
.lot-price { font-family: var(--font-display); font-size: 26px; }
.btn.lot-draw { width: 100%; padding: 18px; font-size: 22px; font-weight: 900; }
.lot-win { text-align: center; display: grid; gap: 8px; border-width: 2px; }
.lot-no { font-family: var(--font-display); font-size: clamp(28px, 7vw, 44px); font-weight: 900; }
.lot-name { font-family: var(--font-display); font-size: clamp(24px, 6vw, 40px); font-weight: 900; overflow-wrap: anywhere; }
.lot-hit { background: var(--fg); color: var(--bg); }
.lot-hit .muted { color: inherit; opacity: .75; }
.lot-result { display: grid; gap: 4px; text-decoration: none; color: inherit; border-width: 2px; }
.lot-top { align-items: start; }

/* 認證舉辦方徽章（陀螺勾勾） */
.v-badge { display: inline-block; width: 1.05em; height: 1.05em; margin-left: .22em; vertical-align: -.16em; flex: none; }
.v-badge svg { width: 100%; height: 100%; display: block; overflow: visible; }
.v-silver svg { filter: drop-shadow(0 0 2px rgba(255,255,255,.45)); }
.v-gold svg { filter: drop-shadow(0 0 3px rgba(245,197,66,.6)); }
@media (prefers-reduced-motion: reduce) { .v-badge animate { display: none; } }

/* 新手功能介紹 */
.intro-modal .modal-box { width: min(100%, 460px); }
.intro { gap: 10px; }
.intro-dots { display: flex; gap: 6px; justify-content: center; }
.intro-dots i { width: 22px; height: 4px; background: var(--line); opacity: .35; }
.intro-dots i.on { opacity: 1; }
.intro-art { display: block; width: 96px; height: 96px; margin: 0 auto; object-fit: contain; align-self: center; filter: invert(var(--line-invert)); animation: art-wobble 1.6s ease-in-out infinite alternate; }   /* 線稿在深色主題反白 */
.intro-tips { margin: 0; padding-left: 1.2em; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.edit-diff{display:grid;grid-template-columns:1fr 1fr;gap:12px}.edit-diff>div{min-width:0;border:1px dashed var(--line);padding:10px}@media(max-width:640px){.edit-diff{grid-template-columns:1fr}}
.diff-hot,.diff-hot b,.diff-hot span{color:#ff3b3b!important;font-weight:700}
.chip.nav-chip{text-decoration:none;font-weight:700}
/* 後台：每小時上線人數直條圖 */
.oc-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.oc-head .seg { display: inline-flex; border: 1px solid var(--line); }
.oc-head .seg button { background: none; border: 0; color: var(--fg); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.oc-head .seg button + button { border-left: 1px solid var(--line); }
.oc-head .seg button.on { background: var(--fg); color: var(--bg); font-weight: 700; }
.oc-sum { font-size: 13px; color: var(--muted); }
.oc-sum b { color: var(--fg); }
.oc-chart { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 180px; align-items: end; border-bottom: 1px solid var(--muted); }
.oc-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; min-width: 0; }
.oc-col i { display: block; width: 100%; max-width: 22px; background: var(--muted); border-radius: 4px 4px 0 0; min-height: 0; opacity: .55; }
.oc-col.peak i { background: var(--fg); opacity: 1; }
.oc-col.hover i { opacity: 1; outline: 2px solid var(--fg); outline-offset: 1px; }
.oc-v { font-size: 11px; font-weight: 700; color: var(--fg); line-height: 1.4; white-space: nowrap; }
.oc-axis { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; font-family: var(--mono, monospace); }
.oc-tip { margin-top: 10px; min-height: 1.5em; }
.oc-table { margin-top: 8px; }
.oc-table summary { cursor: pointer; }
/* 許願區 */
.wish-box { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.wish-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.wish-form .input { min-width: 0; }
.wish-list { display: flex; flex-direction: column; }
.wish-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.wish-row:last-child { border-bottom: 0; }
.wish-row.done { opacity: .55; }
.wish-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.wish-text .muted { font-size: 12px; }
.wish-row .btn-row { flex-wrap: nowrap; gap: 6px; }
@media (max-width: 520px) {
  .wish-form { grid-template-columns: 1fr auto; }
  .wish-form select { grid-column: 1 / -1; }
}
.oc-chart.dense { gap: 1px; }
.oc-chart.dense .oc-col i { border-radius: 2px 2px 0 0; }
.oc-col.day-start { box-shadow: inset 1px 0 0 var(--line); }
.oc-axis span { white-space: nowrap; overflow: visible; }

/* ── 表單對齊：同一排的標題、輸入框、說明各自對齊（標題長短不一時輸入框不會高高低低） ── */
.input:not(textarea):not(div):not([style*="min-height"]) { height: 44px; min-height: 44px; }
.input[style*="min-height"] { height: auto; }
textarea.input:not([rows]) { min-height: 120px; }
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 30px; line-height: 1.2;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
input.input[type="date"], input.input[type="time"] { -webkit-appearance: none; appearance: none; display: flex; align-items: center; }
input.input::-webkit-date-and-time-value { text-align: left; }
div.input { height: auto; }
.form-grid .field > label:first-child { line-height: 1.5; }
.form-grid .field > .tag { line-height: 1.6; }
@supports (grid-template-rows: subgrid) {
  .form-grid { row-gap: 0; }
  .form-grid > .field { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: 6px; align-content: start; padding-bottom: 14px; }
  .form-grid > .field > label:first-child { align-self: end; }
  .form-grid > .field > :nth-child(2) { align-self: start; }
  .form-grid > .field > :nth-child(3) { align-self: start; }
  .form-grid > .full:not(.field) { margin-bottom: 14px; }
}
@supports (grid-template-rows: subgrid) {
  .form-grid > .field > .btn-row { width: 100%; }
  .form-grid > .field > :nth-child(2).check, .form-grid > .field > .btn-row:nth-child(2):has(> .check) { min-height: 44px; align-items: center; }
  .form-grid > .field > :nth-child(2).check { display: flex; }
}
@supports (grid-template-rows: subgrid) {
  .form-grid > .field > .btn, .form-grid > .field > button { justify-self: start; }
}
.host-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); cursor: pointer; }
.host-link:hover { color: var(--fg); text-decoration-color: var(--fg); }
a.chip.host-chip { text-decoration: none; color: inherit; }
a.chip.host-chip:hover { border-color: var(--fg); }

/* 後台 App 內嵌：App 自己有標題列與分頁，網站頂部選單、頁尾隱藏 */
.in-admin-app .topbar, .in-admin-app .foot { display: none !important; }

/* 戰隊 */
.team-logo{display:inline-flex;align-items:center;justify-content:center;object-fit:cover;border:1px solid var(--fg);background:var(--panel);vertical-align:middle;flex:none;font-weight:900;color:var(--fg)}
.team-tag{display:inline-flex;margin-right:6px;vertical-align:middle;text-decoration:none}
.team-name{display:inline-flex;align-items:center;gap:8px;text-decoration:none;color:inherit}
.team-card{display:flex;align-items:center;gap:12px;text-decoration:none;color:inherit}
.team-card>span{display:flex;flex-direction:column;gap:2px;min-width:0}
.team-of{margin-top:8px;padding:6px 10px;border:1px solid var(--fg);background:var(--panel)}
.team-of>span{display:flex;flex-direction:column;line-height:1.2}
.team-of-btn{margin-top:8px;display:inline-flex}
.qc-name .team-logo{margin-right:8px;vertical-align:middle;position:relative;top:-2px}
