/* Layout contract. One spacing scale, one content gutter, explicit flow per view. */
:root{
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;
  --space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;
  --arena-height:100vh;--gutter:clamp(20px,4.4vw,64px);--section-space:clamp(48px,7vw,88px);
}
@supports(height:100dvh){:root{--arena-height:100dvh}}
.studio-polished{overflow-x:clip;line-height:1.6}
.studio-polished .wrap{width:100%;max-width:1408px;margin-inline:auto;padding-inline:max(var(--gutter),env(safe-area-inset-left,0px)) max(var(--gutter),env(safe-area-inset-right,0px));min-width:0}
.studio-polished main,.studio-polished section,.studio-polished .game-shell,.studio-polished .card-scroll{min-width:0}
.studio-polished section{padding-block:var(--section-space)}
header.site{padding-top:env(safe-area-inset-top,0px)}
.studio-polished .nav{min-height:76px;padding-block:16px;gap:24px}
.studio-polished .logo{font-size:32px;letter-spacing:-.045em}
.studio-polished .navlinks{gap:24px}
.studio-polished .navlinks a{font-size:13px}
.studio-polished .theme-btn,.studio-polished .menu-btn,.studio-polished .icon-btn{width:44px;height:44px;flex-shrink:0;border-radius:10px}
.studio-polished .theme-btn{border:1px solid transparent}
.studio-polished .theme-btn:hover{background:var(--paper2);border-color:var(--line)}
.studio-polished :focus-visible{outline:2px solid var(--blue-deep)!important;outline-offset:3px!important}
.studio-polished .menu-panel{right:max(var(--gutter),env(safe-area-inset-right,0px));min-width:240px;padding:8px;max-width:calc(100vw - 40px)}
.studio-polished .menu-panel a,.studio-polished .menu-panel button{min-height:44px;font-size:14px}
.studio-polished .hero-layout{grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:48px;min-height:600px;padding-block:56px}
.studio-polished .hero-copy{min-width:0}
.studio-polished .hero-copy h1{font-size:clamp(56px,6.9vw,100px);font-weight:800;line-height:1.01;letter-spacing:-.048em;margin:24px 0}
.studio-polished .hero p.lede{font-size:16px;line-height:1.7;max-width:400px;margin:0 0 24px}
.studio-polished .eyebrow{font-size:10px;line-height:1.7;letter-spacing:.1em}
.studio-polished .hero-actions{gap:24px;align-items:center}
.studio-polished .hero-fine{margin:12px 0 0;font-size:12px;line-height:1.5}
.studio-polished .hero-mantra{margin:32px 0 0;font-size:17px}
.studio-polished .hero-portrait-stage{min-height:440px;min-width:0;max-width:540px;width:100%;justify-self:center}
.studio-polished .hero-art{width:78%;max-width:410px}
.studio-polished .hero-water{left:0;width:100%;height:100px}
.studio-polished .portrait-tag{bottom:32px;padding:16px 20px;min-width:210px;left:0}
.studio-polished .scene-coordinate{font-size:9px}
.studio-polished .hero-baseline{padding-block:18px;gap:24px}
.studio-polished .hero-baseline>span,.studio-polished .hero-baseline>a{font-size:11px}
.studio-polished .game-sec{padding-block:var(--section-space)}
#gameStage{scroll-margin-top:100px}
#gameStage .section-kicker{margin-bottom:12px;font-size:10px}
#gameStage .game-head{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 24px}
#gameStage .game-head h2{font-size:clamp(30px,3.8vw,48px);line-height:1.1;letter-spacing:-.04em;margin:0 0 12px;color:var(--ink)}
#gameStage .game-head .sub{font-size:14px;line-height:1.65;margin:0;max-width:540px;color:var(--muted)}
#gameStage .game-tools{display:flex;flex-direction:row;gap:8px;margin:0;align-self:center}
#gameStage .game-tools svg{width:20px;height:20px}
.play-steps{display:flex;gap:24px;list-style:none;margin:0 0 20px;padding:0;align-items:center}
.play-steps li{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}
.play-steps li>span{display:grid;place-items:center;border:1px solid var(--line);width:24px;height:24px;border-radius:50%;font:11px var(--font-m);color:var(--ink);background:var(--paper2)}
#gameStage .mode-deck{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0 0 24px;padding:0;overflow:visible;scroll-margin-top:100px}
#gameStage .mode-deck>button{min-width:0;min-height:0;flex:none;border:1px solid var(--line);border-radius:12px;transition:border-color .18s,box-shadow .18s;box-shadow:none}
#gameStage .mode-deck>button.active{border-color:var(--blue-deep);box-shadow:0 0 0 2px var(--blue-deep)}
#gameStage .mode-deck .mode-scene{display:block;width:100%;height:132px;aspect-ratio:auto;object-fit:cover;object-position:center 55%}
#gameStage .mode-card-body{padding:20px}
#gameStage .mode-kicker{font-size:10px;letter-spacing:.08em;margin:0 0 12px;line-height:1.5}
#gameStage .mode-card-body>b{display:block;font-size:25px;line-height:1.15;letter-spacing:-.035em}
#gameStage .mode-card-body>p{font-size:13px;line-height:1.6;margin:12px 0 16px;max-width:none}
#gameStage .mode-card-foot{font-size:11px;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding-top:12px}
#gameStage .mode-card-foot .mode-best{font-size:9px;line-height:1.5;max-width:none;letter-spacing:.02em;text-align:left;min-height:0}
#gameStage .mode-check{font-size:16px;line-height:1}
#gameStage.is-lobby .game-shell{display:grid;grid-template-columns:340px minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);align-items:stretch;border-radius:12px;min-height:0;overflow:hidden}
#gameStage.is-lobby #overlay{position:relative;inset:auto;grid-column:1;grid-row:1 / 3;display:block;padding:0;height:auto;min-height:0;max-height:none;overflow:visible;background:var(--paper2);border:0;border-right:1px solid var(--line);backdrop-filter:none}
#gameStage.is-lobby #ovCard{display:block;max-width:none;width:100%;height:auto;max-height:none;min-height:0;padding:24px;margin:0;border:0;border-radius:0;background:transparent;overflow:visible;box-shadow:none;animation:none;text-align:left}
#gameStage.is-lobby .card-scroll{display:block;overflow:visible;padding:0;margin:0;max-height:none}
#gameStage.is-lobby #pickBlock{margin:0;padding:0}
#gameStage.is-lobby #setupRows{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;width:100%;margin:0;padding:0}
#gameStage.is-lobby .lobby-mode{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 0 16px;margin:0 0 20px;border-bottom:1px solid var(--line)}
.lobby-mode>div{min-width:0}
.lobby-mode span{display:block;font:9px var(--font-m);letter-spacing:.08em;color:var(--muted);margin-bottom:4px}
.lobby-mode b{font:700 16px var(--font-d);letter-spacing:-.02em;line-height:1.3;display:block}
.lobby-mode button{font-size:11px;white-space:nowrap;padding:8px 0;min-height:44px}
#gameStage.is-lobby .lobby-label{margin:0 0 16px;font:600 12px var(--font-b);letter-spacing:0;text-transform:none;line-height:1.5;color:var(--ink)}
#gameStage.is-lobby .selected-herd{display:flex;align-items:center;gap:12px;margin:0}
#gameStage.is-lobby .selected-herd>img{width:60px;height:60px;border-radius:10px;flex-shrink:0}
#gameStage.is-lobby .selected-herd>div{min-width:0;flex:1}
#gameStage.is-lobby .selected-herd b{font-size:26px;line-height:1.2;margin:4px 0;letter-spacing:-.035em}
#gameStage.is-lobby .selected-herd span{font-size:11px;line-height:1.4}
#gameStage.is-lobby .selected-herd em{font-size:12px;line-height:1.4;display:block}
#gameStage.is-lobby .selected-herd button{padding:8px 0 8px 6px;min-height:44px;font-size:11px;white-space:nowrap;color:var(--blue-deep)}
#gameStage #picker{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:start;justify-content:stretch;width:100%;max-width:none;overflow:visible;padding:4px 2px;margin:20px 0}
#gameStage #picker .pick{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;width:100%;height:auto;min-width:0;max-width:none;aspect-ratio:auto;line-height:1.3;border:0;padding:0;border-radius:6px;background:transparent;box-shadow:none}
#gameStage #picker .pick img{width:100%;max-width:48px;height:auto;aspect-ratio:1;object-fit:contain;border-radius:7px;border:2px solid transparent;box-sizing:border-box}
#gameStage #picker .pick.on img{border-color:var(--blue-deep);box-shadow:0 0 0 2px color-mix(in srgb,var(--blue) 16%,transparent)}
#gameStage .pick-name{font:500 10px var(--font-b);letter-spacing:0;line-height:1.4;color:var(--muted);display:block;white-space:nowrap}
#gameStage .pick.on .pick-name{color:var(--blue-deep);font-weight:700}
#gameStage .play-row{display:block;margin:0;padding:0;width:100%}
#gameStage #startBtn{display:flex;width:100%;min-height:48px;justify-content:space-between;align-items:center;padding:14px 18px;gap:12px;border-radius:8px;font-size:13px;line-height:1.4;text-align:left}
#gameStage .preplay-hint{font-size:11px;line-height:1.6;margin:12px 0 20px;text-align:left;color:var(--muted)}
#gameStage .match-options,#gameStage .build-details,#gameStage .opponent-details,#gameStage .order-details{width:100%;margin:0;padding:0;border:0;border-top:1px solid var(--line);background:none;min-width:0}
#gameStage .match-options>summary,#gameStage .build-details>summary,#gameStage .opponent-details>summary,#gameStage .order-details>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;list-style:none;margin:0;padding:12px 0;font-size:12px;line-height:1.5;text-align:left;font-weight:600;cursor:pointer;color:var(--card-ink)}
#gameStage summary::-webkit-details-marker{display:none}
#gameStage .match-options summary>span,#gameStage .build-details summary>span,#gameStage .order-details summary>span{font-size:10px;color:var(--card-muted);white-space:nowrap}
#gameStage .match-options[open]>summary{margin-bottom:8px}
#gameStage #diffWrap{display:block;align-items:stretch;width:100%;gap:0;border:0;background:none;padding:8px 0 16px;margin:0;border-radius:0}
#gameStage #diffWrap .diff-label{text-align:left;font:600 12px var(--font-b);line-height:1.5;letter-spacing:0;text-transform:none;margin:0 0 8px;padding:0;background:none;color:var(--card-ink)}
#gameStage #diffSeg{display:flex;align-items:stretch;width:100%;border-radius:8px;box-shadow:none;background:var(--card-fill);padding:4px;gap:4px;margin:0}
#gameStage #diffSeg button{flex:1;min-width:0;min-height:40px;padding:8px 6px;font-size:12px;line-height:1.4;border-radius:6px;box-shadow:none}
#gameStage .difficulty-note{font-size:11px;line-height:1.7;margin:10px 0 0;text-align:left;color:var(--card-muted)}
#gameStage #holderDuelBox{display:block;width:100%;padding:0 0 16px;margin:0;gap:0;background:none;border:0;border-radius:0}
#gameStage #holderDuelBox .hd-top{display:none}
#gameStage #holderDuelBox .hd-sub{text-align:left;max-width:none;font-size:11px;line-height:1.7;margin:0 0 12px}
#gameStage #holderDuelBody{display:block;width:100%}
#gameStage #holderOppRow{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;justify-content:stretch;overflow:visible;margin:0 0 12px;width:100%}
#gameStage #holderOppRow .pick{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;width:100%;height:auto;border:0;border-radius:6px;line-height:1.4}
#gameStage #holderOppRow .pick img{width:44px;max-width:100%;height:auto;aspect-ratio:1;border-radius:7px;border:2px solid transparent}
#gameStage #holderOppRow .pick.on img{border-color:var(--blue-deep)}
#gameStage .hero-code-tools{padding-top:8px;border-top:1px solid var(--line)}
#gameStage .hero-code-tools summary{font-size:11px;display:flex;justify-content:space-between;min-height:36px;align-items:center;cursor:pointer}
#gameStage .copy-row{display:flex;gap:8px;flex-wrap:wrap;align-items:stretch;margin:12px 0 0}
#gameStage .copy-row input{flex:1 1 100%;min-width:0;width:100%;padding:10px;font-size:12px;min-height:44px}
#gameStage .copy-row .btn{min-height:40px;font-size:11px;padding:8px 12px;gap:8px}
#gameStage #vsPanel{margin:0;padding:8px 0 16px;min-width:0}
#gameStage .vs-cards{grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);gap:8px}
#gameStage .vs-mini{padding:12px 8px;border-radius:8px;min-width:0}
#gameStage .vs-mini .vc-name{font-size:14px;line-height:1.3;overflow-wrap:anywhere}
#gameStage .vs-mini .vc-meta,#gameStage .vs-mini .vc-style{font-size:10px;line-height:1.5}
#gameStage #vsStats{margin-top:12px;padding-top:12px}
#gameStage #vsStats .vstat{padding-block:4px;gap:8px}
#gameStage #vsStats .tc{font-size:11px;min-height:28px}
#gameStage #herdOrder{margin:0 0 16px;padding:0;border:0}
#gameStage #herdDots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#gameStage .herd-dot{font-size:10px;line-height:1.4}
#gameStage #dailyLine{width:100%;max-width:none;padding:12px 0 0;margin:0;border:0;border-top:1px solid var(--line);background:none;border-radius:0;text-align:left;font-size:11px;line-height:1.7}
#gameStage #dailyLine .donly{font-size:10px;margin:4px 0 0}
#gameStage.is-lobby #ovCard .card-foot{padding:0;margin:0;border:0;display:block}
#gameStage.is-lobby #ovCard .card-foot>*:empty{display:none}
#gameStage.is-lobby #hud{grid-column:2;grid-row:1;align-self:start;min-height:90px;padding:16px 20px}
#gameStage.is-lobby #canvasWrap{grid-column:2;grid-row:2;align-self:stretch;aspect-ratio:16/9;min-height:0;display:block;position:relative;overflow:hidden;background:var(--shell-bg)}
#gameStage.is-lobby #game{position:relative;z-index:1;display:block;width:100%;height:100%;aspect-ratio:16/9;object-fit:contain;background:transparent}
.lobby-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0;pointer-events:none}
#gameStage.is-playing .lobby-backdrop{display:none}
#gameStage .art-pending #game,#gameStage .art-pending #banner{opacity:0}
#gameStage .art-pending .lobby-backdrop{display:block;filter:none;transform:none;opacity:1}
#arenaArtLoading,#canvasGraphicsNotice{
 position:absolute;z-index:5;inset:auto 0 8px;width:max-content;
 max-width:calc(100% - 16px);margin:auto;padding:4px 10px;border-radius:6px;
 background:#13262e;color:#fff;font:600 12px/1.4 var(--font-b);pointer-events:none;
}
#gameStage.is-lobby .arena-tip{display:none}
#gameStage .arena-play{
  position:absolute;top:50%;left:50%;translate:-50% -50%;z-index:3;
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  min-width:124px;min-height:48px;padding:10px 24px;border-radius:999px;
  font:700 16px/1.2 var(--font-b);box-shadow:0 4px 18px rgba(10,16,20,.45);
}
#gameStage .arena-play span{font-size:12px}

