/* Vaporașe — Battleship against the phone or for two players on one phone (js/vaporase.js).
   Theme-aware like the other pages: tokens on :root, redefined under body.dark-theme. */
:root {
    --vp-accent: #0e7490;
    --vp-accent-soft: #cffafe;
    --vp-accent-ink: #155e75;
    --vp-p2: #c2410c;
    --vp-p2-soft: #ffedd5;
    --vp-p2-ink: #9a3412;
    --vp-win: #15803d;
    --vp-win-soft: #dcfce7;
    --vp-lost: #b91c1c;
    --vp-lost-soft: #fee2e2;
    --vp-page-bg: #f1f7fb;
    --vp-card-bg: #ffffff;
    --vp-card-border: #dbe4ee;
    --vp-muted: #5b6b80;
    --vp-shadow: 0 10px 30px rgba(8, 47, 73, .10);
    --vp-sea-hi: #d9f0fb;
    --vp-sea-lo: #9fd0ea;
    --vp-line: rgba(14, 116, 144, .22);
    --vp-label: #4b6b82;
    --vp-miss: #1f4a6b;
    --vp-hull-hi: #a7b4c4;
    --vp-hull-lo: #4b5a6d;
    --vp-deck: #e2e8f0;
    --vp-sunk-hi: #5b3a32;
    --vp-sunk-lo: #24130f;
    --vp-halo: rgba(71, 85, 105, .16);
    --vp-cover-bg: #0b3550;
}

body.dark-theme {
    --vp-accent: #22d3ee;
    --vp-accent-soft: #0e2f3a;
    --vp-accent-ink: #67e8f9;
    --vp-p2: #fb923c;
    --vp-p2-soft: rgba(251, 146, 60, .15);
    --vp-p2-ink: #fdba74;
    --vp-win: #4ade80;
    --vp-win-soft: rgba(74, 222, 128, .14);
    --vp-lost: #f87171;
    --vp-lost-soft: rgba(248, 113, 113, .14);
    --vp-page-bg: #0b1424;
    --vp-card-bg: #15233a;
    --vp-card-border: #27405f;
    --vp-muted: #94a8c0;
    --vp-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    --vp-sea-hi: #12466a;
    --vp-sea-lo: #0a2c47;
    --vp-line: rgba(125, 211, 252, .16);
    --vp-label: #8fb3cc;
    --vp-miss: #d6e6f2;
    --vp-hull-hi: #9aa9bb;
    --vp-hull-lo: #3d4a5b;
    --vp-deck: #cbd5e1;
    --vp-sunk-hi: #4a2a22;
    --vp-sunk-lo: #160a07;
    --vp-halo: rgba(148, 163, 184, .14);
    --vp-cover-bg: #04111d;
}

/* clip, not hidden: the site-wide `body { overflow-x: hidden }` makes <body> a scroll
   container that never scrolls, which silently kills any position: sticky inside. */
.vp-body, body.vp-body#page-top {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--vp-page-bg);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: clip;
}
.vp-main { padding-top: 100px; padding-bottom: 32px; }
.vp-wrap { max-width: 1000px; padding-left: 16px; padding-right: 16px; }

