/* Approved UI24 gameplay/popup models, implemented on the existing run state.
   Shared artwork/tokens come from ui-v25.css. Cell geometry, ports, hitboxes,
   pan, departure/volley effects and all booster/save rules remain their owners. */
.game.game-v25 {
  padding:24px 14px 16px; gap:0;
  color:var(--v25-ink,#153f53);
  background-color:#e6f6f3;
}
.game-v25>.top { width:100%; height:44px; gap:16px; grid-template-columns:44px minmax(0,1fr) 44px; }
.game-v25 .top .icon-button { width:44px; height:44px; min-height:44px; padding:10px; }
.game-v25 .top .icon { width:25px; height:25px; }
.game-v25 .brand {
  height:44px; min-width:0; padding:5px 12px; border:1px solid var(--v25-brass,#c69838);
  border-radius:28px; background:#fff5df var(--v25-paper,var(--paper-texture)) center/420px auto;
  box-shadow:inset 0 1px #fffdf1,0 2px 2px #123f5320;
  color:var(--v25-ink,#153f53); font-size:26px; line-height:1; font-weight:400;
}
.game-v25 .brand:is([data-digits="7"],[data-digits="8"],[data-digits="9"]) { font-size:19px; }
.game-v25 .threat-hud { width:100%; height:96px; margin:8px 0 0; }
.game-v25 .threat-hud .crew-captain {
  left:-4px; bottom:0; width:94px; height:96px; z-index:2;
  background-position:center bottom; filter:drop-shadow(0 1px 1px #214d5a30);
}
.game-v25 .threat-hud .admiral-portrait {
  left:auto; right:-4px; top:auto; bottom:0; width:94px; height:96px;
  z-index:2; background-position:center bottom;
  filter:drop-shadow(0 1px 1px #214d5a30);
}
.game-v25 .admiral-portrait[data-rig-flip-x="true"] { scale:-1 1; }
.game-v25 .threat-hud .counter {
  left:20.5%; right:20.5%; top:10px; width:auto; height:52px;
  max-width:none; margin:0; gap:5px; z-index:1;
  border-width:8px 11px; border-image-width:8px 11px;
  border-image-source:var(--v25-primary);
  border-image-slice:40 52 fill;
}
.game-v25 .counter .cannon { width:26px; height:26px; transform:rotate(-8deg); flex:none; }
.game-v25 .counter-copy { min-width:0; gap:4px; }
.game-v25 .counter-copy .label { font-size:13px; }
.game-v25 .counter-copy .moves { font-size:12px; }
.game-v25 .counter-copy strong { font-size:33px; line-height:1; }
.game-v25 .cannon-charge { left:11px; right:11px; bottom:3px; height:2px; opacity:.74; }
.game-v25 .last-move-ribbon { bottom:-5px; font-size:8px; line-height:10px; padding:0 5px; }
.game-v25 .crew-band.battle-radio {
  position:absolute; left:85px; right:85px; bottom:0; width:auto; height:27px;
  margin:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px; z-index:3; color:var(--v25-ink,#153f53); pointer-events:none;
}
.game-v25 .battle-radio .crew-speech {
  position:static; left:auto; top:auto; width:100%; min-height:0; padding:0; margin:0;
  display:block; border:0; border-image:none; background:none; filter:none;
  font:400 11px/1.1 'Bree Serif',Georgia,serif; color:var(--v25-ink,#153f53);
  text-align:center;
}
.game-v25 .battle-radio .crew-speech>span { display:inline-block; max-width:100%; }
.game-v25 .battle-radio .navy-taunt {
  position:static; left:auto; top:auto; width:auto; height:auto; min-height:0;
  margin:0; padding:0; border:0; border-image:none; background:none;
  font:400 10px/1.1 'Libre Baskerville',Georgia,serif;
  color:var(--v25-muted,#647c80); white-space:normal; text-align:center;
}
.game-v25 .battle-radio .navy-taunt::before { display:none; }
.game-v25 .navy-strip {
  width:100%; max-width:none; height:46px; margin:6px 0 0;
  border:1px solid var(--v25-brass,#c69838); border-radius:14px;
  background:#fff4dd var(--v25-paper,var(--paper-texture)) center/420px auto;
  box-shadow:inset 0 1px #fffdf1;
}
.game-v25 .navy { top:4px; width:56px; height:36px; }
.game-v25 .navy-left { left:13px; }
.game-v25 .navy-right { right:13px; }
.game-v25 .navy-cannon { top:2px; width:57px; height:40px; }
.game-v25 .cannon-left { left:76px; }
.game-v25 .cannon-right { right:76px; }
.game-v25 .exit { top:13px; gap:4px; font-size:17px; font-weight:400; }
.game-v25 .exit .icon { width:21px; height:21px; }
.game-v25 .exit::before,.game-v25 .exit::after { display:none; }
.game-v25 .board-stage {
  width:min(374px,calc(100% - 20px),max(264px,calc((var(--app-height) - 360px) * .75)));
  max-width:calc(100% - 20px); margin:14px auto 0;
}
.game-v25 .board-stage.pan-harbor {
  width:min(374px,calc(100% - 20px));
  height:clamp(352px,calc(var(--app-height) - 360px),482px);
}
.game-v25 .board::before { background-image:url('assets/ui-v25/harbor-water-flat.png'); }
.game-v25 .board { background-color:#10b7b4; }
.game-v25 .board::after { opacity:.85; }
.game-v25 .board-wrap::before { filter:drop-shadow(0 2px 2px #194b5a24); }
.game-v25 .board-stage.pan-harbor .board-wrap { background:#e7f5ee; }
.game-v25 .booster-tools {
  width:100%; max-width:none; height:76px; margin-top:22px; gap:8px;
}
.game-v25 .booster-tools .tool {
  height:76px; min-height:76px; padding:0 2px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  font-size:17px; line-height:1.05;
}
.game-v25 .booster-tools .tool>.icon { width:25px; height:25px; }
.game-v25 .booster-tools .tool>span { gap:4px; }
.game-v25 .booster-tools .stock { font-size:17px; }
.game-v25 .booster-tools .tool>small { font-size:9px; line-height:1; opacity:.76; }
.game-v25 .screen-rim { display:none; }

/* Result, settings and pause extend the shared paper window. Decorative art
   is separate from real rewards, counters and actions. No baked text/hitbox. */
.v25-popup-overlay { padding:16px; background:#12384e89; }
.dialog.v25-result-dialog,.dialog.v25-settings-dialog,.dialog.v25-pause-dialog {
  width:364px; max-width:100%; max-height:calc(var(--app-height) - 32px);
  color:var(--v25-ink,#153f53); text-align:center;
}
.v25-dialog-heading { position:relative; min-height:38px; padding:1px 34px 4px; display:flex; align-items:center; justify-content:center; }
.v25-dialog-heading h2 {
  margin:0; color:var(--v25-ink,#153f53); font:400 26px/1.05 'Bree Serif',Georgia,serif;
  background:none; -webkit-text-fill-color:var(--v25-ink,#153f53); text-shadow:none;
}
.v25-dialog-heading .v25-popup-close {
  position:absolute; right:-9px; top:-7px; width:44px; height:44px; min-height:44px;
  padding:12px; color:var(--v25-ink,#153f53);
}
.v25-popup-close>.icon { width:20px; height:20px; }
.v25-result-dialog .v25-dialog-heading { padding-left:22px; padding-right:22px; }
.v25-result-dialog .v25-dialog-heading h2 { font-size:25px; }
.v25-win-hero {
  width:100%; height:112px; margin:1px 0 -3px;
  background:var(--v25-win-hero,var(--ui-threatMateWin)) center bottom/contain no-repeat;
}
.v25-result-dialog .clear-rewards {
  margin:3px 0 10px; padding:9px 7px; gap:8px 13px;
  border:1px solid #ccb98a; border-radius:11px;
  background:#fff4de80; color:var(--v25-ink,#153f53);
}
.v25-result-dialog .clear-rewards>span { font-size:18px; color:var(--v25-ink,#153f53); }
.v25-result-dialog .clear-rewards .icon { width:23px; height:23px; }
.v25-result-dialog .new-part-reward { margin:7px 0 12px; background:#fff5df99; border-color:#cdb98b; }
.v25-result-dialog.has-voyage-progress>.part-progress:not(.bonus-reward-note) { display:none; }
.v25-voyage-progress {
  display:grid; grid-template-columns:70px minmax(0,1fr); align-items:center; gap:10px;
  margin:5px 0 12px; padding:8px;
  border:1px solid #ccb98a; border-radius:11px; background:#fff5df80; text-align:left;
}
.v25-voyage-progress>canvas { width:70px; height:65px; border-radius:10px; background:#a9ddd9; }
.v25-voyage-progress>.icon { width:42px; height:42px; margin:auto; }
.v25-voyage-progress>div { min-width:0; display:flex; flex-direction:column; gap:7px; }
.v25-voyage-progress strong { font-size:17px; line-height:1.1; font-weight:400; }
.v25-voyage-track {
  min-height:22px; position:relative; overflow:hidden; display:flex; align-items:center; justify-content:center;
  border:1px solid #b8ad91; border-radius:16px; background:#d8d0bb;
}
.v25-voyage-track>i { position:absolute; inset:0 auto 0 0; background:#5aafa4; }
.v25-voyage-track>b { position:relative; z-index:1; font-size:17px; line-height:21px; font-weight:400; }
.v25-result-dialog .v25-result-actions { grid-template-columns:minmax(0,1fr) minmax(0,1.7fr); gap:8px; margin-top:9px; }
.v25-result-dialog .v25-result-actions>.tool.primary { grid-column:auto; min-height:50px; font-size:21px; }
.v25-result-dialog .v25-result-actions>.tool:not(.primary) { font-size:15px; min-height:50px; }
.v25-result-dialog .v25-recovery-actions { margin:4px 0 7px; gap:8px; }
.v25-result-dialog .v25-recovery-actions>.tool { min-height:44px; font-size:13px; }
.v25-result-dialog .v25-recovery-actions>.tool:last-child:nth-child(2) { grid-column:auto; }
.v25-result-dialog .v25-recovery-actions>.tool:only-child { grid-column:1/-1; }
.v25-result-dialog .v25-part-action,.v25-result-dialog .v25-bonus-action { margin-top:8px; }
.v25-result-dialog .v25-part-action>.tool,.v25-result-dialog .v25-bonus-action>.tool { grid-column:1/-1; min-height:44px; font-size:13px; }
.loss-dialog.v25-result-dialog {
  display:flex; flex-direction:column; filter:none;
  padding-top:16px; padding-bottom:14px;
}
.loss-dialog.v25-result-dialog>* { order:initial; flex:none; }
.loss-dialog.v25-result-dialog .loss-wreck-badge { height:184px; margin:3px 0 0; }
.loss-dialog.v25-result-dialog p { margin:8px 0 11px; font:400 15px/1.3 'Bree Serif',Georgia,serif; }
.v25-retry-note { margin-top:8px; font-size:10px; line-height:1.2; color:var(--v25-muted,#647c80); }
.v25-settings-dialog .audio-controls { gap:10px; margin:14px 0 16px; }
.v25-settings-dialog .v25-audio-toggle {
  height:56px; min-height:56px; padding:9px 12px; gap:10px;
  border:1px solid #c9b68a; border-radius:12px;
  background:#fff5df99; color:var(--v25-ink,#153f53);
  font:400 18px/1.1 'Bree Serif',Georgia,serif;
}
.v25-audio-toggle>.icon { width:30px; height:30px; }
.v25-audio-toggle>span { flex:1; text-align:left; }
.v25-audio-toggle>strong {
  position:relative; width:64px; min-width:64px; height:30px;
  padding:4px 8px 4px 27px; border:1px solid #a8b4a5; border-radius:18px;
  background:#9aa9a0; color:#fff6df; font-size:14px; line-height:20px; text-align:right; font-weight:400;
}
.v25-audio-toggle>strong::after {
  content:''; position:absolute; left:3px; top:3px; width:22px; height:22px;
  background:#fff4de; border:1px solid #d5c697; border-radius:50%; box-shadow:0 1px 2px #153f5326;
}
.v25-audio-toggle[aria-pressed="true"]>strong { padding:4px 27px 4px 8px; text-align:left; background:var(--v25-teal,#07868b); color:#fff4de; }
.v25-audio-toggle[aria-pressed="true"]>strong::after { left:auto; right:3px; }
.audio-settings.v25-settings-dialog .v25-settings-support>.tool { grid-column:auto; min-height:48px; font-size:12px; }
.v25-settings-dialog .v25-settings-support { gap:9px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.v25-settings-dialog .v25-settings-done { margin-top:13px; }
.v25-settings-done>.tool.primary { min-height:52px; font-size:25px; }
.v25-settings-dialog .v25-service-note { font-size:11px; line-height:1.25; margin:9px 0 0; color:var(--v25-muted,#647c80); }
.v25-pause-emblem { width:64px; height:64px; margin:14px auto 9px; color:var(--v25-teal,#07868b); display:grid; place-items:center; }
.v25-pause-emblem>.icon { width:52px; height:52px; }
.v25-pause-dialog p { font:400 15px/1.35 'Bree Serif',Georgia,serif; }
.v25-pause-dialog .dialog-actions>.tool[data-action="settings"] { grid-column:1/-1; }
@media(max-width:350px) {
  .game.game-v25 { padding-left:12px; padding-right:12px; }
  .game-v25>.top { gap:9px; }
  .game-v25 .brand { font-size:23px; padding-left:6px; padding-right:6px; }
  .game-v25 .threat-hud .crew-captain,.game-v25 .threat-hud .admiral-portrait { width:76px; height:91px; }
  .game-v25 .threat-hud .counter { left:18%; right:18%; border-left-width:9px; border-right-width:9px; border-image-width:8px 9px; }
  .game-v25 .counter .cannon { width:21px; height:21px; }
  .game-v25 .counter-copy { gap:3px; }
  .game-v25 .counter-copy .label,.game-v25 .counter-copy .moves { font-size:11px; }
  .game-v25 .counter-copy strong { font-size:30px; }
  .game-v25 .crew-band.battle-radio { left:62px; right:62px; }
  .game-v25 .battle-radio .crew-speech { font-size:10px; }
  .game-v25 .battle-radio .navy-taunt { font-size:9px; }
  .game-v25 .navy { width:48px; }
  .game-v25 .navy-left { left:7px; }.game-v25 .navy-right { right:7px; }
  .game-v25 .navy-cannon { width:47px; }
  .game-v25 .cannon-left { left:59px; }.game-v25 .cannon-right { right:59px; }
  .game-v25 .exit { font-size:15px; }
  .game-v25 .booster-tools { gap:6px; }
  .game-v25 .booster-tools .tool,.game-v25 .booster-tools .stock { font-size:14px; }
  .game-v25 .booster-tools .tool>small { font-size:8px; }
  .v25-dialog-heading h2,.v25-result-dialog .v25-dialog-heading h2 { font-size:22px; }
  .v25-result-dialog .clear-rewards>span { font-size:16px; }
  .v25-result-dialog .v25-result-actions>.tool.primary { font-size:18px; }
  .v25-voyage-progress strong { font-size:14px; }
  .v25-settings-dialog .v25-audio-toggle { font-size:16px; padding-left:9px; padding-right:9px; }
}