#gameStage .arena-action-strip{font:10px var(--font-m);line-height:1.7;padding:16px 0;gap:16px;margin:0;flex-wrap:wrap;letter-spacing:0}
#gameStage .how-to-play{padding:16px 0;margin:0;border-block:1px solid var(--line)}
#gameStage .how-to-play>summary{font-size:13px;line-height:1.5;gap:16px;min-height:32px}
#gameStage .how-to-play>summary>span{font-size:12px;white-space:nowrap}
#gameStage .instructions{gap:24px;margin:24px 0 16px}
#gameStage .instructions b{font-size:17px;line-height:1.4;display:block}
#gameStage .instructions p{font-size:13px;line-height:1.7;margin:8px 0 0}
#gameStage .keys-note{font-size:11px;line-height:1.8;margin:0 0 8px}
#gameStage.is-playing .mode-deck{display:none}
#gameStage.is-playing #canvasWrap{flex:1 1 0;min-height:0;aspect-ratio:auto;height:auto;background:#17272f}
#gameStage.is-playing #game{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain}
#gameStage .hud{padding:16px 20px;gap:16px;border-bottom:1px solid var(--line)}
#gameStage .hud .name{font-size:13px;line-height:1.4}
#gameStage .hud .soak-label{font-size:10px;line-height:1.5}
#gameStage .hud .timer{font-size:27px;line-height:1.2}
#gameStage .hud .round{font-size:9px;line-height:1.6;letter-spacing:.04em;max-width:260px;margin-top:4px}
#gameStage .hud .badge{display:inline-block;font-size:8px;letter-spacing:.02em}
#gameStage .hud-pfp{width:36px;height:36px;object-fit:contain;border-radius:8px}
#gameStage .hud .soakbar{height:5px;margin-top:8px}
#gameStage .hud .meterbar{height:3px;margin-top:5px}
/* Results and pause have one reading order: outcome, record, actions. */
#gameStage.is-playing #overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto;background:rgba(15,28,33,.7);backdrop-filter:blur(8px)}
#gameStage #ovCard[data-view=result],#gameStage #ovCard[data-view=pause]{display:block;width:100%;max-width:480px;height:auto;min-height:0;max-height:100%;overflow-y:auto;margin:0;padding:28px;border:1px solid var(--card-line);border-radius:14px;text-align:center;box-shadow:0 16px 60px rgba(0,0,0,.15)}
#gameStage #ovCard[data-view=result] .card-scroll,#gameStage #ovCard[data-view=pause] .card-scroll{display:block;overflow:visible;margin:0;padding:0}
#gameStage #ovCard #ovTitle{font-size:30px;line-height:1.14;letter-spacing:-.035em;margin:0 0 12px;color:var(--card-ink)}
#gameStage #ovCard #ovText{font-size:13px;line-height:1.7;max-width:380px;margin:0 auto;color:var(--card-muted)}
#gameStage #resultStats{margin:24px 0 0;padding:0}
#gameStage #resultScore{font-size:64px;line-height:1;letter-spacing:-.045em;margin:0;font-variant-numeric:tabular-nums;color:var(--card-ink)}
#gameStage #resultStats>div:nth-child(2){font-size:10px;line-height:1.6;margin:8px 0 0;letter-spacing:.12em}
#gameStage #newBest{font-size:12px;line-height:1.5;font-weight:700;padding:8px 12px;margin:16px 0 0;background:color-mix(in srgb,var(--gold) 16%,var(--card-bg));color:var(--card-ink);border:1px solid color-mix(in srgb,var(--gold) 50%,var(--card-line));border-radius:6px}
#gameStage #bestLine{font-size:11px;line-height:1.6;margin:10px 0 0}
#gameStage #buildEcho{font-size:12px;line-height:1.6;margin:12px 0 0}
#gameStage .result-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0 0;padding:0}
#gameStage .result-stats>div{padding:12px 8px;min-width:0;background:var(--card-fill);border-radius:7px}
#gameStage .result-stats b{font-size:23px;line-height:1.2;display:block;font-variant-numeric:tabular-nums}
#gameStage .result-stats span{font-size:9px;line-height:1.6;letter-spacing:.06em;margin-top:6px;display:block}
#gameStage #ovCard[data-view=result] .play-row,#gameStage #ovCard[data-view=pause] .play-row{margin:20px 0 0}
#gameStage #ovCard[data-view=result] #startBtn,#gameStage #ovCard[data-view=pause] #startBtn{justify-content:center;font-size:14px;min-height:48px;text-align:center}
#gameStage #ovCard[data-view=result] .card-foot,#gameStage #ovCard[data-view=pause] .card-foot{padding:0;margin:16px 0 0;border:0}
#gameStage #boardToast{font-size:11px;line-height:1.6;font-weight:500;color:var(--card-muted);min-height:0;padding:0;margin:0 0 16px}
#gameStage #mainBtns{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;margin:0;padding:0}
#gameStage #mainBtns>.btn{flex:1 1 calc(50% - 4px);box-sizing:border-box;min-height:44px;min-width:0;font-size:12px;line-height:1.4;padding:10px 12px;gap:8px;justify-content:center;background:transparent;color:var(--card-ink);border:1px solid var(--card-line);border-radius:7px}
#gameStage #ovCard[data-view=result] #demoRecord,#gameStage #ovCard[data-view=result] #resultFinishLine{display:none}
#gameStage .pause-rows{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;margin:0;padding:0}
#gameStage .pause-rows .btn{flex:1 1 calc(50% - 4px);box-sizing:border-box;min-height:44px;font-size:12px;line-height:1.4;padding:10px 12px}
#gameStage #pauseHint{grid-column:1/-1;font-size:11px;line-height:1.7;margin:8px 0 0}
#gameStage #shareToastOverlay:empty,#gameStage #challengeResult:empty,#gameStage #resultFinishLine:empty{display:none}
#gameStage #shareToastOverlay{font-size:11px;line-height:1.6;margin:12px 0 0;min-height:0}
#gameStage #cardTopBtn{display:none}
/* All matchup and celebration ink follows the active surface. */
#gameStage .tale,#gameStage .victory{background:var(--card-bg);color:var(--card-ink);padding:0}
#gameStage .tale-inner{box-sizing:border-box;width:min(100%,760px);max-height:100%;height:auto;margin:auto;padding:24px 32px;overflow:auto;position:relative;color:var(--card-ink)}
#gameStage .tale-title{font-size:30px;line-height:1.1;letter-spacing:-.03em;margin:0 0 8px;color:var(--card-ink);text-shadow:none}
#gameStage .tale-title i{color:var(--blue-deep)}
#gameStage .tale-rung{color:var(--card-muted);font-size:10px;line-height:1.5;letter-spacing:.08em;margin:0 0 16px}
#gameStage .tale-fighters{display:grid;grid-template-columns:minmax(0,1fr) 70px minmax(0,1fr);gap:16px;align-items:center;margin:0}
#gameStage .tale-f img{width:88px;height:88px;border:2px solid var(--line);border-radius:12px;object-fit:contain;margin:0 auto 8px}
#gameStage .tale-f .tf-name{font-size:23px;line-height:1.2;color:var(--card-ink);margin:0;text-shadow:none}
#gameStage .tale-f .tf-name>span{font-size:10px;color:var(--card-muted)}
#gameStage .tale-f .tf-meta{font-size:10px;line-height:1.6;color:var(--card-muted);margin-top:6px}
#gameStage .tale-f .tf-style{font-size:10px;line-height:1.5;color:var(--blue-deep);letter-spacing:.04em;margin-top:6px}
#gameStage .tale-vs{font-size:26px;line-height:1.2;color:var(--card-muted);text-shadow:none}
#gameStage .tale-vs small{font-size:7px;line-height:1.6;color:var(--card-muted);letter-spacing:.08em;margin-top:8px}
#gameStage .tale-tape{display:none}
#gameStage .tale-stats{margin:16px auto 0;max-width:520px;width:100%}
#gameStage .tstat{margin:0;min-height:24px;gap:12px}
#gameStage .tstat .tl{color:var(--card-muted);font-size:10px;line-height:1.5}
#gameStage .tstat .tv{color:var(--card-ink);font-size:11px;line-height:1.5}
#gameStage .tale-edge{color:var(--card-muted);font-size:11px;line-height:1.6;margin:12px 0 0}
#gameStage .tale-mantra{color:var(--card-ink);font-size:13px;line-height:1.5;margin:12px 0 0}
#gameStage .tale-skip,#gameStage .victory-skip{color:var(--card-ink);background:var(--card-bg);border:1px solid var(--card-line);border-radius:6px;min-height:36px;padding:8px 12px;font-size:11px;top:12px;right:12px;z-index:4}
#gameStage .tale-inner .tale-skip{top:0;right:16px;position:relative;float:right;margin:0 0 8px 16px}
#gameStage .victory-inner{padding:24px;max-height:100%;overflow:auto}
#gameStage .victory-kicker,#gameStage .victory-sub{color:var(--card-muted);font-size:13px;line-height:1.6;text-shadow:none}
#gameStage .victory-big{color:var(--card-ink);font-size:clamp(36px,6vw,64px);line-height:1.1;letter-spacing:-.04em;text-shadow:none}
#gameStage .victory-mantra{color:var(--card-ink);font-size:15px;line-height:1.6}
#gameStage .victory-pfp-wrap{width:120px;height:120px;margin:0 auto 20px}
.studio-polished .sec-head h2{margin-bottom:16px}
.studio-polished .sec-head .sub{line-height:1.7;max-width:560px}
.studio-polished .gallery-tools{margin-top:32px;padding-bottom:16px;gap:24px;font-size:10px}
.studio-polished .nft-grid{gap:32px 24px;margin-top:24px;padding:0}
.studio-polished .nft-card .body{padding:16px 0}
.studio-polished .nft-card .line{font-size:12px;margin-top:8px;line-height:1.5}
.studio-polished .nft-card .tap{font-size:11px;margin-top:16px;line-height:1.5}
.studio-polished .herd-line{margin:24px 0 0;font-size:12px;line-height:1.7;text-align:left}
.studio-polished .trait-explorer{margin-top:56px;padding-top:32px}
.studio-polished .trait-heading h3{font-size:34px;line-height:1.15;letter-spacing:-.035em}
.studio-polished .trait-heading p{font-size:13px;line-height:1.7;margin:12px 0 0}
.studio-polished .trait-tabs{margin:24px 0 12px}
.studio-polished .trait-tabs button{min-height:40px;font-size:12px}
.studio-polished .trait-record{gap:24px;padding-block:20px}
.studio-polished .trait-record p{font-size:12px;line-height:1.7}
.studio-polished .registry-note{font-size:11px;line-height:1.8;margin:16px 0 0}
.studio-polished .roller-box{margin-top:48px;padding:32px}
.studio-polished .roller-box>p{font-size:13px;line-height:1.7;margin-bottom:24px}
.studio-polished .matriarch{margin-top:48px;padding:40px;gap:40px}
.studio-polished .matriarch h3{font-size:40px;line-height:1.12;margin:16px 0}
.studio-polished .matriarch p{font-size:14px;line-height:1.8}
.studio-polished .coin-panel{padding-block:40px;gap:48px}
.studio-polished .coin-copy p{font-size:13px;line-height:1.8;margin:16px 0}
.studio-polished .board-line{font-size:11px;line-height:1.8;max-width:800px;margin:16px 0}
.studio-polished .local-label{font-size:10px;line-height:1.7;margin-top:16px}
.studio-polished .board-actions{margin-top:20px;gap:12px}
.studio-polished .board-actions .btn{min-height:44px}
.studio-polished .board-tabs{gap:8px;flex-wrap:wrap}
.studio-polished .board-tab{font-size:12px;min-height:44px;padding:10px 16px}
.studio-polished .t-rank{display:none}
.studio-polished .modal{box-sizing:border-box;max-height:calc(100dvh - 40px);border:1px solid var(--card-line)}
.studio-polished .modal-back{padding:20px}
.studio-polished .nft-modal-body{padding:28px}
.studio-polished .modal p{line-height:1.7}
.studio-polished .modal-x{width:40px;height:40px;top:12px;right:12px;font-size:23px;line-height:1}
.studio-polished footer{padding:56px 0 32px}
.studio-polished footer .big{margin:0 0 40px;font-size:clamp(72px,15vw,200px);line-height:.9;letter-spacing:-.065em}
.studio-polished footer .foot-row{
 display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
 align-items:center;gap:16px;font-size:12px;line-height:1.7;
}
.studio-polished footer .foot-row>span:nth-child(2){text-align:center}
.studio-polished footer .foot-row>span:last-child{text-align:end}
.studio-polished #pageTopBtn{right:20px;bottom:20px;width:40px;height:40px;min-width:40px;box-shadow:none}
/* Tablet: the arena preview gets real room; setup becomes a compact top panel. */
@media(max-width:1050px){
 .studio-polished .hero-layout{gap:24px;min-height:540px;padding-block:40px}
 .studio-polished .hero-portrait-stage{min-height:370px}
 .studio-polished .hero-copy h1{font-size:clamp(55px,7.2vw,76px)}
 #gameStage .mode-card-body{padding:16px}
 #gameStage .mode-card-body>b{font-size:22px}
 #gameStage .mode-card-body>p{font-size:12px}
 #gameStage.is-lobby .game-shell{grid-template-columns:300px minmax(0,1fr)}
 #gameStage.is-lobby #ovCard{padding:20px}
 #gameStage .hud .badge{display:none}
 #gameStage .hud .who{gap:8px}
 #gameStage .hud-pfp{width:30px;height:30px}
 #gameStage .hud .round{font-size:8px;max-width:190px}
}
@media(max-width:1100px),(horizontal-viewport-segments:2){
 #gameStage.is-lobby .game-shell{display:flex;flex-direction:column;grid-template-rows:none}
 #gameStage.is-lobby #overlay{order:1;width:100%;border:0;border-bottom:1px solid var(--line)}
 #gameStage.is-lobby #ovCard{padding:24px;max-width:none;width:100%}
 #gameStage.is-lobby #pickBlock{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:32px;align-items:start}
 #gameStage.is-lobby .lobby-mode{grid-column:1/-1}
 #gameStage.is-lobby .lobby-label,#gameStage.is-lobby .selected-herd,#gameStage.is-lobby #picker{grid-column:1}
 #gameStage.is-lobby .lobby-label{grid-row:2}
 #gameStage.is-lobby .selected-herd{grid-row:3}
 #gameStage.is-lobby #picker{grid-row:4}
 #gameStage.is-lobby .play-row{grid-column:2;grid-row:3;margin-top:8px}
 #gameStage.is-lobby .preplay-hint{grid-column:2;grid-row:4;margin-top:12px}
 #gameStage.is-lobby .build-details,#gameStage.is-lobby .match-options,#gameStage.is-lobby #dailyLine{grid-column:1/-1}
 #gameStage.is-lobby #hud{order:2;width:100%;min-height:80px;box-sizing:border-box}
 #gameStage.is-lobby #canvasWrap{order:3;width:100%;aspect-ratio:16/9;min-height:0}
 #gameStage.is-lobby #game{width:100%;height:auto}
 #gameStage #holderOppRow{grid-template-columns:repeat(5,minmax(0,60px));justify-content:start;gap:12px}
 .studio-polished .navlinks{gap:16px}
 .studio-polished .wallet-btn{display:none}
}
@media(max-width:760px),(horizontal-viewport-segments:2){
 :root{--gutter:24px}
 .studio-polished .nav{min-height:68px;padding-block:12px;gap:16px}
 .studio-polished .logo{font-size:29px}
 .studio-polished .navlinks{gap:8px}
 .studio-polished .hero-layout{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;min-height:0;padding-top:32px;padding-bottom:24px}
 .studio-polished .hero-copy h1{font-size:clamp(48px,8.6vw,64px);line-height:1.02;letter-spacing:-.045em;margin:20px 0}
 .studio-polished .eyebrow{font-size:9px;line-height:1.7;letter-spacing:.07em}
 .studio-polished .hero p.lede{font-size:14px;line-height:1.7;max-width:400px;margin:0 0 20px}
 .studio-polished .hero-actions{gap:20px;align-items:center;flex-wrap:wrap}
 .studio-polished .hero-actions .btn{min-height:48px;font-size:13px;padding:12px 16px;gap:24px}
 .studio-polished .hero-actions .quiet-link{font-size:13px;gap:12px;min-height:44px}
 .studio-polished .hero-fine{font-size:11px;margin:10px 0 0}
 .studio-polished .hero-mantra{display:none}
 .studio-polished .hero-portrait-stage{min-height:280px;max-width:360px;width:100%;margin:0 auto}
 .studio-polished .hero-art{width:74%;max-width:266px}
 .studio-polished .hero-water{height:76px;bottom:0}
 .studio-polished .portrait-tag{min-width:180px;bottom:16px;padding:12px 16px}
 .studio-polished .portrait-tag b{font-size:26px;line-height:1.1;margin:6px 0}
 .studio-polished .portrait-tag span{font-size:8px;letter-spacing:.04em}
 .studio-polished .portrait-tag em{font-size:10px}
 .studio-polished .scene-coordinate{font-size:8px;right:4px;top:4px}
 .studio-polished .hero-baseline{padding-block:16px;gap:16px}
 .studio-polished .hero-baseline>span:first-child{font-size:9px;letter-spacing:.04em}
 .studio-polished .hero-baseline>a{font-size:10px}
 #gameStage{scroll-margin-top:88px}
 #gameStage .game-head{gap:16px;margin:0 0 20px;align-items:center}
 #gameStage .game-head h2{font-size:30px;line-height:1.12;max-width:none;margin:0 0 10px}
 #gameStage .game-head .sub{font-size:13px;line-height:1.65;max-width:none}
 #gameStage .game-tools{gap:6px;flex-direction:row;flex-shrink:0;align-self:flex-start}
 #gameStage .game-tools .icon-btn{width:40px;height:40px}
 .play-steps{gap:16px;flex-wrap:wrap;row-gap:8px;margin-bottom:20px}
 .play-steps li{font-size:11px;gap:6px}
 .play-steps li>span{width:22px;height:22px;font-size:10px}
 #gameStage .mode-deck{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0 0 20px;padding:0;overflow:visible}
 #gameStage .mode-deck>button{display:grid;grid-template-columns:100px minmax(0,1fr);min-width:0;width:100%;text-align:left;align-items:stretch}
 #gameStage .mode-deck .mode-scene{width:100%;height:100%;min-height:118px;aspect-ratio:auto;object-fit:cover;border-radius:0;object-position:center}
 #gameStage .mode-card-body{padding:14px 16px;min-width:0}
 #gameStage .mode-kicker{font-size:9px;line-height:1.4;margin-bottom:7px;letter-spacing:.05em}
 #gameStage .mode-card-body>b{font-size:21px;line-height:1.15}
 #gameStage .mode-card-body>p{font-size:12px;line-height:1.5;margin:8px 0 0}
 #gameStage .mode-card-foot{border:0;padding:0;margin-top:8px;font-size:10px;line-height:1.5;gap:4px}
 #gameStage .mode-card-foot .mode-best{display:none}
 #gameStage.is-lobby .game-shell{border-radius:10px}
 #gameStage.is-lobby #ovCard{padding:20px}
 #gameStage.is-lobby #pickBlock{display:block}
 #gameStage.is-lobby .lobby-mode{margin-bottom:20px;padding-bottom:12px}
 #gameStage.is-lobby .lobby-mode b{font-size:16px}
 #gameStage.is-lobby .lobby-label{font-size:12px;margin-bottom:16px;scroll-margin-top:90px}
 #gameStage.is-lobby .selected-herd>img{width:56px;height:56px}
 #gameStage.is-lobby .selected-herd b{font-size:26px}
 #gameStage #picker{gap:8px;margin:20px 0}
 #gameStage #picker .pick img{max-width:52px}
 #gameStage .pick-name{font-size:10px}
 #gameStage.is-lobby .play-row{margin:0}
 #gameStage #startBtn{font-size:13px;min-height:48px;padding:13px 16px}
 #gameStage .preplay-hint{font-size:11px;margin:12px 0 20px}
 #gameStage.is-lobby #hud,#gameStage .hud{min-height:76px;padding:12px 14px;gap:12px}
 #gameStage .hud .name{font-size:11px;line-height:1.3}
 #gameStage .hud .who{gap:8px}
 #gameStage .hud-pfp{width:28px;height:28px;display:block}
 #gameStage .hud .soak-label{font-size:9px;line-height:1.4}
 #gameStage .hud .timer{font-size:23px}
 #gameStage .hud .round{font-size:8px;line-height:1.5;max-width:150px;letter-spacing:.01em}
 #gameStage .hud .badge{display:none}
 #gameStage .hud:not(.solo){grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 #gameStage .hud:not(.solo) .hud-pfp{display:none}
 #gameStage .hud.solo{grid-template-columns:1fr 1.1fr}
 #gameStage .arena-action-strip{font-size:9px;line-height:1.7;padding:12px 0;display:flex;gap:6px;flex-direction:column;align-items:flex-start}
 #gameStage .arena-action-strip>span+span{margin-top:0}
 #gameStage .how-to-play{padding:12px 0}
 #gameStage .how-to-play>summary{font-size:12px;min-height:36px}
 #gameStage .how-to-play>summary>span{font-size:11px}
 #gameStage .instructions{grid-template-columns:1fr;gap:20px;margin:20px 0}
 #gameStage .instructions b{font-size:16px}
 #gameStage .instructions p{font-size:12px;line-height:1.7}
 #gameStage .keys-note{font-size:10px}
 #gameStage.is-playing #overlay{padding:16px;align-items:center;inset:0}
 #gameStage #ovCard[data-view=result],#gameStage #ovCard[data-view=pause]{padding:24px 20px;max-width:420px;max-height:100%;border-radius:12px}
 #gameStage #ovCard #ovTitle{font-size:27px;line-height:1.16;margin-bottom:12px}
 #gameStage #ovCard #ovText{font-size:12px;line-height:1.7;max-width:none}
 #gameStage #resultStats{margin-top:20px}
 #gameStage #resultScore{font-size:56px}
 #gameStage .result-stats b{font-size:22px}
 #gameStage .result-stats span{font-size:8px}
 #gameStage .result-stats>div{padding:12px 6px}
 #gameStage .tale-inner{padding:16px 20px;width:100%;max-height:100%}
 #gameStage .tale-title{font-size:24px;line-height:1.15;margin-bottom:8px}
 #gameStage .tale-rung{font-size:9px;margin-bottom:12px}
 #gameStage .tale-fighters{grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);gap:8px;align-items:center}
 #gameStage .tale-f img{width:68px;height:68px;border-radius:9px;margin-bottom:8px}
 #gameStage .tale-f .tf-name{font-size:19px;line-height:1.2}
 #gameStage .tale-f .tf-name>span{display:block;font-size:9px;margin-top:4px}
 #gameStage .tale-f .tf-meta{font-size:9px;line-height:1.5;margin-top:6px}
 #gameStage .tale-f .tf-style{font-size:8px;line-height:1.6;letter-spacing:0;margin-top:4px}
 #gameStage .tale-vs{font-size:19px}
 #gameStage .tale-vs small{display:none}
 #gameStage .tale-inner .tale-skip{position:static;float:right;min-height:32px;padding:6px 10px;font-size:10px;margin:0 0 8px 8px}
 #gameStage .tale-stats{margin-top:12px}
 #gameStage .tstat{min-height:22px;gap:8px}
 #gameStage .tstat .tl{font-size:9px}
 #gameStage .tstat .tv{font-size:10px}
 #gameStage .tale-edge{font-size:10px;margin-top:10px}
 #gameStage .tale-mantra{font-size:12px;margin-top:10px}
 #gameStage .victory-inner{padding:24px 20px}
 #gameStage .victory-pfp-wrap{width:100px;height:100px}
 #gameStage .victory-big{font-size:42px}
 #gameStage .victory-sub{font-size:12px}
 .studio-polished .sec-head h2{font-size:36px;line-height:1.12}
 .studio-polished .sec-head .sub{font-size:13px}
 .studio-polished .nft-grid{gap:24px 16px}
 .studio-polished .nft-card .body{padding:14px 0}
 .studio-polished .nft-card .nm{font-size:23px;line-height:1.2}
 .studio-polished .nft-card .nm>span{font-size:10px}
 .studio-polished .nft-card .meta{font-size:10px;gap:6px;margin-top:10px}
 .studio-polished .nft-card .score{font-size:9px}
 .studio-polished .nft-card .line{font-size:11px;line-height:1.5;margin-top:8px}
 .studio-polished .nft-card .tap{font-size:10px;margin-top:12px;line-height:1.5}
 .studio-polished .gallery-tools{font-size:10px;line-height:1.6;gap:20px;margin-top:24px}
 .studio-polished .gallery-tools .text-btn{font-size:11px;max-width:140px;line-height:1.6}
 .studio-polished .herd-line{font-size:12px}
 .studio-polished .trait-heading{display:block}
 .studio-polished .trait-heading h3{font-size:30px;line-height:1.2}
 .studio-polished .trait-heading p{font-size:12px}
 .studio-polished .trait-search input{width:100%;min-width:0;font-size:13px;min-height:44px;margin-top:20px;padding:12px}
 .studio-polished .trait-tabs{display:flex;flex-wrap:wrap;overflow:visible;gap:8px;margin-top:20px}
 .studio-polished .trait-tabs button{font-size:11px;padding:8px 12px;min-height:38px}
 .studio-polished .trait-record{grid-template-columns:minmax(0,1fr) 110px;gap:12px;padding-block:20px}
 .studio-polished .trait-record p{font-size:12px;grid-column:1/-1;line-height:1.7}
 .studio-polished .trait-record-name b{font-size:18px}
 .studio-polished .trait-record-name>span:first-child{font-size:9px}
 .studio-polished .trait-verdict{font-size:9px!important;padding:4px 7px}
 .studio-polished .trait-metrics b{font-size:19px}
 .studio-polished .trait-metrics small{font-size:8px}
 .studio-polished .registry-note{font-size:11px}
 .studio-polished .roller-box{padding:24px;margin-top:40px}
 .studio-polished .roller-box h3{font-size:28px;line-height:1.2}
 .studio-polished .roller-box>p{font-size:12px}
 .studio-polished .matriarch{padding:32px 24px;gap:24px;margin-top:40px}
 .studio-polished .matriarch h3{font-size:32px}
 .studio-polished .matriarch p{font-size:13px}
 .studio-polished .coin-panel{gap:24px;padding-block:32px}
 .studio-polished .coin-copy p{font-size:12px}
 .studio-polished .coin-panel .coin-seq{font-size:10px;gap:8px;flex-wrap:wrap}
 .studio-polished .coin-fine{font-size:11px!important}
 .studio-polished .local-label{font-size:9px;line-height:1.7}
 .studio-polished .board-tab{font-size:11px;min-height:42px;padding:9px 12px}
 .studio-polished .board-line{font-size:11px}
 .studio-polished .board-row{padding:16px 12px}
 .studio-polished .board-actions{gap:8px}
 .studio-polished .modal-back{padding:16px}
 .studio-polished .modal{max-height:calc(100dvh - 32px);padding:24px 20px}
 .studio-polished .nft-modal{padding:0;width:100%}
 .studio-polished .nft-modal-body{padding:24px 20px}
 .studio-polished .set-txt b{font-size:14px}
 .studio-polished .set-txt span{font-size:12px;line-height:1.6}
 .studio-polished .set-row{gap:12px;padding-block:14px}
 .studio-polished footer{padding:40px 0 24px}
 .studio-polished footer .foot-row{grid-template-columns:minmax(0,1fr);font-size:11px;line-height:1.8;gap:8px;text-align:center}
 .studio-polished footer .foot-row>span:last-child{text-align:center}
 .studio-polished footer .foot-row+.foot-row>span:last-child{font-size:11px}
}
@media(max-width:500px),(horizontal-viewport-segments:2){
 :root{--gutter:20px}
 #gameStage .game-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
 #gameStage .game-head h2{font-size:28px}
 #gameStage .game-tools{flex-direction:column;gap:6px}
 #gameStage .game-tools .icon-btn{width:44px;height:44px}
 .play-steps{gap:12px;flex-wrap:wrap}
 .play-steps li{font-size:10px}
 #gameStage .mode-deck>button{grid-template-columns:82px minmax(0,1fr)}
 #gameStage .mode-card-body{padding:12px}
 #gameStage .mode-card-body>b{font-size:20px}
 #gameStage .mode-card-body>p{font-size:11px;line-height:1.55}
 #gameStage .mode-card-foot{font-size:10px}
 .studio-polished .hero-copy h1{font-size:clamp(44px,12vw,55px)}
 .studio-polished .hero-portrait-stage{min-height:250px;max-width:320px}
 .studio-polished .hero-art{max-width:240px}
 .studio-polished .portrait-tag{min-width:160px;padding:10px 14px}
 .studio-polished .portrait-tag b{font-size:24px}
 .studio-polished .hero-actions{gap:16px}
 .studio-polished .hero-actions .btn{font-size:12px;padding:12px 14px;gap:20px}
 .studio-polished .hero-actions .quiet-link{font-size:12px;gap:8px}
}
@media(max-width:380px){
 :root{--gutter:16px}
 .studio-polished .hero-copy h1{font-size:44px}
 .studio-polished .eyebrow{font-size:8px;letter-spacing:.04em}
 #gameStage.is-lobby #ovCard{padding:16px}
 #gameStage #picker{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:12px}
 #gameStage #picker .pick img{max-width:48px}
 #gameStage .pick-name{font-size:11px}
 #gameStage .selected-herd button{font-size:10px}
 #gameStage .mode-deck>button{grid-template-columns:70px minmax(0,1fr)}
 #gameStage .mode-card-body>b{font-size:19px}
 #gameStage #ovCard[data-view=result],#gameStage #ovCard[data-view=pause]{padding:20px 16px}
 #gameStage #ovCard #ovTitle{font-size:25px}
 #gameStage .result-stats b{font-size:20px}
 .studio-polished .nft-grid{gap:20px 12px}
 .studio-polished .nft-card .nm{font-size:21px}
 .studio-polished .nft-card .score{font-size:8px}
}
/* Fullscreen: preserve safe gutters and let the game fit, never stretch. */
#gameStage.fake-full,#gameStage:fullscreen{box-sizing:border-box;padding:16px max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));gap:0}
#gameStage.fake-full .play-steps,#gameStage:fullscreen .play-steps{display:none}
#gameStage.is-lobby:is(.fake-full,:fullscreen) .game-shell{overflow-y:auto;flex:1 1 auto}
@media(max-height:600px) and (orientation:landscape){
 #gameStage.fake-full .game-head,#gameStage:fullscreen .game-head{margin-bottom:8px}
 #gameStage.fake-full .game-head h2,#gameStage:fullscreen .game-head h2{font-size:20px;margin:0}
 #gameStage.fake-full .game-head .sub,#gameStage:fullscreen .game-head .sub{display:none}
 #gameStage.fake-full .hud,#gameStage:fullscreen .hud{min-height:0;padding:8px 12px}
 #gameStage .tale-inner{padding:12px 24px;max-width:700px}
 #gameStage .tale-title{font-size:22px}
 #gameStage .tale-f img{width:52px;height:52px}
 #gameStage .tale-f .tf-name{font-size:18px}
 #gameStage .tale-f .tf-meta,#gameStage .tale-f .tf-style{font-size:8px;line-height:1.3;margin-top:3px}
 #gameStage .tale-rung{font-size:8px;margin-bottom:8px}
 #gameStage .tale-stats{margin-top:8px}
 #gameStage .tstat{min-height:19px}
 #gameStage .tale-edge{margin-top:6px;font-size:9px}
 #gameStage .tale-mantra{display:none}
 #gameStage #ovCard[data-view=result],#gameStage #ovCard[data-view=pause]{max-width:560px;padding:20px;max-height:100%}
}
/* Native small moments. These are event-driven; no always-on cursor or scroll effects. */
.hero-greet{position:absolute;inset:0;background:none;border:0;border-radius:42% 42% 8px 8px;padding:0;cursor:pointer;z-index:3}
.hero-greet:focus-visible{outline-offset:7px!important}
.studio-polished .hero-art #heroFx{display:block;position:absolute;inset:0;pointer-events:none;width:100%;height:100%;z-index:4}
.studio-polished .hero-portrait-stage #snootSplash{position:absolute;inset:-50px -30px -30px;pointer-events:none;z-index:6;width:calc(100% + 60px);height:calc(100% + 80px)}
.splash-ring{position:absolute;left:50%;bottom:32px;width:160px;height:26px;border:2px solid #b4e8f8;border-radius:50%;transform:translateX(-50%);pointer-events:none;z-index:5;animation:herdRipple .9s ease-out both}
@keyframes herdRipple{from{opacity:.9;transform:translateX(-50%) scale(.2)}to{opacity:0;transform:translateX(-50%) scale(1.8)}}
.mode-deck>button .mode-scene{transition:filter .25s ease}
@media(hover:hover) and (pointer:fine){#gameStage .mode-deck>button:hover .mode-scene{filter:saturate(1.12)}.nft-card:focus-visible .tap,.nft-card:hover .tap{color:var(--ink)}}
.studio-polished .ripple-wave{pointer-events:none}
@media(prefers-reduced-motion:reduce){.splash-ring{animation:none;opacity:0}.studio-polished *{scroll-behavior:auto!important}}
.theme-settles .icon-sun,.theme-settles .icon-moon{animation:themeSettle .4s ease-out both}
@keyframes themeSettle{from{opacity:.2;transform:rotate(-25deg) scale(.75)}to{opacity:1;transform:rotate(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.theme-settles .icon-sun,.theme-settles .icon-moon{animation:none}}
/* A separate touch rail leaves the road visible while steering and jumping. */
.run-control-rail{display:none}
@media(max-width:760px),(pointer:coarse),(horizontal-viewport-segments:2){
 #gameStage .run-control-rail:has(button:not([hidden])){display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:6px;background:var(--card-bg);border-top:1px solid var(--card-line)}
 #gameStage .run-control-rail .run-btn{position:static;inset:auto;min-width:0;width:100%;min-height:48px;height:auto;margin:0;padding:8px 4px;font-size:11px;line-height:1.3;border-radius:8px;box-shadow:none;background:var(--card-fill);color:var(--card-ink);border:1px solid var(--card-line)}
 #gameStage .run-control-rail .run-btn.blast{background:var(--gold);color:#27251c;border-color:var(--gold)}
 #gameStage .run-control-rail .run-btn:disabled{opacity:.45}
}
/* Retired gallery bleed must not survive the compact grid layout. */
.studio-polished .nft-grid{width:100%;max-width:100%;margin-left:0;margin-right:0}
.studio-polished .hero{overflow:hidden}
#gameStage.is-lobby #game{object-fit:contain}
/* Legacy matchup labels used a dark-scene palette and a fixed mobile sheet. */
#gameStage .tale{position:absolute;inset:0;border-radius:0;z-index:9}
#gameStage .tstat .tc{color:var(--card-muted);font-size:10px;line-height:1.5;letter-spacing:.03em}
#gameStage .tstat .tc b{color:var(--card-ink);font-size:11px}
#gameStage .tstat .edge{color:var(--blue-deep)}
#gameStage .tale-mantra b{color:var(--card-ink)}
@media(max-width:760px),(horizontal-viewport-segments:2){
 #gameStage .tale{padding:0;overflow:auto}
 #gameStage .tstat .tc{font-size:9px}
 #gameStage .tstat .tc b{font-size:10px}
}
@media(max-width:760px),(horizontal-viewport-segments:2){
 #gameStage .tale-title{font-size:20px;line-height:1.15;text-align:left;padding-right:56px}
 #gameStage .tale-f img{width:56px;height:56px}
 #gameStage .tstat{min-height:20px}
 #gameStage .tale-mantra{display:none}
}

/* Sweep: keep the mobile HUD readable instead of shrinking it to microtype. */
@media(max-width:760px),(horizontal-viewport-segments:2){
 #gameStage .hud .name{font-size:12px}
 #gameStage .hud .soak-label{font-size:11px;letter-spacing:.02em}
 #gameStage .hud .round{font-size:11px;line-height:1.45;letter-spacing:0}
 #gameStage .hud .timer{font-size:26px}
 #gameStage .hud.solo{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);align-items:center}
 #gameStage .hud.solo .who{display:grid;grid-template-columns:28px minmax(0,1fr);column-gap:8px;row-gap:4px;align-items:center}
 #gameStage .hud.solo .who>div{display:contents}
 #gameStage .hud.solo .who .name{grid-column:2;grid-row:1}
 #gameStage .hud.solo .who .soak-label{grid-column:1 / -1;grid-row:2;margin-top:0}
 #gameStage .hud.solo .round{max-width:none}
}

/* Keep the entire game surface inside its grid track even when setup grows.
   An aspect-ratio item with an automatic width can otherwise grow sideways
   from the stretched row height and hide the right platform. */
#gameStage .game-shell,#gameStage #canvasWrap{min-width:0;max-width:100%;box-sizing:border-box}
#gameStage #canvasWrap{width:100%}
#gameStage.is-lobby #canvasWrap{width:100%;max-width:100%;min-width:0;justify-self:stretch}
#gameStage.is-lobby #game{position:absolute;inset:0;width:100%!important;max-width:100%;min-width:0;height:100%!important;aspect-ratio:auto;object-fit:contain}
#gameStage .lobby-backdrop{filter:blur(6px);opacity:.35;transform:scale(1.03)}

/* In a wide lobby the setup scrolls independently; opening a long Build must
   never increase the game's height and therefore its aspect-ratio width. */
@media(min-width:1101px) and (horizontal-viewport-segments:1),
       (min-width:1101px) and (not (horizontal-viewport-segments:2)){
 #gameStage.is-lobby .game-shell{grid-template-rows:auto auto}
 #gameStage.is-lobby #overlay{contain:size;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;align-self:stretch}
 #gameStage.is-lobby #canvasWrap{align-self:start;height:auto;aspect-ratio:16/9}
 #gameStage.is-lobby .play-row{position:sticky;top:8px;z-index:4;background:var(--paper2);padding-block:4px}
}
/* Include the canvas type in this rule so native fullscreen's older height
   selector cannot override the fixed 16:9 lobby surface. */
#gameStage.is-lobby canvas#game{position:absolute;inset:0;margin:auto;width:100%!important;height:auto!important;max-width:100%;max-height:100%;aspect-ratio:16/9;object-fit:contain}
@media(max-width:1100px),(horizontal-viewport-segments:2){
 #gameStage.is-lobby:is(.fake-full,:fullscreen) .game-shell{display:flex;flex-direction:column}
 #gameStage.is-lobby:is(.fake-full,:fullscreen) #hud{display:grid;flex:none;order:0}
 #gameStage.is-lobby:is(.fake-full,:fullscreen) #canvasWrap{display:block;flex:none;width:100%;aspect-ratio:16/9;height:auto;order:1}
 #gameStage.is-lobby:is(.fake-full,:fullscreen) #overlay{contain:none;flex:none;overflow:visible;height:auto;order:2}
}

/* The JS fitter gives the visible canvas its own 16:9 bounds. Absolute
   placement prevents intrinsic canvas pixels from sizing the CSS grid. */
#gameStage.is-playing canvas#game{position:absolute;inset:0;margin:auto;max-width:100%;max-height:100%}

/* Home is distinct from changing the current match setup. */
#gameStage .pause-rows #pauseHint{flex-basis:100%}
#gameStage .screen-home{position:absolute;top:16px;left:16px;z-index:8;min-height:44px;padding:10px 18px;border:1px solid #87a1a9;border-radius:10px;background:#17272c;color:#f6f1e6;font:700 14px Archivo,sans-serif;cursor:pointer}
#gameStage .screen-home:hover{background:#28434b}

/* Equal pairs; an odd final action fills the remaining row without a hole. */
@media(max-width:360px){#gameStage #mainBtns>.btn,#gameStage .pause-rows .btn{flex-basis:100%}}

/* Herd Board: one centered axis for the section and its controls. */
.studio-polished #board>.wrap{max-width:1120px;margin-inline:auto;box-sizing:border-box}
.studio-polished #board .sec-head{max-width:900px;margin-inline:auto;text-align:center}
.studio-polished #board .sec-head .sub{margin-inline:auto}
.studio-polished #board .local-label{max-width:100%;text-align:center}
.studio-polished #board #boardPanel,.studio-polished #board #featsPanel{width:100%;max-width:960px;margin-inline:auto}
.studio-polished #board .board-view-tabs{justify-content:center;margin:32px auto 24px;gap:8px}
.studio-polished #board .board-view-tabs>button{flex:0 1 128px;min-width:0}
.studio-polished #board .board-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:0}
.studio-polished #board .board-tab{min-width:0;text-align:center;white-space:normal;line-height:1.4}
.studio-polished #board .board-line,.studio-polished #board #lastMatchNote{max-width:760px;margin:20px auto;text-align:center}
.studio-polished #board .board-empty,.studio-polished #board .share-toast{text-align:center}
.studio-polished #board .your-best{justify-content:center;text-align:center}
.studio-polished #board .board-actions{display:flex;flex-wrap:wrap;justify-content:center;max-width:640px;margin:24px auto 0;gap:12px}
.studio-polished #board .board-actions>button{flex:1 1 160px;min-height:44px;text-align:center;justify-content:center}
.studio-polished #board .board-actions>.note{flex-basis:100%;text-align:center;line-height:1.7}
.studio-polished #board .herd-points{justify-content:center;text-align:center}
.studio-polished #board .herd-points>span{flex-basis:100%}
.studio-polished #board .code-expander{text-align:center}
@media(max-width:480px){
 .studio-polished #board .board-tab{padding-inline:6px;font-size:11px}
 .studio-polished #board .board-view-tabs{margin-top:24px}
 .studio-polished #board .board-actions{gap:8px}
 .studio-polished #board .board-actions>button{flex-basis:calc(50% - 4px);min-width:0}
}

/* Blast readiness is a status, not another control over the road. */
.run-blast-status{font:11px var(--font-b);border:1px solid var(--line);padding:8px 12px;border-radius:999px;text-align:center;color:var(--muted)}
.run-blast-status.ready{border-color:var(--gold);color:var(--ink);background:color-mix(in srgb,var(--gold) 18%,transparent)}
#runBlastBtn{display:none!important}

@media(max-width:480px){#gameStage[data-game-mode="duel"] #roundLabel{font-size:8px;line-height:1.45;letter-spacing:.04em}#gameStage .hud-name{overflow-wrap:anywhere}#gameStage .run-blast-status{border-radius:10px;width:100%;box-sizing:border-box}}


/* Fit active play between the site navigation and the viewport edge. The
   playfield receives the space left after the HUD and controls have laid out. */
#holderCard {
  margin-inline: auto;
  text-align: center;
}
#holderCard p { margin-inline: auto; }

#gameStage.is-playing {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: calc(var(--arena-height) - var(--arena-nav-height, 76px));
  padding-block: 6px;
  scroll-margin-top: 0;
}
#gameStage.is-playing:is(:fullscreen,:-webkit-full-screen,.fake-full) {
  height: var(--arena-height);
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
#gameStage.is-playing .game-head {
  display: flex;
  flex: none;
  gap: 8px;
  margin: 0 0 6px;
  text-align: left;
}
#gameStage.is-playing .game-head h2 {
  margin: 0;
  font-size: clamp(17px, 3.4vw, 24px);
}
#gameStage.is-playing .game-head .sub,
#gameStage.is-playing .section-kicker,
#gameStage.is-playing .play-steps,
#gameStage.is-playing .how-to-play { display: none; }
#gameStage.is-playing .game-tools { flex-direction: row; flex-shrink: 0; align-self: center; }
#gameStage.is-playing .game-tools .icon-btn { width: 44px; height: 44px; }
#gameStage.is-playing .game-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}
#gameStage.is-playing .hud { flex: none; min-height: 0; padding: 8px 12px; gap: 8px; }
#gameStage.is-playing .hud .round { margin-top: 2px; }
#gameStage.is-playing .arena-pause { width: 44px; height: 44px; }
#gameStage.is-playing .run-control-rail { flex: none; }
#gameStage.is-playing .arena-action-strip {
  display: flex;
  flex: none;
  flex-flow: row nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  min-height: 48px;
  box-sizing: border-box;
  font: 12px/1.35 var(--font-b);
}
#gameStage.is-playing .arena-action-strip > span:first-child { display: none; }
#gameStage.is-playing .arena-action-strip .run-blast-status {
  flex: none;
  width: auto;
  padding: 4px 8px;
  white-space: nowrap;
}
#gameStage.is-playing .arena-peanut {
  position: static;
  flex: none;
  cursor: default;
  pointer-events: none;
  padding: 4px 10px;
  font-size: 12px;
  box-shadow: none;
}
#gameStage.is-playing #activeTargetBar.show {
  flex: none;
  gap: 4px 12px;
  padding: 4px 8px;
  margin-bottom: 4px;
}
#gameStage.is-playing #activeTargetBar > span { display: none; }
@media (max-height: 520px) {
  #gameStage.is-playing .hud-pfp { width: 26px; height: 26px; }
  #gameStage.is-playing .hud { padding-block: 4px; }
  #gameStage.is-playing .hud .timer { font-size: 21px; }
  #gameStage.is-playing .hud .soakbar { margin-top: 4px; }
  #gameStage.is-playing .arena-action-strip { min-height: 32px; }
}

