:root { color-scheme: dark; --team-a: #ff7848; --team-b: #42d9f5; --ink: #f5faf8; --muted: #b3c8bf; --line: #335449; --gold: #ffd56d; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #06110e; color: var(--ink); font-family: Arial, Helvetica, sans-serif; cursor: none; }
#arena { position: absolute; left: 50%; top: 50%; width: 1080px; height: 1920px; transform-origin: center center; background: radial-gradient(ellipse at 50% 45%, #194235 0%, #091a14 67%); isolation: isolate; }
canvas { position: absolute; inset: 0; width: 1080px; height: 1920px; z-index: -1; }
.brand { position: absolute; top: 56px; left: 56px; right: 56px; height: 80px; display: flex; align-items: center; gap: 20px; }
.brand-mark { border: 3px solid var(--ink); width: 76px; height: 76px; display: grid; place-items: center; font-size: 30px; font-weight: 900; transform: skew(-6deg); }
h1 { margin: 0; font-size: 48px; font-weight: 900; letter-spacing: -2px; }
.brand p { font-size: 26px; letter-spacing: 8px; margin: 5px 0 0; color: var(--muted); }
.edition { margin-left: auto; text-align: right; font-size: 26px; font-weight: 700; line-height: 1.4; color: var(--muted); }
.match-meta { position: absolute; top: 171px; left: 56px; right: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 30px; font-weight: 700; letter-spacing: 1px; }
#connection { font-size: 30px; color: var(--muted); max-width: 460px; white-space: nowrap; }
#connection::before { content: ''; display: inline-block; width: 15px; height: 15px; border-radius: 50%; background: var(--muted); margin-right: 11px; }
#connection.connected::before { background: #69f5a3; }
#connection.reconnecting::before { background: var(--gold); }
#connection.disconnected::before { background: #fa7272; }
#timer { font-size: 48px; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.team { position: absolute; left: 56px; width: 968px; height: 206px; display: flex; align-items: center; gap: 23px; padding: 20px 28px 35px; background: #122920ee; border: 2px solid var(--line); border-left: 9px solid var(--team-a); border-radius: 20px; }
.team-a { top: 244px; --team: var(--team-a); }
.team-b { top: 1436px; --team: var(--team-b); border-left-color: var(--team-b); }
.shield { position: relative; width: 92px; height: 110px; flex-shrink: 0; }
.shield svg { width: 100%; height: 100%; fill: var(--team); }
.shield-detail { fill: #10231e; opacity: .8; }
.shield > span { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 10px; font-weight: 900; font-size: 48px; }
.shield .club-crest { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px; background: #f8faf9; border-radius: 12px; object-fit: contain; visibility: hidden; filter: drop-shadow(0 3px 7px #0007); }
.shield.with-logo > svg, .shield.with-logo > span { visibility: hidden; }
.shield.with-logo .club-crest { visibility: visible; }
.team-copy { min-width: 0; max-width: 650px; }
.team-tag { margin: 0 0 7px; font-size: 25px; font-weight: 700; letter-spacing: 2px; color: var(--team); }
.team-tag > span { color: var(--muted); margin-left: 20px; font-size: 24px; }
h2 { margin: 0; font-size: 48px; letter-spacing: -1px; }
.team h2 { max-width: 650px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.join-instruction { margin: 8px 0 0; font-size: 33px; color: var(--muted); max-width: 650px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.join-instruction strong { color: var(--ink); }
.score { font-size: 114px; line-height: 1; margin-left: auto; color: var(--team); font-variant-numeric: tabular-nums; letter-spacing: -7px; }
.energy { position: absolute; bottom: 16px; left: 145px; right: 260px; height: 8px; overflow: hidden; background: #335449; border-radius: 10px; }
.energy span { display: block; height: 100%; background: var(--team); width: 0; transition: width .15s linear; }
.players { position: absolute; bottom: 7px; right: 30px; color: var(--muted); font-size: 26px; }
.field-label { position: absolute; left: 190px; right: 190px; text-align: center; font-size: 29px; font-weight: 700; letter-spacing: 2px; color: #ddede6; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-a-label { top: 484px; }
.goal-b-label { top: 1218px; }
.action-card { position: absolute; top: 1268px; left: 56px; right: 56px; height: 142px; display: flex; flex-direction: column; justify-content: center; padding: 10px 26px; border-radius: 18px; background: #183b2eee; border: 1px solid var(--line); border-left: 5px solid var(--gold); }
.small-label { font-size: 22px; font-weight: 700; letter-spacing: 3px; color: var(--gold); }
.action-card p { margin: 10px 0 0; font-size: 37px; line-height: 1.14; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.supporters { position: absolute; top: 1680px; left: 56px; right: 56px; }
.supporters-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.supporters h2 { font-size: 30px; letter-spacing: 1px; }
.supporters-heading > span { font-size: 20px; color: var(--muted); letter-spacing: 1px; }
#supporter-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.supporter { height: 146px; padding: 13px; background: #10291fea; border: 1px solid var(--line); border-radius: 16px; display: grid; grid-template-columns: 52px 1fr; gap: 8px 10px; align-content: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: #2c5845; display: grid; place-items: center; font-weight: 700; font-size: 29px; object-fit: cover; }
.supporter .identity { overflow: hidden; }
.supporter .rank { font-size: 19px; color: var(--gold); margin-bottom: 5px; display: block; white-space: nowrap; }
.supporter .username { font-size: 34px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supporter .support-score { grid-column: 1 / -1; color: var(--muted); font-size: 30px; }
.supporter:first-child { border-color: #7e7443; }
.round-banner { position: absolute; top: 710px; left: 170px; right: 170px; text-align: center; background: #071b13eb; border: 2px solid #5b896b; padding: 30px; border-radius: 22px; box-shadow: 0 20px 80px #0007; transition: opacity .2s; }
.round-banner > span { font-size: 36px; font-weight: 900; letter-spacing: 3px; }
.round-banner > strong { display: block; font-size: 140px; line-height: 1.2; color: var(--gold); font-variant-numeric: tabular-nums; }
.round-banner > p { margin: 8px 0; font-size: 32px; line-height: 1.4; color: var(--muted); }
.celebration { position: absolute; top: 750px; left: 90px; right: 90px; text-align: center; pointer-events: none; opacity: 0; transform: translateY(20px) scale(.95); transition: opacity .18s, transform .18s; padding: 24px 20px; background: #0b271cf5; border-radius: 24px; border: 3px solid var(--gold); box-shadow: 0 30px 130px #000a; z-index: 3; }
.celebration.visible { opacity: 1; transform: translateY(0) scale(1); }
.celebration small { display: block; font-size: 80px; letter-spacing: -3px; font-weight: 900; color: var(--gold); }
.celebration strong { display: block; margin: 10px 0; font-size: 56px; overflow-wrap: anywhere; }
.celebration > span { font-size: 32px; color: var(--muted); }
.recognition-popup { position: absolute; top: 624px; left: 170px; right: 170px; padding: 18px 25px; text-align: center; background: #092119f2; border: 2px solid var(--team-a); border-radius: 18px; pointer-events: none; opacity: 0; transform: translateY(-12px); transition: opacity .2s, transform .2s; }
.recognition-popup.visible { opacity: 1; transform: translateY(0); }
.recognition-popup > span { font-size: 26px; color: var(--gold); font-weight: 700; letter-spacing: 3px; display: block; }
.recognition-popup strong { font-size: 43px; display: block; margin: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recognition-popup small { font-size: 28px; color: var(--muted); display: block; }
footer { position: absolute; bottom: 16px; left: 56px; right: 56px; text-align: center; font-size: 17px; letter-spacing: 4px; color: #91b2a1; }
.hidden { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Shared portrait layout: commands and score are visible at phone scale. */
.brand { top: 42px; height: 76px; }
.brand p { font-size: 24px; letter-spacing: 4px; }
.edition { font-size: 24px; }
.match-meta { top: 146px; height: 68px; font-size: 26px; }
#connection { font-size: 24px; max-width: 425px; overflow: hidden; text-overflow: ellipsis; }
#timer { font-size: 68px; letter-spacing: 1px; }
.team { height: 228px; }
.team-a { top: 244px; }
.team-b { top: 1188px; }
.team-copy { flex: 1; }
.join-instruction { font-size: 30px; }
.join-instruction strong { display: inline-block; max-width: 470px; vertical-align: middle; text-overflow: ellipsis; overflow: hidden; }
.join-instruction small { display: block; font-size: 23px; color: var(--muted); line-height: 1.2; text-overflow: ellipsis; overflow: hidden; }
.mode-instruction { position: absolute; top: 482px; left: 76px; right: 76px; text-align: center; }
.mode-instruction strong { display: block; font-size: 32px; letter-spacing: 1px; }
.mode-instruction span { display: block; margin-top: 6px; font-size: 23px; color: var(--muted); }
.field-label { display: none; }
.goal-progress { display: none; }
.action-card { top: 1430px; height: 112px; }
.action-card p { font-size: 34px; margin-top: 7px; }
.interaction-guide { position: absolute; top: 1560px; left: 56px; right: 56px; height: 180px; }
.guide-heading { display: flex; justify-content: space-between; gap: 16px; font-size: 26px; margin-bottom: 12px; }
.guide-heading > span { font-size: 22px; color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.guide-grid > div { min-width: 0; height: 60px; text-align: center; border-radius: 10px; background: #163426; border: 1px solid var(--line); }
.guide-grid strong { display: block; margin-top: 3px; color: #9ce5b2; font-size: 30px; line-height: 1.1; }
.guide-grid span { display: block; font-size: 23px; line-height: 1.2; color: var(--muted); }
.guide-grid .gift-guide { background: #30301e; border-color: #625d36; }
.gift-guide strong { color: var(--gold); }
.supporters { top: 1754px; }
.supporters-heading { margin-bottom: 9px; }
.supporters h2 { font-size: 28px; }
.supporter { height: 112px; padding: 10px; gap: 5px 9px; }
.supporter .username { font-size: 32px; }
.supporter .support-score { font-size: 25px; }
footer { font-size: 18px; letter-spacing: 2px; }

/* GOAL_RACE has independent progress bars, without territory directions. */
#arena[data-mode="GOAL_RACE"] .team { height: 340px; align-items: flex-start; padding: 28px; }
#arena[data-mode="GOAL_RACE"] .team-a { top: 286px; }
#arena[data-mode="GOAL_RACE"] .team-b { top: 960px; }
#arena[data-mode="GOAL_RACE"] .shield { width: 116px; height: 132px; }
#arena[data-mode="GOAL_RACE"] .team-copy { padding-right: 112px; }
#arena[data-mode="GOAL_RACE"] .team-tag { font-size: 23px; margin-bottom: 7px; }
#arena[data-mode="GOAL_RACE"] .team-tag > span { display: none; }
#arena[data-mode="GOAL_RACE"] .team h2 { font-size: 56px; line-height: 1.1; }
#arena[data-mode="GOAL_RACE"] .join-instruction { margin-top: 6px; font-size: 34px; line-height: 1; }
#arena[data-mode="GOAL_RACE"] .join-instruction strong { font-size: 88px; line-height: 1; margin-left: 12px; color: var(--team); }
#arena[data-mode="GOAL_RACE"] .join-instruction small { font-size: 24px; margin-top: 4px; height: 29px; }
#arena[data-mode="GOAL_RACE"] .score { position: absolute; top: 50px; right: 28px; font-size: 110px; }
#arena[data-mode="GOAL_RACE"] .energy { display: none; }
#arena[data-mode="GOAL_RACE"] .players { top: 30px; bottom: auto; right: 168px; font-size: 23px; }
#arena[data-mode="GOAL_RACE"] .goal-progress { display: block; position: absolute; left: 28px; right: 28px; bottom: 24px; }
.progress-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 18px; color: var(--muted); font-size: 27px; }
.progress-label strong { font-size: 32px; color: var(--ink); font-variant-numeric: tabular-nums; }
.progress-track { position: relative; height: 36px; background: #071710; border: 2px solid #63816f; border-radius: 12px; overflow: hidden; }
.progress-track > span { display: block; height: 100%; width: 0; background: var(--team); transition: width .2s linear; }
.progress-track > b { position: absolute; right: 12px; top: 3px; font-size: 22px; color: #fff; text-shadow: 0 1px 4px #000, 0 0 4px #000; }
.progress-track.near-goal { border-color: var(--gold); box-shadow: 0 0 18px #ffd56d30; }
#arena[data-mode="GOAL_RACE"] .mode-instruction { top: 662px; }
#arena[data-mode="GOAL_RACE"] .mode-instruction strong { font-size: 46px; }
#arena[data-mode="GOAL_RACE"] .mode-instruction span { font-size: 31px; margin-top: 10px; }
#arena[data-mode="GOAL_RACE"] .round-banner { top: 676px; left: 140px; right: 140px; padding: 18px 24px; z-index: 2; }
#arena[data-mode="GOAL_RACE"] .round-banner > span { font-size: 32px; }
#arena[data-mode="GOAL_RACE"] .round-banner > strong { font-size: 100px; }
#arena[data-mode="GOAL_RACE"] .round-banner > p { font-size: 27px; margin-top: 3px; }
#arena[data-mode="GOAL_RACE"] .celebration { top: 677px; padding: 18px; }
#arena[data-mode="GOAL_RACE"] .celebration small { font-size: 70px; }
#arena[data-mode="GOAL_RACE"] .celebration strong { font-size: 51px; }
#arena[data-mode="GOAL_RACE"] .celebration > span { font-size: 28px; }
#arena[data-mode="GOAL_RACE"] .recognition-popup { top: 783px; left: 164px; right: 164px; padding: 13px 20px; }
#arena[data-mode="GOAL_RACE"] .recognition-popup strong { font-size: 40px; }
#arena[data-mode="GOAL_RACE"] .recognition-popup small { font-size: 26px; }
#arena[data-mode="GOAL_RACE"] .action-card { top: 1322px; height: 122px; }
#arena[data-mode="GOAL_RACE"] .action-card p { font-size: 36px; }
#arena[data-mode="GOAL_RACE"] .interaction-guide { top: 1462px; height: 236px; }
#arena[data-mode="GOAL_RACE"] .guide-heading { font-size: 33px; margin-bottom: 14px; }
#arena[data-mode="GOAL_RACE"] .guide-heading > span { font-size: 25px; }
#arena[data-mode="GOAL_RACE"] .guide-grid { gap: 10px 14px; }
#arena[data-mode="GOAL_RACE"] .guide-grid > div { height: 84px; }
#arena[data-mode="GOAL_RACE"] .guide-grid strong { font-size: 38px; margin-top: 7px; }
#arena[data-mode="GOAL_RACE"] .guide-grid > div:nth-child(3) strong { font-size: 32px; margin-top: 11px; }
#arena[data-mode="GOAL_RACE"] .guide-grid span { font-size: 29px; margin-top: 3px; }
#arena[data-mode="GOAL_RACE"] .supporters { top: 1720px; }
#arena[data-mode="GOAL_RACE"] .supporters-heading { margin-bottom: 12px; }
#arena[data-mode="GOAL_RACE"] .supporter { height: 118px; }
