:root {
  color-scheme: dark;
  --bg: #090b0c;
  --panel: #14191a;
  --text: #f2efd9;
  --muted: #aeb8b1;
  --gold: #e8c24d;
  --enemy: #d43f38;
  --player: #26a7f2;
  --green: #67bc7b;
  --shadow: rgba(0, 0, 0, 0.46);
  --mat-w: 1600px;
  --mat-h: 982px;
  --tile-w: 112px;
  --tile-h: 150px;
  --gap: 24px;
  --slot-border: 6px;
}

* { box-sizing: border-box; }
html { width: 100%; height: 100%; overflow: clip; }
body {
  margin: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: clip;
  background: linear-gradient(rgba(7, 10, 11, 0.74), rgba(7, 10, 11, 0.9)), url("assets/Hero's Commission/Forest of The Beasts.png") center / cover fixed;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}
button { border: 1px solid rgba(242, 239, 217, 0.26); border-radius: 4px; color: var(--text); cursor: pointer; font: inherit; transition: transform 90ms ease, filter 90ms ease, box-shadow 90ms ease, border-color 120ms ease, background 120ms ease; }
button:hover:not(:disabled) { border-color: rgba(232, 194, 77, 0.82); background-color: rgba(232, 194, 77, 0.14); box-shadow: 0 0 0 1px rgba(232, 194, 77, 0.2), 0 0 18px rgba(232, 194, 77, 0.16); filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(2px) scale(0.985); filter: brightness(0.9); }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.app-shell { position: fixed; left: 50%; top: 50%; display: grid; grid-template-columns: 1600px 340px; gap: 10px; width: 1960px; height: 1120px; min-height: 1120px; padding: 10px; transform: translate(-50%, -50%) scale(var(--app-scale, 1)); transform-origin: center; }
.tabletop, .side-panel, .comms-panel { border: 1px solid rgba(232, 194, 77, 0.22); background: rgba(13, 16, 17, 0.92); box-shadow: 0 20px 60px var(--shadow); }
.tabletop { display: grid; grid-template-rows: 88px var(--mat-h); align-content: start; gap: 10px; height: 1100px; min-height: 1100px; padding: 10px; overflow: hidden; }
.topbar, .stage-bar, .control-strip, .center-strip, .stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar { display: grid; grid-template-columns: 190px 82px minmax(0, 1fr); min-width: var(--mat-w); height: 88px; align-items: stretch; }
.table-title { align-self: center; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.9rem; line-height: 1; }
h2 { font-size: 1.05rem; }
.eyebrow { color: var(--gold); font-size: 0.7rem; letter-spacing: 0; text-transform: uppercase; }
.round-box, .stage-bar { border: 1px solid rgba(232, 194, 77, 0.34); border-radius: 4px; background: linear-gradient(180deg, rgba(30, 37, 38, 0.92), rgba(10, 13, 14, 0.92)); }
.round-box { display: grid; align-content: center; min-width: 80px; padding: 8px; text-align: center; }
.round-box strong { color: var(--gold); font-size: 1.8rem; line-height: 1; }
.stage-bar { display: grid; grid-template-columns: minmax(0, 1fr) 142px; grid-template-rows: minmax(0, 1fr) 26px; align-items: center; min-width: 0; padding: 8px; }
.stage-copy { min-width: 0; }
.stage-bar p:last-of-type { max-width: 700px; color: var(--muted); line-height: 1.12; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-bar .primary-command { width: 132px; min-height: 40px; padding: 0 10px; justify-self: end; }
.stage-track { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-top: 4px; }
.stage-chip { min-height: 20px; padding: 3px 5px; border: 1px solid rgba(242, 239, 217, 0.18); border-radius: 3px; background: rgba(255,255,255,0.06); color: var(--muted); font-size: 0.58rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-chip.active { border-color: rgba(232, 194, 77, 0.82); background: linear-gradient(180deg, #d4ad35, #795820); color: #171009; font-weight: 700; }
.stage-chip.past { color: var(--text); background: rgba(104, 167, 216, 0.18); }

.duel-mat {
  position: relative;
  width: var(--mat-w);
  height: var(--mat-h);
  min-width: var(--mat-w);
  min-height: var(--mat-h);
  border: 1px solid rgba(242, 239, 217, 0.12);
  border-radius: 4px;
  background: rgba(246, 246, 240, 0.96);
  overflow: hidden;
  flex: none;
}
.sequence-cycle-button {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 180;
  width: 118px;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(232, 194, 77, 0.58);
  background: linear-gradient(180deg, rgba(16,21,22,0.96), rgba(7,10,11,0.94));
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(255,255,255,0.04);
}
.sequence-cycle-button::before {
  content: "SEQ";
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 18px;
  border-radius: 999px;
  background: rgba(232,194,77,0.18);
  color: var(--gold);
  font-size: 0.52rem;
  letter-spacing: 0;
}
.sequence-cycle-button[data-mode="manual"] { border-color: rgba(38,167,242,0.72); box-shadow: 0 10px 24px rgba(0,0,0,0.42), 0 0 22px rgba(38,167,242,0.24); }
.sequence-cycle-button[data-mode="manual"]::before { background: rgba(38,167,242,0.22); color: #aee1ff; }
.sequence-cycle-button[data-mode="bluff"] { border-color: rgba(103,188,123,0.74); box-shadow: 0 10px 24px rgba(0,0,0,0.42), 0 0 24px rgba(103,188,123,0.24); }
.sequence-cycle-button[data-mode="bluff"]::before { background: rgba(103,188,123,0.22); color: #c9ffd2; }
.sequence-cycle-button[data-mode="off"] { border-color: rgba(212,63,56,0.68); color: #ffd7d4; box-shadow: 0 10px 24px rgba(0,0,0,0.42), 0 0 20px rgba(212,63,56,0.22); }
.sequence-cycle-button[data-mode="off"]::before { background: rgba(212,63,56,0.2); color: #ffc7c2; }
.zone { position: absolute; display: grid; gap: var(--gap); }
.hand-zone { grid-auto-flow: column; grid-auto-columns: var(--tile-w); grid-template-rows: var(--tile-h); }
.single-zone { grid-auto-flow: column; grid-auto-columns: var(--tile-w); grid-template-rows: var(--tile-h); width: max-content; min-width: var(--tile-w); height: var(--tile-h); transform: translateX(-50%); }
.matrix-zone { grid-template-columns: repeat(3, var(--tile-w)); grid-template-rows: var(--tile-h); }
.enemy-zone .slot, .enemy-zone .card-tile { border-color: var(--enemy); }
.player-zone .slot, .player-zone .card-tile { border-color: var(--player); }

.hud-panel { position: absolute; z-index: 120; display: flex; gap: 6px; padding: 4px; border: 1px solid rgba(232,194,77,0.48); background: rgba(9,12,13,0.9); box-shadow: 0 8px 22px rgba(0,0,0,0.42); font-family: Arial, sans-serif; }
.hud-panel span { min-width: 82px; padding: 3px 6px; border: 1px solid rgba(242,239,217,0.14); background: rgba(255,255,255,0.07); color: var(--muted); text-align: center; font-size: 0.66rem; text-transform: uppercase; }
.hud-panel b { color: var(--text); font-size: 0.82rem; }
.enemy-hud { top: 14px; right: 14px; border-color: rgba(212,63,56,0.62); }
.player-hud { left: 14px; bottom: 8px; border-color: rgba(38,167,242,0.62); }

.enemy-hand-zone { top: -56px; left: 50%; transform: translateX(-50%); z-index: 70; display: block; width: 680px; height: 164px; overflow: visible; --gap: 0px; }
.enemy-hand-zone .slot, .enemy-hand-zone .card-tile { position: absolute; left: var(--hand-left); top: 0; z-index: var(--hand-z); transform: translateY(var(--hand-y)) rotate(calc(180deg + var(--hand-angle))); transform-origin: 50% 50%; }
.enemy-deck-zone { top: 120px; left: 350px; }
.enemy-treasury-zone { top: 120px; left: 220px; }
.enemy-forbidden-zone { top: 310px; left: 220px; }
.enemy-void-zone { top: 310px; left: 350px; }
.enemy-action-zone { top: 135px; left: 1210px; }
.enemy-side-zone { top: 325px; left: 1210px; }
.enemy-coin-zone { top: 180px; left: 950px; }
.enemy-support-zone { top: 350px; left: 950px; }
.enemy-combat-zone { top: 520px; left: 950px; }
.player-combat-zone { top: 180px; left: 670px; }
.player-support-zone { top: 360px; left: 670px; }
.player-coin-zone { top: 540px; left: 670px; }
.player-side-zone { top: 520px; left: 24px; }
.player-action-zone { top: 710px; left: 24px; }
.player-void-zone { top: 520px; left: 1260px; }
.player-forbidden-zone { top: 520px; left: 1390px; }
.player-deck-zone { top: 710px; left: 1260px; }
.player-treasury-zone { top: 710px; left: 1390px; }
.field-zone { top: 440px; left: 800px; z-index: 74; border-color: var(--gold); }
.field-zone .slot, .field-zone .card-tile { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,194,77,0.28), 0 8px 22px rgba(0,0,0,0.42); }
.battle-compare { position: absolute; left: 50%; top: 372px; transform: translate(-50%, -50%); z-index: 80; width: 126px; min-height: 58px; display: grid; gap: 3px; padding: 5px; border: 1px solid rgba(232,194,77,0.68); background: rgba(10,13,14,0.86); color: var(--text); font-family: Arial, sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,0.38); pointer-events: none; }
.battle-compare-row { display: grid; grid-template-columns: 32px 1fr 1fr; align-items: center; gap: 3px; font-size: 0.58rem; }
.battle-compare-row strong { color: var(--gold); font-size: 0.58rem; }
.battle-compare-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.battle-compare-stat { min-width: 0; padding: 2px 2px; border: 1px solid rgba(242,239,217,0.18); background: rgba(255,255,255,0.07); text-align: center; font-weight: 800; }
.stage-banner { position: absolute; left: 50%; top: 50%; z-index: 820; transform: translate(-50%, -50%) scale(0.96); min-width: 260px; padding: 12px 20px; border-top: 2px solid rgba(232,194,77,0.9); border-bottom: 2px solid rgba(232,194,77,0.9); background: linear-gradient(90deg, rgba(0,0,0,0), rgba(10,13,14,0.94), rgba(0,0,0,0)); color: var(--gold); font-family: Arial, sans-serif; font-size: 1.28rem; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: 0; text-shadow: 0 2px 12px #000; pointer-events: none; opacity: 0; }
.stage-banner.show { animation: stage-flash 820ms ease both; }
@keyframes stage-flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.88); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); } }
.screen-feedback { position: fixed; left: 50%; top: 50%; z-index: 1400; min-width: 260px; max-width: min(520px, calc(100vw - 40px)); padding: 12px 22px; border: 1px solid rgba(232,194,77,0.76); background: linear-gradient(180deg, rgba(20,24,25,0.97), rgba(7,10,11,0.96)); color: var(--text); font-family: Arial, sans-serif; font-size: 0.92rem; font-weight: 900; text-align: center; text-transform: uppercase; box-shadow: 0 20px 70px rgba(0,0,0,0.68), 0 0 32px rgba(232,194,77,0.22); pointer-events: none; opacity: 0; transform: translate(-50%, -50%) translateY(-18px) scale(0.96); }
.screen-feedback[data-tone="ok"] { border-color: rgba(125,224,143,0.78); box-shadow: 0 20px 70px rgba(0,0,0,0.68), 0 0 34px rgba(125,224,143,0.18); }
.screen-feedback[data-tone="warn"] { border-color: rgba(255,209,102,0.84); color: #fff0ad; }
.screen-feedback.show { animation: screen-feedback-pan 1650ms ease both; }
@keyframes screen-feedback-pan { 0% { opacity: 0; transform: translate(-50%, -50%) translateY(-22px) scale(0.94); } 14% { opacity: 1; transform: translate(-50%, -50%) translateY(-4px) scale(1.02); } 72% { opacity: 1; transform: translate(-50%, -50%) translateY(22px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) translateY(54px) scale(0.98); } }

.duel-mat.targeting::before { content: ""; position: absolute; inset: 0; z-index: 250; background: rgba(0,0,0,0.50); pointer-events: none; }
.duel-mat.targeting .card-tile:not(.target-relevant) { filter: brightness(0.34) saturate(0.65); }
.duel-mat.targeting .card-tile.target-relevant { z-index: 270; filter: brightness(1.18) saturate(1.18); outline: 4px solid rgba(242,211,78,0.98); outline-offset: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,0.18), 0 0 24px rgba(242,211,78,0.95); }
.duel-mat.targeting .card-tile.target-selected { outline-color: #fff7a4; box-shadow: 0 0 0 6px rgba(255,247,164,0.45), 0 0 32px rgba(255,247,164,1), 0 0 70px rgba(38,167,242,0.88); filter: brightness(1.42) saturate(1.35); animation: target-majesty 900ms ease-in-out infinite alternate; }
@keyframes target-majesty { from { transform: scale(1); } to { transform: scale(1.045); } }

.player-hand-zone { top: 790px; left: 50%; transform: translateX(-50%); display: block; width: 608px; height: 212px; overflow: visible; --tile-w: 128px; --tile-h: 190px; --gap: 0px; }
.player-hand-zone .card-tile { position: absolute; left: var(--hand-left); top: 0; z-index: var(--hand-z); transform: translateY(var(--hand-y)) rotate(var(--hand-angle)); transform-origin: 50% 100%; transition: transform 140ms ease, z-index 140ms ease; }
.player-hand-zone .card-tile:hover, .player-hand-zone .card-tile.selected { z-index: 200; transform: translateY(calc(var(--hand-y) - 18px)) rotate(var(--hand-angle)); }
.player-hand-zone .card-tile.card-draw-reveal { opacity: 0; animation: hand-draw-reveal 360ms cubic-bezier(0.18,0.82,0.24,1) var(--draw-reveal-delay, 0ms) both; }
.hand-zone .card-tile.hand-public-reveal { animation: hand-public-reveal 2000ms ease both; }
@keyframes hand-draw-reveal { 0% { opacity: 0; filter: brightness(1.9) blur(2px); box-shadow: 0 0 0 rgba(232,194,77,0); } 58% { opacity: 1; filter: brightness(1.35) blur(0); box-shadow: 0 0 28px rgba(232,194,77,0.5); } 100% { opacity: 1; filter: brightness(1); box-shadow: 0 6px 16px rgba(0,0,0,0.35); } }
@keyframes hand-public-reveal { 0% { filter: brightness(1.65) saturate(1.18); box-shadow: 0 0 0 2px rgba(255,255,255,0.22), 0 0 34px rgba(232,194,77,0.72); } 18% { filter: brightness(1.22) saturate(1.08); box-shadow: 0 0 0 2px rgba(232,194,77,0.62), 0 0 28px rgba(38,167,242,0.46); } 82% { filter: brightness(1.12) saturate(1.05); box-shadow: 0 0 0 2px rgba(232,194,77,0.48), 0 0 22px rgba(232,194,77,0.34); } 100% { filter: brightness(1); box-shadow: 0 6px 16px rgba(0,0,0,0.35); } }

.slot, .card-tile {
  position: relative;
  width: var(--tile-w);
  height: var(--tile-h);
  border: var(--slot-border) solid #111;
  border-radius: 0;
  background:
    linear-gradient(170deg, transparent 0 58%, rgba(0, 0, 0, 0.62) 59% 64%, transparent 65%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 4px, transparent 4px 24px),
    linear-gradient(160deg, #2f3232, #171919 52%, #070808);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  overflow: hidden;
}
.slot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24%;
  background: rgba(0,0,0,0.52);
  border-top: 4px solid rgba(0,0,0,0.62);
}
.hidden-card { background:
  linear-gradient(170deg, transparent 0 58%, rgba(0, 0, 0, 0.62) 59% 64%, transparent 65%),
  repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 4px, transparent 4px 24px),
  linear-gradient(160deg, #333737, #181b1b 52%, #080909);
}
.card-tile.hidden-card { background: url("assets/Card Style/Card Back.png?v=20260706b") center / cover no-repeat; }
.card-tile { padding: 0; cursor: pointer; }
.card-tile.selected { outline: 3px solid var(--gold); outline-offset: 2px; }
.card-tile.frozen-card::before { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; background: linear-gradient(135deg, rgba(206,244,255,0.3), rgba(64,172,242,0.16) 42%, rgba(255,255,255,0.2)); mix-blend-mode: screen; }
.card-tile.frozen-card::after { content: ""; position: absolute; inset: 4px; z-index: 9; pointer-events: none; border: 2px solid rgba(177,237,255,0.78); box-shadow: inset 0 0 20px rgba(177,237,255,0.42), 0 0 18px rgba(64,172,242,0.48); background: repeating-linear-gradient(135deg, rgba(255,255,255,0.22) 0 2px, transparent 2px 16px); opacity: 0.82; }
.card-tile.card-placed { animation: place-card 680ms cubic-bezier(0.2, 0.78, 0.24, 1) var(--place-delay, 0ms) both; }
.card-tile.card-placed.card-place-wait { opacity: 1; filter: brightness(0.78); }
@keyframes place-card { 0% { opacity: 1; transform: translateY(-18px) scale(0.94); filter: brightness(1.45); } 70% { opacity: 1; transform: translateY(4px) scale(1.04); filter: brightness(1.14); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); } }
.card-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-tile .mini-stat, .card-tile .coin-badge { display: none; }
.sequence-link-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 12;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,247,164,0.94);
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff7a4, #e8c24d 52%, #6f3d08 100%);
  color: #140c02;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.56), 0 0 18px rgba(232,194,77,0.72);
  pointer-events: none;
}
.zone[data-zone-count]::after {
  content: attr(data-zone-count);
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 35;
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) scale(0.86);
  border: 2px solid rgba(255,255,255,0.92);
  border-radius: 999px;
  background: rgba(6,8,9,0.78);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 8px #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease;
}
.zone[data-zone-count]:hover::after, .zone-counts-on .zone[data-zone-count]::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.unit-meta { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; align-items: end; justify-content: space-between; gap: 4px; pointer-events: none; }
.equip-stack { position: absolute; right: -5px; top: 8px; z-index: 6; display: grid; gap: 2px; pointer-events: none; }
.equip-mini { width: 28px; height: 40px; border: 2px solid rgba(232,194,77,0.9); background: rgba(10,13,14,0.92); box-shadow: 0 0 12px rgba(232,194,77,0.55); transform: translateX(calc(var(--equip-index) * -5px)); }
.equip-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unit-stats { display: inline-flex; align-items: center; gap: 2px; min-width: 38px; padding: 2px 4px; border: 1px solid rgba(0,0,0,0.58); background: rgba(0,0,0,0.78); font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 800; line-height: 1; text-shadow: 0 1px 2px #000; }
.stat-even { color: #fff; }
.stat-up { color: #f2d34e; }
.stat-down { color: #ff5b58; }
.status-badge { display: inline-flex; align-items: center; gap: 3px; max-width: 58px; padding: 2px 4px; border: 1px solid rgba(232,194,77,0.7); background: rgba(11,13,14,0.84); color: var(--gold); font-family: Arial, sans-serif; font-size: 0.54rem; font-weight: 800; line-height: 1; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.status-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge b { color: #fff; font-size: 0.62rem; }
.inspect-line { display: block; margin-top: 6px; }
.inspect-statuses { display: block; margin-top: 6px; color: var(--text); }
.card-menu { position: fixed; z-index: 650; min-width: 190px; max-width: min(320px, calc(100vw - 24px)); display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(232,194,77,0.56); border-radius: 6px; background: rgba(13,16,17,0.98); box-shadow: 0 18px 44px rgba(0,0,0,0.58); }
.card-menu[hidden] { display: none; }
.card-menu h3 { font-size: 0.86rem; color: var(--gold); line-height: 1.12; }
.card-menu p { color: var(--muted); font-size: 0.76rem; line-height: 1.18; }
.card-menu button { min-height: 34px; padding: 7px 9px; background: rgba(255,255,255,0.08); text-align: left; }
.card-menu button:hover { border-color: rgba(232,194,77,0.78); background: rgba(232,194,77,0.16); }
.card-menu .menu-back { color: var(--muted); }
.currency-option { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 8px; }
.currency-thumb { width: 32px; height: 44px; border: 2px solid rgba(232,194,77,0.72); background: linear-gradient(180deg, #f0d766, #8c641d); color: #171009; display: grid; place-items: center; font-family: Arial, sans-serif; font-weight: 900; font-size: 0.7rem; }
.currency-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.currency-copy { display: grid; gap: 2px; min-width: 0; }
.currency-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.currency-copy small { color: var(--muted); font-size: 0.66rem; }
.treasury-payment-panel { display: grid; gap: 8px; padding: 8px; border: 1px solid rgba(232,194,77,0.22); background: rgba(255,255,255,0.04); }
.treasury-payment-summary { color: #f5e7a8; font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.treasury-payment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 158px; overflow: auto; }
.treasury-payment-card { position: relative; min-height: 58px; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,0.16); background: rgba(0,0,0,0.35); }
.treasury-payment-card:hover,
.treasury-payment-card.selected { border-color: rgba(232,194,77,0.88); box-shadow: 0 0 14px rgba(232,194,77,0.28); transform: translateY(-1px); }
.treasury-payment-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.treasury-payment-card b { position: absolute; right: 2px; bottom: 2px; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(232,194,77,0.95); color: #161008; font-family: Arial, sans-serif; font-size: 0.68rem; }
.screen-transition { position: fixed; inset: 0; z-index: 2600; display: grid; place-items: center; pointer-events: none; overflow: hidden; background: #020405; opacity: 0; --transition-ms: 1150ms; }
.screen-transition[hidden] { display: none; }
.screen-transition.playing { pointer-events: auto; animation: screen-fade-cover var(--transition-ms) ease both; }
.screen-transition.duel-transition { background: radial-gradient(circle at 50% 50%, rgba(232,194,77,0.28), rgba(38,167,242,0.18) 27%, rgba(4,7,8,0.98) 66%); }
.screen-transition.duel-transition.playing { animation: duel-field-fade var(--transition-ms) cubic-bezier(0.16,0.76,0.18,1) both; }
.screen-transition.menu-transition { background: #020405; }
.screen-transition.deck-transition { background: #020405; }
.screen-transition.deck-transition.playing { animation: deck-screen-fade var(--transition-ms) ease both; }
.screen-transition.partial-transition { background: rgba(2,4,5,0.92); }
.screen-transition.partial-transition.playing { animation: partial-screen-fade var(--transition-ms) ease both; }
.screen-transition-core { position: relative; display: grid; justify-items: center; gap: 10px; min-width: min(520px, calc(100vw - 48px)); padding: 24px 34px; border-top: 2px solid rgba(232,194,77,0.72); border-bottom: 2px solid rgba(232,194,77,0.72); color: var(--text); text-align: center; text-transform: uppercase; text-shadow: 0 4px 22px #000; transform: translateY(18px) scale(0.96); opacity: 0; }
.screen-transition-core { display: none; }
.screen-transition-core::before, .screen-transition-core::after { content: ""; position: absolute; left: 50%; width: 72vw; height: 2px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgba(232,194,77,0.9), rgba(98,184,255,0.85), transparent); box-shadow: 0 0 24px rgba(232,194,77,0.52); }
.screen-transition-core::before { top: -14px; }
.screen-transition-core::after { bottom: -14px; }
.screen-transition-core span { color: var(--gold); font-family: Arial, sans-serif; font-size: 0.76rem; font-weight: 900; letter-spacing: 0; }
.screen-transition-core strong { font-size: clamp(1.8rem, 5vw, 4.8rem); line-height: 0.94; }
.screen-transition.duel-transition::before { content: ""; position: absolute; inset: -22%; background: conic-gradient(from 0deg, rgba(232,194,77,0), rgba(232,194,77,0.18), rgba(98,184,255,0.22), rgba(255,255,255,0.08), rgba(232,194,77,0)); animation: transition-spin var(--transition-ms) ease both; opacity: 0.9; }
.screen-transition.duel-transition::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(255,255,255,0.16), transparent 26%), linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.34) 49%, transparent 56% 100%); animation: transition-slash var(--transition-ms) ease both; }
@keyframes screen-fade-cover { 0% { opacity: 0; } 38%, 64% { opacity: 1; } 100% { opacity: 0; } }
@keyframes deck-screen-fade { 0% { opacity: 0; } 34%, 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes partial-screen-fade { 0% { opacity: 0; } 36%, 58% { opacity: 0.82; } 100% { opacity: 0; } }
@keyframes duel-field-fade { 0% { opacity: 0; filter: brightness(1.55) saturate(1.28); } 30%, 72% { opacity: 1; filter: brightness(1.06) saturate(1.2); } 100% { opacity: 0; filter: brightness(1.35) saturate(1.35); } }
@keyframes menu-curtain-left { 0%, 20% { transform: translateX(0); } 100% { transform: translateX(-104%); } }
@keyframes menu-curtain-right { 0%, 20% { transform: translateX(0); } 100% { transform: translateX(104%); } }
@keyframes partial-sword-sweep { 0% { opacity: 0; transform: translateX(-62%) skewX(-9deg); } 18% { opacity: 1; } 100% { opacity: 0; transform: translateX(62%) skewX(-9deg); } }
@keyframes partial-center-flare { 0%, 100% { opacity: 0; transform: scaleX(0); } 42%, 58% { opacity: 1; transform: scaleX(1); } }
@keyframes transition-title { 0% { opacity: 0; transform: translateY(18px) scale(0.96); } 42%, 72% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-12px) scale(0.98); } }
@keyframes duel-transition-title { 0% { opacity: 0; transform: translateY(36px) scale(0.82); filter: brightness(1.8) blur(3px); } 32%, 72% { opacity: 1; transform: translateY(0) scale(1.04); filter: brightness(1.15) blur(0); } 100% { opacity: 0; transform: translateY(-28px) scale(1.12); filter: brightness(1.5); } }
@keyframes transition-spin { 0% { transform: rotate(-35deg) scale(0.9); opacity: 0; } 42% { opacity: 0.78; } 100% { transform: rotate(68deg) scale(1.08); opacity: 0; } }
@keyframes transition-slash { 0%, 30% { opacity: 0; transform: translateX(-42%); } 56% { opacity: 1; } 100% { opacity: 0; transform: translateX(48%); } }

.target-panel { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 780; width: min(430px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 10px; border: 1px solid rgba(232,194,77,0.58); border-radius: 6px; background: rgba(13,16,17,0.98); box-shadow: 0 18px 44px rgba(0,0,0,0.6); }
.target-panel[hidden] { display: none; }
.target-panel h3 { color: var(--gold); font-size: 0.92rem; }
.target-panel p { color: var(--muted); font-size: 0.78rem; line-height: 1.2; }
.target-panel-actions { display: flex; justify-content: end; gap: 8px; }
.target-panel button { min-height: 34px; padding: 0 12px; background: rgba(255,255,255,0.08); }
.effect-resume-button {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 820;
  min-width: 260px;
  min-height: 44px;
  padding: 0 18px;
  transform: translateX(-50%);
  border-color: rgba(232,194,77,0.92);
  background: linear-gradient(180deg, rgba(232,194,77,0.96), rgba(122,86,22,0.96));
  color: #15100a;
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 18px 44px rgba(0,0,0,0.58), 0 0 28px rgba(232,194,77,0.32);
}
.effect-resume-button[hidden] { display: none; }
.effect-resume-button:hover:not(:disabled) { transform: translateX(-50%) translateY(-2px); }
.effect-resume-button:active:not(:disabled) { transform: translateX(-50%) translateY(2px) scale(0.985); }

.choice-menu { position: fixed; inset: 0; z-index: 760; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,0.54); }
.choice-menu[hidden] { display: none; }
.choice-dialog { width: min(720px, calc(100vw - 44px)); max-height: min(680px, calc(100vh - 44px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; padding: 12px; border: 1px solid rgba(232,194,77,0.48); border-radius: 6px; background: rgba(14,17,18,0.98); box-shadow: 0 28px 80px rgba(0,0,0,0.64); }
.choice-dialog h2 { color: var(--gold); }
.choice-dialog p { color: var(--muted); font-size: 0.86rem; line-height: 1.25; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; overflow: auto; padding: 2px; }
.choice-card { display: grid; gap: 6px; min-height: 64px; padding: 6px; border: 1px solid rgba(242,239,217,0.18); border-radius: 4px; background: rgba(255,255,255,0.06); color: var(--text); text-align: left; }
.choice-card:hover, .choice-card.selected { border-color: rgba(232,194,77,0.78); background: rgba(232,194,77,0.15); }
.choice-card img { width: 100%; aspect-ratio: 2.5 / 3.5; object-fit: cover; border: 1px solid rgba(0,0,0,0.7); }
.choice-card span { font-size: 0.72rem; line-height: 1.12; }
.choice-actions { display: flex; justify-content: end; gap: 8px; }
.choice-actions button { min-height: 34px; padding: 0 14px; background: rgba(255,255,255,0.08); }
.choice-actions .primary-command { background: linear-gradient(180deg, #d7a931, #705017); color: #15100a; }
.rps-actions button { min-width: 132px; border-color: rgba(232,194,77,0.86); background: linear-gradient(180deg, #e5bd43, #7e5b1d); color: #15100a; font-weight: 800; }
.rps-choice-button.pressed, .rps-choice-button.pressed:disabled { opacity: 1; transform: translateY(2px) scale(0.985); border-color: rgba(255,243,163,0.98); background: linear-gradient(180deg, #fff0a3, #a97a24); box-shadow: inset 0 4px 12px rgba(0,0,0,0.32), 0 0 22px rgba(232,194,77,0.36); color: #100c05; }
.rps-choice-button:disabled:not(.pressed) { opacity: 0.62; filter: grayscale(0.35); }

.pile-menu, .log-menu, .settings-menu { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; background: rgba(0,0,0,0.58); }
.pile-menu[hidden], .log-menu[hidden], .settings-menu[hidden] { display: none; }
.pile-dialog, .log-dialog, .settings-dialog { width: min(760px, calc(100vw - 48px)); max-height: min(720px, calc(100vh - 48px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; padding: 12px; border: 1px solid rgba(232,194,77,0.42); border-radius: 6px; background: rgba(14,17,18,0.98); box-shadow: 0 28px 80px rgba(0,0,0,0.62); }
.settings-dialog { width: min(980px, calc(100vw - 48px)); height: min(760px, calc(100vh - 48px)); max-height: calc(100vh - 48px); grid-template-rows: auto auto minmax(0, 1fr); }
.pile-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-tabs { min-height: 42px; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); align-items: stretch; gap: 8px; }
.settings-tabs button { min-height: 42px; border-color: rgba(242,239,217,0.16); background: rgba(255,255,255,0.06); color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-tabs button:hover, .settings-tabs button.active { border-color: rgba(232,194,77,0.78); background: rgba(232,194,77,0.16); color: var(--text); }
.pile-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; overflow: auto; padding: 2px; }
.pile-card { display: grid; gap: 6px; padding: 6px; border: 1px solid rgba(242,239,217,0.18); border-radius: 4px; background: rgba(255,255,255,0.06); color: var(--text); text-align: left; }
.pile-card img { width: 100%; aspect-ratio: 2.5 / 3.5; object-fit: cover; border: 1px solid rgba(0,0,0,0.7); }
.pile-card span { font-size: 0.72rem; line-height: 1.12; }
.pile-card .pile-card-meta { color: var(--muted); font-size: 0.66rem; }
.pile-empty { color: var(--muted); font-size: 0.92rem; }

.control-strip { min-width: var(--mat-w); padding: 8px; border: 1px solid rgba(242, 239, 217, 0.12); border-radius: 4px; background: rgba(0, 0, 0, 0.32); }
.stats { flex-wrap: wrap; justify-content: center; }
.stats span { min-width: 70px; padding: 6px 8px; border: 1px solid rgba(242, 239, 217, 0.10); border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--muted); text-align: center; font-size: 0.82rem; }
.stats b { color: var(--text); }
.center-strip { justify-content: center; }
.primary-command, .danger-command { border-color: rgba(212,63,56,0.62); background: rgba(212,63,56,0.18); color: #ffd7d4; }
.icon-command { min-height: 36px; padding: 0 16px; background: rgba(242, 239, 217, 0.08); }
.primary-command { border-color: rgba(232, 194, 77, 0.78); background: linear-gradient(180deg, #d7a931, #705017); color: #15100a; font-weight: 700; }
.side-panel { display: grid; align-content: start; gap: 10px; height: 1100px; max-height: 1100px; overflow: hidden; padding: 10px; }
.comms-panel {
  display: none;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  user-select: text;
}
.comms-header {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.comms-tab {
  min-height: 34px;
  background: rgba(255,255,255,0.065);
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}
.comms-tab.active {
  border-color: rgba(232,194,77,0.76);
  background: linear-gradient(180deg, rgba(232,194,77,0.22), rgba(91,64,18,0.42));
  color: var(--text);
  box-shadow: inset 0 0 18px rgba(232,194,77,0.10);
}
.comms-view {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(242,239,217,0.10);
  background: rgba(0,0,0,0.20);
}
.comms-view[hidden] { display: none; }
.table-log {
  height: 100%;
  margin: 0;
  padding: 8px;
  overflow: auto;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  line-height: 1.28;
  list-style: none;
  user-select: text;
}
.table-log li {
  margin: 0 0 8px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(242,239,217,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  overflow-wrap: anywhere;
}
.chat-messages {
  height: calc(100% - 44px);
  display: grid;
  align-content: end;
  gap: 8px;
  overflow: auto;
  padding: 8px;
  user-select: text;
}
.chat-message {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(242,239,217,0.12);
  background: rgba(255,255,255,0.055);
  font-family: Arial, sans-serif;
}
.chat-message.self {
  border-color: rgba(38,167,242,0.34);
  background: rgba(38,167,242,0.105);
}
.chat-message small {
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}
.chat-message p {
  color: var(--text);
  font-size: 0.74rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.chat-empty {
  align-self: center;
  justify-self: center;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
}
.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid rgba(242,239,217,0.10);
  background: rgba(0,0,0,0.18);
}
.chat-form input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(242,239,217,0.18);
  border-radius: 4px;
  background: rgba(0,0,0,0.34);
  color: var(--text);
  padding: 0 9px;
}
.chat-form button {
  min-height: 36px;
  padding: 0 10px;
}
.table-corner-tools {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 1350;
  display: flex;
  gap: 8px;
  align-items: center;
}
.table-corner-tools button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  font-size: 1.18rem;
  font-weight: 1000;
  line-height: 1;
}
.corner-surrender {
  border-color: rgba(212,63,56,0.62);
  background: rgba(120,0,22,0.28);
  color: #fff;
  box-shadow: 0 12px 34px rgba(0,0,0,0.44), inset 0 0 0 1px rgba(255,255,255,0.06);
}
.corner-surrender:hover:not(:disabled) {
  border-color: rgba(255,92,112,0.88);
  background: rgba(171,18,39,0.34);
  box-shadow: 0 12px 34px rgba(0,0,0,0.44), 0 0 18px rgba(171,18,39,0.24);
}
.corner-command {
  border-color: rgba(232,194,77,0.58);
  background: rgba(10,13,14,0.92);
  color: var(--gold);
  box-shadow: 0 12px 34px rgba(0,0,0,0.42);
}
.corner-command.toggle-on {
  border-color: rgba(255,255,255,0.86);
  background: rgba(232,194,77,0.24);
  color: #fff;
}
.settings-panel { min-height: 0; height: 100%; display: grid; align-content: start; gap: 12px; overflow: auto; padding-right: 2px; }
.settings-panel[hidden] { display: none; }
.settings-section { display: grid; gap: 9px; padding: 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(255,255,255,0.045); }
.settings-section h3 { margin: 0; color: var(--gold); font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
.settings-grid button.toggle-on { border-color: rgba(103,188,123,0.78); background: rgba(103,188,123,0.18); color: #dbffe2; box-shadow: inset 0 0 16px rgba(103,188,123,0.12); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.keybind-list { display: grid; gap: 8px; }
.keybind-row { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.18); color: var(--muted); font-family: Arial, sans-serif; font-size: 0.76rem; font-weight: 800; text-align: left; text-transform: uppercase; }
.keybind-row strong { min-width: 66px; padding: 5px 8px; border: 1px solid rgba(232,194,77,0.26); background: rgba(232,194,77,0.10); color: var(--text); text-align: center; }
.keybind-row:hover:not(.keybind-row-static), .keybind-row.capturing { border-color: rgba(232,194,77,0.64); background: rgba(232,194,77,0.10); }
.keybind-row-static { cursor: default; }
.sound-slider-grid { display: grid; gap: 11px; }
.sound-slider-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 48px; align-items: center; gap: 12px; min-height: 44px; padding: 8px 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.18); color: var(--muted); font-family: Arial, sans-serif; font-size: 0.76rem; font-weight: 800; text-transform: uppercase; }
.sound-slider-row strong { color: var(--text); text-align: right; font-size: 0.78rem; }
.sound-slider-row input[type="range"] { width: 100%; accent-color: #e8c24d; cursor: pointer; }
.sound-slider-row:hover { border-color: rgba(232,194,77,0.44); background: rgba(232,194,77,0.08); }
.sound-now-playing { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.18); color: var(--muted); font-family: Arial, sans-serif; font-size: 0.78rem; }
.sound-now-playing span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-now-playing button { min-height: 34px; }
.animations-off *, .animations-off *::before, .animations-off *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
.setup-panel.custom-game-panel { width: min(1560px, calc(100vw - 32px)); height: min(900px, calc(100vh - 32px)); max-height: calc(100vh - 32px); grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 14px; padding: 20px; border-color: rgba(232,194,77,0.42); background: linear-gradient(180deg, rgba(18,22,23,0.97), rgba(8,11,12,0.96)); }
.custom-game-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.custom-game-overview section { min-height: 62px; display: grid; align-content: center; gap: 4px; padding: 10px 12px; border: 1px solid rgba(242,239,217,0.12); background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02); }
.custom-game-overview span { color: var(--muted); font-family: Arial, sans-serif; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; }
.custom-game-overview strong { color: var(--text); font-size: 1.04rem; line-height: 1; }
.custom-game-content { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.custom-game-browser { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; }
#casual-screen, #public-queue-screen { padding: 0; }
.setup-panel.casual-game-panel { width: 100vw; height: 100vh; max-height: none; grid-template-rows: auto minmax(0, 1fr); gap: 18px; padding: clamp(18px, 3vw, 34px); border: 0; border-radius: 0; border-color: rgba(98,184,255,0.34); background: radial-gradient(circle at 78% 12%, rgba(65,144,214,0.22), transparent 38%), linear-gradient(180deg, rgba(15,22,27,0.98), rgba(7,10,12,0.96)); }
.casual-game-content { min-height: 0; display: grid; place-items: center; grid-template-columns: minmax(0, 1fr); }
.custom-game-toolbar { display: grid; grid-template-columns: 230px minmax(360px, 1fr) 156px; gap: 12px; align-items: end; padding: 14px; border: 1px solid rgba(232,194,77,0.18); background: linear-gradient(90deg, rgba(232,194,77,0.10), rgba(255,255,255,0.04)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025); }
.custom-code-entry, .room-browser-filters label, .public-match-panel label { display: grid; gap: 5px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.7rem; text-transform: uppercase; }
.custom-code-entry input, .room-browser-filters input, .room-browser-filters select { min-height: 42px; border: 1px solid rgba(242,239,217,0.22); border-radius: 4px; background: rgba(0,0,0,0.34); color: var(--text); padding: 0 10px; }
.public-match-panel select { min-height: 42px; border: 1px solid rgba(242,239,217,0.22); border-radius: 4px; background: rgba(0,0,0,0.34); color: var(--text); padding: 0 10px; }
.custom-game-toolbar .primary-command, .custom-game-toolbar .icon-command { min-height: 42px; }
.room-browser-filters { display: grid; grid-template-columns: minmax(340px, 1.8fr) minmax(160px, 0.9fr) repeat(4, minmax(142px, 0.8fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.22); }
.room-list { display: grid; align-content: start; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 12px; min-height: 0; overflow: auto; padding: 2px 5px 2px 1px; }
.room-card { display: grid; grid-template-columns: minmax(0, 1fr) 116px; align-items: center; gap: 14px; min-height: 116px; padding: 16px; border: 1px solid rgba(242,239,217,0.16); background: linear-gradient(145deg, rgba(255,255,255,0.085), rgba(255,255,255,0.028)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 12px 30px rgba(0,0,0,0.24); transition: border-color 120ms ease, background 120ms ease, transform 120ms ease; }
.room-card:hover { transform: translateY(-1px); border-color: rgba(232,194,77,0.52); background: linear-gradient(180deg, rgba(232,194,77,0.11), rgba(255,255,255,0.04)); }
.room-card strong { display: block; color: var(--text); font-size: 1.12rem; line-height: 1.08; }
.room-card small { display: block; margin-top: 5px; color: var(--muted); font-family: Arial, sans-serif; line-height: 1.25; }
.room-card button { min-width: 104px; min-height: 38px; }
.room-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.room-card-meta span { min-height: 22px; display: inline-grid; place-items: center; padding: 3px 8px; border: 1px solid rgba(242,239,217,0.13); border-radius: 999px; background: rgba(255,255,255,0.055); color: var(--muted); font-family: Arial, sans-serif; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; }
.public-match-panel { width: min(760px, calc(100vw - 48px)); max-height: 100%; min-height: min(680px, calc(100vh - 140px)); display: grid; grid-template-rows: auto auto minmax(260px, 1fr) auto auto auto; align-content: stretch; gap: 16px; padding: clamp(18px, 3vw, 34px); border: 1px solid rgba(98,184,255,0.28); background: radial-gradient(circle at 50% 0%, rgba(65,144,214,0.22), rgba(255,255,255,0.045) 45%, rgba(0,0,0,0.24)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 18px 42px rgba(0,0,0,0.24); overflow: auto; }
.deck-select-button { min-height: 58px; border-color: rgba(232,194,77,0.44); background: linear-gradient(180deg, rgba(232,194,77,0.15), rgba(255,255,255,0.055)); color: var(--text); font-weight: 900; text-align: left; padding: 0 16px; }
.deck-select-button.selected { border-color: rgba(103,188,123,0.82); background: rgba(103,188,123,0.16); box-shadow: inset 0 0 0 1px rgba(103,188,123,0.22), 0 0 24px rgba(103,188,123,0.14); }
.public-match-panel h2 { margin: -4px 0 2px; color: var(--text); font-size: clamp(2rem, 4vw, 4.6rem); line-height: 0.92; }
.public-ranked-button { min-height: 0; display: grid; align-content: center; gap: 10px; border: 1px solid rgba(98,184,255,0.34); background: linear-gradient(180deg, rgba(91,166,226,0.18), rgba(255,255,255,0.045)); color: rgba(242,239,217,0.56); cursor: not-allowed; }
.public-ranked-button span { font-size: clamp(2.8rem, 8vw, 7rem); font-weight: 900; color: rgba(242,239,217,0.72); }
.public-ranked-button small { font-family: Arial, sans-serif; font-size: 0.78rem; font-weight: 900; text-transform: uppercase; color: rgba(98,184,255,0.86); }
.public-casual-button { min-height: 62px; font-size: 1rem; }
.public-queue-panel { position: relative; width: 100vw; height: 100vh; min-height: 0; display: grid; place-items: center; align-content: center; gap: 20px; padding: clamp(24px, 5vw, 64px); overflow: hidden; border: 0; background: radial-gradient(circle at 50% 45%, rgba(51,121,180,0.34), rgba(8,12,16,0.96) 58%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035); text-align: center; }
.public-queue-panel::before, .public-queue-panel::after { content: ""; position: absolute; inset: -12vh -12vw; z-index: 0; opacity: 0; pointer-events: none; transition: opacity 420ms ease; }
.public-queue-panel::before { background: linear-gradient(135deg, rgba(42,150,255,0.9), rgba(11,32,70,0.92) 44%, transparent 45%); transform: translate(-60%, 60%); }
.public-queue-panel::after { background: linear-gradient(315deg, rgba(214,44,48,0.9), rgba(72,10,14,0.92) 44%, transparent 45%); transform: translate(60%, -60%); }
.public-queue-panel.match-found::before { opacity: 1; animation: queue-blue-slam 760ms cubic-bezier(0.16,0.92,0.22,1) forwards; }
.public-queue-panel.match-found::after { opacity: 1; animation: queue-red-slam 760ms cubic-bezier(0.16,0.92,0.22,1) forwards; }
.public-queue-panel.open-field::before { opacity: 1; animation: queue-blue-open 900ms ease forwards; }
.public-queue-panel.open-field::after { opacity: 1; animation: queue-red-open 900ms ease forwards; }
.public-queue-panel > * { position: relative; z-index: 1; }
.public-queue-vs { z-index: 2; width: 118px; height: 118px; display: none; place-items: center; border-radius: 999px; border: 2px solid rgba(255,236,143,0.9); background: radial-gradient(circle, rgba(255,232,139,0.94), rgba(95,47,12,0.9)); color: #140b04; font-family: Georgia, serif; font-size: 2.75rem; font-weight: 900; box-shadow: 0 0 44px rgba(232,194,77,0.38), 0 18px 48px rgba(0,0,0,0.5); }
.public-queue-panel.match-found .public-queue-vs, .public-queue-panel.open-field .public-queue-vs { display: grid; animation: queue-vs-pop 720ms ease both; }
.public-queue-panel h1 { margin: 0; color: var(--text); font-size: clamp(2.5rem, 6vw, 5.2rem); line-height: 0.92; text-shadow: 0 0 28px rgba(98,184,255,0.32); }
.public-queue-panel p { margin: 0; color: var(--muted); }
.public-queue-cancel { z-index: 2; }
.queue-orbit { position: absolute; inset: 44px; border: 1px solid rgba(98,184,255,0.16); border-radius: 50%; animation: queue-spin 9s linear infinite; }
.queue-orbit span { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #9ed9ff; box-shadow: 0 0 22px #67c4ff; }
.queue-orbit span:nth-child(1) { left: 50%; top: -6px; }
.queue-orbit span:nth-child(2) { right: 12%; bottom: 10%; animation: queue-pulse 1.8s ease-in-out infinite; }
.queue-orbit span:nth-child(3) { left: 10%; bottom: 18%; animation: queue-pulse 2.2s ease-in-out infinite reverse; }
.public-queue-dice { z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(170px, 1fr)); gap: 14px; width: min(520px, 100%); }
.public-queue-dice[hidden] { display: none; }
.queue-dice-card { display: grid; gap: 8px; padding: 14px; border: 1px solid rgba(232,194,77,0.42); background: rgba(0,0,0,0.28); animation: queue-dice-in 900ms ease both; }
.queue-dice-card strong { color: var(--gold); font-size: 0.86rem; text-transform: uppercase; }
.queue-dice-row { display: flex; justify-content: center; gap: 10px; }
.queue-die { width: 54px; height: 54px; display: grid; place-items: center; border: 2px solid rgba(250,242,211,0.9); border-radius: 9px; background: radial-gradient(circle at 28% 24%, #fff7dc, #d8c175 62%, #856b28); color: #16100a; font-weight: 900; box-shadow: inset 0 0 12px rgba(255,255,255,0.34), 0 0 24px rgba(232,194,77,0.24); animation: dice-tumble 1180ms cubic-bezier(0.18,0.86,0.18,1) both; }
.queue-dice-card b { color: var(--text); font-size: 1.15rem; }
.queue-choice-card { grid-column: 1 / -1; display: grid; justify-items: center; gap: 12px; padding: 18px; border: 1px solid rgba(232,194,77,0.52); background: rgba(0,0,0,0.34); box-shadow: 0 18px 46px rgba(0,0,0,0.34); animation: queue-dice-in 600ms ease both; }
.queue-choice-card strong { color: var(--gold); text-transform: uppercase; }
.queue-choice-card span { color: var(--muted); font-family: Arial, sans-serif; font-weight: 800; }
.queue-choice-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.queue-choice-actions button { min-width: 128px; min-height: 42px; border: 1px solid rgba(232,194,77,0.68); background: linear-gradient(#dfc36a, #a97924); color: #190f04; font-family: Georgia, serif; font-weight: 900; }
.queue-choice-actions button:hover { transform: translateY(-1px); filter: brightness(1.08); }
@keyframes queue-spin { to { transform: rotate(360deg); } }
@keyframes queue-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.35); } }
@keyframes queue-dice-in { 0% { opacity: 0; transform: translateY(20px) scale(0.92); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes queue-blue-slam { to { transform: translate(0, 0); } }
@keyframes queue-red-slam { to { transform: translate(0, 0); } }
@keyframes queue-blue-open { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(-65%, 65%); opacity: 0; } }
@keyframes queue-red-open { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(65%, -65%); opacity: 0; } }
@keyframes queue-vs-pop { 0% { opacity: 0; transform: scale(0.25) rotate(-20deg); } 70% { opacity: 1; transform: scale(1.1) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
#replays-screen { padding: 0; }
.replay-panel { width: 100%; height: 100%; max-height: none; grid-template-rows: auto auto minmax(0, 1fr) auto; border: 0; border-radius: 0; padding: clamp(18px, 2.4vw, 34px); background: radial-gradient(circle at 18% 18%, rgba(232,194,77,0.10), transparent 30%), radial-gradient(circle at 82% 10%, rgba(98,184,255,0.16), transparent 36%), linear-gradient(180deg, rgba(13,16,17,0.99), rgba(5,7,8,0.98)); }
.replay-toolbar { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 12px; border: 1px solid rgba(242,239,217,0.12); background: linear-gradient(90deg, rgba(255,255,255,0.035), rgba(0,0,0,0.20)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.018); }
.replay-library-layout { min-height: 0; display: grid; grid-template-columns: minmax(430px, 0.42fr) minmax(520px, 1fr); gap: 18px; }
.replay-detail { min-height: 0; display: grid; align-content: start; gap: 16px; padding: 24px; border: 1px solid rgba(232,194,77,0.34); background: radial-gradient(circle at 82% 8%, rgba(232,194,77,0.10), transparent 28%), linear-gradient(180deg, rgba(255,255,255,0.072), rgba(0,0,0,0.27)); overflow: auto; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), 0 22px 58px rgba(0,0,0,0.28); }
.replay-detail h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.55rem); line-height: 1; }
.replay-detail p { margin: 0; color: var(--muted); font-family: Arial, sans-serif; line-height: 1.45; }
.replay-spec-grid { display: grid; grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr); gap: 8px 12px; padding: 12px; border: 1px solid rgba(242,239,217,0.12); background: rgba(255,255,255,0.045); }
.replay-spec-grid span { color: var(--muted); font-family: Arial, sans-serif; font-size: 0.72rem; text-transform: uppercase; }
.replay-spec-grid b { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.replay-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.replay-detail-actions button { min-height: 36px; }
.replay-deck-dialog { width: min(1500px, calc(100vw - 32px)); height: min(1040px, calc(100vh - 32px)); max-height: calc(100vh - 32px); grid-template-rows: auto minmax(0, 1fr) auto; padding: clamp(14px, 1.4vw, 22px); }
.replay-deck-cards.deck-preview-grid { width: min(calc(100vw - 96px), calc((100vh - 150px) * 1.1905)); max-width: 100%; aspect-ratio: 50 / 42; align-self: center; justify-self: center; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 7px; overflow: hidden; padding: 8px; border: 1px solid rgba(242,239,217,0.14); background: rgba(0,0,0,0.24); }
.replay-deck-cards .deck-preview-slot { width: 100%; height: 100%; min-height: 0; padding: 0; overflow: hidden; border-color: rgba(242,239,217,0.18); background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(0,0,0,0.22)); }
.replay-deck-cards .deck-preview-slot img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border: 0; box-shadow: none; }
.replay-deck-cards .deck-empty-slot { width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; color: transparent; }
.replay-list { min-height: 0; max-height: none; display: grid; align-content: start; gap: 12px; overflow: auto; padding: 2px 4px 2px 0; }
.replay-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; border: 1px solid rgba(242,239,217,0.17); background: linear-gradient(135deg, rgba(255,255,255,0.086), rgba(255,255,255,0.026)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 12px 34px rgba(0,0,0,0.20); transition: transform 120ms ease, border-color 120ms ease, background 120ms ease; }
.replay-card:hover { transform: translateY(-1px); border-color: rgba(232,194,77,0.58); background: linear-gradient(135deg, rgba(232,194,77,0.12), rgba(255,255,255,0.036)); }
.replay-card.favorite { border-color: rgba(232,194,77,0.82); box-shadow: inset 0 0 0 1px rgba(232,194,77,0.24), 0 0 22px rgba(232,194,77,0.16); }
.replay-card.selected { border-color: rgba(98,184,255,0.9); background: rgba(98,184,255,0.12); }
.replay-copy { min-width: 0; display: grid; gap: 4px; }
.replay-copy strong { color: var(--text); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replay-copy small { color: var(--muted); font-family: Arial, sans-serif; font-size: 0.74rem; }
.replay-badges { display: flex; gap: 6px; align-items: center; }
.replay-star { width: 28px; height: 28px; min-height: 28px; padding: 0; display: grid; place-items: center; border-color: rgba(232,194,77,0.58); background: rgba(232,194,77,0.12); color: var(--gold); font-size: 1rem; }
.replay-warning { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgba(255,209,102,0.82); border-radius: 999px; color: #ffd166; font-family: Arial, sans-serif; font-weight: 900; }
.replay-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.replay-actions button { min-height: 34px; }
.deck-picker-dialog { width: min(1500px, calc(100vw - 48px)); }
.deck-picker-list { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(142px, auto); overflow: auto; }
.deck-library-card { position: relative; }
.deck-library-card.selected-deck { border-color: rgba(103,188,123,0.92); background: rgba(103,188,123,0.14); box-shadow: inset 0 0 0 2px rgba(103,188,123,0.28), 0 0 24px rgba(103,188,123,0.18); }
.deck-card-hover-actions { position: absolute; inset: auto 8px 8px 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity 140ms ease, transform 140ms ease; }
.deck-library-card:hover .deck-card-hover-actions, .deck-library-card:focus-within .deck-card-hover-actions { opacity: 1; transform: translateY(0); }
.deck-card-hover-actions button { min-height: 32px; padding: 0 8px; font-size: 0.68rem; }
.replay-player-menu { position: fixed; left: 50%; bottom: 18px; z-index: 1250; transform: translateX(-50%); width: min(560px, calc(100vw - 30px)); pointer-events: auto; }
.replay-player-menu[hidden] { display: none; }
.replay-player-dialog { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(232,194,77,0.56); background: rgba(10,13,14,0.94); box-shadow: 0 22px 70px rgba(0,0,0,0.66); }
.replay-player-dialog .pile-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.replay-player-dialog h2 { margin: 0; color: var(--text); font-size: 1rem; }
.replay-player-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.replay-player-dialog .screen-message { margin: 0; text-align: center; }
.replay-clean .replay-player-menu, .replay-clean .table-corner-tools, .replay-clean .sequence-cycle-button, .replay-clean #advance-stage { display: none !important; }
.replay-clean-exit { position: fixed; right: 18px; top: 18px; z-index: 1800; min-height: 38px; padding: 0 14px; border: 1px solid rgba(232,194,77,0.58); background: rgba(10,13,14,0.92); color: var(--gold); opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.replay-clean .replay-clean-exit { display: block; }
.replay-clean.replay-exit-hot .replay-clean-exit, .replay-clean .replay-clean-exit:hover { opacity: 1; pointer-events: auto; }
.sidebar-toggle, .comms-toggle { position: fixed; top: var(--duel-sidebar-toggle-top, 96px); z-index: 1120; width: 34px; height: 42px; min-height: 42px; padding: 0; border: 1px solid rgba(232,194,77,0.72); border-radius: 4px; background: rgba(10,13,14,0.94); color: var(--gold); font-family: Arial, sans-serif; font-size: 1.35rem; font-weight: 900; line-height: 1; display: grid; place-items: center; box-shadow: 0 12px 36px rgba(0,0,0,0.52), 0 0 18px rgba(232,194,77,0.18); }
.sidebar-toggle { left: var(--duel-sidebar-toggle-left, calc(100vw - 40px)); top: var(--duel-sidebar-toggle-top, 96px); }
.comms-toggle { left: var(--duel-comms-toggle-left, 8px); top: var(--duel-comms-toggle-top, 96px); }
.quick-tools-menu { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: rgba(0,0,0,0.42); }
.quick-tools-menu[hidden] { display: none; }
.quick-tools-dialog { width: min(360px, calc(100vw - 40px)); display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(232,194,77,0.58); background: rgba(10,13,14,0.96); box-shadow: 0 24px 80px rgba(0,0,0,0.68); }
.sidebar-collapsed .side-panel { display: none !important; }
.replay-clean .sidebar-toggle, .replay-clean .comms-toggle, .replay-clean .quick-tools-menu, .replay-clean .comms-panel { display: none !important; }
body:not([data-screen="duel"]) .sidebar-toggle, body:not([data-screen="duel"]) .comms-toggle, body:not([data-screen="duel"]) .table-corner-tools, body:not([data-screen="duel"]) .comms-panel { display: none !important; }
.lobby-panel { width: min(980px, calc(100vw - 48px)); }
.lobby-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.78rem; }
.lobby-summary span { min-height: 34px; display: grid; place-items: center; padding: 6px 8px; border: 1px solid rgba(242,239,217,0.14); background: rgba(255,255,255,0.06); text-align: center; text-transform: uppercase; }
.lobby-summary b { color: var(--gold); }
.lobby-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.lobby-seat { display: grid; gap: 10px; padding: 12px; border: 1px solid rgba(242,239,217,0.16); background: rgba(255,255,255,0.06); }
.lobby-seat h2 { color: var(--text); font-size: 1.05rem; }
.lobby-seat.ready { border-color: rgba(103,188,123,0.72); box-shadow: 0 0 0 2px rgba(103,188,123,0.16); }
.lobby-seat.waiting { border-color: rgba(232,194,77,0.42); }
.lobby-seat label { display: grid; gap: 5px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.72rem; text-transform: uppercase; }
.lobby-seat select { min-height: 38px; border: 1px solid rgba(242,239,217,0.22); background: rgba(0,0,0,0.34); color: var(--text); padding: 0 8px; }
.lobby-seat button { min-height: 38px; }

.settings-grid button { min-height: 46px; background: rgba(255,255,255,0.08); }
.dev-lab-columns { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; align-items: stretch; }
.dev-tool-card { display: grid; gap: 10px; padding: 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.18); }
.dev-tool-card h4 { margin: 0; color: #f2efd9; font-family: Arial, sans-serif; font-size: 0.74rem; font-weight: 900; text-transform: uppercase; }
.dev-lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dev-lab-grid label { display: grid; gap: 5px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 900; text-transform: uppercase; }
.dev-lab-grid select { min-width: 0; min-height: 38px; border: 1px solid rgba(242,239,217,0.18); background: rgba(0,0,0,0.34); color: var(--text); padding: 0 10px; }
.dev-report { min-height: 210px; max-height: 280px; overflow: auto; margin: 0; padding: 10px; border: 1px solid rgba(242,239,217,0.14); background: rgba(0,0,0,0.38); color: #dbe7e7; font-family: Consolas, "Courier New", monospace; font-size: 0.76rem; line-height: 1.42; white-space: pre-wrap; }
@media (max-width: 900px) { .dev-lab-columns { grid-template-columns: 1fr; } }
.inspector { display: grid; gap: 10px; }
.inspector img { width: 100%; max-height: 360px; border: 1px solid rgba(242, 239, 217, 0.20); border-radius: 4px; background: rgba(0, 0, 0, 0.25); object-fit: contain; }
.inspector p, .rules-box p, #hint { color: var(--muted); line-height: 1.32; font-size: 0.9rem; }
.action-stack { display: grid; gap: 7px; margin-top: 10px; }
.action-stack button { min-height: 34px; background: rgba(103, 188, 123, 0.18); }
.log { display: grid; gap: 7px; max-height: min(590px, calc(100vh - 160px)); overflow: auto; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
.log li:first-child { color: var(--text); }


.fx-layer { position: absolute; inset: 0; z-index: 900; pointer-events: none; overflow: hidden; }
.void-flight { position: absolute; left: 50%; top: 50%; width: 118px; height: 176px; transform: translate(calc(-50% + var(--void-start-x)), calc(-50% + var(--void-start-y))); filter: drop-shadow(0 18px 28px rgba(0,0,0,0.72)); animation: void-board-flight 980ms cubic-bezier(0.18, 0.8, 0.22, 1) forwards; }
.void-flight.from-hand { animation-name: void-hand-flight; filter: drop-shadow(0 0 22px rgba(212,63,56,0.72)) drop-shadow(0 18px 28px rgba(0,0,0,0.72)); }
.void-flight img { width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(20,20,20,0.9); box-shadow: 0 0 0 2px rgba(255,255,255,0.16), 0 0 28px rgba(232,194,77,0.42); }
.void-flight.from-board::before, .void-flight.from-board::after { content: ""; position: absolute; inset: 18px; z-index: -1; border: 2px solid rgba(255,255,255,0.52); opacity: 0; transform: rotate(22deg); animation: board-shatter-flash 640ms ease-out forwards; }
.void-flight.from-board::after { inset: 34px 6px; border-color: rgba(232,194,77,0.58); transform: rotate(-28deg); animation-delay: 80ms; }
.burn-flight { position: absolute; left: 50%; top: 50%; z-index: 7; width: 118px; height: 176px; transform: translate(calc(-50% + var(--burn-start-x)), calc(-50% + var(--burn-start-y))) scale(0.96); filter: drop-shadow(0 18px 28px rgba(0,0,0,0.72)); animation: burn-reveal-flight 1380ms cubic-bezier(0.16,0.82,0.22,1) forwards; }
.burn-flight::before { content: ""; position: absolute; inset: -10px; z-index: -1; border: 2px solid rgba(232,194,77,0.82); box-shadow: 0 0 28px rgba(232,194,77,0.48), inset 0 0 22px rgba(232,194,77,0.24); opacity: 0; animation: burn-reveal-aura 760ms ease-out forwards; }
.burn-flight img { width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(20,20,20,0.95); background: #090b0c; box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 0 34px rgba(232,194,77,0.44); }
.seek-flight { position: absolute; left: 50%; top: 50%; z-index: 190; width: 118px; height: 176px; transform: translate(calc(-50% + var(--seek-start-x)), calc(-50% + var(--seek-start-y))) scale(0.82); filter: drop-shadow(0 18px 30px rgba(0,0,0,0.75)); animation: seek-reveal-flight 1700ms cubic-bezier(0.16,0.82,0.22,1) forwards; }
.seek-flight::before { content: ""; position: absolute; inset: -12px; z-index: -1; border: 2px solid rgba(38,167,242,0.8); box-shadow: 0 0 28px rgba(38,167,242,0.5), inset 0 0 22px rgba(232,194,77,0.18); opacity: 0; animation: burn-reveal-aura 980ms ease-out forwards; }
.seek-flight img { width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(20,20,20,0.95); background: #090b0c; box-shadow: 0 0 0 2px rgba(255,255,255,0.18), 0 0 34px rgba(38,167,242,0.44); }
@keyframes void-board-flight { 0% { opacity: 1; transform: translate(calc(-50% + var(--void-start-x)), calc(-50% + var(--void-start-y))) scale(1.08) rotate(0deg); filter: brightness(1.7); } 34% { opacity: 1; transform: translate(calc(-50% + var(--void-start-x)), calc(-50% + var(--void-start-y))) scale(1.18) rotate(-5deg); filter: brightness(1.9); } 68% { opacity: 1; transform: translate(calc(-50% + var(--void-mid-x)), calc(-50% + var(--void-mid-y))) scale(0.78) rotate(20deg); filter: brightness(1.2); } 100% { opacity: 0; transform: translate(calc(-50% + var(--void-end-x)), calc(-50% + var(--void-end-y))) scale(0.22) rotate(56deg); filter: brightness(0.45); } }
@keyframes void-hand-flight { 0% { opacity: 1; transform: translate(calc(-50% + var(--void-start-x)), calc(-50% + var(--void-start-y))) scale(0.96) rotate(-3deg); filter: brightness(1); } 30% { opacity: 1; transform: translate(calc(-50% + var(--void-start-x)), calc(-50% + var(--void-start-y) - 34px)) scale(1.1) rotate(8deg); filter: brightness(1.8) saturate(1.4); } 74% { opacity: 1; transform: translate(calc(-50% + var(--void-mid-x)), calc(-50% + var(--void-mid-y))) scale(0.72) rotate(-18deg); } 100% { opacity: 0; transform: translate(calc(-50% + var(--void-end-x)), calc(-50% + var(--void-end-y))) scale(0.2) rotate(-48deg); filter: brightness(0.35); } }
@keyframes burn-reveal-flight { 0% { opacity: 0; transform: translate(calc(-50% + var(--burn-start-x)), calc(-50% + var(--burn-start-y))) scale(0.72) rotate(-8deg); filter: brightness(1.8) blur(2px); } 14% { opacity: 1; transform: translate(calc(-50% + var(--burn-start-x)), calc(-50% + var(--burn-start-y) - 12px)) scale(1.08) rotate(0deg); filter: brightness(1.38) blur(0); } 46% { opacity: 1; transform: translate(calc(-50% + var(--burn-start-x)), calc(-50% + var(--burn-start-y) - 12px)) scale(1.08) rotate(0deg); filter: brightness(1.18); } 76% { opacity: 1; transform: translate(calc(-50% + var(--burn-mid-x)), calc(-50% + var(--burn-mid-y))) scale(0.86) rotate(18deg); filter: brightness(1.05); } 100% { opacity: 0; transform: translate(calc(-50% + var(--burn-end-x)), calc(-50% + var(--burn-end-y))) scale(0.28) rotate(54deg); filter: brightness(0.45); } }
@keyframes burn-reveal-aura { 0% { opacity: 0; transform: scale(0.58) rotate(-18deg); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.72) rotate(24deg); } }
@keyframes board-shatter-flash { 0% { opacity: 0; transform: scale(0.45) rotate(22deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(2.6) rotate(72deg); } }
.card-tile.card-voided { animation: void-pulse 850ms ease both; }
@keyframes void-pulse { 0% { filter: brightness(1.75); box-shadow: 0 0 0 rgba(232,194,77,0); } 35% { filter: brightness(1.25); box-shadow: 0 0 26px rgba(232,194,77,0.78); } 100% { filter: brightness(1); box-shadow: 0 6px 16px rgba(0,0,0,0.35); } }
.card-tile.card-side-placed { animation: side-deal 840ms cubic-bezier(0.18, 0.76, 0.2, 1) both; animation-delay: var(--side-place-delay, 0ms); }
@keyframes side-deal { 0% { opacity: 1; transform: translateY(-42px) scale(1.12) rotate(-4deg); filter: brightness(1.45); } 62% { opacity: 1; transform: translateY(7px) scale(1.04) rotate(2deg); filter: brightness(1.14); } 100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); filter: brightness(1); } }
.battle-animation { position: absolute; inset: 0; z-index: 840; display: grid; grid-template-columns: 1fr 1fr; align-items: center; justify-items: center; padding: 76px 135px; background: radial-gradient(circle at center, rgba(232,194,77,0.28), rgba(0,0,0,0.84) 42%, rgba(0,0,0,0.92)); pointer-events: none; overflow: hidden; }
.battle-animation[hidden] { display: none; }
.battle-animation::before, .battle-animation::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.battle-animation::before { background: linear-gradient(90deg, rgba(38,167,242,0.24), transparent 42%, transparent 58%, rgba(212,63,56,0.24)); mix-blend-mode: screen; }
.battle-animation::after { background: linear-gradient(115deg, transparent 0 42%, rgba(255,255,255,0.42) 47%, transparent 52% 100%); animation: battle-slash 760ms ease 1260ms both; }
.battle-big-card { position: relative; z-index: 2; width: 238px; min-height: 396px; display: grid; grid-template-rows: 334px auto auto; gap: 8px; justify-items: center; color: var(--text); font-family: Arial, sans-serif; text-align: center; text-shadow: 0 2px 8px #000; }
.battle-big-card img, .battle-empty-card { width: 238px; height: 334px; object-fit: cover; border: 6px solid rgba(10,13,14,0.94); box-shadow: 0 26px 64px rgba(0,0,0,0.82), 0 0 0 2px rgba(232,194,77,0.42); background: #101314; }
.battle-empty-card { display: grid; place-items: center; color: var(--muted); font-weight: 900; text-transform: uppercase; }
.battle-big-card strong { color: var(--gold); font-size: 1.05rem; text-transform: uppercase; }
.battle-big-card span { max-width: 238px; font-size: 0.86rem; font-weight: 800; }
.battle-animation.playing .battle-big-card.left { animation: battle-left-strike 2800ms cubic-bezier(0.2, 0.78, 0.22, 1) both; }
.battle-animation.playing .battle-big-card.right { animation: battle-right-strike 2800ms cubic-bezier(0.2, 0.78, 0.22, 1) both; }
.battle-animation.destroys-unit.player-wins .battle-big-card.right { animation: battle-right-strike 1900ms cubic-bezier(0.2, 0.78, 0.22, 1) both, loser-fall-right 1350ms ease-in 2200ms forwards; }
.battle-animation.destroys-unit.ai-wins .battle-big-card.left { animation: battle-left-strike 1900ms cubic-bezier(0.2, 0.78, 0.22, 1) both, loser-fall-left 1350ms ease-in 2200ms forwards; }
.battle-animation.no-destroy.player-wins .battle-big-card.right { animation: battle-right-strike 1900ms cubic-bezier(0.2, 0.78, 0.22, 1) both, loser-stagger-right 920ms ease-out 2180ms forwards; }
.battle-animation.no-destroy.ai-wins .battle-big-card.left { animation: battle-left-strike 1900ms cubic-bezier(0.2, 0.78, 0.22, 1) both, loser-stagger-left 920ms ease-out 2180ms forwards; }
.battle-destroy-callout { position: absolute; left: 50%; bottom: 82px; z-index: 4; display: grid; grid-template-columns: 66px minmax(160px, auto); grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 18px; border-top: 2px solid rgba(212,63,56,0.96); border-bottom: 2px solid rgba(232,194,77,0.88); background: linear-gradient(90deg, transparent, rgba(10,13,14,0.96), transparent); color: var(--text); font-family: Arial, sans-serif; text-transform: uppercase; transform: translateX(-50%); opacity: 0; animation: battle-destroy-callout 1200ms ease 2380ms forwards; }
.battle-destroy-callout img { grid-row: 1 / 3; width: 66px; aspect-ratio: 5 / 7; object-fit: cover; border: 3px solid rgba(20,20,20,0.95); box-shadow: 0 0 0 1px rgba(212,63,56,0.74), 0 0 24px rgba(212,63,56,0.42); }
.battle-destroy-callout strong { color: #ff756f; font-size: 1rem; letter-spacing: 0; text-shadow: 0 2px 10px #000; }
.battle-destroy-callout span { color: var(--gold); font-size: 0.76rem; font-weight: 900; text-shadow: 0 2px 8px #000; }
.battle-result-text { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%) scale(0.9); min-width: 420px; padding: 16px 34px; border-top: 3px solid rgba(232,194,77,0.95); border-bottom: 3px solid rgba(232,194,77,0.95); background: linear-gradient(90deg, transparent, rgba(7,10,11,0.96), transparent); color: var(--gold); font-family: Arial, sans-serif; font-size: 2rem; font-weight: 900; text-align: center; text-transform: uppercase; text-shadow: 0 3px 16px #000; opacity: 0; animation: battle-result 1160ms ease 2580ms forwards; }
.choice-count { align-self: center; margin-right: auto; color: var(--gold); font-family: Arial, sans-serif; font-weight: 800; }
.side-choice-dialog .choice-card.selected { box-shadow: 0 0 0 2px rgba(232,194,77,0.55), 0 0 20px rgba(232,194,77,0.22); }
@keyframes battle-left-strike { 0% { transform: translateX(-170px) rotate(-7deg) scale(0.9); opacity: 0; } 12% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; } 32% { transform: translateX(154px) rotate(7deg) scale(1.08); } 43% { transform: translateX(20px) rotate(-2deg) scale(1); } 60% { transform: translateX(132px) rotate(5deg) scale(1.06); } 72% { transform: translateX(0) rotate(0deg) scale(1); } 100% { transform: translateX(0) rotate(0deg) scale(1); } }
@keyframes battle-right-strike { 0% { transform: translateX(170px) rotate(7deg) scale(0.9); opacity: 0; } 12% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; } 36% { transform: translateX(-150px) rotate(-7deg) scale(1.08); } 47% { transform: translateX(-18px) rotate(2deg) scale(1); } 64% { transform: translateX(-128px) rotate(-5deg) scale(1.06); } 76% { transform: translateX(0) rotate(0deg) scale(1); } 100% { transform: translateX(0) rotate(0deg) scale(1); } }
@keyframes loser-fall-right { 0% { opacity: 1; transform: translateX(0) rotate(0deg) scale(1); } 38% { opacity: 1; transform: translate(58px, 90px) rotate(18deg) scale(0.92); } 100% { opacity: 0; transform: translate(420px, 620px) rotate(62deg) scale(0.55); } }
@keyframes loser-fall-left { 0% { opacity: 1; transform: translateX(0) rotate(0deg) scale(1); } 38% { opacity: 1; transform: translate(-58px, 90px) rotate(-18deg) scale(0.92); } 100% { opacity: 0; transform: translate(-420px, 620px) rotate(-62deg) scale(0.55); } }
@keyframes loser-stagger-right { 0% { transform: translateX(0) rotate(0deg) scale(1); filter: brightness(1); } 34% { transform: translate(76px, 18px) rotate(9deg) scale(0.96); filter: brightness(0.74); } 66% { transform: translate(34px, 0) rotate(-3deg) scale(1); filter: brightness(1.1); } 100% { transform: translateX(0) rotate(0deg) scale(1); filter: brightness(0.92); } }
@keyframes loser-stagger-left { 0% { transform: translateX(0) rotate(0deg) scale(1); filter: brightness(1); } 34% { transform: translate(-76px, 18px) rotate(-9deg) scale(0.96); filter: brightness(0.74); } 66% { transform: translate(-34px, 0) rotate(3deg) scale(1); filter: brightness(1.1); } 100% { transform: translateX(0) rotate(0deg) scale(1); filter: brightness(0.92); } }
@keyframes battle-destroy-callout { 0% { opacity: 0; transform: translateX(-50%) translateY(30px) scale(0.72); filter: brightness(1.8) blur(2px); } 22% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); filter: brightness(1.35) blur(0); } 78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); filter: brightness(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.92); filter: brightness(0.7); } }
@keyframes battle-slash { 0% { opacity: 0; transform: translateX(-90%) skewX(-18deg); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateX(90%) skewX(-18deg); } }
@keyframes battle-result { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.74); } 24% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.place-flight { position: absolute; left: 50%; top: 50%; z-index: 2; width: 96px; height: 142px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 24px rgba(232,194,77,0.9)); animation: place-flight 780ms cubic-bezier(0.18, 0.82, 0.24, 1) forwards; }
.place-flight.recruit-flight { z-index: 5; width: 132px; height: 196px; animation: recruit-flight 1180ms cubic-bezier(0.16, 0.84, 0.22, 1) forwards; filter: drop-shadow(0 0 32px rgba(232,194,77,0.95)) drop-shadow(0 18px 34px rgba(0,0,0,0.72)); }
.place-flight::before { content: ""; position: absolute; inset: 24px 0; border-radius: 999px; background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(232,194,77,0.92) 32%, rgba(38,167,242,0.48) 66%, transparent 72%); animation: place-orb 780ms ease forwards; }
.place-flight img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(12,14,15,0.95); opacity: 0; transform: scale(0.55); animation: place-card-materialize 780ms ease forwards; }
.place-flight.recruit-flight::before { inset: 20px -18px; animation: recruit-orb 1180ms ease forwards; }
.place-flight.recruit-flight img { border-width: 5px; animation: recruit-card-materialize 1180ms cubic-bezier(0.16,0.84,0.22,1) forwards; }
.draw-flight { position: absolute; left: 50%; top: 50%; z-index: 3; width: 86px; height: 128px; opacity: 0; transform: translate(calc(-50% + var(--draw-from-x)), calc(-50% + var(--draw-from-y))) scale(0.62); filter: drop-shadow(0 0 20px rgba(38,167,242,0.82)); animation: draw-flight 720ms cubic-bezier(0.18,0.82,0.24,1) both; }
.draw-flight.ai { filter: drop-shadow(0 0 20px rgba(212,63,56,0.78)); }
.draw-flight img { width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(12,14,15,0.95); box-shadow: 0 0 0 2px rgba(255,255,255,0.16), 0 0 28px rgba(38,167,242,0.34); }
.hand-add-flight { position: absolute; left: 50%; top: 50%; z-index: 4; width: 96px; height: 142px; opacity: 0; transform: translate(calc(-50% + var(--hand-add-from-x)), calc(-50% + var(--hand-add-from-y))) scale(0.58) rotate(-8deg); filter: drop-shadow(0 0 24px rgba(232,194,77,0.86)); animation: hand-add-flight 760ms cubic-bezier(0.16,0.84,0.22,1) both; }
.hand-add-flight.ai { filter: drop-shadow(0 0 24px rgba(212,63,56,0.78)); }
.hand-add-flight img { width: 100%; height: 100%; object-fit: cover; border: 4px solid rgba(12,14,15,0.95); box-shadow: 0 0 0 2px rgba(232,194,77,0.42), 0 0 32px rgba(232,194,77,0.34); background: #090b0c; }
.dice-roll-animation { position: absolute; left: 50%; top: 50%; z-index: 8; display: grid; grid-template-columns: auto auto; align-items: center; gap: 28px; padding: 18px 24px; border-top: 2px solid rgba(232,194,77,0.92); border-bottom: 2px solid rgba(232,194,77,0.92); background: radial-gradient(circle at center, rgba(76,34,98,0.82), rgba(8,10,12,0.9) 68%); color: var(--text); font-family: Arial, sans-serif; transform: translate(-50%, -50%); box-shadow: 0 26px 80px rgba(0,0,0,0.78), 0 0 54px rgba(139,70,181,0.32); animation: dice-panel 1680ms ease both; }
.dice-roll-card { display: grid; grid-template-columns: 62px minmax(130px, 190px); grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.dice-roll-card img { grid-row: 1 / 3; width: 62px; aspect-ratio: 5 / 7; object-fit: contain; border: 3px solid rgba(10,12,13,0.96); box-shadow: 0 0 0 1px rgba(232,194,77,0.44), 0 10px 24px rgba(0,0,0,0.62); }
.dice-roll-card strong { color: #f3d66c; font-size: 1.1rem; text-transform: uppercase; text-shadow: 0 2px 12px #000; }
.dice-roll-card span { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.corruption-dice { display: flex; gap: 14px; }
.corruption-die { width: 76px; height: 76px; display: grid; place-items: center; gap: 2px; border: 3px solid rgba(250,242,211,0.9); border-radius: 10px; background: radial-gradient(circle at 28% 24%, #fff7dc, #d8c175 62%, #856b28); color: #16100a; box-shadow: inset 0 0 16px rgba(255,255,255,0.34), 0 0 28px rgba(232,194,77,0.36); animation: dice-tumble 1180ms cubic-bezier(0.18,0.86,0.18,1) both; }
.corruption-die.support { animation-delay: 90ms; background: radial-gradient(circle at 28% 24%, #e8fbff, #75cce0 62%, #246976); }
.corruption-die.frozen { background: radial-gradient(circle at 28% 24%, #f1fdff, #8de5ff 58%, #2f85c5); box-shadow: inset 0 0 18px rgba(255,255,255,0.46), 0 0 34px rgba(96,205,255,0.58); }
.dice-roll-animation.frozen-roll { background: radial-gradient(circle at center, rgba(48,145,205,0.74), rgba(8,14,19,0.92) 68%); box-shadow: 0 26px 80px rgba(0,0,0,0.78), 0 0 58px rgba(96,205,255,0.34); }
.corruption-dice.single-die { justify-content: center; }
.corruption-die small { align-self: end; font-size: 0.56rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.corruption-die b { align-self: start; font-size: 2.05rem; line-height: 0.92; }
@keyframes draw-flight { 0% { opacity: 0; transform: translate(calc(-50% + var(--draw-from-x)), calc(-50% + var(--draw-from-y))) scale(0.46) rotate(-8deg); } 18% { opacity: 1; transform: translate(calc(-50% + var(--draw-from-x)), calc(-50% + var(--draw-from-y))) scale(0.76) rotate(0deg); } 82% { opacity: 1; transform: translate(calc(-50% + var(--draw-to-x)), calc(-50% + var(--draw-to-y))) scale(0.9) rotate(5deg); } 100% { opacity: 0; transform: translate(calc(-50% + var(--draw-to-x)), calc(-50% + var(--draw-to-y))) scale(0.38) rotate(10deg); } }
@keyframes hand-add-flight { 0% { opacity: 0; transform: translate(calc(-50% + var(--hand-add-from-x)), calc(-50% + var(--hand-add-from-y))) scale(0.5) rotate(-10deg); filter: brightness(1.6) blur(2px); } 18% { opacity: 1; transform: translate(calc(-50% + var(--hand-add-from-x)), calc(-50% + var(--hand-add-from-y))) scale(0.78) rotate(-3deg); filter: brightness(1.35) blur(0); } 62% { opacity: 1; transform: translate(calc(-50% + var(--hand-add-to-x)), calc(-50% + var(--hand-add-to-y) - 80px)) scale(1.04) rotate(4deg); filter: brightness(1.25); } 88% { opacity: 1; transform: translate(calc(-50% + var(--hand-add-to-x)), calc(-50% + var(--hand-add-to-y))) scale(0.9) rotate(7deg); } 100% { opacity: 0; transform: translate(calc(-50% + var(--hand-add-to-x)), calc(-50% + var(--hand-add-to-y))) scale(0.42) rotate(10deg); filter: brightness(1); } }
@keyframes place-flight { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.58); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(0.86); } 72% { opacity: 1; transform: translate(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y))) scale(0.72); } 100% { opacity: 0; transform: translate(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y))) scale(1.02); } }
@keyframes seek-reveal-flight { 0% { opacity: 0; transform: translate(calc(-50% + var(--seek-start-x)), calc(-50% + var(--seek-start-y))) scale(0.62) rotateY(82deg); } 24% { opacity: 1; transform: translate(calc(-50% + var(--seek-end-x)), calc(-50% + var(--seek-end-y))) scale(1.08) rotate(var(--seek-tilt)) rotateY(0deg); } 82% { opacity: 1; transform: translate(calc(-50% + var(--seek-end-x)), calc(-50% + var(--seek-end-y))) scale(1.04) rotate(var(--seek-tilt)); } 100% { opacity: 0; transform: translate(calc(-50% + var(--seek-end-x)), calc(-50% + var(--seek-end-y))) scale(0.96) rotate(var(--seek-tilt)); } }
@keyframes recruit-flight { 0% { opacity: 0; transform: translate(calc(-50% + var(--flight-start-x)), calc(-50% + var(--flight-start-y))) scale(0.62); } 24% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); } 52% { opacity: 1; transform: translate(-50%, -50%) scale(1.36); } 82% { opacity: 1; transform: translate(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y))) scale(0.76); } 100% { opacity: 0; transform: translate(calc(-50% + var(--flight-x)), calc(-50% + var(--flight-y))) scale(1.04); } }
@keyframes place-orb { 0%, 54% { opacity: 1; transform: scale(1); } 78%, 100% { opacity: 0; transform: scale(1.9); } }
@keyframes recruit-orb { 0% { opacity: 0.7; transform: scale(0.46); } 20%, 60% { opacity: 1; transform: scale(1.18); } 84%, 100% { opacity: 0; transform: scale(2.25); } }
@keyframes place-card-materialize { 0%, 50% { opacity: 0; transform: scale(0.5) rotate(-12deg); } 76% { opacity: 1; transform: scale(0.9) rotate(2deg); } 100% { opacity: 0; transform: scale(1) rotate(0deg); } }
@keyframes recruit-card-materialize { 0% { opacity: 0; transform: scale(0.48) rotate(-10deg); } 18% { opacity: 1; transform: scale(1) rotate(0deg); } 58% { opacity: 1; transform: scale(1) rotate(0deg); } 84% { opacity: 1; transform: scale(0.66) rotate(2deg); } 100% { opacity: 0; transform: scale(0.84) rotate(0deg); } }
@keyframes dice-panel { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.78); filter: brightness(1.8) blur(3px); } 16% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); filter: brightness(1.3) blur(0); } 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1); } 100% { opacity: 0; transform: translate(-50%, -50%) translateY(32px) scale(0.94); filter: brightness(0.8); } }
@keyframes dice-tumble { 0% { transform: translateY(-40px) rotateX(70deg) rotateZ(-120deg) scale(0.62); filter: blur(2px); } 24% { transform: translateY(8px) rotateX(0) rotateZ(34deg) scale(1.12); filter: blur(0); } 46% { transform: translateY(-14px) rotateZ(-16deg) scale(1.02); } 70% { transform: translateY(4px) rotateZ(7deg) scale(1); } 100% { transform: translateY(0) rotateZ(0) scale(1); } }
.first-choice-dialog { width: min(520px, calc(100vw - 40px)); grid-template-rows: auto auto auto; text-align: center; }
.first-choice-actions { justify-content: center; }
.first-choice-actions button { min-width: 132px; }


body:not([data-screen="duel"]) .app-shell { opacity: 0; pointer-events: none; }
body[data-screen="duel"] .app-shell { opacity: 1; pointer-events: auto; }
.startup-loader { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; background: #000; overflow: hidden; opacity: 1; transition: opacity 820ms ease, visibility 820ms ease; }
.startup-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.startup-logo { width: min(78vw, 980px); max-height: 78vh; object-fit: contain; opacity: 0; transform: translateY(120vh) scale(0.78); filter: drop-shadow(0 28px 48px rgba(0,0,0,0.7)); }
.startup-loader.logo-ready .startup-logo { animation: startup-logo-pan 2300ms cubic-bezier(0.18, 0.88, 0.17, 1) forwards; }
.startup-loading { position: absolute; left: clamp(18px, 3vw, 42px); bottom: clamp(18px, 3vw, 38px); color: #f2efd9; font-family: Arial, sans-serif; font-size: clamp(1rem, 2vw, 1.35rem); font-weight: 900; letter-spacing: 0; text-transform: uppercase; animation: startup-loading-bob 1250ms ease-in-out infinite; }
.startup-loading::after { content: ""; animation: startup-loading-dots 1200ms steps(4, end) infinite; }
.server-notice { position: fixed; left: 50%; top: 22px; z-index: 4200; width: min(560px, calc(100vw - 36px)); transform: translateX(-50%); display: grid; gap: 6px; padding: 12px 16px; border: 1px solid rgba(232,194,77,0.72); border-radius: 6px; background: rgba(9,12,13,0.96); color: var(--text); box-shadow: 0 18px 56px rgba(0,0,0,0.58), 0 0 22px rgba(232,194,77,0.16); font-family: Arial, sans-serif; text-align: center; animation: server-notice-in 420ms ease both; }
.server-notice strong { color: var(--gold); text-transform: uppercase; font-size: 0.78rem; }
.server-notice span { color: var(--muted); font-size: 0.84rem; }
@keyframes server-notice-in { from { opacity: 0; transform: translateX(-50%) translateY(-18px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes startup-logo-pan { 0% { transform: translateY(120vh) scale(0.78); opacity: 0; } 18% { opacity: 1; } 72% { transform: translateY(-2vh) scale(1.02); opacity: 1; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes startup-loading-bob { 0%, 100% { transform: translateY(0); opacity: 0.78; } 50% { transform: translateY(-8px); opacity: 1; } }
@keyframes startup-loading-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }
.screen-layer { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: clamp(14px, 3vw, 34px); background: linear-gradient(rgba(7,10,11,0.72), rgba(7,10,11,0.92)), url("assets/Hero's Commission/Forest of The Beasts.png") center / cover fixed; overflow: hidden; }
.screen-layer[hidden] { display: none; }
.title-screen { background: radial-gradient(circle at 50% 38%, rgba(22,67,110,0.38), transparent 28%), linear-gradient(rgba(0,0,0,0.52), rgba(0,0,0,0.9)), url("assets/Hero's Commission/Forest of The Beasts.png") center / cover fixed; }
.title-hero { width: min(1040px, 92vw); height: min(76vh, 720px); min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; gap: clamp(12px, 2vh, 24px); }
.title-logo { width: min(68vw, 760px); height: min(52vh, 560px); max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 32px 70px rgba(0,0,0,0.84)) drop-shadow(0 0 24px rgba(38,167,242,0.18)); animation: title-logo-settle 900ms ease both; }
.title-start-button { min-height: 54px; padding: 0 clamp(28px, 4vw, 58px); border: 1px solid rgba(242,239,217,0.28); border-radius: 999px; background: rgba(8,11,12,0.68); color: var(--text); font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 2.1rem); font-weight: 900; box-shadow: 0 18px 54px rgba(0,0,0,0.44), 0 0 24px rgba(232,194,77,0.1); animation: title-start-breathe 1800ms ease-in-out infinite; }
.title-start-button:hover { border-color: rgba(232,194,77,0.92); background: rgba(232,194,77,0.16); color: #fff7d8; transform: translateY(-2px); }
.title-settings-button { position: fixed; top: clamp(14px, 2.2vw, 28px); right: clamp(14px, 2.2vw, 28px); z-index: 2; }
.manage-account-button { position: fixed; left: clamp(16px, 2.4vw, 34px); bottom: clamp(16px, 2.4vw, 34px); z-index: 2; min-height: 42px; padding: 0 18px; border: 1px solid rgba(242,239,217,0.24); border-radius: 4px; background: rgba(255,255,255,0.075); color: var(--text); font-family: Arial, sans-serif; font-weight: 800; }
.manage-account-button:hover { border-color: rgba(232,194,77,0.82); background: rgba(232,194,77,0.14); transform: translateY(-1px); }
@media (max-height: 650px) {
  .title-hero { height: calc(100vh - 70px); gap: 10px; }
  .title-logo { width: min(62vw, 680px); height: min(48vh, 360px); }
  .title-start-button { min-height: 46px; font-size: clamp(1.1rem, 2.4vw, 1.65rem); }
}
.account-manager-menu { position: fixed; inset: 0; z-index: 3900; display: grid; place-items: center; padding: clamp(16px, 3vw, 34px); background: rgba(0,0,0,0.62); backdrop-filter: blur(10px); }
.account-manager-menu[hidden] { display: none; }
.account-manager-dialog { width: min(620px, calc(100vw - 30px)); max-height: min(720px, calc(100vh - 30px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; padding: 18px; border: 1px solid rgba(232,194,77,0.42); background: rgba(12,15,16,0.96); box-shadow: 0 28px 92px rgba(0,0,0,0.72); }
.account-manager-list { display: grid; align-content: start; gap: 10px; min-height: 120px; overflow: auto; padding-right: 3px; }
.account-history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 12px; border: 1px solid rgba(242,239,217,0.14); background: rgba(255,255,255,0.045); }
.account-history-row strong { display: block; color: var(--text); font-family: var(--serif); font-size: 1.15rem; line-height: 1.1; }
.account-history-row small { display: block; margin-top: 4px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.78rem; }
.account-history-actions { display: flex; align-items: center; gap: 8px; }
.account-history-actions button { min-height: 36px; padding: 0 12px; }
.account-manager-empty { margin: 0; align-self: center; color: var(--muted); font-family: Arial, sans-serif; text-align: center; }
.account-manager-actions { display: flex; justify-content: flex-end; gap: 10px; }
.tutorial-menu { position: fixed; inset: 0; z-index: 3900; display: grid; place-items: center; padding: clamp(14px, 3vw, 34px); background: rgba(0,0,0,0.66); backdrop-filter: blur(10px); }
.tutorial-menu[hidden] { display: none; }
.tutorial-dialog { width: min(980px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; padding: 18px; border: 1px solid rgba(232,194,77,0.42); background: rgba(12,15,16,0.96); box-shadow: 0 28px 92px rgba(0,0,0,0.72); overflow: hidden; }
.tutorial-header-actions { display: flex; align-items: center; gap: 10px; }
.tutorial-intro { margin: 0; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.92rem; line-height: 1.42; }
.tutorial-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; overflow: auto; padding-right: 3px; }
.tutorial-grid article { min-height: 106px; display: grid; align-content: start; gap: 7px; padding: 12px; border: 1px solid rgba(242,239,217,0.14); background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(0,0,0,0.2)); }
.tutorial-grid strong { color: var(--gold); font-family: var(--serif); font-size: 1.12rem; line-height: 1.1; }
.tutorial-grid p { margin: 0; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.88rem; line-height: 1.38; }
.tutorial-guide { position: fixed; right: clamp(14px, 2vw, 24px); bottom: clamp(86px, 9vh, 118px); z-index: 780; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.tutorial-guide[hidden] { display: none; }
.tutorial-guide-panel { display: grid; gap: 8px; padding: 14px; border: 1px solid rgba(232,194,77,0.58); border-radius: 8px; background: linear-gradient(180deg, rgba(23,28,29,0.97), rgba(8,10,11,0.97)); box-shadow: 0 22px 62px rgba(0,0,0,0.62), 0 0 28px rgba(232,194,77,0.12); pointer-events: auto; }
.tutorial-guide-panel h2 { margin: 0; color: var(--text); font-family: var(--serif); font-size: 1.42rem; line-height: 1.05; }
.tutorial-guide-panel p { margin: 0; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.9rem; line-height: 1.36; }
.tutorial-guide-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 4px; }
.tutorial-guide-actions button { min-height: 36px; }
.tutorial-focus { position: relative; z-index: 30; outline: 3px solid rgba(255,218,87,0.96) !important; outline-offset: 5px; box-shadow: 0 0 0 7px rgba(232,194,77,0.18), 0 0 28px rgba(255,218,87,0.62) !important; animation: tutorial-focus-pulse 1200ms ease-in-out infinite; }
.card-tile.tutorial-focus { outline-offset: 3px; }
@keyframes tutorial-focus-pulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
@keyframes title-logo-settle { from { opacity: 0; transform: translateY(22px) scale(0.96); filter: blur(3px) drop-shadow(0 32px 70px rgba(0,0,0,0.84)); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) drop-shadow(0 32px 70px rgba(0,0,0,0.84)) drop-shadow(0 0 24px rgba(38,167,242,0.18)); } }
@keyframes title-start-breathe { 0%, 100% { box-shadow: 0 18px 54px rgba(0,0,0,0.44), 0 0 18px rgba(232,194,77,0.08); } 50% { box-shadow: 0 18px 54px rgba(0,0,0,0.44), 0 0 34px rgba(232,194,77,0.24); } }
.auth-panel, .menu-shell, .setup-panel, .deck-editor-shell { width: min(1040px, calc(100vw - 28px)); max-height: calc(100vh - 28px); border: 1px solid rgba(232,194,77,0.36); background: rgba(13,16,17,0.94); box-shadow: 0 24px 80px rgba(0,0,0,0.6); }
.auth-panel { position: relative; width: min(430px, calc(100vw - 28px)); display: grid; gap: 12px; padding: 16px; }
.auth-brand { padding: 0 46px; text-align: center; }
.auth-brand h1, .menu-header h1, .screen-header h1 { font-size: clamp(1.55rem, 5vw, 2.45rem); line-height: 0.96; }
.auth-title-back { position: absolute; top: 12px; left: 12px; width: 38px; min-height: 38px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(242,239,217,0.18); border-radius: 999px; background: rgba(255,255,255,0.075); color: var(--gold); font-family: Arial, sans-serif; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.auth-title-back:hover { border-color: rgba(232,194,77,0.82); background: rgba(232,194,77,0.16); transform: translateY(-1px); }
.auth-settings-button { position: absolute; top: 12px; right: 12px; width: 38px; min-height: 38px; padding: 0; border: 1px solid rgba(242,239,217,0.18); border-radius: 999px; background: rgba(255,255,255,0.075); color: var(--text); font-size: 1.08rem; }
.auth-settings-button:hover { border-color: rgba(232,194,77,0.82); background: rgba(232,194,77,0.16); transform: translateY(-1px); }
.google-command { min-height: 40px; display: grid; place-items: center; border: 1px solid rgba(242,239,217,0.22); border-radius: 4px; background: rgba(255,255,255,0.08); color: var(--text); font-family: Arial, sans-serif; font-weight: 800; text-decoration: none; }
.google-command:hover { border-color: rgba(232,194,77,0.72); background: rgba(232,194,77,0.12); }
.account-form { display: grid; gap: 10px; }
.account-form[hidden] { display: none !important; }
.setup-grid [hidden] { display: none !important; }
.account-form label, .setup-grid label, .deck-filter-panel label { display: grid; gap: 5px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.78rem; text-transform: uppercase; }
.account-form input, .setup-grid select, .deck-filter-panel input, .deck-filter-panel select, #deck-name { width: 100%; min-height: 36px; border: 1px solid rgba(242,239,217,0.2); border-radius: 4px; background: rgba(0,0,0,0.36); color: var(--text); padding: 0 10px; font: inherit; }
.text-command { min-height: 34px; border: 0; background: transparent; color: var(--gold); text-align: center; font-family: Arial, sans-serif; font-size: 0.8rem; }
.text-command:hover { color: var(--text); text-decoration: underline; }
.password-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.password-toggle { min-width: 58px; min-height: 36px; padding: 0 8px; border: 1px solid rgba(242,239,217,0.2); background: rgba(255,255,255,0.08); color: var(--text); font-size: 0.72rem; }
.password-toggle:hover { border-color: rgba(232,194,77,0.76); background: rgba(232,194,77,0.14); }
.auth-reset-fields { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid rgba(242,239,217,0.12); }
.auth-reset-fields[hidden] { display: none !important; }
.check-row { grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-content: start; gap: 8px; min-height: 28px; color: var(--text); text-transform: none; }
.check-row input { width: 16px; min-height: 16px; accent-color: var(--gold); padding: 0; }
.auth-back { min-height: 36px; background: rgba(255,255,255,0.08); color: var(--muted); }
.screen-message { min-height: 18px; color: var(--gold); font-family: Arial, sans-serif; font-size: 0.78rem; }
.auth-session-prompt { display: grid; gap: 10px; padding: 10px; border: 1px solid rgba(232,194,77,0.34); background: rgba(0,0,0,0.28); color: var(--text); font-family: Arial, sans-serif; }
.auth-session-prompt[hidden] { display: none !important; }
.auth-session-prompt p { margin: 0; line-height: 1.35; }
.auth-session-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.auth-session-actions button { min-height: 36px; }
.menu-shell { display: grid; gap: 16px; padding: 18px; }
.menu-header, .screen-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-back-button { position: fixed; left: clamp(18px, 3vw, 34px); right: auto; bottom: clamp(18px, 3vw, 34px); z-index: 1800; width: 64px; height: 64px; min-height: 64px; padding: 0; display: grid; place-items: center; border: 2px solid rgba(232,194,77,0.78); border-radius: 999px; background: radial-gradient(circle at 38% 28%, rgba(232,194,77,0.18), rgba(10,13,14,0.94) 62%); color: var(--gold); font-family: Arial, sans-serif; font-size: 2rem; font-weight: 900; line-height: 1; box-shadow: 0 18px 48px rgba(0,0,0,0.54), inset 0 0 0 1px rgba(255,255,255,0.05), 0 0 22px rgba(232,194,77,0.16); }
.menu-back-button:hover { border-color: rgba(255,232,139,0.96); background: radial-gradient(circle at 38% 28%, rgba(255,232,139,0.28), rgba(18,16,10,0.96) 66%); color: var(--text); transform: translateY(-2px); }
.account-pill { min-width: 120px; padding: 8px 12px; border: 1px solid rgba(38,167,242,0.44); background: rgba(38,167,242,0.12); color: var(--text); text-align: center; font-family: Arial, sans-serif; }
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.menu-card { min-height: 128px; display: grid; align-content: end; gap: 8px; padding: 14px; border-color: rgba(232,194,77,0.42); background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.28)); text-align: left; }
.menu-card span { color: var(--text); font-size: 1.18rem; font-weight: 800; }
.menu-card small { color: var(--muted); font-size: 0.78rem; }
.menu-card:not(:disabled):hover { border-color: rgba(232,194,77,0.9); background: rgba(232,194,77,0.14); }
.disabled-card { opacity: 0.55; }
.logout-corner { position: fixed; right: 18px; bottom: 18px; z-index: 340; min-height: 38px; padding: 0 16px; background: rgba(212,63,56,0.18); border-color: rgba(212,63,56,0.56); }
.setup-panel { display: grid; gap: 16px; padding: 18px; width: min(660px, calc(100vw - 28px)); }

/* Replay Library is a full-screen workspace, not a setup dialog. */
#replays-screen.screen-layer {
  place-items: stretch;
  padding: 0;
  background:
    linear-gradient(rgba(7,10,11,0.58), rgba(7,10,11,0.88)),
    url("assets/Hero's Commission/Forest of The Beasts.png") center / cover fixed;
}
#replays-screen .replay-panel {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(14px, 1.5vw, 24px);
  padding: clamp(22px, 2.4vw, 40px);
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(232,194,77,0.12), transparent 30%),
    radial-gradient(circle at 84% 10%, rgba(98,184,255,0.16), transparent 34%),
    linear-gradient(180deg, rgba(8,12,13,0.9), rgba(4,6,7,0.95));
  box-shadow: none;
}
#replays-screen .screen-header {
  min-height: 78px;
  padding: 0 240px 16px 0;
  border-bottom: 1px solid rgba(232,194,77,0.22);
}
#replays-screen .screen-header h1 {
  font-size: clamp(2.5rem, 4.2vw, 4.5rem);
  line-height: 0.9;
}
#replays-screen .replay-toolbar {
  position: absolute;
  top: clamp(24px, 2.4vw, 40px);
  right: clamp(22px, 2.4vw, 40px);
  z-index: 2;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#replays-screen .replay-toolbar button {
  min-height: 44px;
  padding: 0 18px;
  background: rgba(13,16,17,0.82);
}
#replays-screen .replay-library-layout {
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  gap: clamp(16px, 1.8vw, 28px);
}
#replays-screen .replay-list,
#replays-screen .replay-detail {
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(232,194,77,0.24);
  background: linear-gradient(180deg, rgba(7,10,11,0.86), rgba(7,10,11,0.66));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 24px 70px rgba(0,0,0,0.24);
}
#replays-screen .replay-list {
  align-content: start;
  padding: 14px;
  overflow: auto;
}
#replays-screen .replay-detail {
  padding: clamp(22px, 2vw, 34px);
}
#replays-screen .replay-detail h2 {
  font-size: clamp(2rem, 3vw, 3.7rem);
}
#replays-screen .deck-empty {
  min-height: 92px;
  display: grid;
  align-content: center;
  padding: 16px 18px;
  border: 1px dashed rgba(232,194,77,0.24);
  background: rgba(255,255,255,0.035);
  color: rgba(242,239,217,0.78);
}
#replays-screen #replay-message {
  min-height: 28px;
  padding: 0 2px;
  align-self: end;
}
@media (max-width: 1120px) {
  #replays-screen .replay-library-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 0.92fr) minmax(220px, 0.68fr);
  }
  #replays-screen .screen-header {
    padding-right: 0;
  }
  #replays-screen .replay-toolbar {
    position: static;
    justify-content: flex-start;
  }
  #replays-screen .replay-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
}
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.deck-editor-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 14px; width: min(1180px, calc(100vw - 28px)); height: min(760px, calc(100vh - 28px)); }
.deck-header-actions { display: flex; gap: 8px; }
.deck-library-panel, .deck-editor-grid[hidden], .deck-library-panel[hidden] { display: none; }
.deck-library-panel:not([hidden]) { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); gap: 10px; }
.deck-library-list { min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(142px, auto); align-content: start; gap: 10px; overflow: auto; padding-right: 2px; }
.deck-library-card { aspect-ratio: 1 / 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; align-content: stretch; gap: 7px; padding: 8px; border: 1px solid rgba(232,194,77,0.38); background: rgba(255,255,255,0.06); color: var(--text); text-align: left; overflow: hidden; }
.deck-library-card img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: rgba(0,0,0,0.28); border: 1px solid rgba(0,0,0,0.55); }
.deck-library-card strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.deck-library-card small, .deck-rule-note, .deck-empty, .deck-status { color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
.deck-library-card:not(:disabled):hover { border-color: rgba(232,194,77,0.86); background: rgba(232,194,77,0.12); }
.deck-library-card.invalid { border-color: rgba(171,18,39,0.96); background: linear-gradient(180deg, rgba(132,4,31,0.42), rgba(34,2,10,0.66)); box-shadow: inset 0 0 0 1px rgba(255,56,86,0.34), 0 0 24px rgba(171,18,39,0.24); }
.deck-library-card.create-deck-card { text-align: center; justify-items: center; align-items: center; border-style: dashed; background: linear-gradient(180deg, rgba(232,194,77,0.12), rgba(255,255,255,0.035)); }
.create-deck-outline { width: min(72px, 62%); aspect-ratio: 5 / 7; display: grid; place-items: center; border: 2px dashed rgba(232,194,77,0.72); border-radius: 5px; color: var(--gold); font-size: 2.6rem; font-family: Arial, sans-serif; font-weight: 900; background: rgba(0,0,0,0.24); box-shadow: inset 0 0 18px rgba(232,194,77,0.08); }
.deck-rule-note { margin: 0; padding: 8px 10px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.2); }
.deck-empty { margin: 0; padding: 12px; border: 1px solid rgba(242,239,217,0.12); background: rgba(0,0,0,0.18); }
.deck-editor-grid { min-height: 0; display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr) minmax(210px, 280px); gap: 10px; }
.deck-filter-panel, .card-search-panel, .active-deck-panel { min-height: 0; display: grid; align-content: start; gap: 9px; padding: 10px; border: 1px solid rgba(242,239,217,0.14); background: rgba(0,0,0,0.22); }
.deck-filter-panel { overflow: auto; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deck-card-list { min-height: 0; display: grid; align-content: start; gap: 7px; overflow: auto; padding-right: 2px; }
.deck-card-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 58px; padding: 6px; border: 1px solid rgba(242,239,217,0.14); background: rgba(255,255,255,0.06); color: var(--text); text-align: left; }
.deck-card-row img { width: 38px; height: 52px; object-fit: cover; border: 1px solid rgba(0,0,0,0.65); }
.deck-card-copy { min-width: 0; display: grid; gap: 3px; }
.deck-card-copy strong, .deck-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card-copy small { color: var(--muted); font-size: 0.68rem; }
.deck-card-row .count-pill { min-width: 30px; padding: 3px 5px; border: 1px solid rgba(232,194,77,0.4); color: var(--gold); text-align: center; font-family: Arial, sans-serif; font-weight: 800; }
.deck-status[data-tone="ok"] { color: #7de08f; }
.deck-status[data-tone="warn"] { color: #ffd166; }
.danger-command { border-color: rgba(212,63,56,0.58); background: rgba(120,0,22,0.24); color: #ffd6d6; }
.danger-command:not(:disabled):hover { border-color: rgba(255,92,112,0.88); background: rgba(171,18,39,0.32); box-shadow: 0 0 18px rgba(171,18,39,0.24); }
.deck-card-row.deck-cover-card { border-color: rgba(232,194,77,0.96); box-shadow: 0 0 0 1px rgba(232,194,77,0.38), 0 0 22px rgba(232,194,77,0.22); }
.settings-note { color: var(--muted); font-size: 0.78rem; }
.account-settings-summary { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(242,239,217,0.14); background: rgba(255,255,255,0.045); }
.account-settings-summary span { color: var(--text); font-family: var(--serif); font-size: 1.22rem; font-weight: 900; }
.account-settings-summary small { color: var(--muted); font-family: Arial, sans-serif; }
.profile-avatar-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.profile-avatar-option { min-height: 132px; display: grid; place-items: center; align-content: center; gap: 8px; padding: 10px; background: rgba(0,0,0,0.22); color: var(--muted); font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 800; }
.profile-avatar-option img { width: 82px; height: 82px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(242,239,217,0.16); background: rgba(6,12,18,0.8); }
.profile-avatar-option:hover img { border-color: rgba(232,194,77,0.72); }
.profile-avatar-option.selected { border-color: rgba(103,188,123,0.86); background: rgba(103,188,123,0.12); color: #dbffe2; box-shadow: inset 0 0 0 1px rgba(103,188,123,0.22); }
.profile-avatar-option.selected img { border-color: rgba(103,188,123,0.92); box-shadow: 0 0 18px rgba(103,188,123,0.24); }
.account-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.account-settings-grid label { display: grid; gap: 5px; color: var(--muted); font-family: Arial, sans-serif; font-size: 0.78rem; text-transform: uppercase; }
.account-settings-grid input { width: 100%; min-height: 36px; border: 1px solid rgba(242,239,217,0.2); border-radius: 4px; background: rgba(0,0,0,0.36); color: var(--text); padding: 0 10px; font: inherit; }
.account-settings-grid button { min-height: 38px; }
.settings-note[data-tone="ok"] { color: #7de08f; }
.settings-note[data-tone="warn"] { color: #ffd166; }
@media (max-width: 820px) {
  .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tutorial-grid { grid-template-columns: 1fr; }
  .custom-game-toolbar, .room-browser-filters { grid-template-columns: 1fr 1fr; }
  .custom-game-toolbar .primary-command { grid-column: 1 / -1; }
  .custom-game-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-game-content { grid-template-columns: 1fr; overflow: auto; }
  .room-list { grid-template-columns: 1fr; }
  .menu-card { min-height: 92px; }
  .deck-library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-editor-grid { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
  .deck-filter-panel { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-filter-panel > .primary-command { align-self: end; }
}
@media (max-width: 560px) {
  .menu-grid, .setup-grid, .custom-game-toolbar, .room-browser-filters { grid-template-columns: 1fr; }
  .custom-game-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .custom-game-content, .public-queue-dice { grid-template-columns: 1fr; }
  .account-settings-grid { grid-template-columns: 1fr; }
  .menu-card { min-height: 72px; }
  .deck-editor-shell { height: calc(100vh - 20px); }
  .deck-editor-grid { grid-template-columns: 1fr; grid-template-rows: 250px 1fr 1fr; }
  .deck-filter-panel { grid-column: auto; grid-template-columns: 1fr 1fr; gap: 6px; }
  .screen-header, .menu-header { align-items: start; }
}

.result-menu { position: fixed; inset: 0; z-index: 1600; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(232,194,77,0.18), rgba(0,0,0,0.86) 48%, rgba(0,0,0,0.96)); }
.result-menu[hidden] { display: none; }
.result-dialog { width: min(560px, calc(100vw - 42px)); display: grid; justify-items: center; gap: 12px; padding: 28px 24px; border: 1px solid rgba(232,194,77,0.62); background: linear-gradient(180deg, rgba(20,24,25,0.98), rgba(7,10,11,0.96)); color: var(--text); text-align: center; box-shadow: 0 28px 90px rgba(0,0,0,0.72), 0 0 48px rgba(232,194,77,0.18); animation: result-arrive 620ms cubic-bezier(0.18,0.84,0.22,1) both; }
.result-dialog::before { content: ""; width: 132px; height: 4px; background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 22px rgba(232,194,77,0.72); }
.result-dialog h2 { color: var(--gold); font-size: clamp(2rem, 7vw, 4rem); line-height: 0.95; text-transform: uppercase; text-shadow: 0 3px 18px #000; }
.result-dialog p { margin: 0; color: var(--muted); font-family: Arial, sans-serif; }
.result-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.result-actions button { min-width: 154px; }
@keyframes result-arrive { 0% { opacity: 0; transform: translateY(34px) scale(0.88); filter: brightness(1.8); } 58% { opacity: 1; transform: translateY(-5px) scale(1.04); filter: brightness(1.12); } 100% { opacity: 1; transform: translateY(0) scale(1); filter: brightness(1); } }


/* Deck editor visual grid layout */
.deck-editor-shell { width: min(1500px, calc(100vw - 24px)); height: min(820px, calc(100vh - 24px)); }
.deck-editor-grid { grid-template-columns: 212px 250px minmax(500px, 1fr) 230px; gap: 10px; }
.deck-filter-panel, .card-search-panel, .active-deck-panel, .deck-preview-panel { min-height: 0; display: grid; align-content: start; gap: 8px; padding: 9px; border: 1px solid rgba(242,239,217,0.14); background: rgba(0,0,0,0.22); }
.deck-filter-panel { overflow: auto; }
.deck-filter-panel [hidden] { display: none; }
.card-search-panel, .active-deck-panel { grid-template-rows: auto minmax(0, 1fr); }
.card-search-panel h2, .active-deck-panel h2 { font-size: 0.92rem; line-height: 1; }
.deck-card-list { min-height: 0; overflow: auto; padding-right: 2px; }
.search-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 8px; }
.deck-collage-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 6px; overflow: hidden; }
.deck-card-row.deck-image-card { position: relative; display: grid; place-items: center; min-height: 0; padding: 3px; border: 1px solid rgba(242,239,217,0.16); background: rgba(255,255,255,0.055); color: var(--text); }
.deck-card-row.deck-image-card:not(:disabled):hover, .deck-card-row.deck-image-card:focus-visible { border-color: rgba(232,194,77,0.92); box-shadow: 0 0 0 1px rgba(232,194,77,0.34), 0 0 20px rgba(232,194,77,0.22); }
.deck-card-row.deck-image-card:disabled { opacity: 0.46; filter: grayscale(0.55); cursor: not-allowed; }
.deck-card-row.deck-image-card img { width: min(100%, 68px); height: auto; aspect-ratio: 5 / 7; object-fit: cover; border: 1px solid rgba(0,0,0,0.72); box-shadow: 0 7px 14px rgba(0,0,0,0.42); }
.deck-card-row.deck-copy-card img { width: min(100%, 44px); }
.deck-card-row.deck-image-card .count-pill { position: absolute; right: 2px; bottom: 2px; min-width: 24px; padding: 2px 3px; border: 1px solid rgba(232,194,77,0.52); background: rgba(8,10,11,0.88); color: var(--gold); font-size: 0.58rem; line-height: 1; }
.deck-empty-slot { display: grid; place-items: center; min-height: 64px; border: 1px dashed rgba(242,239,217,0.14); background: rgba(255,255,255,0.025); color: rgba(242,239,217,0.24); font-family: Arial, sans-serif; font-size: 0.58rem; }
.deck-card-row.deck-image-card[draggable="true"] { cursor: grab; }
.deck-card-row.deck-image-card.dragging-card { opacity: 1; transform: translateY(-10px) scale(1.05) rotate(-1deg); border-color: rgba(232,194,77,0.98); box-shadow: 0 18px 36px rgba(0,0,0,0.62), 0 0 34px rgba(232,194,77,0.34); cursor: grabbing; z-index: 8; }
.deck-card-row.deck-image-card.drag-over-card { border-color: rgba(38,167,242,0.95); box-shadow: inset 0 0 0 2px rgba(38,167,242,0.45), 0 0 26px rgba(38,167,242,0.32); }
.deck-drag-ghost { position: fixed !important; left: -1000px !important; top: -1000px !important; display: grid !important; place-items: center !important; aspect-ratio: 5 / 7 !important; opacity: 1 !important; pointer-events: none !important; overflow: visible !important; transform: scale(1.08) rotate(-2deg) !important; border: 2px solid rgba(232,194,77,0.96) !important; border-radius: 4px !important; background: rgba(8,10,11,0.86) !important; box-shadow: 0 22px 42px rgba(0,0,0,0.72), 0 0 30px rgba(232,194,77,0.28) !important; z-index: 2000 !important; }
.deck-drag-ghost img { display: block !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: contain !important; }
.deck-preview-panel { grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.deck-preview-panel img { width: min(100%, 168px); justify-self: center; aspect-ratio: 5 / 7; object-fit: cover; border: 2px solid rgba(0,0,0,0.74); background: rgba(0,0,0,0.32); box-shadow: 0 16px 36px rgba(0,0,0,0.46); }
.deck-preview-panel h2 { font-size: 1.05rem; line-height: 1.05; }
.deck-preview-panel p { min-height: 0; overflow: auto; color: var(--text); font-family: Arial, sans-serif; font-size: 0.76rem; line-height: 1.34; }
.deck-preview-panel .inspect-line, .deck-preview-panel .inspect-statuses { display: block; margin: 0 0 6px; color: var(--muted); }
@media (max-width: 1100px) {
  .deck-editor-grid { grid-template-columns: 190px minmax(210px, 250px) minmax(420px, 1fr); }
  .deck-preview-panel { display: none; }
  .deck-collage-grid { gap: 5px; }
  .deck-card-row.deck-copy-card img { width: min(100%, 40px); }
}
@media (max-width: 760px) {
  .deck-editor-shell { height: calc(100vh - 16px); }
  .deck-editor-grid { grid-template-columns: 1fr; grid-template-rows: auto 210px minmax(300px, 1fr); }
  .search-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .deck-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-collage-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}


/* Keep card preview available on the right even in narrow editor viewports. */
.deck-editor-shell { position: relative; }
@media (max-width: 1100px) {
  .deck-editor-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(160px, 210px) minmax(260px, 1fr); padding-right: 190px; }
  .deck-preview-panel { position: absolute; right: 9px; top: 70px; bottom: 12px; width: 176px; z-index: 4; display: grid; }
  .deck-preview-panel img { width: 122px; }
  .deck-preview-panel h2 { font-size: 0.9rem; }
  .deck-preview-panel p { font-size: 0.68rem; }
  .deck-collage-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .deck-card-row.deck-copy-card img { width: min(100%, 40px); }
}
@media (max-width: 760px) {
  .deck-editor-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(150px, 190px) minmax(250px, 1fr); padding-right: 178px; }
  .deck-preview-panel { top: 68px; width: 164px; }
  .deck-preview-panel img { width: 112px; }
}


/* Full-screen deck editor pass */
.deck-editor-screen { padding: 6px; place-items: stretch; }
.deck-editor-screen .deck-editor-shell { width: calc(100vw - 12px); height: calc(100vh - 12px); max-height: none; padding: 10px; gap: 8px; }
.deck-editor-screen .screen-header { min-height: 48px; }
.deck-editor-screen .screen-header h1 { font-size: clamp(1.25rem, 2.4vw, 2rem); }
.deck-editor-screen .deck-editor-grid { grid-template-columns: 250px minmax(315px, 390px) minmax(620px, 1fr) 340px; grid-template-rows: minmax(0, 1fr); gap: 8px; min-height: 0; }
.deck-editor-screen .deck-filter-panel, .deck-editor-screen .card-search-panel, .deck-editor-screen .active-deck-panel, .deck-editor-screen .deck-preview-panel { padding: 8px; gap: 8px; }
.deck-editor-screen .deck-filter-panel { grid-auto-rows: min-content; }
.deck-editor-screen .deck-filter-panel label { font-size: 0.7rem; }
.deck-editor-screen .deck-filter-panel input, .deck-editor-screen .deck-filter-panel select, .deck-editor-screen #deck-name { min-height: 34px; }
.deck-editor-screen #typing-filter-row { grid-column: 1 / -1; }
.deck-editor-screen .search-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.deck-editor-screen .deck-collage-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 7px; }
.deck-editor-screen .deck-card-row.deck-image-card { overflow: hidden; min-height: 118px; padding: 0; aspect-ratio: 5 / 7; border-radius: 3px; }
.deck-editor-screen .deck-collage-grid .deck-card-row.deck-image-card { min-height: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.deck-editor-screen .deck-card-row.deck-image-card img, .deck-editor-screen .deck-card-row.deck-copy-card img { width: 100%; height: 100%; max-width: none; aspect-ratio: auto; object-fit: cover; border: 0; box-shadow: none; }
.deck-editor-screen .deck-card-row.deck-image-card .count-pill { right: 0; bottom: 0; min-width: 34px; padding: 5px 6px; border-width: 0 0 0 1px; background: linear-gradient(135deg, rgba(8,10,11,0.25), rgba(8,10,11,0.95)); color: #fff3a3; font-size: 0.72rem; text-shadow: 0 1px 4px #000; }
.deck-editor-screen .deck-empty-slot { min-height: 0; aspect-ratio: auto; }
.deck-editor-screen .deck-preview-panel { grid-template-rows: minmax(360px, 1.2fr) auto minmax(0, 1fr); }
.deck-editor-screen .deck-preview-panel img { width: min(100%, 300px); align-self: start; }
.deck-editor-screen .deck-preview-panel h2 { font-size: 1.34rem; }
.deck-editor-screen .deck-preview-panel p { font-size: 0.86rem; line-height: 1.38; }
.deck-editor-screen .deck-preview-panel .eyebrow { font-size: 0.72rem; }
@media (max-width: 1300px) {
  .deck-editor-screen .deck-editor-grid { grid-template-columns: 230px minmax(280px, 330px) minmax(450px, 1fr) 280px; }
  .deck-editor-screen .deck-preview-panel img { width: min(100%, 238px); }
}
@media (max-width: 980px) {
  .deck-editor-screen .deck-editor-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 260px minmax(360px, 1fr) 320px; padding-right: 0; }
  .deck-editor-screen .deck-preview-panel { position: static; width: auto; display: grid; }
}


/* Preserve true card proportions in the deck editor. */
.deck-editor-screen .deck-card-row.deck-image-card img, .deck-editor-screen .deck-card-row.deck-copy-card img { width: auto; height: 100%; max-width: 100%; aspect-ratio: auto; object-fit: contain; border: 0; box-shadow: none; justify-self: center; }
.deck-editor-screen .deck-card-row.deck-image-card { background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(0,0,0,0.22)); }
.deck-editor-screen .deck-collage-grid .deck-card-row.deck-image-card { display: grid; place-items: center; }


/* Sequence resolution presentation */
.sequence-build-overlay {
  position: absolute;
  inset: 0;
  z-index: 822;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(232,194,77,0.28), rgba(18,22,24,0.74) 44%, rgba(0,0,0,0.82));
}
.sequence-build-overlay::before {
  content: "";
  position: absolute;
  inset: -18%;
  background: conic-gradient(from 0deg, rgba(232,194,77,0.2), rgba(38,167,242,0.18), rgba(212,63,56,0.18), rgba(232,194,77,0.2));
  animation: sequence-spin 4200ms linear infinite;
  opacity: 0.56;
}
.sequence-build-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 0 31%, rgba(255,255,255,0.2) 32%, transparent 43%);
  animation: sequence-ring 900ms ease-out infinite;
  opacity: 0.7;
}
.sequence-build-overlay[hidden] { display: none; }
.sequence-build-title {
  position: absolute;
  top: 54px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 10px 34px;
  border-top: 2px solid rgba(232,194,77,0.9);
  border-bottom: 2px solid rgba(232,194,77,0.9);
  background: linear-gradient(90deg, transparent, rgba(7,10,11,0.92), transparent);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-size: 1.72rem;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 4px 18px #000;
  animation: sequence-title-pop 620ms ease both;
}
.sequence-build-rail {
  position: relative;
  z-index: 4;
  width: min(92%, 1120px);
  height: clamp(270px, 42vh, 420px);
}
.sequence-build-overlay .sequence-card {
  --build-x: 0px;
  --delay: calc(var(--sequence-index) * 30ms);
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(150px, 16vw, 250px);
  gap: 10px;
  opacity: 1;
  transform: translate(calc(-50% + var(--build-x)), -50%);
  animation: sequence-build-card 1180ms cubic-bezier(0.16,0.85,0.24,1) both;
  filter: drop-shadow(0 24px 36px rgba(0,0,0,0.82));
}
.sequence-build-overlay .sequence-card.active-build { z-index: 8; animation: sequence-build-active 1540ms cubic-bezier(0.16,0.85,0.24,1) both; }
.sequence-build-overlay .sequence-card.pushed-build { z-index: calc(6 - var(--sequence-index)); opacity: 0.82; }
.sequence-build-overlay .sequence-card img { border-width: 6px; box-shadow: 0 0 0 2px rgba(232,194,77,0.68), 0 0 48px rgba(232,194,77,0.42); }
.sequence-build-overlay .sequence-card strong { font-size: 0.95rem; line-height: 1.08; }
.sequence-build-overlay .sequence-card small { font-size: 0.72rem; }
.sequence-animation { grid-template-columns: 1fr; place-items: center; padding: 54px; background: radial-gradient(circle at center, rgba(232,194,77,0.32), rgba(18,22,24,0.9) 44%, rgba(0,0,0,0.96)); }
.sequence-animation::before { background: conic-gradient(from 0deg, rgba(232,194,77,0.2), rgba(38,167,242,0.18), rgba(212,63,56,0.18), rgba(232,194,77,0.2)); animation: sequence-spin 4200ms linear infinite; opacity: 0.68; }
.sequence-animation::after { background: radial-gradient(circle, transparent 0 32%, rgba(255,255,255,0.24) 33%, transparent 44%); animation: sequence-ring 900ms ease-out infinite; }
.sequence-title { position: absolute; top: 54px; left: 50%; z-index: 5; transform: translateX(-50%); padding: 10px 34px; border-top: 2px solid rgba(232,194,77,0.9); border-bottom: 2px solid rgba(232,194,77,0.9); background: linear-gradient(90deg, transparent, rgba(7,10,11,0.92), transparent); color: var(--gold); font-family: Arial, sans-serif; font-size: 1.9rem; font-weight: 900; text-transform: uppercase; text-shadow: 0 4px 18px #000; animation: sequence-title-pop 620ms ease both; }
.sequence-rail { position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 42px); max-width: 94%; }
.sequence-card { --delay: calc(var(--sequence-index) * 720ms); position: relative; width: clamp(150px, 16vw, 250px); display: grid; justify-items: center; gap: 10px; opacity: 0; transform: translateY(30px) scale(0.78) rotate(-5deg); animation: sequence-card-resolve 980ms cubic-bezier(0.16,0.85,0.24,1) var(--delay) both; filter: drop-shadow(0 24px 36px rgba(0,0,0,0.82)); }
.sequence-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border: 6px solid rgba(9,11,12,0.96); box-shadow: 0 0 0 2px rgba(232,194,77,0.68), 0 0 44px rgba(232,194,77,0.45); background: #090b0c; }
.sequence-card strong { max-width: 100%; color: #fff4b8; font-family: Arial, sans-serif; font-size: 0.95rem; text-align: center; text-transform: uppercase; text-shadow: 0 2px 10px #000; }
.sequence-card small { color: var(--muted); font-family: Arial, sans-serif; font-size: 0.72rem; font-weight: 900; text-align: center; text-transform: uppercase; text-shadow: 0 2px 8px #000; }
.sequence-burst { position: absolute; z-index: 3; width: 34vmin; height: 34vmin; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.72), rgba(232,194,77,0.38) 24%, rgba(38,167,242,0.22) 46%, transparent 68%); opacity: 0; animation: sequence-burst 980ms ease-out 540ms both; }
.sequence-resolve-step .sequence-resolve-rail { position: relative; width: min(92%, 1120px); height: clamp(250px, 39vh, 390px); }
.sequence-resolve-step .sequence-card {
  --delay: 0ms;
  --resolve-x: 0px;
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(122px, 12vw, 184px);
  animation: sequence-side-fade 1650ms ease both;
}
.sequence-resolve-step .sequence-card.active-resolve {
  z-index: 7;
  width: clamp(150px, 16vw, 250px);
  animation: sequence-active-resolve 1650ms cubic-bezier(0.16,0.85,0.24,1) both;
}
.sequence-resolve-step .sequence-card:not(.active-resolve) img { box-shadow: 0 0 0 1px rgba(232,194,77,0.3), 0 0 22px rgba(0,0,0,0.64); }
.sequence-choice-dialog { width: min(520px, calc(100vw - 40px)); text-align: center; }
.sequence-list-dialog { width: min(760px, calc(100vw - 40px)); }
@keyframes sequence-build-card { 0% { opacity: 0.26; transform: translate(calc(-50% + var(--build-x) + 80px), calc(-50% + 18px)) scale(0.72) rotate(6deg); filter: brightness(0.7) blur(2px); } 64% { opacity: 0.86; transform: translate(calc(-50% + var(--build-x) - 10px), calc(-50% - 12px)) scale(1.03) rotate(-2deg); filter: brightness(1.18) blur(0); } 100% { opacity: 0.82; transform: translate(calc(-50% + var(--build-x)), -50%) scale(0.96); filter: brightness(0.92); } }
@keyframes sequence-build-active { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 54px)) scale(0.64) rotate(-7deg); filter: brightness(2) blur(4px); } 42% { opacity: 1; transform: translate(-50%, calc(-50% - 22px)) scale(1.18) rotate(2deg); filter: brightness(1.62) blur(0); } 76% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); filter: brightness(1.18); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1); } }
@keyframes sequence-title-pop { 0% { opacity: 0; transform: translate(-50%, -18px) scale(0.82); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes sequence-card-resolve { 0% { opacity: 0; transform: translateY(42px) scale(0.72) rotate(-8deg); filter: brightness(1.8) blur(3px); } 42% { opacity: 1; transform: translateY(-18px) scale(1.08) rotate(2deg); filter: brightness(1.45) blur(0); } 72% { opacity: 1; transform: translateY(0) scale(1) rotate(0); filter: brightness(1.1); } 100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); filter: brightness(1); } }
@keyframes sequence-active-resolve { 0% { opacity: 1; transform: translate(calc(-50% + var(--resolve-x, 0px)), -50%) scale(1) rotate(-2deg); filter: brightness(1); } 42% { opacity: 1; transform: translate(calc(-50% + var(--resolve-x, 0px) + var(--resolve-shift, 0px)), calc(-50% - 28px)) scale(1.28) rotate(1deg); filter: brightness(1.6); } 100% { opacity: 1; transform: translate(calc(-50% + var(--resolve-x, 0px) + var(--resolve-shift, 0px)), -50%) scale(1.18) rotate(0); filter: brightness(1.18); } }
@keyframes sequence-side-fade { 0% { opacity: 1; transform: translate(calc(-50% + var(--resolve-x, 0px)), -50%) scale(0.96); filter: brightness(0.92); } 44% { opacity: 0.38; transform: translate(calc(-50% + var(--resolve-x, 0px) + 44px), calc(-50% + 8px)) scale(0.82); filter: brightness(0.56); } 100% { opacity: 0.08; transform: translate(calc(-50% + var(--resolve-x, 0px) + 104px), calc(-50% + 16px)) scale(0.7); filter: brightness(0.28); } }
@keyframes sequence-burst { 0% { opacity: 0; transform: scale(0.2); } 40% { opacity: 0.95; } 100% { opacity: 0; transform: scale(2.3); } }
@keyframes sequence-spin { to { transform: rotate(360deg); } }
@keyframes sequence-ring { 0% { opacity: 0.78; transform: scale(0.7); } 100% { opacity: 0; transform: scale(1.65); } }
.resolve-animation { grid-template-columns: 1fr; place-items: center; padding: 56px; background: radial-gradient(circle at center, rgba(38,167,242,0.24), rgba(13,16,17,0.92) 42%, rgba(0,0,0,0.96)); }
.resolve-animation::before { background: linear-gradient(120deg, transparent 0 28%, rgba(232,194,77,0.2) 44%, rgba(38,167,242,0.2) 55%, transparent 72%); animation: resolve-flow 1650ms ease-in-out infinite; }
.resolve-animation::after { background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 34%), conic-gradient(from 90deg, transparent, rgba(232,194,77,0.24), transparent, rgba(38,167,242,0.24), transparent); animation: resolve-aura 1600ms ease-in-out infinite alternate; opacity: 0.78; }
.upkeep-animation { grid-template-columns: 1fr; place-items: center; padding: 56px; background: radial-gradient(circle at center, rgba(232,194,77,0.28), rgba(13,16,17,0.92) 44%, rgba(0,0,0,0.96)); }
.upkeep-animation::before { background: conic-gradient(from 20deg, transparent, rgba(232,194,77,0.26), transparent, rgba(38,167,242,0.2), transparent); animation: resolve-aura 1450ms ease-in-out both; opacity: 0.88; }
.upkeep-animation::after { background: radial-gradient(circle, rgba(255,246,187,0.28), transparent 35%); animation: sequence-ring 960ms ease-out infinite; }
.upkeep-animation.failed { background: radial-gradient(circle at center, rgba(168,31,32,0.34), rgba(13,16,17,0.94) 44%, rgba(0,0,0,0.98)); }
.upkeep-animation.failed::before { background: linear-gradient(135deg, transparent 0 38%, rgba(255,77,77,0.34) 44%, transparent 50% 100%); animation: battle-slash 820ms ease both; }
.upkeep-animation.failed .upkeep-card { animation: upkeep-fail-card 1450ms ease both; }
.upkeep-animation.paid .upkeep-card { animation: upkeep-paid-card 1450ms cubic-bezier(0.16,0.85,0.24,1) both; }
.resolve-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: clamp(170px, 18vw, 280px); display: grid; justify-items: center; gap: 12px; filter: drop-shadow(0 28px 42px rgba(0,0,0,0.84)); animation: resolve-card-flow 1250ms cubic-bezier(0.16,0.84,0.24,1) both; }
.resolve-card img { width: 100%; aspect-ratio: 5 / 7; object-fit: contain; border: 7px solid rgba(9,11,12,0.96); background: #090b0c; box-shadow: 0 0 0 2px rgba(232,194,77,0.72), 0 0 54px rgba(38,167,242,0.42); }
.resolve-card strong { color: #fff4b8; font-family: Arial, sans-serif; font-size: 1.02rem; text-align: center; text-transform: uppercase; text-shadow: 0 2px 10px #000; }
.resolve-owner { color: var(--muted); font-family: Arial, sans-serif; font-size: 0.82rem; font-weight: 800; text-transform: uppercase; text-shadow: 0 2px 8px #000; }
.resolve-title { position: absolute; left: 50%; top: 58px; z-index: 6; transform: translateX(-50%); padding: 9px 30px; border-top: 2px solid rgba(38,167,242,0.86); border-bottom: 2px solid rgba(232,194,77,0.86); background: linear-gradient(90deg, transparent, rgba(7,10,11,0.92), transparent); color: #fff4b8; font-family: Arial, sans-serif; font-size: 1.55rem; font-weight: 900; text-transform: uppercase; text-shadow: 0 3px 16px #000; animation: sequence-title-pop 520ms ease both; }
@keyframes resolve-flow { 0% { transform: translateX(-40%) skewX(-12deg); opacity: 0.22; } 50% { opacity: 0.72; } 100% { transform: translateX(40%) skewX(-12deg); opacity: 0.22; } }
@keyframes resolve-aura { from { transform: scale(0.92) rotate(0deg); opacity: 0.46; } to { transform: scale(1.08) rotate(18deg); opacity: 0.8; } }
@keyframes resolve-card-flow { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 48px)) scale(0.78); filter: brightness(1.8) blur(3px); } 42% { opacity: 1; transform: translate(-50%, calc(-50% - 14px)) scale(1.08); filter: brightness(1.35) blur(0); } 76% { transform: translate(-50%, -50%) scale(1); filter: brightness(1.12); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1); } }
@keyframes upkeep-paid-card { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 26px)) scale(0.76); filter: brightness(1.8) blur(2px); } 52% { opacity: 1; transform: translate(-50%, calc(-50% - 14px)) scale(1.12); filter: brightness(1.45) blur(0); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1.05); } }
@keyframes upkeep-fail-card { 0% { opacity: 0; transform: translate(-50%, calc(-50% + 22px)) scale(0.76) rotate(-2deg); filter: brightness(1.4) blur(2px); } 42% { opacity: 1; transform: translate(-50%, calc(-50% - 8px)) scale(1.08) rotate(2deg); filter: brightness(1.1) saturate(1.35); } 76% { opacity: 0.9; transform: translate(-50%, calc(-50% + 4px)) scale(0.96) rotate(-4deg); filter: brightness(0.72) saturate(0.8); } 100% { opacity: 0.18; transform: translate(-50%, calc(-50% + 34px)) scale(0.84) rotate(5deg); filter: brightness(0.42) blur(1px); } }