/* Keep the pause actions together when the arena has little room. */
@media (max-width: 360px) and (max-height: 520px),
       (min-width: 561px) and (max-height: 440px) {
  #gameStage.is-playing #overlay:has(#ovCard[data-view=pause]) { padding: 8px; }
  #gameStage #ovCard[data-view=pause] { max-width: 560px; padding: 10px 14px; }
  #gameStage #ovCard[data-view=pause] #ovTitle { font-size: 20px; margin-bottom: 4px; }
  #gameStage #ovCard[data-view=pause] #ovText { max-width: none; line-height: 1.35; }
  #gameStage #ovCard[data-view=pause] .play-row,
  #gameStage #ovCard[data-view=pause] .card-foot { margin-top: 6px; }
  #gameStage #ovCard[data-view=pause] #startBtn { min-height: 44px; padding-block: 8px; }
  #gameStage #ovCard[data-view=pause] #boardToast:empty,
  #gameStage #ovCard[data-view=pause] #demoRecord,
  #gameStage #ovCard[data-view=pause] #pauseHint { display: none; }
  #gameStage #ovCard[data-view=pause] .pause-rows .btn { flex-basis: calc(50% - 4px); }
}
@media (min-width: 561px) and (max-height: 440px) {
  #gameStage #ovCard[data-view=pause] .pause-rows .btn { flex-basis: calc((100% - 16px) / 3); }
}