/* ---- heading ---- */
.vp-head { text-align: center; margin-bottom: 12px; }
.vp-head h1 { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: clamp(1.6rem, 6vw, 2.3rem); margin: 0 0 4px; }
.vp-title-icon { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 30%; background: linear-gradient(135deg, #0ea5e9, #0e7490); color: #fff; font-size: .8em; }
.vp-lead { color: var(--vp-muted); margin: 0; font-size: .98rem; line-height: 1.45; }

/* ---- mode, level, fleet ---- */
.vp-controls { max-width: 600px; margin: 0 auto; }
.vp-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--vp-card-bg); border: 1px solid var(--vp-card-border); box-shadow: var(--vp-shadow); }
.vp-seg { min-width: 0; min-height: 44px; border: 0; border-radius: 10px; padding: 8px; background: transparent; color: inherit; font-weight: 700; font-size: .88rem; line-height: 1.25; cursor: pointer; touch-action: manipulation; display: flex; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.vp-seg[aria-checked="true"] { background: var(--vp-accent); color: #fff; }
body.dark-theme .vp-seg[aria-checked="true"] { color: #04111d; }
.vp-opts { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; }
.vp-chips { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.vp-chips[hidden] { display: none; }
.vp-chips-label { color: var(--vp-muted); font-size: .88rem; font-weight: 600; }
.vp-chip { min-height: 36px; border: 1px solid var(--vp-card-border); border-radius: 999px; padding: 5px 14px; background: var(--vp-card-bg); color: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; touch-action: manipulation; }
.vp-chip[aria-checked="true"] { background: var(--vp-accent-soft); border-color: var(--vp-accent); color: var(--vp-accent-ink); }
.vp-seg:focus-visible, .vp-chip:focus-visible, .vp-btn:focus-visible, .vp-link:focus-visible, .vp-cell:focus-visible, .vp-dock-ship:focus-visible { outline: 3px solid var(--vp-accent); outline-offset: 2px; }
.vp-cell:focus-visible { outline-offset: -3px; z-index: 1; }

/* ---- score ---- */
.vp-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; max-width: 600px; margin: 12px auto 10px; }
.vp-score-item { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border-radius: 12px; background: var(--vp-card-bg); border: 1px solid var(--vp-card-border); font-size: .9rem; }
.vp-score-item strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.vp-score-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--vp-muted); font-weight: 600; }
.vp-score-mid { align-self: center; padding: 4px 10px; border-radius: 999px; background: var(--vp-accent-soft); color: var(--vp-accent-ink); font-weight: 700; font-size: .8rem; white-space: nowrap; }

/* ---- status ---- */
.vp-status { display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 600px; min-height: 66px; margin: 0 auto 12px; padding: 9px 14px; border-radius: 16px; border: 2px solid var(--vp-accent); background: var(--vp-accent-soft); color: var(--vp-accent-ink); transition: background-color .25s, border-color .25s, color .25s; }
.vp-status-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: currentColor; }
.vp-status-icon svg, .vp-status-icon i { color: var(--vp-card-bg); font-size: 1.05rem; }
.vp-status-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.vp-status-main { font-weight: 800; font-size: clamp(1.15rem, 5vw, 1.45rem); line-height: 1.15; }
.vp-status-sub { font-size: .86rem; font-weight: 600; opacity: .88; line-height: 1.3; min-height: 1.3em; }
.vp-status.is-p2 { background: var(--vp-p2-soft); border-color: var(--vp-p2); color: var(--vp-p2-ink); }
.vp-status.is-ai { background: var(--vp-card-bg); border-color: var(--vp-card-border); color: var(--vp-muted); }
.vp-status.is-ai .vp-status-icon { animation: vp-think 1s ease-in-out infinite; }
.vp-status.is-win { background: var(--vp-win-soft); border-color: var(--vp-win); color: var(--vp-win); }
.vp-status.is-lost { background: var(--vp-lost-soft); border-color: var(--vp-lost); color: var(--vp-lost); }
@keyframes vp-think { 50% { transform: scale(.84); } }

/* ---- the board: labels + sea (hull layer, cells, effects) ---- */
.vp-board { --vp-lab: 18px; display: grid; grid-template-columns: var(--vp-lab) minmax(0, 1fr); grid-template-rows: var(--vp-lab) auto; width: 100%; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.vp-corner { grid-column: 1; grid-row: 1; }
.vp-lab-top { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: repeat(10, 1fr); }
.vp-lab-left { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: repeat(10, 1fr); }
.vp-lab-top span, .vp-lab-left span { display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--vp-label); font-variant-numeric: tabular-nums; }
.vp-sea {
    grid-column: 2; grid-row: 2; position: relative; aspect-ratio: 1; border-radius: 8px;
    background:
        linear-gradient(var(--vp-line) 1px, transparent 1px) 0 0 / 10% 10%,
        linear-gradient(90deg, var(--vp-line) 1px, transparent 1px) 0 0 / 10% 10%,
        radial-gradient(120% 90% at 30% 15%, var(--vp-sea-hi), var(--vp-sea-lo));
    box-shadow: inset 0 0 0 1px var(--vp-line), 0 6px 18px rgba(8, 47, 73, .12);
}
.vp-hulls, .vp-cells, .vp-fx { position: absolute; inset: 0; }
.vp-hulls { z-index: 1; pointer-events: none; }
.vp-cells { z-index: 2; display: grid; grid-template-rows: repeat(10, 1fr); }
.vp-fx { z-index: 3; pointer-events: none; }
.vp-row { display: grid; grid-template-columns: repeat(10, 1fr); min-height: 0; }
.vp-cell { position: relative; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; touch-action: manipulation; }
button.vp-cell { cursor: pointer; }
.vp-board.is-own .vp-cell, .vp-board.is-target:not(.is-armed) .vp-cell { cursor: default; }
.vp-board.is-target.is-armed .vp-cell:not(.is-miss):not(.is-hit):not(.is-water) { cursor: crosshair; }
@media (hover: hover) {
    .vp-board.is-target.is-armed .vp-cell:not(.is-miss):not(.is-hit):not(.is-water):hover { background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 2px var(--vp-accent); }
    body.dark-theme .vp-board.is-target.is-armed .vp-cell:not(.is-miss):not(.is-hit):not(.is-water):hover { background: rgba(34, 211, 238, .16); }
}
#vp-setup-board .vp-sea { touch-action: none; }
.vp-cell.is-halo { background: repeating-linear-gradient(45deg, var(--vp-halo) 0 3px, transparent 3px 7px); }

