/* Casino War layout. Betting controls retain the shared Mines dimensions. */
.war-game{border:1px solid var(--line);border-radius:18px;background:linear-gradient(145deg,rgba(18,51,38,.96),rgba(5,16,11,.98))}
.game-main{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:12px;padding:12px;align-items:start}
.war-game>.stats,.war-game>.round-history{margin:0 12px 18px}
.war-game .control-panel{min-width:0}
.control-panel .round-readout{min-width:0;grid-template-columns:repeat(2,minmax(0,1fr))}
.control-panel .readout-card,.control-panel .field-label output{min-width:0;overflow-wrap:anywhere}
.control-panel .field-label output{text-align:right}

/* Fixed tracks reserve space for both opening cards and three-card WAR hands. */
.war-table{
  --war-table-height:clamp(440px,calc(100dvh - 280px),560px);
  --war-hand-height:calc((var(--war-table-height) - 120px) / 2);
  --war-stage-height:calc(var(--war-hand-height) - 18px);
  --war-card-size:min(100px,calc((var(--war-stage-height) - 22px) / 1.4),calc((100cqw - 32px) / 3));
  container-type:inline-size;display:grid;grid-template-rows:minmax(0,1fr);
  min-width:0;min-height:0;height:var(--war-table-height);padding:10px;
  border-width:6px;border-radius:26px;overflow:visible;
  scroll-margin-top:calc(var(--fvc-shell-mobilebar-height,64px) + 12px);
}
.war-table::before{border-radius:20px}.war-table::after{inset:5px;border-radius:19px}
.war-table.is-war{animation:none;transform:none}
/* Shared Mines/Hi-Lo amount effect, rising from the Casino War felt. */
.war-table .cashout-pop{position:absolute;z-index:10;top:50%;left:50%;width:max-content;white-space:nowrap;font:950 clamp(42px,10vw,74px)/1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:-.07em;opacity:0;pointer-events:none;transform:translate(-50%,-40%) scale(.76)}
.cashout-pop.win{color:#8af0a8;text-shadow:0 3px 0 #174e2a,0 8px 28px rgba(0,0,0,.72),0 0 26px rgba(100,210,138,.38)}
.cashout-pop.loss{color:#ff8179;text-shadow:0 3px 0 #6d211d,0 8px 28px rgba(0,0,0,.72),0 0 26px rgba(239,114,104,.4)}
.cashout-pop[hidden]{display:none}
.cashout-pop.is-active{animation:cashoutAmountPop 1.15s cubic-bezier(.2,.82,.3,1) forwards}
@keyframes cashoutAmountPop{0%{opacity:0;transform:translate(-50%,-34%) scale(.76)}18%{opacity:1;transform:translate(-50%,-50%) scale(1.08)}58%{opacity:1;transform:translate(-50%,-56%) scale(1)}100%{opacity:0;transform:translate(-50%,-88%) scale(.96)}}
@keyframes cashoutAmountFade{0%,70%{opacity:1;transform:translate(-50%,-50%)}100%{opacity:0;transform:translate(-50%,-50%)}}
@media(prefers-reduced-motion:reduce){.cashout-pop.is-active{animation:cashoutAmountFade .9s ease-out forwards!important}}
.table-arena{
  grid-template-columns:max-content minmax(0,1fr) max-content;
  grid-template-rows:24px var(--war-hand-height) 52px var(--war-hand-height);
  grid-template-areas:"round shoe ante" "dealer dealer dealer" "status status status" "player player player";
  gap:4px 8px;min-height:0;
}
.dealer-side,.player-side{width:100%;min-width:0;align-self:center;transform:none}
.combatant{position:relative;display:grid;grid-template-rows:14px var(--war-stage-height);height:var(--war-hand-height);gap:4px}
.player-side{grid-template-rows:var(--war-stage-height) 14px}
.player-side .card-stage{grid-row:1;order:initial}.player-side .combatant-head{grid-row:2;order:initial}
.combatant-head{height:14px;min-height:0;justify-content:flex-start;flex-wrap:nowrap;gap:8px;padding-inline:8px;line-height:14px}
.identity-token{font-size:12px;letter-spacing:.08em}.combatant-readout{display:none;font-size:10px;letter-spacing:.02em}
.card-stage,.card-stage.has-war-options{
  position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);
  place-items:center;justify-content:stretch;height:var(--war-stage-height);
  min-height:0;padding:0 8px 22px;gap:0;overflow:visible;scroll-snap-type:none;
}
.card,.war-options .card{width:var(--war-card-size);max-width:100%;height:calc(var(--war-card-size) * 1.4);aspect-ratio:auto;border-radius:9px}
.war-options{width:min(100%,calc(var(--war-card-size) * 3 + 16px));max-width:100%;gap:8px;align-items:center}
.war-options .card-slot{justify-content:center}
.card.winner,.war-options .card.winner{animation:none;transform:none}
.card-slot.war-option[data-war-pick]:hover .card.back{transform:none}
.card .c-tl,.card .c-br,.war-options .card .c-tl,.war-options .card .c-br{font-size:18px}
.card .c-tl,.war-options .card .c-tl{top:8px;left:7px}.card .c-br,.war-options .card .c-br{right:7px;bottom:8px}
.card .c-tl i,.card .c-br i,.war-options .card .c-tl i,.war-options .card .c-br i{font-size:13px;margin-top:4px}
.card .c-rank,.war-options .card .c-rank{font-size:42px}.card .c-suit,.war-options .card .c-suit{font-size:30px}
.card-placeholder{bottom:10px;font-size:8px;letter-spacing:.06em}.back-emblem{font-size:42px}
.card.back::after{inset:5px;border-radius:6px}.card::before{inset:3px;border-radius:6px}
/* Readable captions have a reserved line, outside the card and clear of the rail. */
.card-round-label{
  bottom:-22px;max-width:none;padding:2px 7px;border-radius:5px;background:rgba(2,18,12,.72);
  color:#e4eae4;font:600 11px/16px system-ui,sans-serif;letter-spacing:.01em;text-transform:none;white-space:nowrap;
}
.card-slot.war-option.discarded .card-round-label{opacity:1;color:#b9c4bb}
.card-slot.war-option.selected .card-round-label{color:#f5dfa6}
.war-history{position:absolute;inset:-18px 8px auto auto;width:max-content;max-width:65%;min-height:0;height:14px;flex-wrap:nowrap;gap:4px;font-size:9px;line-height:12px}
.player-side .war-history{inset:auto 8px -18px auto}
.war-history span{padding:0 4px;font-size:9px;line-height:12px}

/* A quiet result strip: sentence case, one supporting line, and a payout badge. */
.battle-status,.battle-status[data-tone="war"],.battle-status[data-tone="win"],.battle-status[data-tone="lose"]{
  --status-accent:#b9a168;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:20px 14px;
  align-content:center;align-items:center;column-gap:12px;row-gap:2px;
  width:min(100%,440px);height:52px;min-height:0;padding:7px 14px;text-align:left;
  border:1px solid rgba(215,226,216,.14);border-left:3px solid var(--status-accent);border-radius:10px;
  background:rgba(5,24,18,.88);box-shadow:0 4px 14px rgba(0,0,0,.14);
  animation:none;transform:none;transition:border-color .2s,background-color .2s;
}
.battle-status[data-tone="win"]{--status-accent:#8bdbab}
.battle-status[data-tone="lose"]{--status-accent:#d59c95}
.battle-status[data-tone="war"]{--status-accent:#ddbd78}
.battle-status::before,.battle-status::after,.status-kicker{display:none}
.status-headline,.battle-status.is-long .status-headline,.battle-status[data-tone="war"] .status-headline,.battle-status[data-tone="war"].is-long .status-headline{
  grid-column:1;grid-row:1;margin:0;color:#f1f3ed;font:650 18px/20px system-ui,sans-serif;letter-spacing:-.025em;text-transform:none;text-wrap:initial;
}
.status-comparison,.battle-status[data-tone="war"] .status-comparison{grid-column:1;grid-row:2;color:#acbdb2;font:500 11px/14px system-ui,sans-serif;text-wrap:initial}
.status-credits,.battle-status[data-tone="war"] .status-credits,.battle-status[data-tone="win"] .status-credits,.battle-status[data-tone="lose"] .status-credits{
  grid-column:2;grid-row:1 / 3;margin:0;padding:5px 8px;border-radius:6px;background:rgba(255,255,255,.045);
  color:var(--status-accent);font:650 11px/16px system-ui,sans-serif;letter-spacing:0;text-transform:none;white-space:nowrap;
}
.battle-status:not([data-tone="win"]):not([data-tone="lose"]) .status-credits{display:none}
.battle-status[data-tone="win"] .status-headline,.battle-status[data-tone="lose"] .status-headline{color:#f1f3ed}

.round-marker{position:relative;top:auto;left:auto;align-self:center;justify-self:start;margin:0;padding:2px 5px;white-space:nowrap}
.round-marker span{font-size:7px;line-height:9px}.round-marker strong{font-size:10px;line-height:11px}
.card-shoe{display:flex;width:auto;margin:0;align-items:center;align-self:center;gap:5px;justify-self:center;text-align:left;transform:none}
.shoe-stack{display:none}.shoe-label,.card-shoe small{margin:0;font-size:8px;letter-spacing:.03em}
.ante-spot{justify-self:end;width:max-content;min-width:94px;height:26px;min-height:0;margin:0;padding:0 20px 0 7px;border-width:1px}
.ante-copy{flex-direction:row;gap:5px}.ante-copy>span{font-size:8px;letter-spacing:.08em}.ante-copy strong{margin:0;font-size:13px}.ante-copy small{display:none}
.chip-stack{top:-5px;right:-6px;width:22px;height:22px}.chip-mark{width:22px;height:22px;border-width:1px;font-size:6px;box-shadow:0 2px 5px rgba(0,0,0,.45),inset 0 0 0 2px rgba(0,0,0,.22)}
.felt-guide{display:none}
.round-history p{min-height:18px}
.round-history ol{height:84px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding-bottom:6px;touch-action:pan-x}
.round-history li{flex:0 0 130px}

@media(min-width:901px){
  @container(min-width:530px){
    .table-arena{--war-stage-height:var(--war-hand-height);--war-card-size:min(140px,calc((var(--war-hand-height) - 22px) / 1.4),calc((100cqw - 212px) / 3))}
    .combatant{display:block}
    .combatant-head{position:absolute;z-index:2;top:30%;left:4px;display:flex;flex-direction:column;width:88px;height:auto;gap:5px;padding:0;text-align:center}
    .combatant-readout{display:block;line-height:13px;white-space:normal}
    .war-history,.player-side .war-history{inset:68% auto auto 4px;width:88px;max-width:none;height:auto;flex-wrap:wrap;font-size:9px;line-height:12px}
    .card .c-tl,.card .c-br,.war-options .card .c-tl,.war-options .card .c-br{font-size:21px}
    .card .c-rank,.war-options .card .c-rank{font-size:48px}.card .c-suit,.war-options .card .c-suit{font-size:34px}
    .back-emblem{font-size:48px}
  }
}
@media(min-width:961px){
  /* Keep Roulette's shared 1196px page width and 1160px content alignment. */
  html[data-fvc-fullsize][data-fvc-game-page] body>.wrap.wrap:has(>.topbar){padding-top:8px}
  .topbar{margin-bottom:24px}
  html[data-fvc-fullsize][data-fvc-game-page] body>.wrap>.header.war-hero{padding-block:0!important}
}
@media(min-width:901px) and (max-width:1200px){
  .war-table{--war-table-height:clamp(440px,calc(100dvh - 310px),560px)}
}
@media(max-width:900px){
  .game-main{grid-template-columns:1fr}
  .war-table{--war-table-height:624px;--war-stage-height:174px;--war-hand-height:196px;--war-card-size:min(96px,calc((100cqw - 32px) / 3));padding:12px 9px;grid-template-rows:minmax(0,1fr) 34px;row-gap:10px}
  .table-arena{grid-template-rows:30px var(--war-hand-height) 76px var(--war-hand-height);row-gap:8px}
  .combatant{grid-template-rows:18px var(--war-stage-height)}.player-side{grid-template-rows:var(--war-stage-height) 18px}
  .combatant-head{height:18px;justify-content:center;line-height:18px;padding:0}
  .combatant-readout{display:inline;font-size:9px}
  .card-stage,.card-stage.has-war-options{padding:18px 8px 22px}
  .card-stage:not(.has-war-options){--war-card-size:96px}
  .war-history,.player-side .war-history{inset:0 0 auto;width:auto;max-width:none;height:16px}
  .battle-status,.battle-status[data-tone="war"],.battle-status[data-tone="win"],.battle-status[data-tone="lose"]{height:76px;grid-template-rows:auto auto;padding:8px 10px;column-gap:8px}
  .status-headline,.battle-status.is-long .status-headline,.battle-status[data-tone="war"] .status-headline,.battle-status[data-tone="war"].is-long .status-headline{font-size:17px;line-height:20px}
  .status-comparison,.battle-status[data-tone="war"] .status-comparison{font-size:10px;line-height:13px}
  .status-credits,.battle-status[data-tone="win"] .status-credits,.battle-status[data-tone="lose"] .status-credits{font-size:10px;padding:4px 6px}
  .card .c-tl,.card .c-br,.war-options .card .c-tl,.war-options .card .c-br{font-size:14px}
  .card .c-tl i,.card .c-br i,.war-options .card .c-tl i,.war-options .card .c-br i{font-size:11px}
  .card .c-rank,.war-options .card .c-rank{font-size:34px}.card .c-suit,.war-options .card .c-suit{font-size:24px}
  .back-emblem{font-size:34px}
  .card-round-label{font-size:10px;padding:2px 4px}
  .felt-guide{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:0;padding:4px 0 0}
  .felt-step{flex-direction:row;justify-content:flex-start;gap:4px;padding:0;font-size:7px;line-height:10px;letter-spacing:0}
  .felt-step b{width:14px;height:14px;flex:0 0 14px;font-size:7px}
  .round-history p{min-height:36px}
}
@media(max-width:680px){
  .wrap{padding:24px 18px 54px}
  .war-table{border-radius:22px}.war-table::after{border-radius:15px}
}

/* The shared navigation rail can leave a laptop table as narrow as a phone. */
@container (max-width:380px){
  .card-shoe .shoe-label{display:none}
  .battle-status:not([data-tone="win"]):not([data-tone="lose"]){grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:2px 0;padding:1px 10px}
  .battle-status .status-comparison{line-height:13px}
  .battle-status:is([data-tone="win"],[data-tone="lose"]){
    grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;gap:2px 0;padding:1px 10px;
  }
  .battle-status:is([data-tone="win"],[data-tone="lose"]) .status-headline{grid-area:1/1;font-size:16px;line-height:18px}
  .battle-status:is([data-tone="win"],[data-tone="lose"]) .status-comparison{grid-area:2/1;line-height:13px}
  .battle-status:is([data-tone="win"],[data-tone="lose"]) .status-credits{grid-area:3/1;justify-self:start;padding:0 5px;font-size:10px;line-height:13px}
}
@container (max-width:280px){
  .card-shoe{display:none}
}

/* A short landscape viewport has room for both hands across the felt. */
@media (min-width:550px) and (max-width:960px) and (max-height:520px) and (orientation:landscape){
  .game-main{grid-template-columns:minmax(0,1fr)}
  .war-table{--war-table-height:clamp(230px,calc(100dvh - var(--fvc-shell-mobilebar-height,64px) - 24px),320px);grid-template-rows:minmax(0,1fr);padding:6px 10px;gap:0}
  .table-arena{
    --war-hand-height:calc(var(--war-table-height) - 100px);
    --war-stage-height:calc(var(--war-hand-height) - 18px);
    --landscape-card-size:min(96px,calc((var(--war-stage-height) - 36px) / 1.4),calc((100cqw - 84px) / 6));
    --war-card-size:var(--landscape-card-size);
    grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:24px var(--war-hand-height) minmax(44px,1fr);
    grid-template-areas:"round round shoe shoe ante ante" "dealer dealer dealer player player player" "status status status status status status";
    gap:3px 4px;
  }
  .combatant,.player-side{display:grid;grid-template-rows:14px var(--war-stage-height);gap:4px}
  .combatant-head,.player-side .combatant-head{position:static;display:flex;flex-direction:row;justify-content:center;grid-row:1;width:auto;height:14px;padding:0;line-height:14px}
  .combatant-readout{display:none}
  .card-stage,.card-stage.has-war-options,.player-side .card-stage{grid-row:2;padding:14px 4px 22px}
  .card-stage:not(.has-war-options){--war-card-size:var(--landscape-card-size)}
  .war-history,.player-side .war-history{inset:0 0 auto;width:auto;max-width:none;height:13px;flex-wrap:nowrap}
  .battle-status,.battle-status[data-tone]{height:44px;grid-template-rows:auto auto;padding:2px 10px}
  .felt-guide{display:none}
}
