/* Game screen laid out like the official field mat, on the original paper / purple palette. */
body[data-view="match"]:has(.game){padding:0;height:100dvh;overflow:hidden}
body[data-view="match"]:has(.game) .app-header,body[data-view="match"]:has(.game) footer{display:none}
body[data-view="match"]:has(.game) main{max-width:none;height:100dvh;padding:0;margin:0}
.game{--night:#c1afcf;--day:#e8b84a;--glow:var(--night);--mat-line:#a88cbc40;position:relative;height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;gap:4px;padding:max(6px,env(safe-area-inset-top,0px)) max(10px,env(safe-area-inset-right,0px)) 0 max(10px,env(safe-area-inset-left,0px));color:var(--ink);background:var(--paper);overflow:hidden;isolation:isolate}
.game.is-day{--glow:var(--day)}
.game-bar{display:flex;align-items:center;gap:6px;min-height:40px}
.game-bar .icon-button,.game-tools button{width:38px;height:38px;min-height:38px;padding:0;display:grid;place-items:center;border-radius:10px;border:1px solid var(--line);background:#fbfaf7;color:var(--ink)}
.game-bar .icon-button:disabled,.game-tools button:disabled{opacity:.35}
.game-bar .icon{width:18px;height:18px}
.turn-chip{display:flex;align-items:baseline;gap:5px;padding:5px 10px;border-radius:10px;background:var(--lilac);color:var(--purple)}
.turn-chip small{font:700 8px ui-monospace,monospace;letter-spacing:2px}
.turn-chip b{font:700 18px/1 var(--display)}
.stage-chip{flex:1;min-width:0;font-size:11px;font-weight:700;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.game-tools{display:flex;gap:6px}
.game-tools button[aria-pressed="true"]{background:var(--purple);border-color:var(--purple);color:#fff}
.watch-speed{font:700 12px ui-monospace,monospace!important}
/* Opponent hand */
.opp-hand{display:flex;align-items:center;gap:8px;height:34px;padding:0 2px}
.nameplate{display:inline-flex;align-items:center;gap:5px;max-width:42%;font-size:11px;font-weight:700;color:var(--ink)}
.nameplate span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.nameplate .icon{width:14px;height:14px;color:#8a9a3a}
.opp-cards{flex:1;display:flex;justify-content:center;height:100%}
.opp-card{width:24px;height:34px;margin:0 -5px;padding:0;border:0;min-height:0;border-radius:3px;overflow:hidden;transform-origin:50% -120%;transform:rotate(calc((var(--i) - var(--mid,2)) * -6deg));box-shadow:0 2px 5px #291a3940;background:none}
.opp-card img{width:100%;height:100%;object-fit:cover}
.opp-card .card-back{width:100%;height:100%;border-width:2px}
.opp-hand>.count{font:700 13px ui-monospace,monospace;color:var(--purple)}
/* Mat */
.mat-wrap{container-type:size;min-height:0;display:grid;place-items:center}
.mat{--mat-ratio:.76;position:relative;width:min(100cqw,calc(100cqh * var(--mat-ratio)));height:min(100cqh,calc(100cqw / var(--mat-ratio)));display:grid;grid-template-columns:7% 21% 44% 21% 7%;grid-template-rows:24% 26% 26% 24%;grid-template-areas:"ohp odeck oset opow ." "ohp . center oaby ." ". maby center . mhp" ". mpow mset mdeck mhp";
  border-radius:12px;padding:1.6%;color:#f3eef6;background:radial-gradient(ellipse at 50% 0,#76548f40,transparent 65%),var(--deep);box-shadow:0 10px 26px #291a3940;container-type:inline-size}
.zone{position:relative;min-width:0;min-height:0;margin:5%;border:1px solid var(--mat-line);border-radius:6px;background:#ffffff06;display:grid;place-items:center;padding:0;color:#f3eef6}
button.zone:hover{border-color:#c1afcf88;background:#ffffff0d}
.zone .count{position:absolute;right:-4px;bottom:-4px;min-width:22px;height:22px;padding:0 5px;border-radius:11px;display:grid;place-items:center;background:#fbfaf7;color:var(--deep);font:700 11px ui-monospace,monospace;z-index:3;box-shadow:0 1px 4px #0005}
.zone-name{position:absolute;top:4px;left:0;right:0;text-align:center;font:600 7px ui-monospace,monospace;letter-spacing:1.5px;color:#b09bc2}
.deck-opp{grid-area:odeck}.power-opp{grid-area:opow}.abyss-opp{grid-area:oaby}.set-opp{grid-area:oset}
.deck-me{grid-area:mdeck}.power-me{grid-area:mpow}.abyss-me{grid-area:maby}.set-me{grid-area:mset}
.hp-opp{grid-area:ohp}.hp-me{grid-area:mhp}
.mat-card{display:block;border:0;padding:0;min-height:0;background:none;width:100%;height:100%;border-radius:5px;overflow:visible}
.mat-card img{display:block;width:100%;height:100%;object-fit:contain;border-radius:5%/3.5%;filter:drop-shadow(0 3px 6px #0008)}
.deck-stack{width:72%;position:relative;filter:drop-shadow(0 calc(var(--depth) * 1px) 0 #1a1024) drop-shadow(0 calc(var(--depth) * .5px) 0 #4a3463)}
/* Set zones A B C */
.set-zone{display:grid;grid-template-columns:repeat(3,1fr);gap:4%;border:0;background:none;margin:3% 1%}
.set-slot{position:relative;display:grid;place-items:center;border:1px dashed var(--mat-line);border-radius:6px;background:#ffffff05;min-width:0;min-height:0;padding:6%}
.set-slot>em{position:absolute;font:700 clamp(13px,4.6cqw,24px)/1 var(--display);font-style:normal;color:#ffffff1f}
.set-slot>.card-back,.set-slot>.mat-card{position:relative;width:100%;height:auto;aspect-ratio:5/7}
.set-slot[data-slot="C"]{border-color:#d6eb9140}
/* Power charger: diamond as on the mat */
.power-zone::before{content:'';position:absolute;inset:16%;border:1px solid var(--mat-line);transform:rotate(45deg);border-radius:4px}
.pile-cards{position:relative;width:70%;aspect-ratio:5/7}
.pile-cards img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:5%/3.5%;transform:translate(calc(var(--i) * 6%),calc(var(--i) * -3%)) rotate(calc(var(--i) * 2deg));box-shadow:0 2px 5px #0008}
.power-zone .count{background:var(--acid)}
/* HP meter: each player's 100 sits next to the centre line, as on the mat */
.hp-meter{position:relative;margin:4% 8%}
.hp-track{position:relative;height:100%;border-radius:10px;border:1px solid var(--mat-line);background:#ffffff08;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:6px 0;overflow:visible}
.hp-track>span{font:600 clamp(6px,1.9cqw,9px)/1 ui-monospace,monospace;color:#b09bc299;z-index:1}
.hp-fill{position:absolute;left:2px;right:2px;bottom:2px;height:calc((100% - 4px) * var(--hp) / 100);border-radius:8px;background:var(--night);opacity:.32;transition:height .7s cubic-bezier(.2,.8,.2,1)}
.hp-opp .hp-track{flex-direction:column-reverse}
.hp-opp .hp-fill{bottom:auto;top:2px;background:var(--day)}
.hp-chip{position:absolute;left:50%;top:calc(6px + (100% - 12px) * (100 - var(--hp)) / 100);transform:translate(-50%,-50%);min-width:30px;height:30px;padding:0 4px;border-radius:50%;display:grid;place-items:center;font:700 12px ui-monospace,monospace;color:var(--deep);background:#fbfaf7;border:3px solid var(--night);box-shadow:0 2px 6px #0007;z-index:2;transition:top .7s cubic-bezier(.2,.8,.2,1)}
.hp-opp .hp-chip{top:calc(100% - 6px - (100% - 12px) * (100 - var(--hp)) / 100);border-color:var(--day)}
.hp-meter.is-hit .hp-chip{animation:chip-hit .8s}
/* Center: Chronos and battle zones */
.center{grid-area:center;position:relative;display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr);min-height:0;justify-items:center;align-items:center;z-index:1}
.chronos{position:absolute;left:50%;top:50%;width:min(132%,100cqw * .62);aspect-ratio:1;transform:translate(-50%,-50%);z-index:-1;pointer-events:none;color:#d7c5e4}
.chronos svg{width:100%;height:100%;overflow:visible}
.chronos .half-night{fill:#c1afcf12;stroke:#c1afcf44;stroke-width:.4}
.chronos .half-day{fill:#e8b84a0d;stroke:#e8b84a40;stroke-width:.4}
.chronos.is-night .half-night{fill:#c1afcf24}.chronos.is-day .half-day{fill:#e8b84a1f}
.chronos .ring{fill:none;stroke:#d7c5e455;stroke-width:.4}
.chronos .orbit{fill:none;stroke:#d7c5e422;stroke-width:.3}
.chronos .axis{stroke:#d7c5e42e;stroke-width:.3}
.chronos .mark circle{fill:#d7c5e4aa}
.chronos .mark.is-night circle.cut{fill:var(--deep)}
.chronos .mark.is-day path{stroke:#d7c5e4aa;stroke-width:.6}
.chronos .mark.is-now circle{fill:var(--acid)}
.chronos #chronos-glow stop{stop-opacity:0}
.chronos.chronos-top{z-index:5}
.medal-arm{position:absolute;inset:0;transform:rotate(var(--angle));transition:transform .95s cubic-bezier(.45,.05,.2,1)}
.medal{position:absolute;left:50%;top:7%;width:14%;aspect-ratio:1;transform:translate(-50%,-50%) rotate(calc(-1 * var(--angle)));transition:transform .95s cubic-bezier(.45,.05,.2,1);display:grid;place-items:center;border-radius:50%;background:var(--acid);box-shadow:0 0 0 2px var(--deep),0 0 0 4px #d6eb9166,0 3px 8px #000a;color:var(--deep)}
.medal .icon{width:60%;height:60%}
.chronos-label{display:none}
.center>.battle-zone{position:relative;height:88%;max-height:88%;aspect-ratio:5/7;display:block;border:1px solid var(--mat-line);border-radius:6px;background:#ffffff06;min-height:0}
.battle-zone>.mat-card{position:absolute;inset:0}
.battle-zone>.zone-ghost{position:absolute;inset:0;display:grid;place-items:center}
.battle-opp{align-self:end;margin-bottom:3%}.battle-me{align-self:start;margin-top:3%}
.zone-ghost{font:600 7px ui-monospace,monospace;letter-spacing:1.5px;color:#b09bc2}
.attack-badge{position:absolute;right:-30%;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:3px;padding:3px 7px;border-radius:9px;background:#fbfaf7;color:var(--deep);font:700 14px/1 ui-monospace,monospace;white-space:nowrap;z-index:4;box-shadow:0 2px 6px #0007}
.attack-badge .icon{width:12px;height:12px;color:var(--purple)}
.battle-opp .attack-badge{right:auto;left:-30%}
/* Hand dock (original lilac hand panel) */
.turn-controls{position:relative;z-index:5;margin:0 -10px;padding:0 max(12px,env(safe-area-inset-right,0px)) max(10px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));background:#e9e2ee;border-top:1px solid #d9ccdf}
.game .turn-controls>.hand-panel,.game .hand-panel{height:auto;min-height:0;margin:0;padding:6px 0 0;border:0;background:none;box-shadow:none;display:grid;grid-template-rows:auto auto auto;gap:8px;position:relative}
.game .hand-panel>h2{display:none}
.game .hand{grid-row:auto}.game .hand-panel .hand-action{grid-row:auto}
.dock-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:26px}
.dock-title{font-size:11px;font-weight:700;color:var(--ink);display:flex;align-items:center;gap:6px;min-width:0}
.dock-title.hand-hint{color:var(--muted);font-weight:400;margin:0}
.dock-title .icon{width:14px;height:14px;color:var(--purple)}
.dock-head .perspective-tabs{display:flex;gap:3px;margin:0;padding:3px;background:#d9cde1;border-radius:10px}
.dock-head .perspective-tabs button{min-height:28px;padding:3px 9px;font-size:10px;border:0;border-radius:8px}
.dock-head .perspective-tabs button[aria-pressed="true"]{background:#fbf9fc;color:var(--purple)}
.game .hand{display:grid;grid-template-columns:repeat(var(--n),minmax(0,var(--w,84px)));justify-content:center;gap:clamp(4px,1.6vw,10px);margin:0;padding:14px 0 0;overflow:visible}
.game .hand .card{position:relative;width:auto;min-width:0;display:block;padding:0;border:0;background:none;box-shadow:none;transition:transform .22s cubic-bezier(.2,.8,.2,1)}
.game .hand .hand-select{display:block;width:100%;padding:0;border:0;min-height:0;background:none!important;border-radius:6px;outline:none}
.game .hand .hand-select img{display:block;width:100%;aspect-ratio:5/7;object-fit:cover;border-radius:6%/4.3%;box-shadow:0 4px 10px #291a3940;transition:filter .2s,box-shadow .2s}
.game .hand .hand-select:disabled{cursor:default;opacity:1}
.game .hand .card.chosen{transform:translateY(-12px)}
.game .hand .card.chosen .hand-select img{box-shadow:0 0 0 3px var(--purple),0 10px 16px #291a3955}
.game .hand .card.chosen.is-mull .hand-select img{filter:grayscale(.8) brightness(.7);box-shadow:0 0 0 3px var(--deep),0 10px 16px #291a3955}
.pick-badge{position:absolute;left:50%;top:-10px;transform:translateX(-50%);min-width:24px;height:24px;padding:0 7px;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:3px;font:700 12px/1 ui-monospace,monospace;background:var(--purple);color:#fff;box-shadow:0 2px 6px #291a3955;pointer-events:none;white-space:nowrap}
.is-mull .pick-badge{background:var(--deep);font-family:inherit;font-size:11px}
.pick-badge .icon{width:12px;height:12px}
.cost-badge{position:absolute;left:-4px;bottom:-4px;display:flex;align-items:center;gap:3px;height:24px;padding:0 7px;border-radius:12px;background:var(--purple);color:#fff;font:700 11px/1 ui-monospace,monospace;box-shadow:0 2px 5px #291a3955;pointer-events:none}
.cost-badge small{font:700 9px/1 system-ui,sans-serif;color:inherit}
.game .hand .card.is-short .hand-select img{filter:saturate(.35) brightness(.8)}
.game .hand .card.is-short .cost-badge{background:#9b2f4b}
.game .hand .card.is-short.chosen .hand-select img{filter:saturate(.5)}
.power-chip{display:inline-flex;align-items:center;gap:3px;flex:none;padding:3px 9px;border-radius:10px;background:var(--acid);color:var(--deep);font:700 12px ui-monospace,monospace}
.power-chip .icon{width:13px;height:13px}
.attack-badge.is-short{background:#9b2f4b;color:#fff}
.attack-badge.is-short .icon{color:#fff}
.hand-info{position:absolute;right:-4px;bottom:-4px;width:26px;height:26px;min-height:26px;padding:0;border-radius:50%;display:grid;place-items:center;background:#fbfaf7;border:1px solid #cabcd4;color:var(--purple)}
.hand-info .icon{width:14px;height:14px}
.game .hand-action{display:flex;align-items:center;gap:10px;margin:0;padding:0;border:0;background:none;box-shadow:none;position:static;min-height:50px}
.pick-summary{display:flex;align-items:baseline;gap:3px;min-width:0;flex:0 1 auto;font-size:11px;color:var(--muted)}
.pick-summary b{font:700 20px/1 var(--display);color:var(--ink)}
.game .primary{flex:1;justify-content:center;gap:10px;min-height:50px;border-radius:12px;font-size:14px;max-width:none}
.game .primary:disabled{opacity:.45}
.game .primary .icon{width:18px;height:18px}
.game .secondary{min-height:50px;border-radius:12px;border:1px solid var(--line);background:#fbfaf7;font-weight:700;padding:0 16px}
.game .cpu-thinking{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:50px;border-radius:12px;background:#f6f2f8;border:1px solid #d9ccdf;font-size:12px;color:var(--muted);padding:0}
.thinking-dots{display:inline-flex;gap:4px}.thinking-dots i{width:6px;height:6px;border-radius:50%;background:var(--purple);animation:dot 1s infinite}.thinking-dots i:nth-child(2){animation-delay:.15s}.thinking-dots i:nth-child(3){animation-delay:.3s}
.dock-panel{display:grid;gap:10px;padding:10px 0 0}
.dock-panel h2{margin:0;font-size:14px;display:flex;align-items:center;gap:8px}
.dock-panel h2 .icon{width:16px;height:16px;color:var(--purple)}
.dock-panel .effect{margin:4px 0 0;font-size:12px;line-height:1.7;padding:10px;max-height:22dvh;overflow:auto}
.effect-card{display:flex;gap:10px;align-items:flex-start}
.effect-card>button{flex:0 0 64px;padding:0;border:0;min-height:0;background:none}
.effect-card img{width:64px;border-radius:5px;box-shadow:0 3px 8px #291a3940}
.effect-card strong{font-size:13px}
.effect-order{display:flex;flex-wrap:wrap;gap:8px}
.effect-chip{display:flex;align-items:center;gap:8px;padding:5px 10px 5px 5px;border-radius:10px;background:#fbfaf7;min-height:48px;text-align:left;font-size:12px}
.effect-chip img{width:28px;border-radius:3px}
.adjust{font-size:11px;color:var(--muted)}
.adjust>summary{display:inline-flex;align-items:center;gap:6px;padding:4px 0;min-height:32px}
.adjust>summary .icon{width:14px;height:14px}
.adjust[open]{max-height:38dvh;overflow:auto;background:#fbfaf7;border:1px solid var(--line);border-radius:12px;padding:8px 10px}
.adjust input,.adjust select{min-height:38px;font-size:14px}
.adjust .edit-row{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:6px 0}
.adjust .edit-row label{display:grid;gap:3px;font-size:10px}
.adjust .edit-row input{width:76px}
.adjust button{min-height:38px;font-size:11px;padding:6px 10px}
.versus{display:flex;align-items:center;justify-content:center;gap:16px;font:700 30px/1 var(--display);color:var(--muted)}
.versus span{font-size:11px;letter-spacing:2px}
.versus .is-higher{color:var(--purple)}
.versus-note{margin:0;text-align:center;font-size:10px}
/* Choice */
.game .choice-panel{display:grid;gap:8px;padding:10px 0 0;border:0;background:none}
.game .choice-panel>.eyebrow{margin:0}
.game .choice-panel h2{margin:0;font-size:14px}
.game .choice-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;max-height:34dvh;overflow:auto;padding:4px}
.game .choice-card{width:68px;display:grid;gap:5px;max-width:none;flex:none}
.game .choice-art{padding:0;border:0;min-height:0;background:none}
.game .choice-art img{width:100%;border-radius:5px;box-shadow:0 3px 8px #291a3940}
.game .choice-select{min-height:30px;font-size:11px;padding:3px}
.game .choice-panel .hand-action{flex:none}
/* Covers inside the dock */
.dock-cover{display:grid;justify-items:center;gap:8px;padding:14px 0 4px;text-align:center}
.dock-cover h2{margin:0;font-size:18px}
.dock-cover p{margin:0;font-size:11px}
.dock-cover .primary{width:100%}
.exit-confirm{display:grid;gap:10px;padding:12px 0 0}
.exit-confirm h2{margin:0;font-size:15px;text-align:center}
.exit-confirm .row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.exit-confirm .danger{min-height:50px;border-radius:12px;font-weight:700}
/* Result */
.result-overlay{position:absolute;inset:0;z-index:30;display:grid;place-items:center;align-content:center;gap:14px;padding:24px;text-align:center;color:#f3eef6;background:#291a39e6;animation:fade-in .5s both}
.result-overlay .result-title{font:italic 900 clamp(42px,14vw,84px)/1 var(--display);letter-spacing:.02em;color:var(--acid);animation:result-pop .8s 1.15s cubic-bezier(.2,1.4,.3,1) both}
.result-overlay.is-loss .result-title{color:#d7c5e4}
.result-overlay p{margin:0;color:#d9c9e5;font-size:13px}
.result-overlay .row{display:grid;gap:10px;width:min(320px,100%)}
.result-overlay .primary{background:var(--acid);border-color:var(--acid);color:var(--deep)}
.result-overlay .secondary{color:var(--ink)}
.result-overlay .icon-trophy{width:52px;height:52px;color:var(--acid);animation:result-pop .8s 1.2s cubic-bezier(.2,1.4,.3,1) both}
.result-overlay.is-loss .icon-trophy{color:#d7c5e4}
/* Banners and floating numbers */
.game-banner{position:absolute;left:0;right:0;top:40%;z-index:25;display:flex;align-items:baseline;justify-content:center;gap:10px;pointer-events:none;padding:12px 0;background:linear-gradient(90deg,transparent,#291a39f0 18%,#291a39f0 82%,transparent);color:#f3eef6;animation:banner 1.3s cubic-bezier(.2,.8,.2,1) both}
.game-banner b{font:italic 900 38px/1 var(--display);letter-spacing:.04em}
.game-banner small{font:700 11px ui-monospace,monospace;letter-spacing:4px;color:#c1afcf}
.time-banner.is-night b{color:#e4d8f0}
.time-banner.is-day b{color:var(--day,#e8b84a)}
.reveal-banner b{color:var(--acid);animation:pop .8s cubic-bezier(.2,1.4,.3,1) both}
.float-text{position:absolute;z-index:26;transform:translate(-50%,-50%);font:italic 900 32px/1 var(--display);pointer-events:none;animation:float-up 1.5s cubic-bezier(.2,.8,.2,1) both;text-shadow:0 2px 0 var(--deep),0 0 6px var(--deep)}
.float-text.damage{color:#f08aa0}
.float-text.heal{color:var(--acid)}
/* Animation classes */
.deal-me{animation:deal-me .55s cubic-bezier(.2,.8,.2,1) both}
.deal-opp{animation:deal-opp .55s cubic-bezier(.2,.8,.2,1) both}
.flip-in{animation:flip-in .7s cubic-bezier(.2,.8,.2,1) both}
.summon{animation:summon .8s cubic-bezier(.2,1.2,.3,1) both}
.pulse{animation:pulse-zone .8s ease-out}
.battle-zone.is-hit{animation:hit .7s}
.battle-me.lunge{animation:lunge-up .7s cubic-bezier(.3,0,.2,1)}
.battle-opp.lunge{animation:lunge-down .7s cubic-bezier(.3,0,.2,1)}
.battle-me.clash{animation:clash-up .6s}.battle-opp.clash{animation:clash-down .6s}
.game.shake .mat{animation:shake .45s}
.game .hand .card.drawn{animation:drawn .6s cubic-bezier(.2,.8,.2,1) both}
.game .hand.is-entering .card{animation:hand-in .35s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i,0) * 40ms)}
@keyframes deal-me{from{opacity:0;transform:translateY(120%) rotate(-8deg) scale(1.2)}to{opacity:1;transform:none}}
@keyframes deal-opp{from{opacity:0;transform:translateY(-120%) rotate(8deg) scale(1.2)}to{opacity:1;transform:none}}
@keyframes flip-in{0%{transform:perspective(500px) rotateY(90deg) scale(1.12)}60%{transform:perspective(500px) rotateY(-8deg) scale(1.04)}100%{transform:none}}
@keyframes summon{0%{opacity:0;transform:scale(1.5)}60%{opacity:1;transform:scale(.97)}100%{transform:none}}
@keyframes pulse-zone{0%{box-shadow:0 0 0 0 #d6eb9199}100%{box-shadow:0 0 0 12px #d6eb9100}}
@keyframes hit{0%,100%{transform:none}20%{transform:translateX(-6%) rotate(-3deg);filter:brightness(.6)}40%{transform:translateX(5%) rotate(2deg)}60%{transform:translateX(-3%)}}
@keyframes chip-hit{0%,100%{transform:translate(-50%,-50%)}25%{transform:translate(-50%,-50%) scale(1.3)}}
@keyframes lunge-up{0%,100%{transform:none}40%{transform:translateY(-34%) scale(1.1)}55%{transform:translateY(-30%) scale(1.1)}}
@keyframes lunge-down{0%,100%{transform:none}40%{transform:translateY(34%) scale(1.1)}55%{transform:translateY(30%) scale(1.1)}}
@keyframes clash-up{0%,100%{transform:none}45%{transform:translateY(-14%)}}
@keyframes clash-down{0%,100%{transform:none}45%{transform:translateY(14%)}}
@keyframes shake{0%,100%{transform:none}20%{transform:translate(-5px,2px)}40%{transform:translate(4px,-3px)}60%{transform:translate(-3px,1px)}80%{transform:translate(2px,0)}}
@keyframes drawn{from{opacity:0;transform:translate(60%,-120%) rotate(15deg) scale(.6)}to{opacity:1;transform:none}}
@keyframes hand-in{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
@keyframes banner{0%{opacity:0;transform:translateX(-24%)}18%{opacity:1;transform:none}78%{opacity:1;transform:none}100%{opacity:0;transform:translateX(24%)}}
@keyframes pop{from{transform:scale(.4);opacity:0}to{transform:none;opacity:1}}
@keyframes result-pop{from{transform:scale(.5);opacity:0}to{transform:none;opacity:1}}
@keyframes float-up{0%{opacity:0;transform:translate(-50%,-20%) scale(.6)}20%{opacity:1;transform:translate(-50%,-60%) scale(1.1)}100%{opacity:0;transform:translate(-50%,-170%)}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@keyframes dot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
/* Landscape phones and desktop: mat left, hand panel right */
@media (min-width:900px),(orientation:landscape) and (max-height:620px){
  .game{grid-template-columns:minmax(0,1fr) minmax(300px,380px);grid-template-rows:auto auto minmax(0,1fr);column-gap:14px;padding-bottom:max(10px,env(safe-area-inset-bottom,0px))}
  .game-bar{grid-column:1/-1}
  .opp-hand{grid-column:1}
  .mat-wrap{grid-column:1;grid-row:3}
  .turn-controls{grid-column:2;grid-row:2/4;margin:0;align-self:end;border-radius:14px;border:1px solid #d9ccdf;padding:6px 14px 14px;max-height:100%;overflow:auto}
  .game .hand{--w:96px;grid-template-columns:repeat(min(var(--n),3),minmax(0,var(--w)))}
}
@media (orientation:landscape) and (max-height:620px){
  .opp-hand{height:26px}.opp-card{height:26px;width:18px}
  .game .hand{--w:64px;grid-template-columns:repeat(min(var(--n),5),minmax(0,var(--w)));padding-top:10px}
  .game .primary,.game .cpu-thinking{min-height:44px}
}
@media (prefers-reduced-motion:reduce){.medal-arm,.medal,.hp-fill,.hp-chip{transition:none}}
/* Battle log: a timeline of public actions with their cards */
.battle-log{display:grid;gap:14px;padding-bottom:8px}
.log-turn h3{position:sticky;top:-18px;z-index:2;display:flex;align-items:baseline;gap:6px;margin:0 0 8px;padding:8px 0;background:var(--paper);font:700 20px/1 var(--display);color:var(--purple)}
.log-turn h3 small{font-size:9px;letter-spacing:2px;color:var(--muted)}
.log-turn ol,.feed-toast{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.log-entry{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:12px;background:#fbfaf7;border:1px solid var(--line);border-left:4px solid var(--night);animation:log-in .35s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(min(var(--i,0),40) * 18ms)}
.log-entry.is-p1{border-left-color:var(--acid)}
.log-entry:not(.is-p0):not(.is-p1){border-left-color:var(--purple)}
.log-entry.is-damage{background:#f8eef1}
.log-cards{display:flex;flex:none}
.log-card{width:40px;min-height:0;height:auto;padding:0;border:0;background:none;margin-right:-14px;border-radius:4px;box-shadow:0 2px 6px #291a3940;transition:transform .15s}
.log-card:last-child{margin-right:0}
.log-card:hover{transform:translateY(-3px);z-index:1}
.log-card img{display:block;width:100%;aspect-ratio:5/7;object-fit:cover;border-radius:4px}
.log-card.card-back{aspect-ratio:5/7;border-width:2px}
.log-card.card-back i{font-size:12px}
.log-icon{flex:none;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:var(--lilac);color:var(--purple)}
.log-icon .icon{width:18px;height:18px}
.log-icon.is-day{background:var(--sun-soft);color:var(--sun-ink)}
.log-icon.is-result{background:var(--acid);color:var(--deep)}
.is-damage .log-icon{background:#9b2f4b;color:#fff}
.log-text{display:grid;gap:2px;min-width:0}
.log-text strong{font-size:13px;line-height:1.4}
.log-text small{font-size:11px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.log-side{display:inline-flex;align-items:center;gap:4px;font:700 9px ui-monospace,monospace;letter-spacing:1px;color:var(--muted)}
.log-side .icon{width:11px;height:11px}
.log-notes{margin:2px 0 0;font-size:10px;line-height:1.6;color:var(--muted)}
.log-dialog{max-height:86dvh}
/* Live action feed over the board */
.feed-toasts{position:absolute;left:10px;right:10px;top:max(84px,calc(env(safe-area-inset-top,0px) + 80px));z-index:20;display:grid;justify-items:center;gap:6px;pointer-events:none}
.feed-toast{width:min(360px,100%);animation:toast-drop .35s cubic-bezier(.2,.9,.3,1.2) both}
.feed-toast .log-entry{animation:none;box-shadow:0 8px 20px #291a3933;background:#fbfaf7f2;backdrop-filter:blur(6px)}
.feed-toast .log-card{pointer-events:auto}
.feed-toast.is-leaving{animation:toast-up .4s ease-in both}
@keyframes log-in{from{opacity:0;transform:translateX(-10px)}to{opacity:1;transform:none}}
@keyframes toast-drop{from{opacity:0;transform:translateY(-14px) scale(.96)}to{opacity:1;transform:none}}
@keyframes toast-up{to{opacity:0;transform:translateY(-12px)}}
/* Battle summary and post-game bar */
.battle-summary{margin:0;text-align:center;font-size:13px;font-weight:700;color:var(--muted)}
.battle-summary.is-damage{color:#9b2f4b}
.result-bar .row{display:flex;align-items:center;gap:8px}
.result-bar .row+.row>*{flex:1}
.result-mini{font:italic 900 22px/1 var(--display);color:var(--purple)}
.result-bar.is-loss .result-mini{color:#9b2f4b}
.result-bar small{flex:1;min-width:0;font-size:11px;color:var(--muted)}
.result-bar #show-result{flex:none;width:44px;min-height:44px;padding:0;display:grid;place-items:center}
.result-overlay .row{grid-template-columns:1fr}
.log-card.card-back{width:40px;flex:0 0 40px;height:auto;display:grid}
.log-dialog .sheet-head{margin-bottom:6px}
.log-turn h3{top:-18px}
/* One card back for every hidden card, using the real back image when it is available */
.card-back{position:relative;display:grid;place-items:center;aspect-ratio:5/7;border:0;border-radius:6%/4.3%;overflow:hidden;container-type:inline-size;color:#e6dcf0;background:url(/private/cards/card-back.jpg) center/cover no-repeat,radial-gradient(ellipse at 50% 40%,#5a3d86 0,#35204d 55%,#241634 100%);box-shadow:inset 0 0 0 1px #c1afcf66,0 2px 6px #0006}
.card-back i{display:grid;justify-items:center;font:italic 900 15cqw/1 var(--display);letter-spacing:.02em;font-style:italic}
.card-back i b{font:700 9cqw/1.4 ui-monospace,monospace;letter-spacing:.3em;font-style:normal}
html.has-card-back .card-back{box-shadow:0 2px 6px #0006}
html.has-card-back .card-back i{display:none}
.game .card-back,.set-slot>.card-back,.deck-stack>.card-back,.opp-card>.card-back{width:100%;flex:none}
.game .hand .card>.card-back{width:100%}
.deck-cover .cover-back{display:block}
.hidden-choice{color:#e6dcf0}
/* The opponent's cards face the opponent, as across a real table; counts and labels stay readable. */
.battle-opp .mat-card img,.set-opp .mat-card img,.set-opp .card-back,.power-opp .pile-cards img,.abyss-opp .pile-cards img,.deck-opp .card-back,.opp-card img,.opp-card .card-back{rotate:180deg}
/* Compact one-line notices over the opponent's hand row, clear of the mat */
.feed-toasts{top:max(42px,calc(env(safe-area-inset-top,0px) + 40px));gap:4px}
.feed-toast .log-entry{padding:4px 10px 4px 6px;gap:8px;min-height:40px}
.feed-toast .log-card{width:24px;margin-right:-10px}
.feed-toast .log-icon{width:28px;height:28px}
.feed-toast .log-icon .icon{width:14px;height:14px}
.feed-toast .log-text{display:flex;align-items:baseline;gap:6px;min-width:0}
.feed-toast .log-text strong{font-size:12px;white-space:nowrap}
.feed-toast .log-text small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.feed-toast .log-side,.feed-toast .log-notes{display:none}
/* Two-card play */
.set-zone.can-double .set-slot[data-slot="A"],.set-zone.can-double .set-slot[data-slot="B"]{border-color:#d6eb91aa;border-style:solid;background:#d6eb9114}
.double-badge{position:absolute;left:50%;transform:translate(-50%,-50%);top:0;z-index:4;display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:10px;background:var(--acid);color:var(--deep);font:700 10px/1 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 6px #0007;animation:pop .5s cubic-bezier(.2,1.4,.3,1) both}
.set-opp .double-badge{top:100%}
.double-badge .icon,.double-chip .icon{width:12px;height:12px}
.double-chip{display:inline-flex;align-items:center;gap:4px;flex:none;padding:3px 9px;border-radius:10px;background:var(--acid);color:var(--deep);font-size:11px;font-weight:700}
/* Drag to the set zone */
.game .hand .hand-select{touch-action:none}
.drag-ghost{position:fixed;z-index:100;pointer-events:none;border-radius:6%/4.3%;box-shadow:0 16px 32px #000a;transform:rotate(-5deg) scale(1.08)}
.game .hand .card.is-dragging{opacity:.3}
.set-me.drop-ready .set-slot[data-slot="A"],.set-me.drop-ready .set-slot[data-slot="B"]{border:2px solid var(--acid);background:#d6eb9130;box-shadow:0 0 0 4px #d6eb9133}
/* Tap-based adjustments */
.quick-edit{display:grid;gap:8px;padding:6px 0}
.qe-player{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.qe-player>strong{display:inline-flex;align-items:center;gap:4px;min-width:62px;font-size:12px}
.qe-player>strong .icon{width:14px;height:14px;color:var(--purple)}
.qe-stat{display:inline-flex;align-items:center;gap:2px;padding:2px;border-radius:10px;background:#fbfaf7;border:1px solid var(--line)}
.qe-stat small{padding:0 4px;font-size:10px;color:var(--muted)}
.qe-stat b{min-width:30px;text-align:center;font:700 13px ui-monospace,monospace}
.qe-stat button{width:30px;height:30px;min-height:30px;padding:0;display:grid;place-items:center;border-radius:8px}
.qe-stat .icon{width:14px;height:14px}
.qe-draw{min-height:34px;padding:4px 10px;font-size:11px;border-radius:9px}
.qe-label{margin:2px 0 0;font-size:11px;color:var(--muted)}
.qe-zone small{font-size:10px;color:var(--muted)}
.qe-cards{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}
.qe-card{width:38px;padding:0;min-height:0;border:0;background:none;border-radius:4px}
.qe-card img{display:block;width:100%;aspect-ratio:5/7;object-fit:cover;border-radius:4px;box-shadow:0 2px 5px #291a3940}
.qe-card[aria-pressed="true"] img{box-shadow:0 0 0 3px var(--purple);transform:translateY(-3px)}
.qe-dest{display:flex;flex-wrap:wrap;gap:6px;padding:8px;border-radius:12px;background:var(--lilac)}
.qe-dest button{min-height:36px;padding:4px 10px;font-size:11px;border-radius:9px;background:#fbfaf7}
.qe-dest .qe-cancel{background:none}
.qe-host.is-open{max-height:34dvh;overflow:auto;border-top:1px solid var(--line);padding-top:4px}
/* CPU candidates */
.log-analysis{display:grid;gap:4px;margin-top:6px;padding:6px 8px;border-radius:10px;background:var(--lilac)}
.log-analysis>small{font-size:9px;color:var(--muted)}
.candidate{display:flex;align-items:center;gap:8px}
.candidate .log-card{width:24px;margin-right:-8px}
.candidate-bar{flex:1;height:6px;border-radius:3px;background:#ffffff99;overflow:hidden}
.candidate-bar i{display:block;height:100%;background:#b09bc2}
.candidate.is-chosen .candidate-bar i{background:var(--purple)}
.candidate b{font:700 11px ui-monospace,monospace;min-width:34px;text-align:right}
.candidate em{font-style:normal;font-size:10px;font-weight:700;color:var(--purple)}
.watch-thought{display:grid;gap:2px}
.watch-thought .log-analysis{margin:0;padding:4px 8px}
.watch-thought .log-analysis>small{display:none}
/* Replay */
.replay-button{display:inline-flex;align-items:center;gap:6px;min-height:36px;margin-top:8px;padding:4px 12px;font-size:12px;border-radius:10px;background:var(--lilac);color:var(--purple);border-color:transparent}
.replay-button .icon{width:14px;height:14px}
dialog.replay-dialog{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:var(--paper)}
.replay-dialog #detail-body{height:100%}
.replay-dialog .close{position:absolute;top:max(10px,env(safe-area-inset-top,0px));right:12px;z-index:5;width:40px;height:40px;min-height:40px;padding:0;border-radius:50%}
.replay{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:8px;padding:max(12px,env(safe-area-inset-top,0px)) 12px max(12px,env(safe-area-inset-bottom,0px))}
.replay-head{display:flex;align-items:baseline;gap:10px;padding-right:48px}
.replay-head .eyebrow{display:flex;align-items:center;gap:4px;margin:0}
.replay-head .eyebrow .icon{width:13px;height:13px}
.replay-head strong{font:700 18px var(--display);color:var(--purple)}
.replay-head span{margin-left:auto;font:700 12px ui-monospace,monospace;color:var(--muted)}
.replay-entries{list-style:none;margin:0;padding:0;display:grid;gap:6px;max-height:24dvh;overflow:auto}
.replay-empty{padding:10px;text-align:center;font-size:12px;color:var(--muted)}
.replay-controls{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.replay-controls button,.replay-controls button.primary{min-height:48px;padding:0;display:grid;place-items:center;place-content:center;border-radius:12px;gap:0}
.replay-range{width:100%;accent-color:var(--purple)}
/* Reduced motion */
.reduce-motion .game *,.reduce-motion .game{animation-duration:1ms!important;animation-delay:0s!important;transition-duration:1ms!important}
/* Power charger / abyss sheet: compact card grid */
dialog.sheet-dialog .zone-card-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:12px 10px;margin:0}
.zone-card-list>button{position:relative;display:grid;align-content:start;gap:5px;padding:0;border:0;background:none;min-height:0;text-align:left;border-radius:6%/4.3%}
.zone-card-list>button img{display:block;width:100%;aspect-ratio:5/7;object-fit:cover;border-radius:6%/4.3%;box-shadow:0 3px 8px #291a3940;transition:transform .15s}
.zone-card-list>button:hover img{transform:translateY(-3px)}
.zone-card-list>button span{font-size:10px;line-height:1.35;overflow-wrap:anywhere}
.zone-power{position:absolute;right:4px;top:4px;padding:1px 6px;border-radius:8px;background:var(--acid);color:var(--deep);font:700 11px ui-monospace,monospace}
.zone-total{display:inline-flex;align-items:center;gap:4px;margin-top:8px;padding:4px 10px;border-radius:10px;background:var(--acid);color:var(--deep);font-size:12px}
.zone-total .icon{width:14px;height:14px}
.sheet-head h2 small{font-size:13px;font-weight:400;color:var(--muted)}
/* Result bar under the final hand */
.game .result-bar{display:grid;gap:8px;padding-top:2px}
/* Attack breakdown during battle */
.breakdown-pair{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.attack-breakdown{display:grid;gap:2px;padding:6px 8px;border-radius:10px;background:#fbfaf7;border:1px solid var(--line);align-content:start}
.attack-breakdown>span{display:flex;justify-content:space-between;align-items:baseline;gap:6px;min-width:0}
.attack-breakdown small{font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.attack-breakdown b{font:700 11px ui-monospace,monospace;flex:none}
.attack-breakdown .is-plus b{color:#4f6b14}.attack-breakdown .is-minus b{color:#9b2f4b}
.attack-breakdown .is-total{border-top:1px solid var(--line);padding-top:3px;margin-top:1px}
.attack-breakdown .is-total b{font-size:14px;color:var(--purple)}
.attack-breakdown .is-shield small,.attack-breakdown .is-shield b{color:var(--muted)}
.attack-breakdown.is-short{background:#f8e3e8;border-color:#e7b7c3}
.attack-breakdown.is-short small{white-space:normal;color:#8f2f4a}
/* Keep the board readable: the panel scrolls instead of shrinking the mat */
@media (max-width:899px) and (orientation:portrait){.turn-controls{max-height:46dvh;overflow-y:auto;overscroll-behavior:contain}}
.watch-thoughts{border-radius:10px;background:#fbfaf7;border:1px solid var(--line);padding:0 10px}
.watch-thoughts>summary{display:flex;align-items:center;gap:6px;min-height:38px;font-size:12px;font-weight:700}
.watch-thoughts>summary .icon{width:14px;height:14px;color:var(--purple)}
.watch-thoughts[open]{padding-bottom:8px}
.attack-breakdown.is-plain{padding:4px 8px}
.attack-breakdown.is-plain .is-total{border:0;padding:0;margin:0}
/* Chronos: played clock values are added up while the medal steps */
.clock-sum{position:absolute;left:50%;top:50%;z-index:6;transform:translate(-50%,-50%);display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:14px;background:#fbfaf7f2;color:var(--deep);box-shadow:0 6px 18px #0008;white-space:nowrap;animation:pop .35s cubic-bezier(.2,1.4,.3,1) both;font-size:11px}
.clock-sum span{display:inline-flex;align-items:center;gap:3px}
.clock-sum{max-width:calc(100vw - 32px);flex-wrap:wrap;justify-content:center;white-space:normal}
.clock-sum .clock-phase-label{font-size:10px}
.clock-sum .icon{width:12px;height:12px}
.clock-sum b{font:700 13px ui-monospace,monospace;color:var(--purple)}
.clock-sum .plus{font-weight:700;color:var(--muted)}
.clock-count{min-width:34px;padding:2px 6px;border-radius:9px;background:var(--acid);font:800 15px ui-monospace,monospace;text-align:center}
.clock-count.tick{animation:pop .22s ease-out}
.clock-sum.is-done{animation:fade-out .6s ease-in forwards}
@keyframes fade-out{to{opacity:0;transform:translate(-50%,-70%)}}
/* Mulligan: exchanged cards return to the deck */
.game .hand .card.mull-out{animation:mull-out .5s cubic-bezier(.5,0,.75,0) forwards}
@keyframes mull-out{to{opacity:0;transform:translate(40%,-160%) rotate(18deg) scale(.5)}}
.opp-card.opp-redeal{animation:opp-redeal .7s cubic-bezier(.2,.8,.2,1) both}
@keyframes opp-redeal{0%{opacity:0;translate:0 -30px}100%{opacity:1;translate:0 0}}
/* Cards travelling between zones */
.flying-card{position:fixed;left:0;top:0;z-index:90;pointer-events:none;border-radius:6%/4.3%;overflow:hidden;box-shadow:0 10px 24px #000a;will-change:transform}
.flying-card img{display:block;width:100%;height:100%;object-fit:cover}
.flying-card .card-back{width:100%;height:100%}
/* Position with the translate property so the pop/fade animations (transform) keep it centred */
.clock-sum{transform:none;translate:-50% -50%}
.clock-sum.is-done{animation:clock-sum-out .6s ease-in forwards}
@keyframes clock-sum-out{to{opacity:0;translate:-50% -80%}}
/* CPU candidates stay visible while spectating */
.watch-thoughts{display:grid;gap:4px;padding:6px 10px 8px}
.watch-thoughts>h3{display:flex;align-items:center;gap:6px;margin:0;font-size:12px}
.watch-thoughts>h3 .icon{width:14px;height:14px;color:var(--purple)}
.set-slot{grid-template-columns:minmax(0,1fr)}
.set-zone{place-items:stretch}.set-slot{place-items:center}
/* Phone layout: the main action stays in view while the dock scrolls, and hands that cannot be played this step shrink. */
.feed-toast .log-card:last-child{margin-right:0}
.nameplate.is-night .icon{color:var(--purple)}
.game .turn-controls .hand-action{position:sticky;bottom:0;z-index:3;background:#e9e2ee;padding:6px 0 0;margin-top:-6px}
.game .hand-panel.is-compact{gap:6px}
.game .hand-panel.is-compact .hand{--w:46px;padding-top:2px}
.game .hand-panel.is-compact .hand-hint{display:none}
.game[data-stage="battle"] .versus,.game[data-stage="end"] .versus{margin:0}
.game[data-stage="battle"] .versus strong,.game[data-stage="end"] .versus strong{font-size:26px}
@media (max-width:400px){
  .game-bar,.game-tools{gap:4px}
  .game-bar .icon-button,.game-tools button{width:34px;height:34px;min-height:34px}
  .turn-chip{padding:4px 8px}
}
/* Hint sheet: up to three ranked moves with their evaluation */
.hint-profile{grid-template-columns:repeat(2,1fr);margin-bottom:10px}
.hint-progress{display:grid;gap:6px;justify-items:center;padding:18px 0;font-size:12px;color:var(--muted)}
.hint-progress progress{width:100%}
.hint-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.hint-row{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"rank cards body apply";align-items:center;gap:6px 10px;padding:10px;border-radius:12px;background:#fbfaf7;border:1px solid var(--line)}
.hint-row.is-best{border-color:var(--purple);box-shadow:0 0 0 1px var(--purple)}
.hint-rank{grid-area:rank;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--lilac);color:var(--purple);font:700 14px ui-monospace,monospace}
.hint-row.is-best .hint-rank{background:var(--purple);color:#fff}
.hint-cards{grid-area:cards;display:flex}
.hint-cards .log-card{width:34px;margin-right:-8px}
.hint-cards .log-card:last-child{margin-right:0}
.hint-body{grid-area:body;display:grid;gap:4px;min-width:0}
.hint-body strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.hint-score{display:flex;align-items:baseline;gap:8px}
.hint-score b{font:700 18px/1 var(--display);color:var(--purple)}
.hint-score small{font-size:11px;color:var(--muted)}
.hint-apply{grid-area:apply;min-height:40px;padding:0 12px;font-size:12px;border-radius:10px;border:1px solid var(--line);background:#fff;font-weight:700}
.hint-note{font-size:11px;line-height:1.6;margin:10px 0 0}
.hint-empty{padding:16px 0}
.game-tools .hint-button{color:var(--purple)}
@media (max-width:899px) and (orientation:portrait){.game{grid-template-columns:minmax(0,1fr)}.game-bar{min-width:0}}
/* Spectator: CPU candidates above the board instead of inside the dock */
.game{grid-template-rows:auto auto auto minmax(0,1fr) auto}
.thought-strip:empty{margin-top:-4px}
.watch-top{display:grid;gap:3px;padding:4px 8px;border-radius:10px;background:#fbfaf7;border:1px solid var(--line)}
.watch-top-title{display:flex;align-items:center;gap:4px;font-size:10px;font-weight:700;color:var(--muted)}
.watch-top-title .icon{width:12px;height:12px;color:var(--purple)}
.thought-row{display:flex;align-items:center;gap:8px;min-width:0}
.thought-row .log-side{flex:0 0 46px}
.thought-pick{display:inline-flex;align-items:center;gap:3px;padding:2px 6px 2px 3px;border-radius:8px;opacity:.7}
.thought-pick.is-chosen{background:var(--lilac);opacity:1}
.thought-pick b{font:700 10px ui-monospace,monospace;color:var(--purple)}
.thought-pick .log-card{width:20px;margin-right:-6px}
.thought-pick .log-card:last-child{margin-right:0}
.cost-badge,.cost-badge small{white-space:nowrap}
@media (min-width:900px),(orientation:landscape) and (max-height:620px){
  .game{grid-template-rows:auto auto auto minmax(0,1fr)}
  .thought-strip{grid-column:1}
  .mat-wrap{grid-row:4}
  .turn-controls{grid-row:2/5}
}
/* Night-side seat at the bottom: the moon half and midnight face that player. Rotation keeps the medal moving clockwise. */
.mat.seat-night .chronos{transform:translate(-50%,-50%) rotate(180deg)}
.mat.seat-night .medal{transform:translate(-50%,-50%) rotate(calc(-180deg - var(--angle)))}
.thought-score{margin-left:4px;font:700 11px ui-monospace,monospace;font-style:normal;color:var(--ink)}
.candidate-score{font:700 11px ui-monospace,monospace;min-width:44px;text-align:right;color:var(--ink)}
.watch-top.is-bottom{margin-top:6px}
/* On-board cues: the acting card glows and its change rises from it */
.mat-card.cue-glow,.battle-zone.cue-glow{animation:cue-glow 1.2s ease-out}
@keyframes cue-glow{0%{filter:none;box-shadow:none}25%{filter:brightness(1.35);box-shadow:0 0 0 3px var(--acid),0 0 18px var(--acid)}100%{filter:none;box-shadow:none}}
.cue-label{position:absolute;z-index:26;transform:translate(-50%,-50%);padding:4px 9px;border-radius:10px;background:#291a39e6;color:#f3eef6;font:700 12px/1.2 system-ui,sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 2px 8px #0007;animation:cue-rise 1.6s cubic-bezier(.2,.8,.2,1) both}
.cue-label.cue-up{color:var(--acid)}
.cue-label.cue-down{color:#f3a3b5}
.cue-label.cue-shield{color:#bfe3ff}
.cue-label.cue-effect{border:1px solid var(--acid)}
@keyframes cue-rise{0%{opacity:0;transform:translate(-50%,-20%) scale(.7)}18%{opacity:1;transform:translate(-50%,-60%) scale(1.05)}75%{opacity:1;transform:translate(-50%,-110%)}100%{opacity:0;transform:translate(-50%,-140%)}}
.feed-toasts{display:none}
/* Battle values live on the mat: the higher attack glows, reduction sits under it */
button.attack-badge{min-height:0;height:auto;border:0;margin:0;cursor:pointer;font:700 14px/1 ui-monospace,monospace}
.attack-badge.is-higher{background:var(--acid);color:var(--deep);box-shadow:0 0 0 2px #fff8,0 0 16px var(--acid);animation:pop .5s cubic-bezier(.2,1.4,.3,1) both}
.attack-badge.is-higher .icon{color:var(--deep)}
.shield-badge{position:absolute;right:-30%;top:calc(50% + 18px);z-index:4;padding:2px 6px;border-radius:8px;background:#bfe3ff;color:var(--deep);font:700 10px/1.2 system-ui,sans-serif;white-space:nowrap;box-shadow:0 2px 6px #0006}
.battle-opp .shield-badge{right:auto;left:-30%;top:auto;bottom:calc(50% + 18px)}
.sheet-dialog .breakdown-pair{display:grid;gap:10px}
/* Two-card play: the B card that did not appear is dimmed and labelled */
.set-card.is-clock-only img{filter:saturate(.35) brightness(.7)}
.clock-only-tag{position:absolute;left:50%;bottom:4%;transform:translateX(-50%);z-index:3;padding:2px 5px;border-radius:6px;background:#291a39e6;color:#d7c5e4;font:700 8px/1.2 system-ui,sans-serif;white-space:nowrap;pointer-events:none}
.set-opp .clock-only-tag{bottom:auto;top:4%}
/* Post-match review: one row per own set, the largest gaps marked as turning points */
.review-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.review-row{display:grid;gap:8px;padding:10px;border-radius:12px;background:#fbfaf7;border:1px solid var(--line)}
.review-row.is-turning{border-color:#9b2f4b;box-shadow:0 0 0 1px #9b2f4b}
.review-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px}
.review-head b{font:700 13px ui-monospace,monospace;color:var(--purple)}
.review-head span{display:inline-flex;align-items:center;gap:4px}
.review-head .icon{width:12px;height:12px}
.review-head em{font-style:normal;font-size:10px;font-weight:700;padding:2px 6px;border-radius:6px;background:#9b2f4b;color:#fff}
.review-verdict{margin-left:auto;font-weight:700}
.review-moves{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}
.review-moves>div{display:grid;gap:4px}
.review-moves small{font-size:10px;color:var(--muted)}
.review-practice{margin-left:auto;min-height:38px;padding:0 10px;border-radius:10px;border:1px solid var(--line);background:#fff;font-size:12px;font-weight:700;display:inline-flex;align-items:center;gap:4px}
.review-practice .icon{width:14px;height:14px}
/* The three banners share one band: same height, label and lettering size */
.game-banner{padding:8px 0;min-height:48px;align-items:center}
.game-banner b{font-size:28px;line-height:1}
.game-banner small{min-width:40px;text-align:right}
.turn-banner b{color:#f3eef6}