/* markers: a miss is a dot, water next to a sunk ship a fainter one, a hit burns */
.vp-cell.is-miss::after, .vp-cell.is-water::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24%; height: 24%; border-radius: 50%; background: var(--vp-miss); transform: translate(-50%, -50%); opacity: .8; }
.vp-cell.is-water::after { width: 16%; height: 16%; opacity: .4; }
.vp-cell.is-fresh::after { animation: vp-fade .45s var(--vp-delay, 0ms) both; }
.vp-cell.is-hit { background: radial-gradient(circle, rgba(239, 68, 68, .45), rgba(239, 68, 68, .12) 70%); }
.vp-cell.is-hit::before { content: ""; position: absolute; inset: 14% 18% 10%; border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%; background: radial-gradient(ellipse at 50% 75%, #fffbe0 0 14%, #ffd23f 28%, #ff7a1a 52%, rgba(220, 38, 38, .85) 70%, transparent 74%); transform-origin: 50% 90%; animation: vp-flame .7s ease-in-out infinite alternate; }
.vp-cell.is-hit::after { content: ""; position: absolute; left: 50%; bottom: 8%; width: 46%; height: 12%; border-radius: 50%; background: rgba(60, 20, 10, .45); transform: translateX(-50%); }
.vp-cell.is-sunk { background: radial-gradient(circle, rgba(40, 10, 5, .25), transparent 75%); }
.vp-cell.is-sunk::before { inset: 30% 30% 18%; opacity: .85; animation-duration: 1.3s; filter: saturate(.8); }
.vp-cell.is-sunk::after { display: none; }
.vp-cell.is-last { box-shadow: inset 0 0 0 2px var(--vp-accent); border-radius: 3px; }
.vp-board.is-own .vp-cell.is-last { box-shadow: inset 0 0 0 2px var(--vp-p2); }
@keyframes vp-flame { from { transform: scale(.9, .86) rotate(-3deg); opacity: .9; } to { transform: scale(1.04, 1.08) rotate(3deg); opacity: 1; } }
@keyframes vp-fade { from { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } }

/* ships: a grey hull with a little bridge; length is set by the inline size */
.vp-hull { position: absolute; }
.vp-hull::before { content: ""; position: absolute; inset: 16% 3px; border-radius: 999px 40% 40% 999px / 50%; background: linear-gradient(to bottom, var(--vp-hull-hi), var(--vp-hull-lo)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22), 0 2px 4px rgba(0, 0, 0, .25); }
.vp-hull::after { content: ""; position: absolute; left: 34%; right: 30%; top: 36%; bottom: 36%; border-radius: 3px; background: var(--vp-deck); opacity: .8; }
.vp-hull.is-v::before { inset: 3px 16%; border-radius: 50% / 999px 999px 40% 40%; background: linear-gradient(to right, var(--vp-hull-hi), var(--vp-hull-lo)); }
.vp-hull.is-v::after { left: 36%; right: 36%; top: 34%; bottom: 30%; }
.vp-hull.is-1::before { inset: 18%; border-radius: 50%; }
.vp-hull.is-1::after { inset: 40%; border-radius: 50%; }
.vp-hull.is-selected::before { box-shadow: 0 0 0 2px var(--vp-accent), 0 0 12px var(--vp-accent); }
.vp-hull.is-lifted { opacity: .3; }
.vp-hull.is-ghost::before { background: var(--vp-accent); opacity: .55; box-shadow: none; }
.vp-hull.is-ghost::after { display: none; }
.vp-hull.is-ghost.is-bad::before { background: #ef4444; }
.vp-hull.is-sunk::before { background: linear-gradient(to bottom, var(--vp-sunk-hi), var(--vp-sunk-lo)); }
.vp-hull.is-v.is-sunk::before { background: linear-gradient(to right, var(--vp-sunk-hi), var(--vp-sunk-lo)); }
.vp-hull.is-sunk::after { background: #1b0d09; opacity: .6; }
.vp-hull.is-reveal::before { background: transparent; border: 2px dashed var(--vp-hull-lo); box-shadow: none; }
body.dark-theme .vp-hull.is-reveal::before { border-color: var(--vp-hull-hi); }
.vp-hull.is-reveal::after { display: none; }
.vp-board.is-target .vp-hull.is-sunk { animation: vp-fade-hull .5s ease-out both; }
@keyframes vp-fade-hull { from { opacity: 0; } }

/* effects: the falling shell, a splash, an explosion, the board shaking on a sinking */
.vp-shell, .vp-aim, .vp-splash, .vp-boom { position: absolute; width: 10%; height: 10%; }
.vp-shell::before { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #94a3b8, #1e293b 70%); box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.vp-aim::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 2px solid var(--vp-lost); animation: vp-aim .36s ease-in both; }
@keyframes vp-aim { from { transform: scale(1.6); opacity: 0; } to { transform: scale(.7); opacity: 1; } }
.vp-splash span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 1px rgba(14, 116, 144, .35); animation: vp-ring .75s ease-out both; }
.vp-splash span + span { animation-delay: .14s; }
.vp-splash::before { content: ""; position: absolute; left: 30%; right: 30%; bottom: 40%; height: 70%; border-radius: 50% 50% 20% 20%; background: linear-gradient(to top, rgba(255, 255, 255, .9), rgba(186, 230, 253, 0)); transform-origin: 50% 100%; animation: vp-plume .6s ease-out both; }
@keyframes vp-ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.9); opacity: 0; } }
@keyframes vp-plume { from { transform: scaleY(.1); opacity: 1; } 60% { transform: scaleY(1); opacity: .9; } to { transform: scaleY(.6) translateY(10%); opacity: 0; } }
.vp-boom::before { content: ""; position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, #fffbe0 0 12%, #ffd23f 26%, #ff7a1a 45%, rgba(220, 38, 38, .6) 62%, transparent 72%); animation: vp-boom .65s ease-out both; }
.vp-boom::after { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(circle, rgba(70, 70, 70, .45), transparent 65%); animation: vp-smoke 1s .15s ease-out both; }
.vp-boom.is-late::before { animation-delay: .18s; }
.vp-boom.is-late::after { animation-delay: .3s; }
@keyframes vp-boom { from { transform: scale(.2); opacity: 1; } 55% { opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
@keyframes vp-smoke { from { transform: scale(.4); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1.5) translateY(-25%); opacity: 0; } }
.vp-board.is-shake .vp-sea { animation: vp-shake .45s ease-in-out; }
@keyframes vp-shake { 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 2px); } 80% { transform: translate(2px, -1px); } }

/* ---- setup ---- */
.vp-setup { display: grid; gap: 14px; max-width: 560px; margin: 0 auto; }
.vp-setup[hidden], .vp-battle[hidden] { display: none; }
.vp-setup-side { display: flex; flex-direction: column; gap: 10px; }
.vp-hint { margin: 0; font-size: .88rem; color: var(--vp-muted); line-height: 1.4; min-height: 2.8em; }
.vp-hint.is-bad { color: var(--vp-lost); font-weight: 700; }
.vp-dock { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; align-content: flex-start; }
.vp-dock-ship { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 5px; min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--vp-card-border); background: var(--vp-card-bg); color: inherit; cursor: grab; touch-action: none; }
.vp-dock-ship.is-selected { border-color: var(--vp-accent); box-shadow: 0 0 0 2px var(--vp-accent); background: var(--vp-accent-soft); }
.vp-dock-bar { display: inline-flex; gap: 2px; }
.vp-dock-bar i { display: block; width: 16px; height: 16px; border-radius: 4px; background: linear-gradient(to bottom, var(--vp-hull-hi), var(--vp-hull-lo)); }
.vp-dock-name { font-size: .74rem; font-weight: 700; color: var(--vp-muted); }
.vp-dock-done { margin: 0; font-size: .88rem; font-weight: 600; color: var(--vp-win); align-self: center; }
.vp-setup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---- battle ---- */
.vp-battle { display: grid; gap: 16px; max-width: 560px; margin: 0 auto; }
.vp-panel-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; margin: 0 0 6px; color: var(--vp-accent-ink); }
.vp-panel-own .vp-panel-title { color: var(--vp-muted); }
.vp-fleetlist { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; min-height: 14px; }
.vp-fl { position: relative; display: inline-flex; gap: 2px; align-items: center; }
.vp-fl i { display: block; width: 11px; height: 11px; border-radius: 3px; background: var(--vp-hull-lo); }
.vp-fl i.is-hit { background: #f97316; }
.vp-fl.is-sunk { opacity: .45; }
.vp-fl.is-sunk i { background: var(--vp-lost); }
.vp-fl.is-sunk::after { content: ""; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: currentColor; transform: rotate(-8deg); }
.vp-own-row { display: grid; grid-template-columns: minmax(0, 62%) minmax(0, 1fr); gap: 12px; align-items: start; }
.vp-own-row .vp-fleetlist { margin-top: 18px; flex-direction: column; gap: 6px; }
.vp-board.is-own { --vp-lab: 13px; }
.vp-board.is-own .vp-lab-top span, .vp-board.is-own .vp-lab-left span { font-size: .58rem; }
.vp-board.is-over .vp-cell { cursor: default; }

/* ---- buttons ---- */
.vp-actions { display: flex; justify-content: center; margin: 16px auto 6px; }
.vp-actions .vp-btn { min-width: 200px; }
.vp-btn { min-height: 46px; border-radius: 12px; border: 1px solid var(--vp-card-border); background: var(--vp-card-bg); color: inherit; font-weight: 700; font-size: .95rem; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; touch-action: manipulation; line-height: 1.2; }
.vp-btn:hover:not(:disabled) { border-color: var(--vp-accent); }
.vp-btn:disabled { opacity: .45; cursor: default; }
.vp-btn-primary { background: var(--vp-accent); border-color: var(--vp-accent); color: #fff; }
body.dark-theme .vp-btn-primary { color: #04111d; }
.vp-tools { display: flex; justify-content: center; gap: 6px 18px; flex-wrap: wrap; margin-bottom: 12px; }
.vp-link { border: 0; background: none; color: var(--vp-accent-ink); font-weight: 600; font-size: .9rem; padding: 8px 4px; min-height: 40px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.vp-link[hidden], .vp-link span[hidden] { display: none; }
.vp-link span { display: inline-flex; align-items: center; gap: 6px; }

.vp-help { max-width: 600px; margin: 0 auto; padding: 12px 16px; border-radius: 14px; background: var(--vp-card-bg); border: 1px solid var(--vp-card-border); }
.vp-help summary { font-weight: 700; cursor: pointer; }
.vp-help ul { margin: 10px 0 8px; padding-left: 20px; line-height: 1.55; }
.vp-help p { margin: 0; color: var(--vp-muted); font-size: .9rem; }
.vp-powered { text-align: center; color: var(--vp-muted); font-size: .85rem; margin: 18px 0 0; }
.vp-powered a { color: var(--vp-accent-ink); }

/* ---- pass the phone ---- */
.vp-cover { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: radial-gradient(120% 80% at 50% 0%, #155e75, var(--vp-cover-bg)); animation: vp-fade-in .25s ease-out; }
.vp-cover[hidden] { display: none; }
.vp-cover.is-p2 { background: radial-gradient(120% 80% at 50% 0%, #9a3412, #2a1206); }
.vp-cover-card { width: min(100%, 380px); padding: 22px 18px 18px; border-radius: 20px; background: var(--vp-card-bg); color: var(--text-color); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.vp-cover-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--vp-accent-soft); color: var(--vp-accent-ink); font-size: 1.8rem; margin-bottom: 8px; animation: vp-pass 1.6s ease-in-out infinite; }
.vp-cover.is-p2 .vp-cover-icon { background: var(--vp-p2-soft); color: var(--vp-p2-ink); }
.vp-cover-card h2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 2px; }
.vp-cover-who { font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; color: var(--vp-accent-ink); }
.vp-cover.is-p2 .vp-cover-who { color: var(--vp-p2-ink); }
.vp-cover-text { color: var(--vp-muted); font-size: .92rem; margin: 0 0 16px; }
.vp-cover-text:empty { display: none; }
.vp-cover-go { width: 100%; min-height: 54px; font-size: 1rem; }
.vp-cover.is-p2 .vp-cover-go { background: var(--vp-p2); border-color: var(--vp-p2); }
@keyframes vp-pass { 0%, 100% { transform: translateX(-6px) rotate(-6deg); } 50% { transform: translateX(6px) rotate(6deg); } }
@keyframes vp-fade-in { from { opacity: 0; } }

/* ---- end of the game ---- */
.vp-end { position: fixed; inset: 0; z-index: 1900; display: grid; place-items: center; padding: 16px; background: rgba(2, 10, 24, .55); animation: vp-fade-in .25s ease-out; }
.vp-end[hidden] { display: none; }
.vp-end-card { width: min(100%, 380px); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 16px 16px; border-radius: 20px; background: var(--vp-card-bg); color: var(--text-color); border: 1px solid var(--vp-card-border); text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); animation: vp-pop .3s cubic-bezier(.2, 1.4, .4, 1); }
.vp-end-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--vp-win-soft); color: var(--vp-win); font-size: 1.6rem; margin-bottom: 6px; }
.vp-end.is-lost .vp-end-icon { background: var(--vp-lost-soft); color: var(--vp-lost); }
.vp-end-card h2 { font-size: 1.4rem; font-weight: 800; margin: 0 0 4px; }
.vp-end-text { color: var(--vp-muted); font-size: .92rem; margin: 0 0 10px; }
.vp-stats { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 8px; }
.vp-stats th, .vp-stats td { padding: 6px 4px; border-bottom: 1px solid var(--vp-card-border); }
.vp-stats thead th { font-size: .8rem; color: var(--vp-muted); }
.vp-stats tbody th { text-align: left; font-weight: 600; color: var(--vp-muted); }
.vp-stats td { text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.vp-stats td.is-win { color: var(--vp-win); }
.vp-end-record { font-weight: 700; color: var(--vp-accent-ink); font-size: .9rem; margin: 0 0 12px; }
.vp-end-record:empty { display: none; }
.vp-end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@keyframes vp-pop { from { opacity: 0; transform: scale(.85); } }

/* ---- wider screens: board beside the dock, the two seas side by side ---- */
@media (min-width: 860px) {
    .vp-setup { max-width: 900px; grid-template-columns: minmax(0, 500px) minmax(0, 320px); justify-content: center; align-items: start; }
    .vp-setup-side { padding-top: 22px; }
    .vp-battle { max-width: 1000px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
    .vp-panel { padding: 14px; border-radius: 18px; background: var(--vp-card-bg); border: 1px solid var(--vp-card-border); box-shadow: var(--vp-shadow); }
    .vp-own-row { grid-template-columns: 1fr; }
    .vp-own-row .vp-fleetlist { margin-top: 8px; flex-direction: row; gap: 6px 10px; }
    .vp-board.is-own { --vp-lab: 18px; }
    .vp-board.is-own .vp-lab-top span, .vp-board.is-own .vp-lab-left span { font-size: .72rem; }
}

@media (max-width: 420px) {
    .vp-seg { font-size: .8rem; padding: 7px 4px; gap: 5px; }
    .vp-chip { padding: 5px 11px; font-size: .84rem; }
    .vp-score-item { padding: 6px 6px; font-size: .82rem; gap: 6px; }
    .vp-score-mid { padding: 4px 8px; font-size: .74rem; }
    .vp-status { min-height: 60px; padding: 8px 10px; gap: 10px; }
    .vp-status-icon { width: 32px; height: 32px; }
    .vp-board { --vp-lab: 15px; }
    .vp-lab-top span, .vp-lab-left span { font-size: .64rem; }
    .vp-btn { font-size: .9rem; padding: 8px; }
    .vp-dock-ship { padding: 7px 8px; }
    .vp-dock-bar i { width: 14px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .vp-cell.is-hit::before, .vp-status.is-ai .vp-status-icon, .vp-cover-icon { animation: none; }
    .vp-cover, .vp-end, .vp-end-card, .vp-board.is-shake .vp-sea, .vp-cell.is-fresh::after, .vp-board.is-target .vp-hull.is-sunk { animation: none; }
}
