/* The portrait harbor keeps the existing V25 chrome, live ship canvases and
   motion owners. Only gameplay is scoped here; Home and meta panels retain
   their approved layout. Board dimensions remain true grid-cell dimensions. */
.game.game-v30 {
  --harbor-frame-pad:20px;
  padding:10px 14px 12px;
  min-height:var(--app-height);
  gap:0;
  color:var(--v25-ink,#153f53);
}
.game-v30>.top { height:40px; gap:12px; grid-template-columns:40px minmax(0,1fr) 40px; }
.game-v30>.top>.icon-button { width:40px; height:40px; min-height:40px; padding:9px; }
.game-v30>.top .icon { width:22px; height:22px; }
.game-v30 .brand { height:40px; padding:4px 12px; font-size:25px; line-height:30px; }
.game-v30 .brand[data-digits="7"],.game-v30 .brand[data-digits="8"],.game-v30 .brand[data-digits="9"] { font-size:18px; }
.game-v30 .brand>.harbor-region-label { bottom:-12px; font-size:10px; line-height:12px; }
.game-v30 .threat-hud { height:76px; margin:4px 0 0; }
.game-v30 .threat-hud .crew-captain,.game-v30 .threat-hud .admiral-portrait { width:82px; height:80px; bottom:0; }
.game-v30 .threat-hud .crew-captain { left:-3px; }
.game-v30 .threat-hud .admiral-portrait { right:-3px; }
.game-v30 .threat-hud .counter { left:20%; right:20%; top:7px; height:47px; gap:4px; }
.game-v30 .counter .cannon { width:24px; height:24px; }
.game-v30 .counter-copy { gap:3px; }
.game-v30 .counter-copy .label { font-size:12px; }
.game-v30 .counter-copy strong { font-size:31px; }
.game-v30 .counter-copy .moves { font-size:11px; }
.game-v30 .cannon-charge { bottom:2px; height:2px; }
.game-v30 .crew-band.battle-radio { left:75px; right:75px; height:23px; gap:2px; }
.game-v30 .battle-radio .crew-speech { font-size:10px; }
.game-v30 .battle-radio .navy-taunt { font-size:9px; }
.game-v30 .last-move-ribbon { bottom:-4px; line-height:9px; font-size:8px; }
.game-v30 .navy-strip { height:34px; margin:4px 0 0; border-radius:11px; }
.game-v30 .navy-strip .navy { top:2px; width:47px; height:28px; }
.game-v30 .navy-strip .navy-left { left:12px; }
.game-v30 .navy-strip .navy-right { right:12px; }
.game-v30 .navy-strip .navy-cannon { top:0; width:46px; height:33px; }
.game-v30 .navy-strip .cannon-left { left:64px; }
.game-v30 .navy-strip .cannon-right { right:64px; }
.game-v30 .navy-strip .exit { top:8px; gap:3px; font-size:15px; line-height:18px; }
.game-v30 .navy-strip .exit .icon { width:18px; height:18px; }
.game-v30 .board-stage {
  width:min(374px,calc(100% - 10px),max(304px,calc((var(--app-height) - 318px) * .75)));
  max-width:calc(100% - 10px);
  margin:14px auto 0;
}
.game-v30 .board-stage.pan-harbor {
  width:min(374px,calc(100% - 10px));
  height:clamp(352px,calc(var(--app-height) - 296px),500px);
  --cell-size:48px;
}
.game-v30 .board-stage.pan-harbor[data-columns="7"] { --cell-size:48px; }
.game.game-v30 .board-stage:not(.pan-harbor) .board-wrap { padding:var(--harbor-frame-pad); }
.game.game-v30[data-region] .board-stage .board-wrap {
  background-color:var(--harbor-water-base,#10b7b4);
  background-image:var(--harbor-region-image,none); background-position:center;
  background-size:220% 220%; background-repeat:no-repeat;
}
.game.game-v30[data-region] .board { border-radius:6px; background:transparent; z-index:4; }
.game.game-v30[data-region] .board::before { border-radius:6px; background:none; }
.game-v30 .harbor-scenic-fringe {
  --fringe-depth:10px;
  position:absolute; inset:-10px; padding:10px; border-radius:12px; z-index:2;
  pointer-events:none; background:var(--harbor-region-image,none) center/100% 100% no-repeat;
  -webkit-mask-image:linear-gradient(to right,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to left,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to bottom,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to top,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth));
  -webkit-mask-composite:source-over;
  mask-image:linear-gradient(to right,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to left,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to bottom,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth)),linear-gradient(to top,#000 calc(var(--fringe-depth) - 8px),transparent var(--fringe-depth));
  mask-composite:add;
}
.game-v30 .pan-harbor .harbor-scenic-fringe { inset:12px; }
.game.game-v30 .board-stage:not(.pan-harbor) .harbor-scenic-fringe { --fringe-depth:var(--harbor-frame-pad); inset:0; padding:var(--harbor-frame-pad); border-radius:6px; }
.game-v30 .board::after {
  opacity:.48;
  background-image:linear-gradient(90deg,#d7f7de46 1px,transparent 1px),linear-gradient(#d7f7de46 1px,transparent 1px);
}
.game.game-v30 .board-wrap::before { filter:drop-shadow(0 3px 3px #23495d35); z-index:3; }
.game.game-v30 .pan-harbor .board-wrap::before { z-index:3; }
.game-v30 .pan-harbor .board-wrap { background:#dbefea; }
.game-v30 .corridor { background:linear-gradient(#fff2a918,#ffedb609); border-color:#fff0a037; }
.game-v30 .corridor::before { border-color:#fff4ac3b; }
.game-v30 .corridor.hinted { background:#fff0ab2c; border-color:#fff0aaa0; }
.game-v30 .corridor.hinted::before { border-color:#fff6b580; }
.game-v30 .piece-label { width:17px; min-width:17px; height:17px; font-size:10px; line-height:15px; border-color:#d8bd83; box-shadow:0 1px 2px #234a5840; }
.game-v30 .heading-arrow { color:#fff8d7; font-size:13px; text-shadow:0 1px 2px #163d4e99; }
.game-v30 .captain-label { bottom:-6px; min-width:54px; height:16px; font-size:8px; line-height:12px; }
.game-v30 .harbor-port { z-index:13; font-size:10px; border-color:transparent; }
.game-v30 .harbor-port.is-locked { color:#865513; text-shadow:0 1px #fff5d6; }
.game-v30 .harbor-port.is-closed { color:#6b716f; text-shadow:0 1px #fff8e9; }
.game-v30 .harbor-port.is-locked .icon,.game-v30 .harbor-port.is-closed .icon { width:12px; height:12px; }
.game.game-v30 .harbor-port.port-left,.game.game-v30 .harbor-port.port-right { width:18px; min-width:18px; font-size:9px; }
.game.game-v30 .harbor-port.port-left { transform:translate(calc(-100% - 1px),-50%); }
.game.game-v30 .harbor-port.port-right { transform:translate(1px,-50%); }
.game.game-v30 .harbor-port.is-locked:is(.port-left,.port-right),.game.game-v30 .harbor-port.is-closed:is(.port-left,.port-right) { height:64px; }
.game.game-v30 .board-stage.single-exit:not(.pan-harbor) .harbor-port.port-up.is-locked { display:flex; }
.game.game-v30 .harbor-port.port-up.is-locked {
  transform:translate(calc(-100% - var(--cell-size,54px) - 3px),-50%);
}
.game-v30 .booster-tools { width:100%; height:68px; margin-top:18px; gap:8px; }
.game-v30 .booster-tools .tool { min-height:68px; height:68px; padding:0 2px; gap:2px; font-size:16px; line-height:1.05; }
.game-v30 .booster-tools .tool .icon { width:23px; height:23px; }
.game-v30 .booster-tools .tool .stock { font-size:16px; }
.game-v30 .booster-tools .tool small { font-size:9px; line-height:11px; }

/* Live rule explanations occupy one stable strip, never another popup. */
.game-v30 .mechanic-help {
  width:100%; min-height:36px; margin:12px 0 0; padding:4px 10px;
  display:flex; align-items:center; justify-content:center; gap:7px;
  border:0; border-image:none;
  background:#fff5df var(--v25-paper,var(--paper-texture)) center/420px auto;
  border-radius:10px;
  color:var(--v25-ink,#153f53); text-align:center;
  position:relative; z-index:2;
}
.game-v30 .mechanic-help>.icon { width:25px; height:25px; flex:none; color:#ac7626; }
.game-v30 .mechanic-help>span { min-width:0; display:flex; flex-direction:column; gap:2px; }
.game-v30 .mechanic-help b { font-family:"Bree Serif",Georgia,serif; font-size:12px; font-weight:400; line-height:13px; }
.game-v30 .mechanic-help small { font-size:10px; line-height:11px; }
.game-v30 .mechanic-help+.booster-tools { margin-top:8px; }
.game-v30 .pan-harbor~.mechanic-help { margin-top:23px; }

/* Mechanic raster parts use one bounded atlas; text, icons and hitboxes stay
   live. These overlays use the same coordinate plane as the support ships. */
.game-v30 .mechanic-raster { display:block; position:absolute; inset:0; pointer-events:none; background-repeat:no-repeat; }
.game-v30 .mechanic-port {
  position:absolute; transform:translate(-50%,-50%); pointer-events:none;
  z-index:11; overflow:visible;
}
.game-v30 .mechanic-port-art-frame { position:absolute; inset:0; pointer-events:none; filter:drop-shadow(0 2px 1px #1b455e45); }
.game-v30 .mechanic-port-art-frame.is-vertical {
  inset:auto; left:50%; top:50%; width:var(--gate-art-width); height:var(--gate-art-height);
  transform:translate(-50%,-50%) rotate(90deg);
}
.game-v30 .mechanic-port.is-open>.mechanic-port-art-frame { opacity:.83; }
.game-v30 .mechanic-deadline {
  position:absolute; left:100%; top:0; transform:translate(-12%,-65%);
  min-width:80px; min-height:26px; padding:3px 6px; gap:4px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid #edca73; border-radius:9px;
  color:#fff2c4; background:#9b3c31; box-shadow:0 2px 3px #19495c35;
  font-family:"Bree Serif",Georgia,serif; text-align:center;
}
.game-v30 .mechanic-deadline>.icon { width:19px; height:19px; color:#ffda75; flex:none; }
.game-v30 .mechanic-deadline>span { display:block; font-size:9px; line-height:11px; white-space:nowrap; }
.game-v30 .mechanic-deadline b { font-size:13px; color:#ffe290; }
.game-v30 .mechanic-deadline.is-urgent { background:#ad2e24; border-color:#ffe08a; }
.game-v30 .mechanic-deadline.is-closed { background:#455764; color:#f2ebe0; }
.game-v30 .mechanic-port-down .mechanic-deadline { top:100%; transform:translate(-12%,-35%); }
.game-v30 .mechanic-port-left .mechanic-deadline { top:0; left:100%; transform:translate(0,-80%); }
.game-v30 .mechanic-port-right .mechanic-deadline { top:0; left:0; transform:translate(-100%,-80%); }
.game-v30 .mechanic-bridge {
  position:absolute; transform:translate(-50%,-50%); z-index:5;
  display:block; min-width:44px; min-height:44px; margin:0; padding:0;
  border:0; border-image:none; border-radius:10px; outline:0;
  background:none; color:#164b59; overflow:visible;
  -webkit-appearance:none; appearance:none; cursor:pointer;
}
.game-v30 .mechanic-bridge>.mechanic-bridge-art {
  inset:auto; left:50%; top:50%; width:var(--bridge-art-width); height:var(--bridge-art-height);
  transform:translate(var(--bridge-anchor-x,-50%),var(--bridge-anchor-y,-50%)) rotate(var(--bridge-angle));
  transform-origin:var(--bridge-pivot-x,50%) var(--bridge-pivot-y,50%);
  filter:drop-shadow(0 2px 2px #153f594f);
}
.game-v30 .mechanic-bridge.is-turning>.mechanic-bridge-art { animation:bridge-quarter-turn30 .24s cubic-bezier(.22,.8,.27,1) both; }
.game-v30 .bridge-rotate-chip {
  width:29px; height:29px; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  border:1px solid #b28432; border-radius:50%; background:#fff1c9;
  box-shadow:0 1px 2px #173e564f,inset 0 0 0 2px #f1c868;
  display:flex; align-items:center; justify-content:center; pointer-events:none;
}
.game-v30 .bridge-rotate-chip>.icon { width:22px; height:22px; }
.game-v30 .bridge-rotate-chip>b {
  position:absolute; right:-5px; bottom:-3px; min-width:14px; height:14px;
  border:1px solid #c3a15a; border-radius:7px; background:#fff7df;
  font-size:10px; line-height:12px; text-align:center;
}
.game-v30 .mechanic-bridge.is-hinted>.mechanic-bridge-art { filter:drop-shadow(0 0 4px #fff3a9) drop-shadow(0 0 2px #fff3a9); }
.game-v30 .mechanic-bridge:active:not(:disabled)>.bridge-rotate-chip { background:#ffe299; }
.game-v30 .mechanic-bridge:focus-visible { outline:2px solid #fff2a5; outline-offset:2px; }
.game-v30 .mechanic-bridge:disabled { cursor:default; opacity:1; }
.game-v30 .mechanic-ship-badges {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  display:flex; align-items:center; justify-content:center; gap:3px;
  pointer-events:none; z-index:5;
}
.game-v30 .mechanic-ship-badge {
  display:flex; align-items:center; justify-content:center; position:relative;
  width:26px; height:26px; border:1px solid #d0a84b; border-radius:8px;
  background:#fff2c8; color:#7d4b15; box-shadow:0 1px 2px #153f5966;
}
.game-v30 .mechanic-ship-badge>.icon { width:23px; height:23px; }
.game-v30 .badge-chest>.mechanic-raster { inset:3px 1px; z-index:1; }
.game-v30 .badge-chest>.mechanic-raster:not(.is-loading)+.icon { visibility:hidden; }
@keyframes bridge-quarter-turn30 {
  from { transform:translate(var(--bridge-anchor-x,-50%),var(--bridge-anchor-y,-50%)) rotate(var(--bridge-from)); }
  to { transform:translate(var(--bridge-anchor-x,-50%),var(--bridge-anchor-y,-50%)) rotate(var(--bridge-angle)); }
}
@media (max-height:780px) {
  .game.game-v30 { padding-top:7px; padding-bottom:9px; }
  .game-v30>.top { height:36px; grid-template-columns:36px minmax(0,1fr) 36px; }
  .game-v30>.top>.icon-button { width:36px; height:36px; min-height:36px; padding:8px; }
  .game-v30>.top .icon { width:20px; height:20px; }
  .game-v30 .brand { height:36px; padding:2px 10px; font-size:23px; }
  .game-v30 .threat-hud { height:69px; }
  .game-v30 .threat-hud .crew-captain,.game-v30 .threat-hud .admiral-portrait { width:76px; height:73px; }
  .game-v30 .threat-hud .counter { height:44px; top:5px; }
  .game-v30 .counter-copy strong { font-size:28px; }
  .game-v30 .crew-band.battle-radio { left:69px; right:69px; height:21px; }
  .game-v30 .battle-radio .crew-speech { font-size:9px; }
  .game-v30 .battle-radio .navy-taunt { font-size:8px; }
  .game-v30 .board-stage { width:min(374px,calc(100% - 10px),max(304px,calc((var(--app-height) - 288px) * .75))); margin-top:12px; }
  .game-v30 .board-stage.pan-harbor { width:min(374px,calc(100% - 10px)); height:clamp(320px,calc(var(--app-height) - 288px),460px); }
  .game-v30 .mechanic-help { margin-top:10px; min-height:32px; padding-top:2px; padding-bottom:2px; }
  .game-v30 .mechanic-help b { font-size:11px; line-height:12px; }
  .game-v30 .mechanic-help small { font-size:9px; line-height:10px; }
  .game-v30 .booster-tools,.game-v30 .booster-tools .tool { height:62px; min-height:62px; }
  .game-v30 .booster-tools .tool { font-size:15px; }
}
@media (max-width:350px) {
  .game.game-v30 { --harbor-frame-pad:10px; padding-left:10px; padding-right:10px; }
  .game-v30 .threat-hud .counter { left:21%; right:21%; }
  .game-v30 .counter-copy { gap:2px; }
  .game-v30 .counter-copy .label,.game-v30 .counter-copy .moves { font-size:10px; }
  .game-v30 .counter-copy strong { font-size:27px; }
  .game-v30 .counter .cannon { width:20px; height:20px; }
  .game-v30 .navy-strip .navy-left { left:8px; }
  .game-v30 .navy-strip .navy-right { right:8px; }
  .game-v30 .navy-strip .cannon-left { left:51px; }
  .game-v30 .navy-strip .cannon-right { right:51px; }
  .game-v30 .mechanic-help { gap:4px; padding-left:5px; padding-right:5px; }
  .game-v30 .mechanic-help b { font-size:10px; }
  .game-v30 .mechanic-help small { font-size:8px; }
}
@media (max-width:320px) {
  .game.game-v30 { --harbor-frame-pad:0px; }
}
@media (prefers-reduced-motion:reduce) {
  .game-v30 .mechanic-bridge.is-turning>.mechanic-bridge-art { animation:none; }
}
