/* Shared, in-flow placement for the owner. Comments, whitespace and scripts do not open it. */
.footer-placement { display:none; }
.footer-placement.placement-text,
.footer-placement:has(> :not(script,style,template,[hidden],[data-ad-status="unfilled"])) {
  display:block; position:static; clear:both; align-self:end; width:min(100%,980px);
  max-width:100%; min-width:0; margin:150px auto 20px; overflow-wrap:anywhere; text-align:center;
}
.footer-placement iframe { max-width:100%; }
.arrival-page {
  background-color:#061923;
  background-image:linear-gradient(0deg,#061722f7,transparent 49%),linear-gradient(90deg,#051724df,#07202a2c 49%,#081c2866),url('vali-alliance.webp');
}
.arrival-page .domain-link {text-decoration:none;color:#f3e2bc;font-size:.93rem;letter-spacing:.025em}
.arrival-page .domain-link:hover{text-decoration:underline}
.arrival-page .identity h1 span {color:#ffe0a0;text-shadow:0 3px 26px #22190fb3}
.arrival-page .mode {color:#a6eadb}
.arrival-page .entry {background:linear-gradient(145deg,#102e35f7,#081b27f5);border:1px solid #65938b85;border-top:3px solid #8bdfcc;border-radius:10px;box-shadow:0 14px 46px #0010177a}
.arrival-page #enter,.arrival-page #return {background:linear-gradient(110deg,#ffdc96,#edbb71);color:#202321;border-color:#ffe5ab}
.arrival-page .learn-link {background:transparent;color:#bcf1e4;border-color:#41635f}
.arrival-page .intro {max-width:34ch}
.arrival-page #intro-film {filter:saturate(1.15) contrast(1.045)}
@media(max-width:760px){
  .arrival-page {background:linear-gradient(0deg,#091923 15%,#091923ef 46%,transparent 92%),linear-gradient(90deg,#051522c9,#06152219 83%),url('vali-alliance.webp') 50% top / auto max(380px,52svh) no-repeat,#091923}
  .arrival-page .intro {max-width:40ch}
}

.board-page {--rim:#d0a963;--ink:#f2f2e7;--muted:#b9cfcc;--sea:#93ead3;color:var(--ink);overflow-x:clip}
.board-page::before {background:linear-gradient(100deg,#051a24df,#09233190 51%,#071e29ef),var(--fjords) center/cover fixed,#102633}
.board-page .aurora-table {
  width:min(100%,1200px);max-width:none;min-height:100svh;margin:0 auto;
  padding:clamp(12px,2vw,28px);display:grid;
  grid-template-columns:minmax(0,min(65vw,calc(100svh - 130px))) minmax(216px,292px);
  grid-template-areas:'top top' 'board rail';grid-template-rows:auto auto;justify-content:center;
  align-content:center;align-items:start;gap:16px clamp(18px,3vw,42px);
}
.table-top {grid-area:top;display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:12px;border-bottom:1px solid #8eb7ad57;position:relative;z-index:9}
.table-top .table-brand {margin:0;display:flex;flex-direction:row;gap:.22em;align-items:center;font:normal clamp(1.45rem,3vw,2.1rem)/1 Georgia,serif;color:#fff3d6;letter-spacing:-.035em}
.table-brand img {width:34px;height:34px;border-radius:7px;margin-right:6px}
.table-brand span {color:#ffd68e;letter-spacing:.045em}
.board-page .playfield {grid-area:board;width:100%;align-self:start}
.board-page .board-frame {box-shadow:0 9px 28px #0211198c,inset 0 0 0 2px #dfb76b77;border-color:#ddb46d}
.board-page .cell.high:not(.selected,.legal-target,.capture-target,.partner-ready,.check,.last-move){background-image:linear-gradient(142deg,#e4e5cfd6,#a8d3cfc4)}
.board-page .cell.low:not(.selected,.legal-target,.capture-target,.partner-ready,.check,.last-move){background-image:linear-gradient(140deg,#1d5264ba,#4e858aa1)}
.board-page .cell.selected {outline:3px solid #ffe288;outline-offset:-3px}
.board-page .cell:focus-visible {outline:3px solid #fff0b8;outline-offset:-3px;z-index:2}
.board-page .match-rail {grid-area:rail;min-width:0;border:1px solid #709c9366;border-radius:12px;background:linear-gradient(150deg,#102f35f5,#0b1e2bed);padding:clamp(15px,2vw,22px);display:grid;gap:20px;align-self:center;box-shadow:0 12px 34px #00151e66}
.board-page .turn-wing {display:grid;grid-template-columns:1fr;gap:8px;max-width:none;text-align:left}
.board-page .turn-caption {display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;padding:0;font:600 .82rem/1.2 system-ui,sans-serif;color:#b6d7d0;text-shadow:none}
.turn-caption .turn-count {color:#ead4a8}
.board-page .turn-badge {margin:0;padding:0 0 0 10px;border:0;border-left:4px solid var(--accent,#fc8d78);border-radius:0;background:transparent;color:#fbf4de;box-shadow:none;font:normal clamp(1.42rem,2.4vw,2.15rem)/1.12 Georgia,serif;text-align:left}
.board-page .turn-badge[data-force="1"]{--accent:#f4dda5}.board-page .turn-badge[data-force="2"]{--accent:#70c4ff}.board-page .turn-badge[data-force="3"]{--accent:#75e7be}
.board-page .turn-detail,.board-page .flash {color:#d1e6e1;text-shadow:none;text-align:left;font:400 .91rem/1.45 system-ui,sans-serif}
.board-page .turn-wing :is(.flash,.turn-detail):empty{display:none}
.board-page .clock-stack {display:grid;grid-template-columns:1fr 1fr;gap:8px}
.board-page .clock-tile {padding:11px 6px;text-align:center;background:#082027;border:1px solid #7baba65c;border-radius:7px;box-shadow:none}
.board-page .clock-tile h2 {display:block;font:650 .83rem/1.3 system-ui,sans-serif;color:#c4e9df}
.board-page .clock-tile time {font:normal clamp(1.45rem,2.25vw,2.05rem)/1.12 Georgia,serif;font-variant-numeric:tabular-nums;margin:.14em 0;color:#fff1ce}
.board-page .squad-line,.board-page .tile-score {font:500 .78rem/1.4 system-ui,sans-serif;color:#c7d3d0}
.squad-line .pip {display:inline-block;width:7px;height:7px}
.board-page .match-keys {display:grid;gap:8px}
.board-page .match-keys button,.board-page .action-menu>summary {cursor:pointer;padding:10px 14px;min-height:42px;font:650 .92rem/1.3 system-ui,sans-serif;border:1px solid #64847b;border-radius:6px;background:#12313a;color:#e9f5ed;box-shadow:none;}
.board-page .match-keys .partner-key {background:#efd196;border-color:#ffdf9f;color:#282a27}
.board-page .match-keys .partner-key[aria-pressed="true"] {background:#a0e3d2;border-color:#d4ffed;color:#162d2b}
.board-page .match-keys button:disabled {opacity:.55;cursor:default}
.board-page :is(.match-keys button,.action-menu summary,.drawer-links button):hover:enabled{filter:brightness(1.16)}
.board-page .action-menu {position:relative;width:auto}
.board-page .drawer-body {position:absolute;inset:calc(100% + 7px) 0 auto auto;width:min(345px,calc(100vw - 24px));max-height:min(68svh,580px);padding:14px;background:#10272ffb;border:1px solid #65897e;color:#e6f1e5}
.drawer-body button {color:#ecf4e7;background:#183942;border:1px solid #567b74;border-radius:5px;padding:8px;cursor:pointer}
.drawer-body .record-preview {font:.85rem/1.4 system-ui,sans-serif;color:#d0e1db}
.drawer-body .record-preview summary {padding:4px;min-height:0;background:none;border:0;font:inherit;box-shadow:none}
.drawer-body .save-state:empty{display:none}
.board-page :is(.match-keys,.table-top) :is(button,summary):focus-visible,.scene-catalog summary:focus-visible{outline:3px solid #ffe39b;outline-offset:3px}
@media(max-width:720px),(orientation:portrait){
  .board-page .aurora-table{max-width:700px;min-height:100svh;align-content:start;padding:9px max(8px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-bottom));grid-template-columns:minmax(0,1fr);grid-template-areas:'top' 'clocks' 'board' 'turn' 'keys';gap:9px}
  .table-top{padding:2px 2px 8px}.board-page .match-rail{display:contents}
  .board-page .clock-stack{grid-area:clocks;gap:8px}
  .board-page .clock-tile{display:grid;align-items:center;grid-template-columns:1fr auto;text-align:left;padding:6px 9px}
  .board-page .clock-tile h2{font-size:.81rem}.board-page .clock-tile time{grid-column:2;grid-row:1/3;margin:0;font-size:1.34rem}
  .board-page .clock-tile .squad-line{grid-column:1;grid-row:2}.board-page .clock-tile .tile-score{grid-column:1/-1;font-size:.75rem}
  .board-page .turn-wing{grid-area:turn;align-items:initial;padding:7px 6px 2px;grid-template-columns:1fr auto;gap:5px 10px}
  .board-page .turn-caption{grid-column:2;grid-row:1;gap:5px;align-self:center}.board-page .turn-badge{grid-column:1;grid-row:1}
  .board-page .turn-detail,.board-page .flash{grid-column:1/-1}.board-page .match-keys{grid-area:keys;grid-template-columns:1fr 1fr;padding:0 4px}
}
@media(orientation:landscape) and (max-height:530px) and (min-width:721px){
 .board-page .aurora-table{grid-template-columns:minmax(0,min(61vw,calc(100svh - 64px))) minmax(230px,300px);padding:5px 12px;gap:5px 16px}
 .table-top{padding-bottom:4px}.board-page .match-rail{gap:8px;padding:10px}.board-page .match-keys{grid-template-columns:1fr 1fr}
}
#dialog .scene-highlights {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr));gap:8px;margin:12px 0}
#dialog .scene-highlights button {margin:0;border-color:#618d82;background:#193a41;color:#ffdf9c}
#dialog .scene-catalog {border-top:1px solid #668c805c;padding-block:10px}
#dialog .scene-catalog summary{min-height:40px;padding:8px 0;color:#c4f0df;cursor:pointer}
#combat-scene .cf-combat-surface canvas,#combat-scene .cf-march-surface canvas,#combat-scene canvas.miniature-board-layer,#combat-scene canvas.shadow-on-board {filter:saturate(1.18) contrast(1.035)}
#combat-scene .battle-caption #combat-title{color:#ffdd93}
#combat-scene :is(#combat-skip,#combat-sound){min-height:38px}
@media(prefers-reduced-motion:no-preference){
  .table-top .drawer-body,#dialog[open] .scene-highlights {animation:panel-in .18s ease-out}
  .board-page .cell.selected .piece{animation:pick-piece .22s ease-out}
  @keyframes panel-in{from{opacity:.4;transform:translateY(-4px)}to{opacity:1;transform:none}}
  @keyframes pick-piece{0%{scale:.96}60%{scale:1.045}100%{scale:1}}
}

@media(prefers-reduced-motion:no-preference){
  #dialog .tutor-success {animation:lesson-complete .55s ease-out}
  @keyframes lesson-complete{from{box-shadow:inset 4px 0 #aeffe0;background-color:#336453}to{box-shadow:none}}
}
