:root {
  color-scheme: dark;
  --ink: #f6f8fc;
  --muted: #aebbd0;
  --navy: #081629;
  --panel: #11243d;
  --panel-alt: #182f4e;
  --gold: #ffc65b;
  --red: #ef6c5e;
  --teal: #74d9b6;
  --blue: #84b5ff;
  --line: rgba(173, 200, 229, .24);
  --shadow: 0 18px 44px rgba(0, 4, 14, .28);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: #081426; }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(ellipse at 76% -10%, #1d3f63 0%, transparent 42%), linear-gradient(145deg, #0b1930, #071325 70%); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .12; background-image: linear-gradient(#afc7e0 1px, transparent 1px), linear-gradient(90deg, #afc7e0 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, transparent, #000); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #ffcf77; outline-offset: 4px; }
a { color: inherit; }
.ambient { position: fixed; pointer-events: none; border: 2px solid #7ba1c918; border-radius: 50%; }
.ambient-a { width: 600px; height: 600px; right: -210px; top: -395px; box-shadow: 0 0 0 42px #76a2cf0a, 0 0 0 84px #76a2cf0a; }
.ambient-b { width: 490px; height: 490px; left: -380px; bottom: -330px; box-shadow: 0 0 0 48px #76a2cf0a; }
.site-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px clamp(18px, 3.4vw, 52px); border-bottom: 1px solid #8fa6c227; background: #081426d9; position: relative; z-index: 2; }
.brand-block { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { width: 84px; height: 44px; object-fit: contain; background: white; border-radius: 3px; padding: 4px; flex: 0 0 auto; }
.brand-title { display: flex; flex-direction: column; gap: 2px; border-left: 1px solid #b1c0d83d; padding-left: 16px; line-height: 1.2; }
.brand-title span { color: #b9cce1; font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.brand-title strong { color: white; font-size: 19px; letter-spacing: .07em; white-space: nowrap; }
.version-label { color: #a1b2c9; font-size: 12px; white-space: nowrap; }
.home-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #e1e9f4; text-decoration: none; border: 1px solid #acc1d94f; padding: 10px 14px; font-size: 14px; white-space: nowrap; transition: border-color .18s, background .18s; }
.home-link:hover { background: #ffffff0c; border-color: #f5cf82; }
.competition-shell { position: relative; z-index: 1; width: min(1460px, 100%); margin: auto; padding: 20px clamp(16px, 3.3vw, 48px) 48px; }
.section-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #a9bacf; font-size: 11px; font-weight: 800; letter-spacing: .14em; margin: 0 0 13px; }
.section-bar > div { display: flex; align-items: center; gap: 9px; }
.section-marker { width: 24px; height: 3px; background: var(--gold); }
.section-bar-right { color: #9bafc4; font-size: 12px; letter-spacing: .1em; }
.journey { display: flex; align-items: center; gap: 0; overflow-x: auto; scrollbar-width: thin; border: 1px solid var(--line); background: #101f35d9; margin-bottom: clamp(22px, 3vw, 40px); }
.journey-item { flex: 1 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px clamp(10px, 1.5vw, 24px); color: #8d9eb6; font-size: 14px; font-weight: 700; white-space: nowrap; border-right: 1px solid #9baec022; }
.journey-item:last-child { border-right: 0; }
.journey-item.is-current, .journey-item.active, .journey-item[aria-current="step"] { color: #fff; background: #213752; box-shadow: inset 0 -3px var(--gold); }
.journey-item.is-complete, .journey-item.done { color: #bfd5e9; }
.step-number { color: #e4b762; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.scene { min-height: min(630px, 60vh); animation: stage-in .38s ease-out both; }
.screen-head { margin: 0 0 22px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--gold); margin: 0 0 8px; font-size: 13px; letter-spacing: .12em; font-weight: 800; }
.eyebrow::before { content: ''; width: 21px; height: 2px; background: currentColor; }
.hero-title { margin: 0; font-size: clamp(30px, 4.1vw, 54px); line-height: 1.14; letter-spacing: .02em; font-weight: 900; }
.lead, .subtitle { max-width: 850px; margin: 11px 0 0; color: #c3d0e0; font-size: clamp(15px, 1.45vw, 18px); line-height: 1.75; }
.title-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.title-row .screen-head { margin-bottom: 0; }
.stage-panel, .panel, .feature-card { background: linear-gradient(145deg, #182d49ef, #11243bf2); border: 1px solid #a4bed941; box-shadow: var(--shadow); border-radius: 5px; }
.stage-panel, .panel { padding: clamp(20px, 3vw, 36px); }
.feature-card { padding: clamp(18px, 2.1vw, 30px); }
.two-column { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }
.info-grid, .choice-grid, .group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 120px; padding: 18px; text-align: center; color: #eaf2fa; background: #152b46; border: 1px solid #aac4df59; border-radius: 4px; transition: transform .18s, background .18s, border-color .18s; }
button.choice-card:hover:not(:disabled) { transform: translateY(-3px); background: #223c5a; border-color: var(--gold); }
.choice-card.selected, .choice-card[aria-pressed=true], .choice-card[aria-checked=true] { background: #283f55; border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.choice-card strong { font-size: 19px; }
.choice-card small { color: #bed0df; font-size: 13px; line-height: 1.5; }
.choice-card .choice-icon { font-size: clamp(34px, 4vw, 54px); line-height: 1; }
.choice-card img { max-width: 100px; height: 90px; object-fit: contain; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.primary-btn, .secondary-btn, .action-btn { min-height: 48px; padding: 11px 22px; border-radius: 3px; color: white; font-weight: 800; letter-spacing: .03em; transition: filter .18s, transform .18s, border-color .18s; }
.primary-btn, .action-btn { border: 1px solid #ffb1a1; background: linear-gradient(110deg, #be4137, #912d2c); box-shadow: 0 4px 14px #0004; }
.secondary-btn { border: 1px solid #aac1db77; background: #142941; }
.primary-btn:hover:not(:disabled), .secondary-btn:hover:not(:disabled), .action-btn:hover:not(:disabled) { filter: brightness(1.13); transform: translateY(-1px); }
.primary-btn:disabled, .secondary-btn:disabled, .action-btn:disabled { opacity: .42; }
.badge, .stage-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #ffc65b66; background: #ffc65b16; color: #ffda89; font-size: 13px; font-weight: 800; border-radius: 3px; }
.muted, .fine { color: var(--muted); font-size: 14px; line-height: 1.6; }
.group-card { min-width: 0; overflow: hidden; background: #12253e; border: 1px solid #9cb9d54b; border-radius: 7px; box-shadow: var(--shadow); }
.group-card.is-player { border-color: #f3b962bb; box-shadow: 0 0 0 1px #f3b96255, var(--shadow); }
.group-header, .group-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 54px; padding: 12px 14px; background: #203957; }
.group-header strong, .group-card header strong { font-size: 18px; letter-spacing: .04em; }
.group-header small, .group-card header small { color: #b4c6d9; font-size: 12px; }
.group-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); margin-right: 7px; }
.group-grid > :nth-child(4n + 1) .group-dot { background: var(--red); }
.group-grid > :nth-child(4n + 2) .group-dot { background: var(--gold); }
.group-grid > :nth-child(4n + 3) .group-dot { background: var(--teal); }
.group-grid > :nth-child(4n + 4) .group-dot { background: var(--blue); }
.group-card .group-body { padding: 8px 10px 12px; }
.score-table, table.score-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; font-size: 14px; }
.score-table th { color: #9eb2c9; font-size: 12px; font-weight: 600; text-align: right; padding: 5px 6px; white-space: nowrap; }
.score-table th:nth-child(2), .score-table td:nth-child(2) { text-align: left; }
.score-table td { padding: 8px 6px; text-align: right; color: #d6e2ee; }
.score-table tbody tr:nth-child(even) { background: #ffffff06; }
.score-table tbody tr.is-player, .score-table tbody tr.player-row, .score-table tbody tr.is-winner, .score-table tbody tr:first-child { background: #ecbc5920; color: white; box-shadow: inset 3px 0 #ffc65b; }
.score-table tbody tr.is-player td, .score-table tbody tr.player-row td { color: #fff4d7; font-weight: 800; }
.score-table .points { color: var(--gold); font-weight: 800; }
.rank-note { margin: 9px 7px 2px; color: var(--gold); font-size: 12px; font-weight: 700; }
.bracket-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.bracket-column { display: grid; gap: 13px; min-width: 0; }
.bracket-column > h3, .column-title { margin: 0 0 2px; color: #b8cbe0; font-size: 15px; font-weight: 800; letter-spacing: .05em; }
.match-card { background: #142943; border: 1px solid #a4bfdc50; border-radius: 5px; padding: 13px; box-shadow: 0 8px 24px #0002; }
.match-card h4 { margin: 0 0 9px; color: #aabfd4; font-size: 13px; font-weight: 700; }
.match-row, .team-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 9px; font-size: 15px; line-height: 1.3; }
.qualifying-detail { display: block; margin-top: 5px; color: #b8cbe0; font-size: 12px; line-height: 1.4; font-weight: 400; }
.match-row.is-winner, .match-row.winner, .team-row.is-winner, .team-row.winner { color: #fff5d9; background: #ffcb6021; border-left: 3px solid var(--gold); font-weight: 800; }
.match-row .points, .team-row .points { color: #ffcf70; font-size: 18px; font-weight: 900; }
.results-list { display: grid; gap: 8px; }
.results-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #ffffff0a; border: 1px solid #ffffff10; }
.results-row strong { flex: 1; }
.rank-medal { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #0a1c2f; background: #d8e5f0; font-weight: 900; }
.results-row:first-child .rank-medal { background: #ffca65; }
.results-row:nth-child(3) .rank-medal { background: #e3a67d; }
.trophy, .trophy-icon { display: grid; place-items: center; margin: 0 auto 18px; color: var(--gold); font-size: clamp(68px, 12vw, 124px); line-height: 1; filter: drop-shadow(0 10px 24px #ffb63c44); animation: trophy-arrive .8s cubic-bezier(.2,.8,.2,1) both; }
.champion-panel { max-width: 840px; margin-inline: auto; text-align: center; padding: clamp(25px, 4vw, 52px); background: radial-gradient(circle at 50% 0%, #9a692e51, transparent 53%), #132840; border: 1px solid #ffcd7080; box-shadow: var(--shadow), 0 0 60px #ffa92d12; }
.champion-panel .eyebrow, .champion-panel .action-row { justify-content: center; }
.champion-panel .lead { margin-inline: auto; }
.centered { text-align: center; }
.centered .action-row, .centered .eyebrow { justify-content: center; }
.form-field { display: grid; gap: 8px; max-width: 430px; margin: 18px 0; }
.form-field label { font-weight: 800; color: #dfeaf6; }
.form-field input { width: 100%; color: white; background: #091b30; border: 1px solid #a8bdd75d; border-radius: 3px; padding: 13px; font-size: 16px; }
.note-box { padding: 13px 16px; border-left: 3px solid var(--gold); background: #ffffff0b; color: #c6d5e5; font-size: 14px; line-height: 1.6; }
/* Each screen and its score cards animate when the flow replaces the content. */
.scene > .screen-head, .scene > .stage-panel, .scene > .group-grid, .scene > .bracket-grid, .scene > .champion-panel { animation: stage-in .38s ease-out both; }
.group-grid > .group-card, .bracket-grid .match-card { animation: reveal-up .48s ease-out both; }
.group-grid > .group-card:nth-child(2), .bracket-grid .match-card:nth-child(2) { animation-delay: .08s; }
.group-grid > .group-card:nth-child(3) { animation-delay: .16s; }
.group-grid > .group-card:nth-child(4) { animation-delay: .24s; }
.reveal { animation: reveal-up .48s both; }
.reveal:nth-child(2) { animation-delay: .08s; }.reveal:nth-child(3) { animation-delay: .16s; }.reveal:nth-child(4) { animation-delay: .24s; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes stage-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reveal-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trophy-arrive { from { opacity: 0; transform: translateY(22px) scale(.84); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1050px) { .group-grid, .info-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .bracket-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .bracket-grid > :last-child { grid-column: 1 / -1; } }
@media (max-width: 680px) { .site-header { min-height: 64px; padding: 9px 14px; } .brand-block { gap: 10px; } .brand-logo { width: 66px; height: 38px; } .brand-title { padding-left: 10px; } .brand-title strong { font-size: 16px; } .brand-title span { font-size: 10px; } .version-label { display: none; } .home-link { padding: 9px; font-size: 12px; } .home-link span { display: none; } .competition-shell { padding: 15px 14px 38px; } .section-bar-right { display: none; } .journey { margin-bottom: 22px; } .journey-item { font-size: 12px; padding: 11px 12px; } .hero-title { font-size: clamp(28px, 8vw, 38px); } .two-column, .bracket-grid, .choice-grid.three { grid-template-columns: 1fr; } .bracket-grid > :last-child { grid-column: auto; } .choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .choice-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); } .choice-card { min-height: 104px; padding: 12px 7px; } .choice-card strong { font-size: 16px; } .choice-card img { max-width: 70px; height: 65px; } .primary-btn, .secondary-btn { flex-grow: 1; text-align: center; } }
@media (max-width: 450px) { .group-grid, .info-grid { grid-template-columns: 1fr; } .group-card .score-table { font-size: 14px; } .bracket-grid { gap: 14px; } .group-header, .group-card header { min-height: 48px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.top-icon { width:90px; height:90px; filter:drop-shadow(0 5px 7px #0007); }
.top-choice-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.top-choice-grid .choice-card:disabled:not(.selected) { opacity:.42; }
.rps-result { margin-top:20px; display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:15px; padding:18px; border:1px solid #ffc65b66; background:#0c1c31; }
.rps-result span { font-size:18px; } .rps-result strong { color:var(--gold); } .rps-result p { flex-basis:100%; margin:0; text-align:center; font-weight:800; color:#ffe0a0; }
.selection-result { margin:18px 0 0; padding:14px; background:#ffc65b16; border-left:3px solid var(--gold); line-height:1.7; }
.match-results { margin-top:18px; } .total-strip { display:flex; gap:32px; margin-top:18px; padding:15px; background:#ffc65b16; } .total-strip strong { font-size:24px; color:var(--gold); }
.podium-results { max-width:840px; margin:18px auto 0; } .top-choice-grid + .selection-result strong { color:#ffda89; }
@media(max-width:680px) { .top-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .top-icon { width:70px; height:70px; } .match-results .results-row { flex-wrap:wrap; } }

.hero-title[tabindex="-1"]:focus { outline:none; }
.results-row strong, .match-row span, .score-table td, .champion-panel .hero-title { min-width:0; overflow-wrap:anywhere; }
/* 兩隊從八個陀螺輪流各選三個。 */
.draft-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.draft-summary > div { display:grid; gap:6px; padding:12px 14px; background:#081a2ea8; border:1px solid #a6bed43b; border-radius:4px; }
.draft-summary strong { color:#ffda89; font-size:15px; overflow-wrap:anywhere; }
.draft-summary span { min-height:1.4em; color:#d2e0ed; font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.draft-turn { margin:16px 0 12px; font-size:16px; line-height:1.55; font-weight:800; color:#ffe2a2; }
.top-choice-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.draft-history-wrap { margin-top:20px; }
.draft-history-wrap h2 { margin:0 0 10px; font-size:17px; }
.draft-history { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); list-style:none; gap:7px; margin:0; padding:0; counter-reset:none; }
.draft-history li { padding:9px 10px; background:#ffffff0a; border-left:3px solid #8db7e1; border-radius:2px; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.draft-history li.is-player { border-color:#ffca65; }
.draft-history b { display:block; color:#abc1d7; font-size:12px; }
.draft-empty { margin:0; }
@media(max-width:680px) { .top-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .draft-history { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:380px) { .draft-summary { grid-template-columns:1fr; } }

/* 以兩個真實示範賽果說明同分情況。 */
.tie-examples { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.tie-card { padding:clamp(18px,2.6vw,30px); background:#142942; border:1px solid #b1c8df55; box-shadow:var(--shadow); border-radius:5px; min-width:0; }
.tie-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#b6c8da; font-weight:700; font-size:14px; }
.tie-number { color:#ffd687; font-weight:900; letter-spacing:.06em; }
.tie-card h2 { margin:14px 0 8px; color:#fff; font-size:clamp(20px,2.1vw,27px); }
.tie-card p { color:#ccdaeb; line-height:1.7; }
.tie-card p strong,.tie-conclusion { color:#ffda89; }
.tie-teams { display:grid; gap:7px; margin:18px 0; }
.tie-team { display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px 12px; padding:11px; background:#0a1b30; line-height:1.5; overflow-wrap:anywhere; }
.tie-team span { color:#c4d5e4; } .tie-team b { color:#ffda89; }
.tie-conclusion, .tie-pending { margin:0; padding:12px 14px; background:#f3c06016; border-left:3px solid #ffc65b; }
.tie-rematch-result { margin-top:14px; padding:14px; border:1px solid #ffc65b77; background:#203a4e; }
.tie-rematch-result>strong { color:#ffda89; } .tie-score { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:7px; padding:12px 0 0; }
.tie-score b { color:#ffce69; font-size:24px; } .tie-rematch-result p { margin:8px 0; } .tie-rematch-result small { display:block; color:#bacbda; line-height:1.6; }
.tie-brief { display:block; margin:9px 7px 3px; color:#cad7e6; font-size:12px; line-height:1.5; }
.group-card.is-pending .score-table tbody tr:first-child { background:transparent; box-shadow:none; }
.group-card.is-pending .score-table tbody tr.pending-row { background:#f4bd5620; box-shadow:inset 3px 0 #ffc65b; }
@media(max-width:680px) { .tie-examples { grid-template-columns:1fr; } }

.tie-section { margin-top:32px; } .tie-section-title { font-size:clamp(24px,2.7vw,34px); margin:0; }

/* A high-contrast cross marks tops taken by the other team; names stay readable. */
.top-icon-wrap { position:relative; display:inline-grid; place-items:center; width:90px; height:90px; flex:none; }
.top-choice-grid .choice-card.opponent-picked:disabled { opacity:1; border-color:#bd7772; background:#1c2a3d; }
.opponent-picked .top-icon { opacity:.38; }
.opponent-cross { position:absolute; inset:4px; width:calc(100% - 8px); height:calc(100% - 8px); pointer-events:none; }
.opponent-cross path { fill:none; stroke-linecap:round; }
.opponent-cross .cross-outline { stroke:#fff; stroke-width:12; }
.opponent-cross .cross-stroke { stroke:#c3272b; stroke-width:7; }
@media(max-width:680px) { .top-icon-wrap { width:70px; height:70px; } }
/* The deciding round communicates only who advances. */
.tie-score span { display:grid; gap:4px; }
.tie-score .result-winner { color:#91e6b7; font-size:16px; }
.tie-score .result-loser { color:#c7d0dc; font-size:16px; }