#introSkip{
  position:absolute;z-index:5;min-height:44px;
  top:max(12px,env(safe-area-inset-top,0px));
  right:max(12px,env(safe-area-inset-right,0px));
}
@media(max-height:440px){
  #intro .intro-lockup{scale:.76;padding:8px}
}
@media(max-height:350px){
  #intro .intro-lockup{scale:.64}
}
.studio-polished .modal-back{
  padding-top:max(16px,env(safe-area-inset-top,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px));
  padding-bottom:max(16px,env(safe-area-inset-bottom,0px));
  padding-left:max(16px,env(safe-area-inset-left,0px));
}
.studio-polished #pageTopBtn{right:max(20px,env(safe-area-inset-right,0px));bottom:max(20px,env(safe-area-inset-bottom,0px))}
@media(horizontal-viewport-segments:2){
  .studio-polished{width:env(viewport-segment-width 0 0,100%)}
  #intro,.studio-polished .modal-back,#gameStage:is(.fake-full,:fullscreen){
    width:env(viewport-segment-width 0 0,100%);margin:0;inset-inline:0 auto;
  }
  .studio-polished #pageTopBtn{
    right:calc(100vw - env(viewport-segment-right 0 0,100vw) + 20px);
  }
}
@media(vertical-viewport-segments:2){
  :root{--arena-height:env(viewport-segment-height 0 0,100dvh)}
  #intro,.studio-polished .modal-back,#gameStage:is(.fake-full,:fullscreen){
    height:var(--arena-height);margin:0;inset-block:0 auto;
  }
  #intro .intro-lockup{scale:.76;padding:8px}
  .studio-polished .modal{max-height:calc(var(--arena-height) - 40px)}
}
