/* Spelling Out. Night sky, gold ink, carved capitals. The Sun team warm, the Moon team cool, heals green. */
:root {
  --night: #08061a; --night2: #120c2e; --night3: #1d1442;
  --gold: #ffd27a; --gold2: #f0a93c; --ink: #fff4d6;
  --sun: #ffb347; --moon: #7fb2ff; --heal: #45f08a;
  --txt: #f3efff; --dim: #b3a9d6; --line: rgba(255, 210, 122, 0.22); --panel: rgba(14, 9, 36, 0.78);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--txt); font-family: var(--font); font-weight: 800; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(120% 90% at 50% 0%, #2a1c5c 0%, var(--night3) 30%, var(--night2) 60%, var(--night) 100%) fixed var(--night); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0.7; background-image: radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 38% 66%, #ffe9b0 50%, transparent 51%), radial-gradient(1px 1px at 86% 54%, #cfe0ff 50%, transparent 51%), radial-gradient(1px 1px at 22% 84%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 58% 34%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 92% 88%, #ffd9a8 50%, transparent 51%), radial-gradient(1px 1px at 6% 52%, #cfe0ff 50%, transparent 51%); }
body.screen-mode::before { display: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
b, strong { font-weight: 900; }

/* ---------------------------------------------------------------- shared bits */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-weight: 900; font-size: 15px; text-align: center; transition: transform 0.12s, background 0.2s, filter 0.2s, box-shadow 0.2s; }
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.btn:active:not(:disabled) { transform: translateY(2px) scale(0.985); }
.btn.big { min-height: 54px; font-size: 18px; width: 100%; border-radius: 16px; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 13.5px; border-radius: 11px; }
.btn.primary { background: linear-gradient(180deg, #ffe7a6, var(--gold) 50%, var(--gold2)); border: 0; color: #3a1d00; box-shadow: 0 5px 0 #9a5a10, 0 10px 30px rgba(255, 190, 80, 0.35); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); font-family: var(--display); letter-spacing: 0.04em; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); background: linear-gradient(180deg, #ffe7a6, var(--gold) 50%, var(--gold2)); }
.btn.primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #9a5a10; }
.btn.primary:disabled { background: rgba(0, 0, 0, 0.2); border: 2px dashed rgba(255, 255, 255, 0.25); color: var(--dim); box-shadow: none; text-shadow: none; }
.btn.ghost { background: none; border-color: transparent; color: var(--dim); }
.btn.ghost:hover:not(:disabled) { color: #fff; background: none; }
.btn.danger { color: #ffb0a8; }
.hint { color: var(--dim); font-size: 13.5px; font-weight: 700; line-height: 1.5; margin: 8px 0 0; }
.hint.big { font-size: 15.5px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); gap: 2px; }
.seg button { padding: 7px 12px; border-radius: 9px; font-size: 13.5px; color: var(--dim); }
.seg button.on { background: linear-gradient(180deg, #ffe7a6, var(--gold)); color: #3a1d00; }
.hat { width: 1.6em; height: 1.55em; flex: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)); }

#toast { position: fixed; left: 50%; bottom: calc(20px + var(--sab)); transform: translate(-50%, 30px); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px; background: rgba(20, 12, 46, 0.95); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); font-size: 15px; text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1); z-index: 300; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#net { position: fixed; top: calc(10px + var(--sat)); left: 50%; transform: translate(-50%, -80px); padding: 8px 16px; border-radius: 99px; background: #6b1d2e; color: #fff; font-size: 13.5px; z-index: 290; transition: transform 0.3s; }
#net.show { transform: translate(-50%, 0); }
.loading { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--dim); z-index: 5; }
.loading i { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(255, 210, 122, 0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- the logo */
.logo { position: relative; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.logo .lg-ink { width: min(78vw, 520px); height: auto; aspect-ratio: 900 / 380; filter: drop-shadow(0 6px 18px rgba(255, 160, 60, 0.35)); }
.logo .lg-out { margin-top: -0.5em; font-family: var(--display); font-weight: 900; font-size: clamp(26px, 7vw, 44px); letter-spacing: 0.55em; padding-left: 0.55em; color: transparent; background: linear-gradient(180deg, #fff6dc, var(--gold) 55%, #b86a1a); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.45)); }
.logo .lg-out::before, .logo .lg-out::after { content: '✦'; font-size: 0.45em; vertical-align: 0.5em; margin: 0 0.6em; color: var(--gold); -webkit-text-fill-color: var(--gold); }

/* ---------------------------------------------------------------- title and menus */
#screen.menu { position: fixed; inset: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: calc(16px + var(--sat)) 18px calc(24px + var(--sab)); z-index: 10; }
.title { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: auto 0; }
.title-top { align-self: stretch; display: flex; justify-content: flex-start; }
.tag { text-align: center; color: var(--dim); font-size: 16px; line-height: 1.5; margin: 0 6px; max-width: 460px; }
.tag b { color: var(--ink); }
.megas { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.mega { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: 18px; text-align: left; background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); transition: transform 0.15s, border-color 0.2s, background 0.2s; }
.mega:hover { border-color: rgba(255, 210, 122, 0.55); background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05)); }
.mega:active { transform: scale(0.985); }
.mega .mi { font-size: 34px; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.mega b { display: block; font-family: var(--display); font-size: 19px; letter-spacing: 0.03em; color: var(--ink); }
.mega small { display: block; color: var(--dim); font-size: 13.5px; margin-top: 3px; font-weight: 700; }
.mega.host { border-color: rgba(255, 210, 122, 0.5); }
.title-foot { display: flex; gap: 8px; }
.panel { width: 100%; max-width: 440px; margin: auto 0; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.panel h2 { margin: 0; font-family: var(--display); font-size: 26px; color: var(--gold); letter-spacing: 0.03em; }
.back { align-self: flex-start; color: var(--dim); font-size: 14px; padding: 4px 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; color: var(--dim); letter-spacing: 0.04em; text-transform: uppercase; }
.field input { font: inherit; font-size: 20px; color: #fff; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; outline: none; -webkit-user-select: text; user-select: text; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 210, 122, 0.2); }
.field input.code { font-family: var(--display); font-size: 30px; letter-spacing: 0.35em; text-transform: uppercase; text-align: center; }

/* the sheet (menu, rules) */
#sheet { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(4, 2, 12, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-card { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; padding: 22px 20px; border-radius: 22px; background: #140d33; border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 12px; }
.sheet-card h3 { margin: 0 34px 4px 0; font-family: var(--display); color: var(--gold); font-size: 22px; }
.sheet-card h4 { margin: 8px 0 0; color: var(--dim); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.sheet-x { position: absolute; top: 12px; right: 14px; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; color: var(--dim); background: rgba(255, 255, 255, 0.06); }
.sheet-card .row { display: flex; flex-wrap: wrap; gap: 8px; }
.slide { display: flex; align-items: center; gap: 12px; }
.slide span { width: 70px; color: var(--dim); font-size: 14px; }
.slide input { flex: 1; accent-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: center; color: var(--dim); font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-weight: 700; font-size: 14.5px; line-height: 1.5; color: #ddd5f5; }
.how b { color: var(--ink); }

/* ---------------------------------------------------------------- the phone: a wand */
.wand-root { position: fixed; inset: 0; }
.wand { position: absolute; inset: 0; display: flex; flex-direction: column; }
.w-top { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--sat)) 12px 10px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent); z-index: 3; }
.w-who { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.w-who .hat { font-size: 26px; }
.w-who b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--pc); }
.w-who small { display: block; color: var(--dim); font-size: 12px; }
.w-hp { position: relative; width: 104px; height: 20px; border-radius: 99px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.15); overflow: hidden; flex: none; }
.w-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff5a5a, #ffcf4a 45%, #4fe08a); transition: width 0.6s cubic-bezier(0.3, 1, 0.4, 1); }
.w-hp span { position: relative; display: block; text-align: center; font-size: 12px; line-height: 20px; text-shadow: 0 1px 2px #000; }
.w-hp.dead { opacity: 0.4; }
.w-code { font-family: var(--display); font-size: 18px; letter-spacing: 0.2em; color: var(--gold); }
.w-st { display: flex; gap: 2px; font-size: 18px; }
.w-menu { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-size: 18px; }
.w-main { flex: 1; overflow-y: auto; padding: 4px 14px calc(18px + var(--sab)); display: flex; flex-direction: column; }
.w-card { padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.w-card h3 { margin: 4px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.w-card h3:first-child { margin-top: 0; }
.w-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.w-team { padding: 12px 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.w-team span { font-size: 26px; }
.w-team b { font-family: var(--display); font-size: 17px; }
.w-team small { color: var(--dim); font-size: 12px; }
.w-team.t-sun.on { border-color: var(--sun); background: rgba(255, 150, 50, 0.18); }
.w-team.t-moon.on { border-color: var(--moon); background: rgba(90, 140, 255, 0.18); }
.w-team:disabled { opacity: 0.4; }
.w-swatches { display: flex; gap: 10px; }
.w-swatches .sw { width: 44px; height: 44px; border-radius: 50%; background: var(--c); border: 3px solid rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 0 #fff; transition: box-shadow 0.15s; }
.w-swatches .sw.on { box-shadow: 0 0 0 3px #fff, 0 0 18px var(--c); }
.w-swatches .sw:disabled { opacity: 0.25; }
.w-hats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.w-hats .hb { padding: 8px 2px 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.w-hats .hb .hat { font-size: 30px; }
.w-hats .hb small { font-size: 10.5px; color: var(--dim); }
.w-hats .hb.on { border-color: var(--pc); background: rgba(255, 255, 255, 0.08); }
.wandcard p { margin: 0 0 10px; color: #ddd5f5; font-weight: 700; line-height: 1.45; font-size: 14.5px; }
.wandcard .ok { color: #c8ffd9; }
.w-set { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--dim); font-size: 14px; }
.w-row { display: flex; gap: 8px; margin-bottom: 10px; }
.w-row .btn { flex: 1; }
.w-wait { text-align: center; color: var(--dim); }
.roster { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w-col h4 { margin: 0 0 6px; font-family: var(--display); font-size: 14px; }
.w-col.t-sun h4 { color: var(--sun); }
.w-col.t-moon h4 { color: var(--moon); }
.w-pl { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 10px; font-size: 13.5px; }
.w-pl.me { background: rgba(255, 255, 255, 0.08); }
.w-pl span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-pl .x { width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--dim); }
.w-col .empty { color: var(--dim); font-size: 12.5px; margin: 4px; }
.w-msg { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 10px; }
.w-msg h2 { margin: 0; font-family: var(--display); font-size: 28px; color: var(--ink); }
.w-msg p { margin: 0; color: #d7cff2; font-weight: 700; line-height: 1.5; max-width: 340px; }
.w-big { font-size: 60px; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.5)); }
.w-msg.fallen .w-big { filter: grayscale(1); }
.w-word { font-family: var(--display); font-size: 30px !important; color: var(--gold) !important; letter-spacing: 0.04em; }
.w-dmg { margin-top: -6px !important; font-weight: 800; color: #ffd6c2 !important; }
.w-dmg span { color: #e2c2ff; font-weight: 700; }
.w-time { margin: -4px 0 4px !important; color: var(--dim) !important; font-size: 14px !important; }
.w-close { margin-top: 10px !important; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); font-size: 14px !important; color: var(--dim) !important; }
.w-close.quick { color: #ffe27a !important; background: rgba(255, 210, 80, 0.1); border: 1px solid rgba(255, 210, 80, 0.35); }
.w-surge { margin: 2px 0 4px; padding: 8px 12px; border-radius: 12px; text-align: center; font-weight: 800; font-size: 14px; color: #f3e9ff; background: linear-gradient(90deg, rgba(120, 60, 255, 0.45), rgba(255, 70, 190, 0.35)); border: 1px solid rgba(220, 170, 255, 0.5); box-shadow: 0 0 18px rgba(170, 90, 255, 0.35); }
.w-note { margin-top: 10px; padding: 12px; border-radius: 14px; background: rgba(255, 210, 122, 0.08); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.w-score { font-family: var(--display); font-size: 84px; line-height: 1; color: var(--pc); text-shadow: 0 0 30px var(--pc); }
.w-score small { font-size: 34px; }
.w-msg.result.bad .w-score { color: #9a92b8; text-shadow: none; }
.w-log { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.w-log li { padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); font-size: 14.5px; animation: pop-in 0.3s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes pop-in { from { transform: scale(0.8); opacity: 0; } }
.w-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; max-width: 360px; margin: 6px 0; }
.w-stats span { display: flex; flex-direction: column; padding: 8px 2px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); font-size: 11px; color: var(--dim); }
.w-stats b { font-size: 20px; color: var(--ink); }
.w-award { padding: 8px 12px; border-radius: 12px; background: rgba(255, 210, 122, 0.1); border: 1px solid var(--line); }
.w-award small { display: block; color: var(--dim); font-weight: 700; }
.end-btns { width: 100%; max-width: 360px; flex-direction: column; }
.w-msg.end.won h2 { color: var(--gold); text-shadow: 0 0 24px rgba(255, 200, 90, 0.6); }

/* choosing a move */
.w-choose { display: flex; flex-direction: column; gap: 12px; margin: auto 0; }
.w-q { display: flex; align-items: center; justify-content: space-between; font-family: var(--display); font-size: 21px; color: var(--ink); }
.w-left { font-family: var(--display); color: var(--gold); font-size: 22px; }
.w-moves { display: flex; flex-direction: column; gap: 10px; }
.w-move { display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 14px 16px; border-radius: 18px; text-align: left; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.12); transition: transform 0.12s, border-color 0.2s, background 0.2s; }
.w-move i { grid-row: span 2; font-style: normal; font-size: 30px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: rgba(0, 0, 0, 0.35); }
.w-move b { font-family: var(--display); font-size: 22px; }
.w-move small { color: var(--dim); font-size: 13px; }
.w-move:active:not(:disabled) { transform: scale(0.98); }
.w-move.m-attack i { color: #ff9a6a; }
.w-move.m-heal i { color: var(--heal); }
.w-move.m-revive i { color: var(--gold); }
.w-move.on.m-attack { border-color: #ff8a5a; background: rgba(255, 110, 60, 0.18); }
.w-move.on.m-heal { border-color: var(--heal); background: rgba(69, 240, 138, 0.14); }
.w-move.on.m-revive { border-color: var(--gold); background: rgba(255, 210, 122, 0.16); }
.w-move:disabled { opacity: 0.35; }
.w-targets { padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 8px; }
.w-targets p { margin: 0; color: var(--dim); font-size: 13px; }
.w-tg { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 2px solid transparent; text-align: left; }
.w-tg .hat { font-size: 26px; }
.w-tg span { flex: 1; }
.w-tg b { display: block; color: var(--pc); }
.w-tg.on { border-color: var(--pc); background: rgba(255, 255, 255, 0.12); }
.hpb { display: block; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); margin-top: 4px; overflow: hidden; }
.hpb u { display: block; height: 100%; background: linear-gradient(90deg, #ff5a5a, #ffcf4a, #4fe08a); }
.w-locked { margin: 0; color: #c8ffd9; text-align: center; font-size: 14px; }
.w-hint { margin: 0; color: var(--dim); text-align: center; font-size: 13px; }

/* the pad: the whole screen is the wand's button */
.w-padtime { position: absolute; top: calc(70px + var(--sat)); left: 18px; right: 18px; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.w-padtime i { display: block; height: 6px; flex: 1 1 auto; max-width: 100%; border-radius: 3px; background: var(--pc); box-shadow: 0 0 12px var(--pc); transition: width 0.25s linear; }
.w-padtime span { flex: none; font-family: var(--display); font-size: 18px; color: var(--dim); }
.w-pad.late .w-padtime i { background: #ff6a5a; box-shadow: 0 0 12px #ff6a5a; }
.w-pad.late .w-padtime span { color: #ff9a8a; }
.w-pad.lobby .w-padtime { display: none; }
.w-pad { position: absolute; inset: 0; z-index: 5; touch-action: none; display: grid; place-items: center; background: radial-gradient(80% 60% at 50% 55%, color-mix(in srgb, var(--pc) 18%, transparent), rgba(4, 2, 14, 0.86) 70%); }
.w-pad.lobby { top: auto; height: 46%; border-radius: 28px 28px 0 0; border-top: 1px solid var(--line); }
.w-pad.lab { top: auto; height: 50%; border-radius: 28px 28px 0 0; border-top: 1px solid var(--line); }
.w-pad.lab .w-padtime { display: none; }
.w-pad.lab .w-ring { width: min(44vw, 210px); }
.w-lab { display: flex; flex-direction: column; gap: 10px; padding-bottom: 52vh; }
.w-lab-h { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); }
.w-lab-h b { font-size: 20px; color: var(--gold); }
.w-lab-h span { color: var(--dim); font-size: 14px; }
.w-lab-word { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.w-lab-word b { text-align: center; font-family: var(--display); font-size: 26px; color: #fff; overflow-wrap: anywhere; }
.w-lab-word .btn { min-width: 48px; }
.w-lab-score { margin: 0; text-align: center; color: var(--dim); font-size: 14px; }
.w-lab-score b { color: var(--pc); font-size: 18px; }
.w-lab-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.w-lab-row > span, .w-lab-row small { color: var(--dim); font-size: 13px; }
.w-lab .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.w-lab .seg button { padding: 7px 12px; background: transparent; color: var(--ink); border: 0; font: inherit; font-size: 14px; }
.w-lab .seg button.on { background: color-mix(in srgb, var(--pc) 40%, transparent); color: #fff; font-weight: 800; }
.w-lab .w-note { margin: 0; }
.w-ring { position: relative; width: min(64vw, 300px); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; pointer-events: none; }
.w-pad.lobby .w-ring { width: min(40vw, 190px); }
.w-ring i { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--pc); box-shadow: 0 0 30px var(--pc), inset 0 0 30px color-mix(in srgb, var(--pc) 50%, transparent); animation: breathe 2.2s ease-in-out infinite; }
.w-ring b { position: relative; font-family: var(--display); font-size: 26px; color: #fff; }
.w-ring small { position: relative; max-width: 80%; color: var(--dim); font-size: 13px; font-weight: 700; }
.w-pad.down .w-ring i { background: radial-gradient(circle, color-mix(in srgb, var(--pc) 55%, #fff) 0%, var(--pc) 45%, transparent 72%); animation: none; transform: scale(1.08); transition: transform 0.12s; }
.w-pad.down { background: radial-gradient(90% 70% at 50% 55%, color-mix(in srgb, var(--pc) 35%, transparent), rgba(4, 2, 14, 0.8) 75%); }
.w-pad.traced:not(.down) .w-ring i { border-style: dashed; animation: none; opacity: 0.7; }
@keyframes breathe { 50% { transform: scale(1.05); box-shadow: 0 0 50px var(--pc), inset 0 0 40px color-mix(in srgb, var(--pc) 60%, transparent); } }
.w-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 8; }
.w-flash.go { animation: wflash 0.6s ease-out; }
.w-flash.hit { background: radial-gradient(circle, transparent 30%, rgba(255, 40, 40, 0.65)); }
.w-flash.kill { background: radial-gradient(circle, rgba(0, 0, 0, 0.3) 20%, rgba(160, 0, 0, 0.85)); }
.w-flash.heal { background: radial-gradient(circle, transparent 30%, rgba(69, 240, 138, 0.5)); }
@keyframes wflash { 10% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- the big screen */
#stage { position: fixed; inset: 0; z-index: 0; }
#stage .gl { display: block; }
body.practice #stage { cursor: crosshair; }
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; font-size: clamp(12px, 1.25vw, 22px); }
.hud button, .hud a, .hud .h-lobby { pointer-events: auto; }
.h-top { position: absolute; top: 1.2vh; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.8em; padding: 0.35em 0.6em; z-index: 3; }
.h-round { font-family: var(--display); color: var(--dim); font-size: 1em; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.h-round b { color: var(--ink); font-size: 1.3em; }
.h-lab { position: absolute; bottom: 2.5vh; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: auto; width: min(64em, 94vw); }
.hud[data-phase='lab'] .h-team, .hud[data-phase='lab'] .h-prompt { display: none; }
.lab-card { padding: 0.6em 1em; border-radius: 1em; background: rgba(10, 6, 30, 0.8); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 0.4em 1.2em; }
.lab-h { display: grid; font-family: var(--display); line-height: 1.2; }
.lab-h b { color: var(--gold); font-size: 1.1em; letter-spacing: 0.04em; white-space: nowrap; }
.lab-h span { color: var(--dim); font-size: 0.85em; }
.lab-nav { display: grid; grid-template-columns: auto minmax(6em, auto) auto; gap: 0.5em; align-items: center; }
.lab-nav b { text-align: center; font-family: var(--display); font-size: 1.4em; color: #fff; }
.lab-nav .btn { padding: 0.35em 0.8em; }
.lab-last { text-align: center; color: var(--dim); line-height: 1.25; }
.lab-last b { color: var(--pc); }
.lab-last .sc { font-family: var(--display); font-size: 1.5em; color: #fff; margin: 0 0.25em; }
.lab-last small { display: block; font-size: 0.78em; }
.lab-foot { display: contents; }
.lab-foot p { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 0.78em; color: var(--dim); text-align: center; }
.lab-foot .btn { grid-column: 4; grid-row: 1; }
.l-foot .l-lab { margin-left: 0.5em; opacity: 0.8; }
.h-tier { white-space: nowrap; display: flex; align-items: baseline; gap: 0.5em; padding: 0.35em 0.9em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); animation: pop-in 0.4s; }
.h-tier i { font-style: normal; color: var(--gold); font-size: 0.9em; letter-spacing: 0.1em; }
.h-tier b { font-family: var(--display); color: var(--gold); }
.h-tier span { font-family: var(--display); font-size: 1.15em; color: #fff; }
.h-tier small { color: var(--dim); font-size: 0.75em; }
.h-tier.t-wizard { border-color: rgba(130, 170, 255, 0.5); }
.h-tier.t-sorcerer { border-color: rgba(255, 110, 200, 0.6); box-shadow: 0 0 24px rgba(255, 90, 200, 0.35); }
.h-phase { color: var(--dim); font-size: 0.9em; white-space: nowrap; }
.h-surge { white-space: nowrap; font-family: var(--display); font-weight: 700; font-size: 0.9em; letter-spacing: 0.04em; padding: 0.3em 0.8em; border-radius: 99px; color: #f3e9ff; background: linear-gradient(90deg, rgba(120, 60, 255, 0.55), rgba(255, 70, 190, 0.45)); border: 1px solid rgba(220, 170, 255, 0.6); box-shadow: 0 0 18px rgba(170, 90, 255, 0.45); animation: pop-in 0.4s, surgeglow 2.4s infinite; }
@keyframes surgeglow { 50% { box-shadow: 0 0 30px rgba(200, 110, 255, 0.75); } }
.tc-surge { font-style: normal; color: #e7c6ff; text-shadow: 0 0 12px rgba(190, 110, 255, 0.9); }
.h-clock { position: relative; width: 2.6em; height: 2.6em; }
.h-clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.h-clock circle { fill: none; stroke-width: 3.5; }
.h-clock .bg { stroke: rgba(255, 255, 255, 0.12); }
.h-clock .fg { stroke: var(--gold); stroke-dasharray: 100; stroke-linecap: round; transition: stroke-dashoffset 0.2s linear; }
.h-clock b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.95em; }
.h-clock.low .fg { stroke: #ff6a5a; }
.h-clock.low b { color: #ff9a8a; animation: tick 1s infinite; }
@keyframes tick { 50% { transform: scale(1.2); } }

/* rosters, down each side */
.h-team { position: absolute; top: 9vh; width: clamp(170px, 17vw, 300px); display: flex; flex-direction: column; gap: 0.45em; z-index: 3; }
.h-sun { left: 1.2vw; }
.h-moon { right: 1.2vw; }
.h-teamname { font-family: var(--display); font-size: 1.15em; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 0.4em; padding: 0 0.3em; text-shadow: 0 2px 8px #000; }
.h-sun .h-teamname { color: var(--sun); }
.h-moon .h-teamname { color: var(--moon); flex-direction: row-reverse; }
.h-card { position: relative; display: flex; align-items: center; gap: 0.5em; padding: 0.4em 0.55em; border-radius: 0.8em; background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.08); border-left: 4px solid var(--pc); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity 0.4s, filter 0.4s; }
.h-moon .h-card { border-left: 1px solid rgba(255, 255, 255, 0.08); border-right: 4px solid var(--pc); }
.h-card .h-av .hat { font-size: 1.6em; }
.h-info { flex: 1; min-width: 0; }
.h-info b { display: block; font-size: 0.92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.h-info b small { font-size: 0.75em; }
.h-hp { position: relative; height: 0.95em; margin-top: 0.25em; border-radius: 99px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.h-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff4a4a, #ffc94a 50%, #46e386); transition: width 0.5s cubic-bezier(0.3, 1, 0.4, 1); }
.h-hp span { position: relative; display: block; font-size: 0.7em; line-height: 1.36em; text-align: center; text-shadow: 0 1px 2px #000; }
.h-card.hurt { animation: hurt 0.45s; }
@keyframes hurt { 15% { transform: translateX(-4px); background: rgba(120, 10, 20, 0.85); } 35% { transform: translateX(4px); } }
.h-card.dead { opacity: 0.45; filter: grayscale(0.9); }
.h-card.frozen { box-shadow: inset 0 0 0 2px rgba(170, 240, 255, 0.7); }
.h-card.away::after { content: 'away'; position: absolute; top: 0.2em; right: 0.5em; font-size: 0.6em; color: var(--dim); }
.h-st { display: flex; gap: 0.1em; }
.h-st .st { font-style: normal; font-size: 0.95em; opacity: 0.55; }
.h-st .st.on { opacity: 1; filter: drop-shadow(0 0 6px currentColor); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.h-card .b { position: absolute; top: -0.45em; right: -0.45em; width: 1.5em; height: 1.5em; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.8em; background: #2a2150; border: 2px solid rgba(255, 255, 255, 0.25); }
.h-moon .h-card .b { right: auto; left: -0.45em; }
.h-card .b.ok { background: #1d7a46; border-color: #46e386; }
.h-card .b.pen { background: #5a3d10; border-color: var(--gold); animation: pulse 0.7s infinite; }
.h-card .b.wait { color: var(--dim); }
.h-card .b.mv.m-attack { background: #7a2a10; border-color: #ff8a5a; }
.h-card .b.mv.m-heal { background: #11583a; border-color: var(--heal); }
.h-card .b.mv.m-revive { background: #6b4a10; border-color: var(--gold); }

/* over heads */
.h-tags { position: absolute; inset: 0; overflow: hidden; z-index: 2; }
.h-tag { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 0.2em; margin: -2.4em 0 0 -4em; width: 8em; pointer-events: none; transition: opacity 0.3s; }
.h-tag b { font-size: 0.78em; padding: 0.1em 0.55em; border-radius: 99px; background: rgba(8, 4, 24, 0.7); color: var(--pc); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.h-tag .bar { display: block; width: 4.4em; height: 0.42em; border-radius: 99px; background: rgba(0, 0, 0, 0.6); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); }
.h-tag .bar u { display: block; height: 100%; background: linear-gradient(90deg, #ff4a4a, #ffc94a, #46e386); transition: width 0.4s; }
.h-tag .bar.dead { opacity: 0.3; }
.h-tag.dim { opacity: 0.35; }
.h-pop { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 900; font-size: 2.2em; color: #fff; text-shadow: 0 3px 0 #000, 0 0 18px rgba(255, 60, 60, 0.8); white-space: nowrap; animation: popfly 2s cubic-bezier(0.2, 1, 0.3, 1) forwards; }
.h-pop small { font-size: 0.5em; }
.h-pop.dmg { color: #ffd4c8; }
.h-pop.crit { font-size: 3.2em; color: #ffe08a; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255, 120, 40, 0.9); }
.h-pop.heal { color: #a8ffcb; text-shadow: 0 3px 0 #000, 0 0 18px rgba(69, 240, 138, 0.9); }
.h-pop.revive { color: #ffe9a8; text-shadow: 0 3px 0 #000, 0 0 24px rgba(255, 210, 122, 0.9); }
.h-pop.combo { font-size: 3.4em; letter-spacing: 0.06em; color: #fff3c4; text-shadow: 0 4px 0 #000, 0 0 26px rgba(255, 190, 90, 0.95), 0 0 60px rgba(190, 120, 255, 0.7); animation-duration: 2.2s; }
.h-pop.combo small { display: block; font-size: 0.36em; letter-spacing: 0.08em; text-align: center; color: #fff; }
.h-pop.status { font-size: 1.6em; color: #fff; letter-spacing: 0.06em; text-transform: uppercase; }
.h-pop.status.st-burn { text-shadow: 0 3px 0 #000, 0 0 20px #ff6a1a; }
.h-pop.status.st-shock { text-shadow: 0 3px 0 #000, 0 0 20px #6aa8ff; }
.h-pop.status.st-freeze { text-shadow: 0 3px 0 #000, 0 0 20px #aef3ff; }
.h-pop.felled { font-size: 3em; color: #ff5a5a; letter-spacing: 0.08em; text-shadow: 0 4px 0 #000, 0 0 30px rgba(255, 0, 0, 0.8); }
.h-pop.meh { font-size: 1.1em; color: var(--dim); text-shadow: 0 2px 0 #000; font-family: var(--font); }
@keyframes popfly { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } 12% { transform: translate(-50%, -80%) scale(1.25); opacity: 1; } 30% { transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { transform: translate(-50%, -190%) scale(0.95); opacity: 0; } }
.h-label { position: absolute; transform: translate(-50%, -140%); display: flex; align-items: baseline; gap: 0.4em; padding: 0.3em 0.8em; border-radius: 99px; background: rgba(8, 4, 24, 0.82); border: 2px solid var(--pc, var(--gold)); white-space: nowrap; animation: pop-in 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); transition: transform 0.4s, opacity 0.4s; }
.h-label b { color: var(--pc); }
.h-label span { font-family: var(--display); font-size: 1.4em; color: #fff; }
.h-label.small { transform: translate(-50%, -140%) scale(0.8); opacity: 0.8; }

/* the middle: cards, banners, rankings, victory */
.h-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; }
.tiercard { perspective: 900px; }
.tc-in { min-width: 13em; padding: 1.4em 2.6em 1.2em; border-radius: 1.2em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.2em; background: linear-gradient(160deg, #2a1d5a, #110a2c); border: 2px solid var(--gold); box-shadow: 0 0 60px rgba(255, 200, 100, 0.35), 0 30px 80px rgba(0, 0, 0, 0.6); animation: cardflip 0.9s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.tc-in i { font-style: normal; color: var(--gold); font-size: 1.6em; letter-spacing: 0.2em; }
.tc-in b { font-family: var(--display); font-weight: 900; font-size: 3.2em; color: transparent; background: linear-gradient(180deg, #fff6dc, var(--gold) 55%, #c9761e); -webkit-background-clip: text; background-clip: text; letter-spacing: 0.04em; line-height: 1.05; }
.tc-in span { font-family: var(--display); color: var(--ink); letter-spacing: 0.5em; text-transform: uppercase; font-size: 1em; padding-left: 0.5em; }
.tc-in small { color: var(--dim); margin-top: 0.4em; font-size: 0.9em; }
.tiercard.t-wizard .tc-in { border-color: #8fb0ff; box-shadow: 0 0 70px rgba(120, 150, 255, 0.45), 0 30px 80px rgba(0, 0, 0, 0.6); background: linear-gradient(160deg, #1d2a6a, #0b0e2e); }
.tiercard.t-wizard .tc-in b { background-image: linear-gradient(180deg, #fff, #9fc0ff 55%, #4a6ee0); }
.tiercard.t-sorcerer .tc-in { border-color: #ff7ad0; box-shadow: 0 0 110px rgba(255, 90, 200, 0.6), 0 30px 80px rgba(0, 0, 0, 0.6); background: linear-gradient(160deg, #4a0f4a, #12051e); animation: cardflip 0.9s cubic-bezier(0.3, 1.3, 0.5, 1) both, glowpulse 1.2s 0.9s infinite; }
.tiercard.t-sorcerer .tc-in b { background-image: linear-gradient(180deg, #fff, #ff9ae0 50%, #b02aa0); }
@keyframes cardflip { 0% { transform: rotateY(90deg) scale(0.6); opacity: 0; } 60% { transform: rotateY(-12deg) scale(1.08); opacity: 1; } 100% { transform: none; } }
@keyframes glowpulse { 50% { box-shadow: 0 0 160px rgba(255, 90, 200, 0.85), 0 30px 80px rgba(0, 0, 0, 0.6); } }
.banner { font-family: var(--display); font-weight: 900; font-size: 5em; color: transparent; background: linear-gradient(180deg, #fff6dc, var(--gold) 55%, #c9761e); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 0 30px rgba(255, 180, 70, 0.5)); animation: bannerin 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both; text-align: center; }
.banner.go { font-size: 6em; letter-spacing: 0.08em; }
.banner.intro { display: flex; flex-direction: column; align-items: center; gap: 0.1em; font-size: 4em; -webkit-text-fill-color: initial; background: none; }
.banner.intro b { font-weight: 900; }
.banner.intro .b-sun { color: var(--sun); text-shadow: 0 0 40px rgba(255, 150, 50, 0.7); }
.banner.intro .b-moon { color: var(--moon); text-shadow: 0 0 40px rgba(90, 150, 255, 0.7); }
.banner.intro i { font-style: normal; font-size: 0.35em; color: var(--dim); letter-spacing: 0.4em; text-transform: uppercase; }
.banner.intro small { font-family: var(--font); font-size: 0.25em; color: var(--dim); margin-top: 0.6em; }
.banner.surge { display: flex; flex-direction: column; align-items: center; gap: 0.15em; font-size: 4.2em; color: #fff; -webkit-text-fill-color: initial; background: none; filter: none; animation: bannerin 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both, surgeshake 0.5s 0.6s 3; }
.banner.surge b { font-weight: 900; color: transparent; background: linear-gradient(180deg, #fff, #e2b8ff 45%, #8a3dff); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 0 34px rgba(170, 80, 255, 0.8)); }
.banner.surge small { font-family: var(--font); font-weight: 800; font-size: 0.32em; letter-spacing: 0.06em; color: #f2e4ff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 18px rgba(170, 80, 255, 0.8); }
@keyframes surgeshake { 25% { transform: translate(-3px, 1px); } 50% { transform: translate(3px, -1px); } 75% { transform: translate(-2px, -1px); } }
@keyframes bannerin { from { transform: scale(2.2); opacity: 0; } }
.ranking { min-width: 30em; max-width: 92vw; padding: 1em 1.2em; border-radius: 1em; background: rgba(10, 6, 30, 0.88); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop-in 0.4s cubic-bezier(0.3, 1.4, 0.5, 1); }
.ranking h3 { margin: 0 0 0.5em; font-family: var(--display); color: var(--gold); text-align: center; letter-spacing: 0.1em; text-transform: uppercase; font-size: 1.1em; }
.rk { display: grid; grid-template-columns: 1.6em 1.8em minmax(5em, 1fr) auto 3.5em 7.5em; align-items: center; gap: 0.5em; padding: 0.35em 0.5em; border-radius: 0.6em; margin: 0.15em 0; animation: pop-in 0.35s both; }
.rk .n { font-family: var(--display); color: var(--dim); text-align: center; }
.rk .hat { font-size: 1.4em; }
.rk b { color: var(--pc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk .mv { color: var(--dim); font-size: 0.85em; white-space: nowrap; }
.rk .sc { font-family: var(--display); font-size: 1.2em; text-align: right; line-height: 1.05; }
.rk .sc small { display: block; font-family: var(--font); font-size: 0.55em; color: var(--dim); }
.rk .qk { display: block; font-style: normal; font-size: 0.85em; color: #ffe27a; text-shadow: 0 0 10px rgba(255, 210, 80, 0.7); }
.rk-notes { margin: 0.7em 0 0; font-size: 0.8em; color: var(--dim); text-align: center; line-height: 1.5; }
.rk .res { font-size: 0.85em; text-align: right; }
.rk.ok { background: rgba(255, 255, 255, 0.06); }
.rk.ok .res { color: #c8ffd9; }
.rk.no { opacity: 0.55; }
.rk.no .res { color: #ff9a8a; }
.cut { position: relative; height: 1.3em; display: flex; align-items: center; }
.cut::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(255, 210, 122, 0.55); }
.cut span { position: relative; margin: 0 auto; padding: 0 0.6em; background: #0c0726; color: var(--gold); font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.1em; }
.cut.c75::before { border-color: rgba(69, 240, 138, 0.5); }
.cut.c75 span { color: var(--heal); }
.h-prompt { position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%); z-index: 3; text-align: center; max-width: 70vw; }
.h-prompt .pr { display: inline-block; padding: 0.55em 1.2em; border-radius: 99px; background: rgba(8, 4, 24, 0.75); border: 1px solid var(--line); color: #e8e0ff; font-size: 0.95em; animation: pop-in 0.4s; }
.h-prompt b { color: var(--gold); }
.victory-wrap { background: radial-gradient(60% 60% at 50% 45%, rgba(10, 6, 30, 0.55), transparent); }
.victory { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4em; padding: 1em 2em; animation: bannerin 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) both; max-width: 90vw; }
.v-crest { font-size: 5em; line-height: 1; filter: drop-shadow(0 0 30px currentColor); }
.victory.t-sun .v-crest { color: var(--sun); }
.victory.t-moon .v-crest { color: var(--moon); }
.victory h1 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 4.2em; color: transparent; background: linear-gradient(180deg, #fff6dc, var(--gold) 55%, #c9761e); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.5)); line-height: 1.1; }
.v-names { margin: 0; font-size: 1.2em; }
.v-names b { color: var(--pc); }
.v-awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6em; margin-top: 0.6em; }
.v-award { display: flex; flex-direction: column; align-items: center; gap: 0.1em; min-width: 9em; padding: 0.7em 0.9em; border-radius: 0.9em; background: rgba(10, 6, 30, 0.82); border: 1px solid var(--line); animation: pop-in 0.4s both; }
.v-award:nth-child(2) { animation-delay: 0.25s; }
.v-award:nth-child(3) { animation-delay: 0.5s; }
.v-award:nth-child(4) { animation-delay: 0.75s; }
.v-award:nth-child(5) { animation-delay: 1s; }
.v-award i { font-style: normal; font-size: 1.8em; }
.v-award b { font-family: var(--display); color: var(--gold); font-size: 0.95em; }
.v-award em { font-style: normal; color: var(--pc); }
.v-award small { color: var(--dim); font-size: 0.75em; }
.v-btns { display: flex; gap: 0.8em; margin-top: 1em; pointer-events: auto; animation: pop-in 0.5s 0.3s both; }
.v-btns .btn { width: auto; min-width: 12em; font-size: 1em; }
.v-wait { color: var(--dim); }
.h-corner { position: absolute; top: 1.2vh; right: 1.2vw; display: flex; align-items: center; gap: 0.6em; z-index: 5; }
.hud[data-phase='trace'] .h-corner, .hud[data-phase='reveal'] .h-corner { opacity: 0.4; }
.h-menu { width: 2em; height: 2em; border-radius: 0.6em; background: var(--panel); border: 1px solid var(--line); font-size: 0.9em; }
.h-room { color: var(--dim); font-size: 0.8em; }
.h-room b { color: var(--gold); font-family: var(--display); letter-spacing: 0.15em; }
.h-paused { padding: 0.3em 0.8em; border-radius: 99px; background: #6b1d2e; font-size: 0.8em; }
.hud[data-phase='trace'] .h-prompt, .hud[data-phase='reveal'] .h-prompt { bottom: 1.5vh; }
.hud[data-phase='lobby'] .h-team { display: none; }
.h-team { transition: transform 0.5s cubic-bezier(0.5, 0, 0.3, 1), opacity 0.4s; }
.hud[data-phase='reveal'] .h-sun, .hud[data-phase='trace'] .h-sun, .hud[data-phase='results'] .h-sun { transform: translateX(-115%); opacity: 0; }
.hud[data-phase='reveal'] .h-moon, .hud[data-phase='trace'] .h-moon, .hud[data-phase='results'] .h-moon { transform: translateX(115%); opacity: 0; }
.hud[data-phase='reveal'] .h-tag, .hud[data-phase='trace'] .h-tag, .hud[data-phase='results'] .h-tag { opacity: 0; }

/* practice: the move picker on the big screen */
.pick { pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 0.8em; padding: 1.2em 1.6em; border-radius: 1.2em; background: rgba(10, 6, 30, 0.88); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: pop-in 0.35s; }
.pick h3 { margin: 0; font-family: var(--display); color: var(--gold); font-size: 1.4em; }
.pick p { margin: 0; color: var(--dim); }
.pk-row { display: flex; gap: 0.8em; }
.pk { display: flex; flex-direction: column; align-items: center; gap: 0.2em; min-width: 7.5em; padding: 0.8em 1em; border-radius: 1em; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 255, 255, 0.12); }
.pk i { font-style: normal; font-size: 2em; }
.pk b { font-family: var(--display); font-size: 1.15em; }
.pk small { color: var(--dim); font-size: 0.75em; min-height: 1em; }
.pk:disabled { opacity: 0.35; }
.pk.on.m-attack { border-color: #ff8a5a; background: rgba(255, 110, 60, 0.18); }
.pk.on.m-heal { border-color: var(--heal); background: rgba(69, 240, 138, 0.14); }
.pk.on.m-revive { border-color: var(--gold); background: rgba(255, 210, 122, 0.16); }
.pk-t { display: flex; align-items: center; gap: 0.4em; padding: 0.5em 0.8em; border-radius: 0.8em; background: rgba(255, 255, 255, 0.06); border: 2px solid transparent; }
.pk-t b { color: var(--pc); }
.pk-t .hat { font-size: 1.4em; }
.pk-t.on { border-color: var(--pc); }

/* the lobby on the big screen */
.h-lobby { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr minmax(0, 1.25fr) 1fr; grid-template-rows: auto 1fr auto; gap: 1.2vh 2vw; padding: 2vh 2.4vw; z-index: 4; pointer-events: none; }
.h-lobby > * { pointer-events: auto; }
.l-head { grid-column: 1 / 3; display: flex; align-items: flex-start; gap: 1.5vw; }
.l-head .logo .lg-ink { width: clamp(240px, 26vw, 520px); }
.l-head .logo .lg-out { font-size: clamp(20px, 2.2vw, 40px); }
.l-join { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 1em; padding: 0.9em; border-radius: 1.1em; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.l-qr { width: 8.5em; height: 8.5em; padding: 0.4em; border-radius: 0.6em; background: #fff; }
.l-qr svg { width: 100%; height: 100%; display: block; }
.l-how p { margin: 0; color: var(--dim); font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.08em; }
.l-how > b { display: block; margin: 0.2em 0 0.6em; font-size: 0.95em; color: #fff; }
.l-code { font-family: var(--display); font-weight: 900; font-size: 3em; letter-spacing: 0.18em; color: var(--gold); line-height: 1; text-shadow: 0 0 24px rgba(255, 200, 90, 0.45); }
.l-teams { grid-column: 1 / 4; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 2vw; align-self: end; }
.l-vs { font-family: var(--display); font-weight: 900; font-size: 2.6em; color: rgba(255, 255, 255, 0.3); align-self: center; }
.l-team { padding: 0.8em; border-radius: 1.1em; background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); max-width: 26em; width: 100%; }
.l-team.t-moon { justify-self: end; }
.l-team h3 { margin: 0 0 0.5em; font-family: var(--display); font-size: 1.2em; display: flex; align-items: center; gap: 0.4em; }
.l-team h3 small { margin-left: auto; font-family: var(--font); font-size: 0.65em; color: var(--dim); }
.l-team.t-sun h3 { color: var(--sun); }
.l-team.t-moon h3 { color: var(--moon); }
.l-players { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45em; }
.l-p { position: relative; display: flex; align-items: center; gap: 0.5em; padding: 0.5em 0.6em; border-radius: 0.8em; background: rgba(255, 255, 255, 0.06); border-left: 4px solid var(--pc); animation: pop-in 0.4s cubic-bezier(0.3, 1.5, 0.5, 1); min-width: 0; }
.l-p .hat { font-size: 1.7em; }
.l-p b { color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.l-p small { color: var(--dim); font-size: 0.7em; white-space: nowrap; }
.l-p.away { opacity: 0.5; }
.l-p .x, .l-p .sw { position: absolute; top: -0.4em; width: 1.5em; height: 1.5em; border-radius: 50%; background: #2a2150; border: 1px solid var(--line); color: var(--dim); font-size: 0.8em; }
.l-p .x { right: -0.4em; }
.l-p .sw { right: 1.3em; }
.l-empty { display: grid; place-items: center; padding: 0.4em; border-radius: 0.8em; border: 2px dashed rgba(255, 255, 255, 0.12); color: var(--dim); font-size: 0.8em; min-height: 3em; }
.l-foot { grid-column: 1 / 4; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.8em 1.4em; }
.l-set { display: flex; align-items: center; gap: 0.3em; padding: 0.3em; border-radius: 0.8em; background: var(--panel); border: 1px solid var(--line); font-size: 0.85em; }
.l-set span { color: var(--dim); padding: 0 0.5em; }
.l-set button { padding: 0.4em 0.8em; border-radius: 0.6em; color: var(--dim); }
.l-set button.on { background: linear-gradient(180deg, #ffe7a6, var(--gold)); color: #3a1d00; }
.l-foot .btn.l-start { width: auto; min-width: 16em; font-size: 1.1em; }
.l-wait { color: var(--dim); margin: 0; }
.l-tip { flex-basis: 100%; text-align: center; margin: 0; color: var(--dim); font-size: 0.85em; }
.l-hub .bb-home { font-size: 13px; }
@media (max-aspect-ratio: 4/3) {
  .h-lobby { grid-template-columns: 1fr 1fr; }
  .l-head { grid-column: 1 / 3; }
  .l-join { grid-column: 1 / 3; grid-row: 2; justify-self: center; }
  .l-teams { grid-row: 3; grid-template-columns: 1fr; }
  .l-vs { display: none; }
  .l-foot { grid-row: 4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