/* Width-driven deck cards: preserve image aspect ratio without skinny grid sizing. */
.deck-editor-screen .deck-card-row.deck-image-card img, .deck-editor-screen .deck-card-row.deck-copy-card img { width: 100%; height: auto; max-height: 100%; object-fit: contain; align-self: center; justify-self: center; }
.deck-editor-screen .deck-card-row.deck-image-card, .deck-editor-screen .deck-collage-grid .deck-card-row.deck-image-card { aspect-ratio: 5 / 7; }

.deck-editor-screen .deck-card-row.deck-image-card { grid-template-columns: 1fr; grid-template-rows: 1fr; }


/* Opponent board cards face the other player; the hand fan owns its own rotation. */
.enemy-zone:not(.enemy-hand-zone) .card-tile, .enemy-zone:not(.enemy-hand-zone) .slot { rotate: 180deg; }
.enemy-hand-zone .card-tile, .enemy-hand-zone .slot { rotate: 0deg; }

/* Deck editor add-card grid: true card-shaped tiles with no overlap. */
.deck-editor-screen .search-card-grid { grid-auto-rows: auto; align-items: start; overflow-y: auto; overflow-x: hidden; }
.deck-editor-screen .search-card-grid .deck-card-row.deck-image-card { width: 100%; height: auto; min-height: 0; aspect-ratio: 5 / 7; align-self: start; justify-self: stretch; }
.deck-editor-screen .search-card-grid .deck-card-row.deck-image-card img { width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.deck-editor-screen .search-card-grid .deck-card-row.deck-image-card .count-pill { position: absolute; right: 0; bottom: 0; }


/* Stable non-overlapping add-card browser layout. */
.deck-editor-screen .search-card-grid { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 10px; overflow-y: auto; overflow-x: hidden; }
.deck-editor-screen .search-card-grid .deck-card-row.deck-image-card { flex: 0 0 calc((100% - 20px) / 3); width: calc((100% - 20px) / 3); height: auto; aspect-ratio: 5 / 7; }

/* Deck/replay preview popups use the same single-cell card tiles as the editor collage. */
.replay-deck-cards .deck-card-row.deck-image-card,
.replay-deck-cards .deck-preview-slot {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  aspect-ratio: auto;
  overflow: hidden;
}
.replay-deck-cards .deck-card-row.deck-image-card img,
.replay-deck-cards .deck-preview-slot img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  justify-self: stretch;
  align-self: stretch;
  border: 0;
  box-shadow: none;
}
.replay-deck-cards .deck-empty-slot {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}


/* Full-screen duel table layout */
body[data-screen="duel"] .app-shell {
  inset: 6px;
  left: 6px;
  top: 6px;
  width: calc(100vw - 12px);
  height: calc(100vh - 12px);
  min-height: 0;
  padding: 0;
  transform: none;
  transform-origin: top left;
  display: block;
  grid-template-columns: none;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  align-content: stretch;
  align-items: stretch;
  overflow: hidden;
}
.tabletop-frame {
  position: fixed;
  left: var(--duel-table-left, 6px);
  top: var(--duel-table-top, 6px);
  width: var(--duel-table-w, 1620px);
  height: var(--duel-table-h, 1100px);
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  justify-self: start;
  overflow: visible;
}
body[data-screen="duel"] .tabletop {
  width: 1620px;
  height: 1100px;
  min-height: 0;
  transform: scale(var(--duel-scale, 1));
  transform-origin: top left;
}
body[data-screen="duel"] .duel-mat {
  height: var(--mat-h);
  min-height: var(--mat-h);
}
body[data-screen="duel"] .choice-menu,
body[data-screen="duel"] .screen-feedback {
  left: var(--duel-mat-left, 6px);
  top: var(--duel-mat-top, 6px);
  right: auto;
  bottom: auto;
  width: var(--duel-mat-w, 100vw);
  height: var(--duel-mat-h, 100vh);
}
body[data-screen="duel"] .choice-menu {
  width: var(--duel-mat-w, 100vw);
  height: var(--duel-mat-h, 100vh);
  transform: none;
}
body[data-screen="duel"] .screen-feedback {
  position: fixed;
  display: grid;
  place-self: center;
  justify-self: center;
  align-self: center;
  left: var(--duel-mat-center-x, 50%);
  top: var(--duel-mat-center-y, 50%);
  right: auto;
  bottom: auto;
  width: max-content;
  height: auto;
  transform: translate(-50%, -50%) translateY(-18px) scale(0.96);
}
body[data-screen="duel"] .effect-resume-button {
  left: var(--duel-mat-center-x, 50%);
  bottom: calc(100vh - var(--duel-mat-top, 0px) - var(--duel-mat-h, 100vh) + 18px);
}
body[data-screen="duel"] .side-panel {
  position: fixed;
  left: var(--duel-sidebar-left, calc(100vw - 340px));
  top: var(--duel-sidebar-top, 116px);
  width: var(--duel-sidebar-w, 340px);
  height: var(--duel-sidebar-h, calc(100vh - 128px));
  max-height: none;
  min-height: 0;
  overflow: hidden auto;
}
body[data-screen="duel"] .comms-panel {
  position: fixed;
  left: var(--duel-left-panel-left, 6px);
  top: var(--duel-sidebar-top, 116px);
  width: var(--duel-left-panel-w, 0px);
  height: var(--duel-sidebar-h, calc(100vh - 128px));
  z-index: 1115;
  max-height: none;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  opacity: 1;
  pointer-events: auto;
}
body[data-screen="duel"].left-comms-hidden .comms-panel,
body[data-screen="duel"].left-comms-auto-hidden .comms-panel {
  display: none;
}
body[data-screen="duel"].left-comms-auto-hidden .comms-toggle { display: none; }
body[data-screen="duel"].duel-game-over .comms-tab,
body[data-screen="duel"].duel-game-over .chat-form input,
body[data-screen="duel"].duel-game-over .chat-form button {
  opacity: 0.48;
  filter: grayscale(0.45) brightness(0.82);
}
body.result-screen-open .sidebar-toggle,
body.result-screen-open .comms-toggle,
body.result-screen-open .side-panel,
body.result-screen-open .comms-panel,
body.result-screen-open .table-corner-tools,
body.result-screen-open .sequence-cycle-button,
body.result-screen-open #advance-stage {
  opacity: 0.28;
  filter: grayscale(0.65) brightness(0.7);
  pointer-events: none;
}
body[data-screen="duel"] .inspector {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}
body[data-screen="duel"] .inspector img {
  max-height: min(44vh, 420px);
}
@media (max-width: 980px) {
  body[data-screen="duel"] .app-shell {
    grid-template-columns: none;
    gap: 6px;
  }
  body[data-screen="duel"] .side-panel { padding: 8px; }
  body[data-screen="duel"] .sidebar-stats { grid-template-columns: 1fr; }
}


/* Large card image preview */
.image-zoom-menu { position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at center, rgba(232,194,77,0.16), rgba(0,0,0,0.82) 46%, rgba(0,0,0,0.95)); }
.image-zoom-menu[hidden] { display: none; }
.image-zoom-dialog { position: relative; display: grid; place-items: center; width: min(92vw, 620px); height: min(92vh, 860px); }
.image-zoom-dialog img { box-sizing: border-box; max-width: min(100%, calc((92vh - 48px) * 5 / 7)); max-height: calc(92vh - 48px); aspect-ratio: 5 / 7; object-fit: contain; border: 8px solid rgba(8,10,11,0.96); background: #090b0c; box-shadow: 0 30px 90px rgba(0,0,0,0.86), 0 0 0 2px rgba(232,194,77,0.58), 0 0 46px rgba(232,194,77,0.28); }
.image-zoom-dialog .icon-command { position: absolute; right: 0; top: 0; z-index: 2; background: rgba(13,16,17,0.94); }
#inspect-art, #deck-preview-art { cursor: zoom-in; }
