/* ============================================================
   決斷之海 1942 — interface & art direction
   ============================================================ */
:root {
  --bg: #041013;
  --bg-deep: #020a0d;
  --bg-panel: #07181b;
  --bg-panel-2: #0a2024;
  --sea: #0a2c35;
  --cream: #ece5d0;
  --cream-dim: #cec5ad;
  --muted: #8da19c;
  --faint: #5f7470;
  --brass: #c7a867;
  --brass-bright: #e8ce92;
  --brass-deep: #8a6c3b;
  --red: #b3483b;
  --red-bright: #d56854;
  --red-deep: #6d241e;
  --teal: #7dc6b8;
  --teal-dim: #4c9389;
  --green: #7eb995;
  --line: rgba(198, 219, 206, 0.13);
  --line-soft: rgba(198, 219, 206, 0.075);
  --line-brass: rgba(199, 168, 103, 0.32);
  --serif: "Noto Serif TC", "Songti TC", "SimSun", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.48);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
svg { display: block; }
::selection { background: rgba(199, 168, 103, 0.32); color: #fff8e9; }
:focus-visible { outline: 1px solid var(--brass-bright); outline-offset: 3px; }

#app { height: 100%; position: relative; }
.hidden { display: none !important; }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  opacity: 0;
}
.screen.is-active {
  display: flex;
  opacity: 1;
  animation: screenIn 0.5s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ shared atoms ============ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-brass);
  color: var(--cream);
  letter-spacing: 0.08em;
  font-size: 13px;
  font-weight: 600;
  border-radius: 1px;
  background: rgba(5, 17, 20, 0.55);
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
  transition: color .2s, border-color .2s, background .2s, transform .2s, filter .2s;
}
.btn:hover { border-color: rgba(232, 206, 146, 0.62); color: #fff8e9; background: rgba(25, 47, 48, 0.65); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; filter: grayscale(.6); }
.btn-primary {
  color: #10201f;
  border-color: #e6cf98;
  background: linear-gradient(135deg, #e4ca8e 0%, #c0a05f 50%, #a38348 100%);
  box-shadow: 0 0 32px rgba(199, 168, 103, 0.16);
  text-shadow: 0 1px 0 rgba(255, 247, 222, 0.45);
}
.btn-primary:hover {
  color: #0a1615;
  background: linear-gradient(135deg, #f0daa6 0%, #d0b06b 50%, #b39354 100%);
  border-color: #f4e0b1;
  filter: drop-shadow(0 0 14px rgba(222, 193, 126, 0.24));
}
.btn-primary small {
  font-family: var(--sans);
  font-size: 9px;
  border: 1px solid rgba(16, 32, 31, 0.35);
  padding: 1px 5px;
  border-radius: 2px;
  opacity: .7;
}
.btn-ghost { background: rgba(4, 14, 16, 0.5); }
.btn-large { min-height: 56px; min-width: 260px; font-size: 14px; letter-spacing: .16em; padding: 0 26px; justify-content: space-between; }
.btn-ornament { width: 5px; height: 5px; background: var(--red-deep); transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(16,32,31,.15); }
.btn-arrow { font-family: var(--serif); font-size: 17px; transition: transform .25s; }
.btn-large:hover .btn-arrow { transform: translateX(4px); }

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--cream-dim);
  font-size: 13px;
  border-radius: 50%;
  transition: border-color .2s, color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--line-brass); color: var(--brass-bright); background: rgba(199, 168, 103, 0.06); }
.text-btn {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color .2s;
}
.text-btn span { font-size: 16px; }
.text-btn:hover { color: var(--cream); }
.kicker, .panel-kicker {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brass);
  opacity: .83;
}
.sound-icon {
  width: 16px;
  height: 16px;
  position: relative;
  display: block;
}
.sound-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 5px;
  width: 5px;
  height: 6px;
  border: 1px solid currentColor;
  border-right: 0;
}
.sound-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 8px;
  height: 12px;
  border: 1px solid currentColor;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  opacity: .75;
}
.sound-off .sound-icon::after {
  width: 14px;
  height: 1px;
  top: 8px;
  left: 3px;
  background: currentColor;
  border: 0;
  border-radius: 0;
  transform: rotate(-45deg);
  opacity: 1;
}
.sound-off { color: var(--faint); }

/* ============ title screen ============ */

.title-screen {
  flex-direction: column;
  background: #041014;
  overflow: hidden;
}
#title-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.title-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .1;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
.title-left-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(2, 10, 13, 0.92) 0%, rgba(2, 10, 13, 0.68) 34%, rgba(2, 10, 13, 0.12) 63%, rgba(2, 10, 13, 0.38) 100%),
    linear-gradient(0deg, rgba(2, 8, 10, 0.9) 0%, rgba(2, 8, 10, 0) 30%);
}
.title-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid rgba(203, 222, 211, 0.09);
  backdrop-filter: blur(2px);
}
.nav-emblem { display: flex; align-items: center; gap: 14px; }
.sun-disc {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #d55d4a 0%, #a6342a 55%, #6f1e18 100%);
  box-shadow: 0 0 22px rgba(181, 63, 49, 0.38), inset 0 0 0 1px rgba(230, 191, 128, 0.28);
  position: relative;
  flex: 0 0 auto;
}
.sun-disc::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(239, 213, 158, 0.38);
  border-radius: 50%;
}
.emblem-kicker {
  display: block;
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: .28em;
  color: var(--brass);
  opacity: .72;
}
.emblem-line {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--cream-dim);
}
.title-layout {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  padding: 20px clamp(24px, 6.5vw, 110px) 0;
}
.title-copy { max-width: 720px; padding-bottom: 18px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--brass);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.eyebrow-line { display: inline-block; width: 48px; height: 1px; background: var(--brass); opacity: .55; }
.game-logo {
  font-family: var(--serif);
  font-weight: 900;
  line-height: .96;
  letter-spacing: .045em;
  color: var(--cream);
  text-shadow: 0 8px 35px rgba(0,0,0,.45);
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.3));
}
.logo-top {
  display: block;
  font-size: clamp(92px, 12.8vw, 182px);
  letter-spacing: .05em;
  margin-left: -0.06em;
}
.logo-bottom {
  display: flex;
  align-items: center;
  margin-left: .68em;
  margin-top: .07em;
  font-size: clamp(58px, 8.6vw, 116px);
  line-height: 1;
  letter-spacing: .18em;
  color: rgba(236, 229, 208, 0.08);
  -webkit-text-stroke: 1.5px rgba(208, 182, 126, 0.8);
}
.logo-bottom i {
  display: inline-block;
  width: 1px;
  height: .72em;
  background: var(--red);
  margin-right: .32em;
  box-shadow: 0 0 18px rgba(179, 72, 59, 0.35);
  -webkit-text-stroke: 0;
}
.logo-subrow {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
  margin-top: 20px;
  padding-left: 4px;
}
.year-mark {
  font-family: Georgia, var(--serif);
  font-size: clamp(32px, 3.2vw, 48px);
  letter-spacing: .09em;
  color: var(--brass);
  opacity: .82;
  border-right: 1px solid var(--line-brass);
  padding-right: clamp(22px, 3vw, 44px);
}
.title-tagline {
  font-family: var(--serif);
  font-size: clamp(15px, 1.4vw, 19px);
  letter-spacing: .12em;
  line-height: 1.7;
  color: var(--cream-dim);
}
.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 4vh, 42px);
}
.title-actions .btn { min-width: 232px; }
.title-actions .btn-ghost { min-width: 168px; }
.title-progress {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 28px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .12em;
}
.title-progress b { color: var(--cream-dim); font-weight: 500; }
.progress-line { width: 26px; height: 1px; background: var(--line); }
.title-aside {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding-right: 12px;
  padding-bottom: 10px;
}
.aside-rule { width: 1px; height: 92px; background: linear-gradient(var(--line-brass), transparent); }
.vertical-copy {
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .32em;
  color: rgba(222, 218, 196, 0.52);
}
.aside-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  writing-mode: vertical-rl;
  font-size: 8px;
  letter-spacing: .24em;
  color: var(--brass);
  opacity: .56;
}
.title-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(24px, 5vw, 72px) calc(20px + var(--safe-bottom));
  border-top: 1px solid rgba(203, 222, 211, 0.07);
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.footer-coord { color: var(--brass); opacity: .6; letter-spacing: .24em; }

/* ============ operations screen ============ */

.ops-screen {
  flex-direction: column;
  background:
    radial-gradient(ellipse at 20% 35%, rgba(21, 63, 67, 0.28), transparent 54%),
    radial-gradient(ellipse at 88% 10%, rgba(99, 71, 34, 0.11), transparent 42%),
    #061318;
  overflow: hidden;
}
.ops-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(171, 200, 190, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(171, 200, 190, .026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at center, black, transparent 78%);
}
.ops-header {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px clamp(22px, 4vw, 56px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(4, 14, 17, 0.35);
  backdrop-filter: blur(6px);
}
#ops-back { justify-self: start; }
.ops-heading { text-align: center; }
.ops-heading .kicker { margin-bottom: 5px; }
.ops-heading h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--cream);
}
.ops-header-actions { justify-self: end; display: flex; gap: 8px; }
.ops-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, .8fr);
  gap: clamp(22px, 3vw, 42px);
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(18px, 3vh, 34px) clamp(22px, 4vw, 56px);
  min-height: 0;
}
.ops-chart-wrap { display: flex; min-height: 0; min-width: 0; }
.chart-frame {
  position: relative;
  flex: 1;
  min-height: 260px;
  border: 1px solid rgba(184, 207, 195, 0.16);
  background: #081b21;
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4), 0 24px 70px rgba(0, 0, 0, 0.25);
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}
.chart-frame::before,
.chart-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 26px;
  height: 26px;
  pointer-events: none;
  border-color: rgba(199, 168, 103, 0.48);
  border-style: solid;
}
.chart-frame::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.chart-frame::after { right: 12px; bottom: 12px; border-width: 0 1px 1px 0; }
.pacific-chart { width: 100%; height: 100%; min-height: 300px; display: block; }
.chart-topline, .chart-bottomline {
  position: absolute;
  left: 30px;
  right: 30px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: Georgia, var(--serif);
  font-size: 8px;
  letter-spacing: .2em;
  color: rgba(183, 203, 193, 0.36);
  pointer-events: none;
}
.chart-topline { top: 26px; }
.chart-bottomline { bottom: 26px; }
.chart-live { display: flex; align-items: center; gap: 7px; color: rgba(208, 177, 105, 0.64); }
.chart-live i { width: 4px; height: 4px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 8px var(--red); animation: blink 2.4s infinite; }
@keyframes blink { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

.chart-node { cursor: default; outline: none; }
.chart-node .node-pulse {
  fill: none;
  stroke: rgba(199, 168, 103, 0.25);
  stroke-width: 1;
  transform-origin: center;
  transform-box: fill-box;
}
.chart-node .node-ring {
  fill: rgba(5, 17, 20, 0.82);
  stroke: rgba(183, 161, 107, 0.35);
  stroke-width: 1;
  transition: stroke .25s, fill .25s;
}
.chart-node .node-core { fill: rgba(186, 164, 110, 0.45); transition: fill .25s; }
.chart-node .node-number {
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: .15em;
  fill: rgba(206, 185, 132, 0.35);
}
.chart-node .node-name {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .12em;
  fill: rgba(228, 224, 204, 0.38);
  transition: fill .25s;
}
.chart-node .node-state {
  font-family: var(--sans);
  font-size: 7px;
  letter-spacing: .28em;
  fill: rgba(172, 190, 181, 0.22);
}
.chart-node.is-locked { opacity: .6; }
.chart-node.is-unlocked { cursor: pointer; }
.chart-node.is-unlocked .node-ring { stroke: var(--brass); fill: rgba(9, 28, 31, 0.96); }
.chart-node.is-unlocked .node-core { fill: var(--brass-bright); }
.chart-node.is-unlocked .node-number { fill: rgba(232, 206, 146, 0.8); }
.chart-node.is-unlocked .node-name { fill: rgba(244, 238, 218, 0.9); }
.chart-node.is-unlocked .node-state { fill: rgba(225, 195, 126, 0.58); }
.chart-node.is-unlocked .node-pulse { animation: nodePulse 3s ease-out infinite; }
.chart-node.is-unlocked:hover .node-ring { stroke: #f4e0b1; fill: rgba(24, 46, 46, 0.98); }
.chart-node.is-unlocked:hover .node-name { fill: #fff8e8; }
.chart-node.is-complete .node-ring { stroke: rgba(130, 194, 158, 0.9); }
.chart-node.is-complete .node-core { fill: #8ed2a7; }
.chart-node.is-complete .node-state { fill: rgba(147, 207, 169, 0.7); }
.chart-node:focus-visible .node-ring { stroke: #fff4d4; stroke-width: 2; }
@keyframes nodePulse {
  0% { opacity: .6; transform: scale(.85); }
  55% { opacity: 0; transform: scale(1.8); }
  100% { opacity: 0; transform: scale(1.8); }
}

.ops-list-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(199, 168, 103, .3) transparent;
}
.ops-list-wrap::-webkit-scrollbar { width: 4px; }
.ops-list-wrap::-webkit-scrollbar-thumb { background: rgba(199,168,103,.28); }
.ops-list-heading { margin-bottom: 20px; }
.ops-list-heading h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  margin: 5px 0 9px;
}
.ops-list-heading p { max-width: 390px; font-size: 11px; line-height: 1.8; color: var(--muted); letter-spacing: .02em; }
.mission-list { display: flex; flex-direction: column; gap: 9px; }
.mission-dossier {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(11, 31, 34, 0.84), rgba(5, 17, 20, 0.62));
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  position: relative;
  transition: border-color .22s, transform .22s, background .22s;
}
.mission-dossier::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--line-brass);
  opacity: .35;
  transition: background .22s, opacity .22s;
}
.mission-dossier:hover {
  border-color: rgba(199, 168, 103, 0.42);
  background: linear-gradient(120deg, rgba(16, 40, 42, 0.92), rgba(7, 21, 23, 0.76));
  transform: translateX(3px);
}
.mission-dossier:hover::before { background: var(--brass-bright); opacity: .9; }
.mission-dossier.is-locked { opacity: .48; filter: grayscale(.4); cursor: not-allowed; }
.mission-dossier.is-locked:hover { transform: none; border-color: var(--line); background: linear-gradient(120deg, rgba(11, 31, 34, 0.84), rgba(5, 17, 20, 0.62)); }
.mission-dossier.is-locked::before { background: var(--faint); }
.mission-number {
  font-family: Georgia, var(--serif);
  font-size: 23px;
  color: var(--brass);
  letter-spacing: .04em;
  border-right: 1px solid var(--line);
  padding-right: 10px;
  opacity: .8;
}
.mission-info { min-width: 0; }
.mission-date {
  display: block;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.mission-title-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.mission-title-row strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--cream);
}
.mission-title-row em { font-style: normal; font-family: var(--serif); font-size: 11px; letter-spacing: .06em; color: var(--brass); opacity: .74; }
.mission-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 9px; letter-spacing: .05em; }
.difficulty-dots { display: inline-flex; gap: 3px; }
.difficulty-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.difficulty-dots i.on { background: var(--red-bright); box-shadow: 0 0 6px rgba(213,104,84,.3); }
.mission-state { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.mission-state .stars { color: var(--brass-bright); font-size: 11px; letter-spacing: 2px; }
.mission-state .stars .off { color: rgba(255,255,255,.13); }
.mission-state .state-label { font-size: 8px; letter-spacing: .12em; color: var(--brass); text-align: right; white-space: nowrap; }
.mission-state .state-label.locked { color: var(--faint); }
.mission-state .state-label.complete { color: var(--green); }
.rank-card {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.rank-badge {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-brass);
  border-radius: 50%;
  color: var(--brass);
  font-size: 15px;
  flex: 0 0 auto;
}
.rank-card strong { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: .12em; margin: 4px 0; font-weight: 600; }
.rank-card p { font-size: 10px; color: var(--faint); line-height: 1.6; }
.manual-link {
  align-self: flex-start;
  margin-top: 18px;
  padding: 4px 0;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.manual-link span { margin-left: 8px; }
.manual-link:hover { color: var(--brass-bright); border-color: var(--line-brass); }

/* ============ game screen ============ */

.game-screen {
  flex-direction: column;
  background: var(--bg);
}
.game-topbar {
  flex: 0 0 66px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: linear-gradient(180deg, rgba(10, 28, 31, 0.98), rgba(5, 17, 20, 0.98));
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}
.game-topbar::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 18px; right: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199,168,103,.28), transparent);
}
.game-op { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-btn { border-radius: 4px; width: 32px; height: 32px; font-size: 17px; flex: 0 0 auto; }
.game-op-copy { min-width: 0; }
.game-op-kicker {
  display: block;
  font-size: 8px;
  letter-spacing: .16em;
  color: var(--brass);
  opacity: .7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-op-copy h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: .14em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.turn-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 17px;
  border: 1px solid var(--line-soft);
  background: rgba(2, 11, 13, 0.3);
  min-width: 156px;
  justify-content: center;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.phase-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 9px rgba(125, 198, 184, 0.55);
  animation: dotPulse 2.2s infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.turn-copy { display: flex; flex-direction: column; line-height: 1.35; }
.turn-copy span { font-size: 8px; letter-spacing: .16em; color: var(--teal); }
.turn-copy b { font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--cream-dim); }
.enemy-phase .phase-dot { background: var(--red-bright); box-shadow: 0 0 9px rgba(213,104,84,.6); }
.enemy-phase .turn-copy span { color: var(--red-bright); }
.enemy-phase .turn-status { border-color: rgba(179, 72, 59, .24); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cp-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  min-height: 32px;
  color: var(--brass-bright);
  background: rgba(2,11,13,.26);
}
.cp-label { font-size: 8px; letter-spacing: .16em; color: var(--faint); }
.cp-pips { display: flex; align-items: center; gap: 3px; }
.cp-pips i {
  display: block;
  width: 9px; height: 3px;
  background: rgba(255,255,255,.09);
  transition: background .25s, box-shadow .25s;
}
.cp-pips i.filled { background: var(--brass); box-shadow: 0 0 7px rgba(199,168,103,.35); }
.cp-display b { font-family: Georgia, serif; font-size: 13px; font-weight: 500; min-width: 8px; text-align: right; }

.game-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr) 324px;
  position: relative;
}
.side-panel {
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(10, 27, 30, 0.97), rgba(5, 16, 19, 0.985));
  backdrop-filter: blur(7px);
}
.fleet-panel { border-right: 1px solid var(--line); }
.intel-panel { border-left: 1px solid var(--line); }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 16px 13px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.panel-head h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .15em;
  margin-top: 3px;
}
.panel-close { display: none; font-size: 9px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 2px 0; }
.objective-block { padding: 13px 16px 10px; border-bottom: 1px solid var(--line-soft); flex: 0 0 auto; }
.objective-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.objective-top span { font-size: 8px; letter-spacing: .18em; color: var(--brass); }
.objective-top i { font-size: 8px; color: var(--faint); letter-spacing: .08em; font-style: normal; }
.objective-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.objective-row .obj-mark {
  width: 4px; height: 4px;
  transform: rotate(45deg);
  background: var(--brass);
  flex: 0 0 auto;
}
.objective-row.done .obj-mark { background: var(--green); box-shadow: 0 0 6px rgba(126,185,149,.4); }
.objective-text { flex: 1; font-size: 10px; color: var(--cream-dim); letter-spacing: .02em; line-height: 1.5; }
.objective-count { font-family: Georgia, serif; font-size: 10px; color: var(--brass); white-space: nowrap; }
.objective-row.done .objective-count { color: var(--green); }
.objective-progress { height: 2px; background: rgba(255,255,255,.06); margin-top: 6px; overflow: hidden; }
.objective-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass-deep), var(--brass-bright)); transition: width .4s; }
.objective-defeat {
  margin-top: 9px;
  color: rgba(207, 117, 101, .72);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: .02em;
}
.roster {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(199,168,103,.23) transparent;
}
.roster::-webkit-scrollbar { width: 4px; }
.roster::-webkit-scrollbar-thumb { background: rgba(199,168,103,.22); }
.roster-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 6px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.roster-group-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.ship-card {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  margin-bottom: 3px;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  text-align: left;
  position: relative;
  transition: background .18s, border-color .18s;
}
.ship-card:hover { background: rgba(125, 198, 184, 0.045); border-color: rgba(198,219,206,.08); }
.ship-card.is-selected {
  background: linear-gradient(90deg, rgba(199,168,103,.105), rgba(199,168,103,.02));
  border-color: rgba(199,168,103,.18);
  border-left-color: var(--brass);
}
.ship-card.is-enemy { border-left-color: rgba(179,72,59,.3); }
.ship-card.is-sunk { opacity: .3; filter: grayscale(1); }
.ship-card.is-sunk:hover { background: transparent; border-color: transparent; }
.ship-glyph { width: 36px; height: 30px; display: grid; place-items: center; color: var(--cream-dim); opacity: .9; }
.ship-glyph svg { width: 36px; height: 24px; overflow: visible; }
.ship-card.is-selected .ship-glyph { color: var(--brass-bright); }
.ship-main { min-width: 0; }
.ship-line { display: flex; align-items: baseline; gap: 7px; }
.ship-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ship-type { font-size: 8px; color: var(--faint); letter-spacing: .1em; }
.ship-flag {
  font-size: 7px;
  color: var(--brass);
  border: 1px solid rgba(199,168,103,.28);
  padding: 0 3px;
  line-height: 1.5;
}
.hp-track { display: block; height: 2px; background: rgba(255,255,255,.075); margin-top: 5px; overflow: hidden; }
.hp-track i { display: block; height: 100%; background: var(--green); transition: width .35s, background .35s; }
.hp-track i.warn { background: var(--brass); }
.hp-track i.crit { background: var(--red-bright); }
.ship-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.ship-meta .air-count { color: var(--teal-dim); }
.action-pips { display: flex; align-items: center; gap: 2.5px; margin-left: auto; }
.action-pips i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255,255,255,.13); }
.action-pips i.avail { background: var(--teal); box-shadow: 0 0 4px rgba(125,198,184,.3); }
.ship-card .ended-mark { color: var(--faint); font-size: 9px; align-self: start; margin-top: 3px; }
.fleet-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px calc(11px + var(--safe-bottom));
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 9px;
  letter-spacing: .08em;
}
.fleet-footer strong { color: var(--cream-dim); font-family: var(--serif); font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.fleet-count { margin-left: auto; color: var(--faint); }

/* map */
.map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #06171c;
  touch-action: none;
}
#game-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.map-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(1, 8, 10, 0.25) 100%),
    linear-gradient(180deg, rgba(2, 9, 11, .28), transparent 10%, transparent 84%, rgba(2, 9, 11, .32));
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .18);
}
.map-hud { position: absolute; z-index: 6; pointer-events: none; }
.map-hud-left {
  top: 16px;
  left: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.map-sector {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(4, 15, 18, 0.55);
  border-left: 1px solid rgba(199,168,103,.4);
  backdrop-filter: blur(5px);
}
.sector-kicker { font-size: 7px; color: var(--brass); letter-spacing: .2em; opacity: .7; }
.map-sector strong { font-family: var(--serif); font-size: 11px; letter-spacing: .06em; font-weight: 500; color: var(--cream-dim); }
.weather-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--muted);
  background: rgba(4, 15, 18, 0.48);
  padding: 4px 8px;
  backdrop-filter: blur(4px);
}
.weather-icon { color: var(--brass); font-size: 11px; }
.map-tools {
  position: absolute;
  z-index: 8;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 1px;
  background: rgba(4, 15, 18, 0.55);
  border: 1px solid rgba(198,219,206,.11);
  backdrop-filter: blur(5px);
}
.map-tool {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: var(--cream-dim);
  font-size: 14px;
  transition: background .2s, color .2s;
}
.map-tool:hover { background: rgba(199,168,103,.1); color: var(--brass-bright); }
.map-tool + .map-tool { border-left: 1px solid rgba(198,219,206,.08); }
.map-legend {
  position: absolute;
  z-index: 6;
  left: 18px;
  bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .04em;
  background: rgba(4, 15, 18, 0.48);
  backdrop-filter: blur(5px);
  pointer-events: none;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-mark { width: 7px; height: 7px; display: block; border: 1px solid; }
.legend-mark.own { border-color: var(--brass); background: rgba(199,168,103,.35); }
.legend-mark.enemy { border-color: var(--red-bright); background: rgba(213,104,84,.3); }
.legend-mark.ghost { border-color: rgba(206,188,143,.5); border-style: dashed; background: transparent; border-radius: 50%; }
.legend-drag { color: var(--faint); margin-left: 2px; }
.turn-banner {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: min(520px, 74%);
  text-align: center;
  pointer-events: none;
  text-shadow: 0 4px 20px rgba(0,0,0,.55);
  animation: bannerIn 2.3s cubic-bezier(.2,.7,.2,1) both;
}
.turn-banner .banner-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(199,168,103,.6), transparent);
  margin: 2px 0 10px;
}
.turn-banner .banner-kicker { font-family: Georgia, serif; font-size: 8px; letter-spacing: .3em; color: var(--brass); }
.turn-banner strong {
  font-family: var(--serif);
  font-size: clamp(26px, 3.3vw, 40px);
  font-weight: 600;
  letter-spacing: .24em;
  color: var(--cream);
  margin-top: 4px;
}
.turn-banner .banner-sub { font-size: 10px; letter-spacing: .3em; color: var(--muted); margin-top: 3px; }
.turn-banner.enemy-banner .banner-kicker { color: var(--red-bright); }
.turn-banner.enemy-banner strong { color: #f0d7cd; }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.02); }
}
.map-toast {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(4, 15, 18, .84);
  border: 1px solid rgba(199,168,103,.28);
  color: var(--cream-dim);
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
  backdrop-filter: blur(7px);
  animation: toastDrop .3s ease both;
  pointer-events: none;
}
@keyframes toastDrop { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
.map-toast.warn { border-color: rgba(179,72,59,.45); color: #e8c9c1; }
.map-toast.good { border-color: rgba(125,198,184,.36); color: #d6ece2; }

.map-tooltip {
  position: absolute;
  z-index: 20;
  width: 214px;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(8, 24, 27, 0.97), rgba(4, 14, 17, 0.98));
  border: 1px solid rgba(199,168,103,.3);
  padding: 11px 12px;
  font-size: 9px;
  color: var(--muted);
  box-shadow: 0 14px 38px rgba(0,0,0,.45);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.tt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-soft); padding-bottom: 6px; margin-bottom: 7px; }
.tt-name { font-family: var(--serif); font-size: 13px; letter-spacing: .06em; color: var(--cream); font-weight: 600; }
.tt-class { font-size: 8px; color: var(--faint); letter-spacing: .08em; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; }
.tt-row b { color: var(--cream-dim); font-weight: 500; }
.tt-hit { color: var(--brass-bright); font-family: Georgia, serif; font-size: 14px; }
.tt-dmg { color: #f0b29f; }
.tt-note { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); font-size: 8px; color: var(--faint); line-height: 1.5; }
.tt-danger { color: var(--red-bright); }
.tt-good { color: var(--teal); }

.mobile-panel-nav { display: none; }

/* intel */
.intel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(199,168,103,.23) transparent;
}
.intel-scroll::-webkit-scrollbar { width: 4px; }
.intel-scroll::-webkit-scrollbar-thumb { background: rgba(199,168,103,.22); }
.ship-hero {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(26, 50, 49, 0.5), rgba(5, 18, 20, 0.2) 54%),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(154, 189, 177, .04) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(154, 189, 177, .04) 19px 20px);
  padding: 14px 14px 12px;
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.ship-hero::after {
  content: "";
  position: absolute;
  right: -22px; top: -30px;
  width: 130px; height: 130px;
  border: 1px solid rgba(199,168,103,.13);
  border-radius: 50%;
  pointer-events: none;
}
.ship-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ship-hero h4 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .09em;
  line-height: 1.2;
}
.ship-roman { display: block; font-family: Georgia, serif; font-size: 7px; letter-spacing: .17em; color: var(--faint); margin-top: 4px; text-transform: uppercase; }
.hero-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hero-tag {
  font-size: 7px;
  letter-spacing: .1em;
  border: 1px solid rgba(199,168,103,.26);
  color: var(--brass);
  padding: 2px 5px;
  white-space: nowrap;
}
.hero-tag.enemy { border-color: rgba(179,72,59,.35); color: var(--red-bright); }
.hero-tag.green { border-color: rgba(126,185,149,.3); color: var(--green); }
.ship-silhouette { height: 82px; display: grid; place-items: center; color: rgba(218, 225, 202, .78); position: relative; }
.ship-silhouette svg { width: 142px; height: 68px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.28)); }
.enemy .ship-silhouette { color: rgba(180, 202, 207, .66); }
.hp-big { margin-top: 2px; }
.hp-big-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.hp-big-label { font-size: 8px; letter-spacing: .13em; color: var(--faint); }
.hp-big-value { font-family: Georgia, serif; font-size: 14px; color: var(--cream); }
.hp-big-value small { color: var(--faint); font-size: 9px; }
.hp-big-track { height: 4px; background: rgba(255,255,255,.07); }
.hp-big-track i { display: block; height: 100%; background: linear-gradient(90deg, #5b9d78, var(--green)); transition: width .3s; }
.hp-big-track i.warn { background: linear-gradient(90deg, #9b7b43, var(--brass)); }
.hp-big-track i.crit { background: linear-gradient(90deg, #762d26, var(--red-bright)); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin-top: 12px; }
.stat-cell { background: rgba(5, 18, 20, .8); padding: 7px 9px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.stat-cell span { font-size: 8px; color: var(--faint); letter-spacing: .08em; }
.stat-cell b { font-family: Georgia, serif; font-size: 12px; color: var(--cream-dim); font-weight: 500; }
.trait-quote {
  margin-top: 12px;
  padding: 9px 10px;
  border-left: 1px solid var(--line-brass);
  background: rgba(199,168,103,.035);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
  letter-spacing: .02em;
}
.trait-quote b { color: var(--brass); font-weight: 500; }
.action-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  font-size: 9px;
  color: var(--muted);
}
.action-status .status-line { flex: 1; height: 1px; background: var(--line-soft); }
.status-pill { padding: 2px 7px; border: 1px solid rgba(125,198,184,.26); color: var(--teal); font-size: 8px; letter-spacing: .06em; }
.status-pill.spent { border-color: var(--line); color: var(--faint); }
.commander-block {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: rgba(5, 17, 19, .55);
}
.commander-block-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); }
.commander-block-head span { font-size: 8px; letter-spacing: .16em; color: var(--brass); }
.commander-block-head b { font-family: Georgia, serif; font-size: 10px; font-weight: 500; color: var(--faint); }
.command-list { padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.command-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  background: rgba(255,255,255,.018);
  text-align: left;
  transition: border-color .2s, background .2s;
}
.command-card:hover:not(:disabled) { background: rgba(125,198,184,.05); border-color: rgba(125,198,184,.16); }
.command-card:disabled { opacity: .38; }
.command-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--line-brass);
  color: var(--brass);
  font-size: 10px;
  flex: 0 0 auto;
}
.command-copy { flex: 1; min-width: 0; }
.command-copy strong { display: block; font-size: 10px; font-weight: 500; color: var(--cream-dim); letter-spacing: .04em; }
.command-copy small { display: block; color: var(--faint); font-size: 8px; margin-top: 2px; line-height: 1.4; }
.command-cost { font-family: Georgia, serif; font-size: 10px; color: var(--brass); white-space: nowrap; }
.command-note { padding: 2px 10px 9px; font-size: 8px; color: var(--faint); line-height: 1.5; }

.enemy-intel-card { border: 1px solid rgba(179,72,59,.22); background: linear-gradient(150deg, rgba(43, 20, 19, .28), rgba(5, 17, 19, .35)); padding: 13px; }
.enemy-intel-card .ship-hero { border: 0; background: transparent; padding: 0; clip-path: none; }
.enemy-intel-card .ship-hero::after { display: none; }
.enemy-intel-card .stat-cell { background: rgba(20, 14, 14, .48); }
.enemy-warning { margin-top: 11px; padding: 8px 9px; border: 1px solid rgba(179,72,59,.18); color: #cda99f; font-size: 8px; line-height: 1.6; }
.enemy-warning b { color: var(--red-bright); font-weight: 500; }
.no-selection {
  border: 1px solid var(--line-soft);
  padding: 16px;
  background: rgba(5,17,19,.4);
  position: relative;
}
.no-selection .intel-mission {
  font-family: var(--serif);
  color: var(--cream-dim);
  font-size: 15px;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.no-selection p { color: var(--muted); font-size: 10px; line-height: 1.75; }
.intel-block { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.intel-block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.intel-block-head span { font-size: 8px; letter-spacing: .16em; color: var(--brass); }
.intel-block-head b { font-size: 8px; font-weight: 400; color: var(--faint); }
.contact-list { display: flex; flex-direction: column; gap: 4px; }
.contact-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--muted); font-size: 9px; }
.contact-row .dot { width: 3px; height: 3px; background: var(--red-bright); border-radius: 50%; }
.contact-row strong { color: var(--cream-dim); font-weight: 500; } 
.contact-row span { margin-left: auto; color: var(--faint); font-size: 8px; letter-spacing: .06em; }
.intel-empty-note { color: var(--faint); font-size: 9px; padding: 5px 0; }
.ship-index-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.ship-index-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 7px;
  border: 1px solid var(--line-soft);
  font-size: 9px;
  color: var(--muted);
  background: rgba(255,255,255,.015);
}
.ship-index-chip b { font-family: var(--serif); font-weight: 500; color: var(--cream-dim); font-size: 10px; }
.ship-index-chip.sunk { opacity: .35; text-decoration: line-through; }
.ship-index-chip span { margin-left: auto; font-size: 7px; color: var(--faint); }

.log-section {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: rgba(4, 15, 17, 0.6);
  min-height: 0;
}
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.log-head span { font-size: 8px; letter-spacing: .17em; color: var(--brass); }
.live-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px rgba(126,185,149,.45); animation: dotPulse 2.6s infinite; }
.combat-log {
  max-height: 132px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(199,168,103,.18) transparent;
  font-size: 9px;
  line-height: 1.7;
}
.combat-log::-webkit-scrollbar { width: 3px; }
.combat-log::-webkit-scrollbar-thumb { background: rgba(199,168,103,.2); }
.log-entry { display: flex; gap: 7px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.035); color: var(--muted); }
.log-entry .log-turn { flex: 0 0 18px; font-family: Georgia, serif; font-size: 7px; color: var(--faint); padding-top: 2px; }
.log-entry .log-text { flex: 1; }
.log-entry.hit .log-text, .log-entry.crit .log-text { color: #d7cba9; }
.log-entry.crit .log-text { color: #efb194; }
.log-entry.miss .log-text { color: var(--faint); }
.log-entry.contact .log-text { color: var(--teal); }
.log-entry.sink .log-text { color: var(--red-bright); }
.log-entry.turn .log-text { color: var(--brass); letter-spacing: .04em; }
.log-entry.command .log-text { color: var(--cream-dim); }
.log-entry.warn .log-text { color: var(--brass); }
.log-empty { color: var(--faint); font-size: 9px; padding: 5px 0; }

/* command bar */
.command-bar {
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px calc(0px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(7, 21, 24, 0.98), rgba(3, 12, 14, 0.99));
  border-top: 1px solid var(--line);
  z-index: 20;
  position: relative;
}
.command-hint { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.hint-label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 8px;
  letter-spacing: .13em;
  color: var(--brass);
  white-space: nowrap;
}
.hint-label i { width: 4px; height: 4px; background: var(--brass); transform: rotate(45deg); display: block; }
#hint-text {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .02em;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-summary { display: flex; align-items: center; gap: 10px; flex: 0 1 auto; }
.summary-chip {
  display: flex; flex-direction: column; gap: 1px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  min-width: 54px;
}
.summary-chip span { color: var(--faint); font-size: 7px; letter-spacing: .1em; }
.summary-chip b { color: var(--cream-dim); font-family: Georgia, var(--serif); font-size: 11px; font-weight: 500; white-space: nowrap; }
.command-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.command-actions .btn { min-width: 104px; min-height: 38px; }
.end-turn-btn { min-width: 132px !important; }
.end-turn-btn.armed { animation: armedPulse 1.1s infinite; border-color: #f0d7a0; }
@keyframes armedPulse { 0%, 100% { box-shadow: 0 0 0 rgba(199,168,103,0); } 50% { box-shadow: 0 0 20px rgba(199,168,103,.26); } }

/* ============ overlays, modals, result ============ */

.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(ellipse at center, rgba(11, 35, 38, .98), rgba(2, 9, 11, .995));
  animation: fadeIn .25s ease both;
}
.transition-overlay p { font-family: var(--serif); font-size: 19px; letter-spacing: .25em; color: var(--cream); margin-top: 18px; }
.transition-overlay small { font-family: Georgia, serif; font-size: 7px; letter-spacing: .3em; color: var(--brass); opacity: .5; }
.radar-loader { width: 74px; height: 74px; border: 1px solid rgba(199,168,103,.25); border-radius: 50%; position: relative; display: grid; place-items: center; }
.radar-loader::before, .radar-loader::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(199,168,103,.14); border-radius: 50%; }
.radar-loader::after { inset: 25px; }
.radar-loader i { width: 4px; height: 4px; background: var(--brass); border-radius: 50%; box-shadow: 0 0 9px rgba(199,168,103,.65); }
.radar-loader span {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 310deg, rgba(199,168,103,.32) 360deg);
  animation: radarSpin 1.4s linear infinite;
}
@keyframes radarSpin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#modal-root { position: relative; z-index: 1000; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(1, 8, 10, 0.76);
  backdrop-filter: blur(9px);
  animation: fadeIn .24s ease both;
  overflow-y: auto;
}
.modal-card {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 38px);
  max-height: calc(100dvh - 38px);
  overflow-y: auto;
  background:
    linear-gradient(135deg, rgba(15, 37, 39, 0.98), rgba(5, 17, 20, 0.99)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(174, 202, 190, .02) 27px 28px);
  border: 1px solid rgba(199, 168, 103, .28);
  box-shadow: var(--shadow-deep), inset 0 0 80px rgba(0, 0, 0, .25);
  padding: clamp(22px, 4vw, 38px);
  animation: modalIn .32s cubic-bezier(.2,.8,.2,1) both;
  clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
  scrollbar-width: thin;
  scrollbar-color: rgba(199,168,103,.25) transparent;
}
.modal-card::-webkit-scrollbar { width: 4px; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(199,168,103,.25); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-card::before, .modal-card::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  border-color: rgba(199,168,103,.5);
  border-style: solid;
  pointer-events: none;
}
.modal-card::before { top: 13px; left: 13px; border-width: 1px 0 0 1px; }
.modal-card::after { right: 13px; bottom: 13px; border-width: 0 1px 1px 0; }
.modal-close {
  position: absolute;
  top: 15px; right: 15px;
  z-index: 4;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(5,16,18,.4);
  font-size: 16px;
}
.modal-close:hover { color: var(--cream); border-color: var(--line-brass); }
.modal-kicker { font-family: Georgia, serif; font-size: 8px; letter-spacing: .28em; color: var(--brass); text-transform: uppercase; }
.modal-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: .13em;
  margin: 8px 0 5px;
}
.modal-sub { color: var(--muted); font-size: 11px; letter-spacing: .05em; }

/* briefing */
.briefing-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.briefing-stamp {
  pointer-events: none;
  border: 1px solid rgba(179,72,59,.55);
  color: var(--red-bright);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .18em;
  padding: 6px 10px;
  transform: rotate(3deg);
  opacity: .75;
  line-height: 1;
  white-space: nowrap;
}
.briefing-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .85fr); gap: clamp(22px, 4vw, 42px); padding-top: 20px; }
.briefing-copy p { color: var(--cream-dim); font-size: 12px; line-height: 1.95; letter-spacing: .025em; }
.briefing-intro {
  font-family: var(--serif);
  font-size: clamp(17px, 2.1vw, 22px) !important;
  color: var(--cream) !important;
  line-height: 1.8 !important;
  letter-spacing: .08em !important;
  margin-bottom: 14px;
}
.briefing-section-label { display: flex; align-items: center; gap: 9px; margin: 22px 0 9px; font-size: 8px; letter-spacing: .18em; color: var(--brass); }
.briefing-section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.objective-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.objective-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 11px; line-height: 1.6; color: var(--cream-dim); }
.objective-list li i { width: 5px; height: 5px; margin-top: 6px; transform: rotate(45deg); background: var(--brass); flex: 0 0 auto; }
.objective-list li.defeat i { background: var(--red-bright); }
.tactical-note { margin-top: 18px; border-left: 1px solid var(--line-brass); padding: 10px 13px; background: rgba(199,168,103,.035); color: var(--muted); font-size: 10px; line-height: 1.8; }
.tactical-note b { display: block; margin-bottom: 3px; font-weight: 500; color: var(--brass); font-size: 8px; letter-spacing: .15em; }
.intel-side { border-left: 1px solid var(--line-soft); padding-left: clamp(16px, 2.5vw, 28px); }
.intel-force-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04); color: var(--muted); }
.intel-force-row b { color: var(--cream-dim); font-weight: 500; font-family: var(--serif); font-size: 11px; }
.force-silhouette-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 4px; }
.force-silhouette {
  width: 48px; height: 31px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.015);
  display: grid; place-items: center;
  color: var(--cream-dim);
}
.force-silhouette.enemy { color: var(--red-bright); border-color: rgba(179,72,59,.2); }
.force-silhouette svg { width: 39px; height: 27px; }
.historical-note { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line-soft); font-size: 9px; line-height: 1.75; color: var(--faint); font-style: italic; }
.briefing-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.briefing-actions .btn { min-width: 130px; }
.briefing-actions .completion-note { margin-right: auto; color: var(--faint); font-size: 9px; letter-spacing: .07em; }
.stars { color: var(--brass-bright); letter-spacing: 2px; }
.stars .off { color: rgba(255,255,255,.14); }

/* manual */
.manual-card { width: min(820px, calc(100vw - 32px)); }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 30px; padding-top: 20px; }
.manual-item { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.manual-item h4 { font-family: var(--serif); font-size: 15px; font-weight: 600; letter-spacing: .08em; color: var(--cream-dim); margin-bottom: 6px; }
.manual-item p { color: var(--muted); font-size: 10px; line-height: 1.8; }
.manual-item p b { color: var(--brass); font-weight: 500; }
.manual-footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; color: var(--faint); font-size: 9px; }
.keycap { display: inline-block; min-width: 20px; text-align: center; font-family: Georgia, serif; font-size: 9px; border: 1px solid var(--line); padding: 1px 5px; margin: 0 2px; color: var(--muted); }
.manual-footer .btn { margin-left: auto; }

/* confirm */
.confirm-card { width: min(440px, calc(100vw - 32px)); padding: 30px; text-align: center; }
.confirm-card .modal-title { font-size: 25px; }
.confirm-card p { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 10px auto 22px; max-width: 330px; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; }
.confirm-actions .btn { min-width: 120px; }

/* result */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at center, rgba(11, 34, 35, .9), rgba(1, 8, 10, .97) 70%),
    rgba(1, 8, 10, .95);
  backdrop-filter: blur(7px);
  animation: fadeIn .4s ease both;
}
.result-overlay.defeat { background: radial-gradient(ellipse at center, rgba(48, 20, 18, .92), rgba(3, 8, 10, .98) 70%); }
.result-card {
  width: min(720px, calc(100vw - 32px));
  position: relative;
  text-align: center;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(199,168,103,.25);
  background: linear-gradient(155deg, rgba(14, 36, 37, .97), rgba(4, 14, 16, .99));
  box-shadow: var(--shadow-deep);
  animation: modalIn .4s .1s cubic-bezier(.2,.8,.2,1) both;
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.result-overlay.defeat .result-card { border-color: rgba(179,72,59,.25); }
.result-stamp {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--brass-bright);
  border: 2px solid rgba(199,168,103,.48);
  padding: 7px 24px 10px;
  transform: rotate(-2deg);
  text-shadow: 0 0 25px rgba(199,168,103,.15);
  margin-bottom: 8px;
}
.result-overlay.defeat .result-stamp { color: var(--red-bright); border-color: rgba(179,72,59,.55); }
.result-kicker { font-family: Georgia, serif; font-size: 8px; letter-spacing: .3em; color: var(--faint); margin-bottom: 16px; }
.result-sub { font-family: var(--serif); font-size: 16px; letter-spacing: .14em; color: var(--cream-dim); margin-top: 8px; }
.result-stars { font-size: 24px; letter-spacing: 8px; color: var(--brass-bright); margin: 16px 0 2px; }
.result-stars .off { color: rgba(255,255,255,.1); }
.result-unlock { margin-top: 10px; color: var(--teal); font-size: 10px; letter-spacing: .05em; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-soft); margin: 22px auto 18px; border: 1px solid var(--line-soft); }
.result-stat { background: rgba(4,15,17,.82); padding: 11px 6px; }
.result-stat span { display: block; font-size: 7px; color: var(--faint); letter-spacing: .1em; margin-bottom: 5px; }
.result-stat b { font-family: Georgia, serif; font-size: 18px; font-weight: 500; color: var(--cream); }
.result-stat b small { font-size: 9px; color: var(--faint); margin-left: 2px; }
.result-note { font-size: 9px; color: var(--faint); line-height: 1.7; max-width: 490px; margin: 0 auto; }
.result-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.result-actions .btn { min-width: 150px; }
.result-detail { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 9px; color: var(--faint); line-height: 1.8; }

/* toasts */
.toast-root {
  position: fixed;
  z-index: 1500;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: min(92vw, 500px);
}
.global-toast {
  padding: 8px 15px;
  background: rgba(5, 18, 20, 0.94);
  border: 1px solid var(--line);
  color: var(--cream-dim);
  font-size: 10px;
  letter-spacing: .03em;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  animation: toastIn .3s cubic-bezier(.2,.8,.2,1) both;
  text-align: center;
}
.global-toast.warn { border-color: rgba(179,72,59,.36); color: #e8c6bf; }
.global-toast.good { border-color: rgba(125,198,184,.32); color: #d1e9df; }
.global-toast.leaving { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

/* ============ responsive ============ */

@media (max-width: 1320px) {
  .game-main { grid-template-columns: 254px minmax(0, 1fr) 300px; }
  .title-layout { padding-left: clamp(24px, 5vw, 70px); }
  .selection-summary { display: none; }
}

@media (max-width: 1100px) {
  .game-main { grid-template-columns: minmax(0, 1fr); }
  .side-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(370px, 88vw);
    z-index: 45;
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
    box-shadow: 20px 0 50px rgba(0,0,0,.35);
    border-right: 1px solid var(--line);
  }
  .fleet-panel { left: 0; transform: translateX(-104%); }
  .intel-panel { right: 0; left: auto; transform: translateX(104%); border-left: 1px solid var(--line); }
  .game-screen.show-fleet .fleet-panel { transform: translateX(0); }
  .game-screen.show-intel .intel-panel { transform: translateX(0); }
  .panel-close { display: block; }
  .sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: rgba(1, 7, 9, 0.52);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
  }
  .game-screen.show-fleet .sheet-backdrop,
  .game-screen.show-intel .sheet-backdrop { opacity: 1; pointer-events: auto; }
  .mobile-panel-nav {
    display: flex;
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 8;
    background: rgba(4, 15, 18, .72);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  }
  .mobile-panel-nav button {
    padding: 7px 14px;
    font-size: 9px;
    letter-spacing: .08em;
    color: var(--cream-dim);
  }
  .mobile-panel-nav button + button { border-left: 1px solid var(--line-soft); }
  .map-legend { bottom: 60px; }
  .toast-root { bottom: 78px; }
  .ops-body { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .85fr); gap: 20px; }
}

@media (max-width: 920px) {
  .ops-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
    align-content: start;
  }
  .ops-chart-wrap { min-height: 300px; }
  .chart-frame { flex: none; height: clamp(280px, 48vw, 420px); }
  .ops-list-wrap { overflow: visible; }
  .briefing-grid { grid-template-columns: 1fr; }
  .intel-side { border-left: 0; border-top: 1px solid var(--line-soft); padding-left: 0; padding-top: 16px; }
}

@media (max-width: 760px) {
  body { font-size: 13px; }
  .title-topbar { padding: 16px 20px; }
  .title-layout { padding: 10px 22px 0; align-items: center; }
  .title-copy { max-width: 100%; }
  .eyebrow { margin-bottom: 18px; }
  .logo-top { font-size: clamp(84px, 25vw, 120px); }
  .logo-bottom { font-size: clamp(48px, 15vw, 72px); margin-left: .35em; }
  .logo-subrow { margin-top: 15px; gap: 18px; }
  .year-mark { font-size: 30px; padding-right: 18px; }
  .title-tagline { font-size: 13px; }
  .title-aside { display: none; }
  .title-actions { gap: 8px; margin-top: 25px; }
  .title-actions .btn { min-width: 0; flex: 1; min-height: 50px; font-size: 12px; letter-spacing: .1em; }
  .title-actions .btn-large { padding: 0 16px; }
  .title-actions .btn-ornament { display: none; }
  .title-actions .btn-arrow { font-size: 14px; }
  .title-progress { margin-top: 20px; }
  .title-footer { padding: 13px 20px calc(13px + var(--safe-bottom)); font-size: 7px; }
  .title-footer .footer-coord { display: none; }
  .ops-header { padding: 14px 16px; grid-template-columns: auto 1fr auto; gap: 8px; }
  .ops-heading h2 { font-size: 20px; letter-spacing: .16em; }
  .ops-heading .kicker { font-size: 7px; }
  .ops-body { padding: 14px 16px 24px; gap: 18px; }
  .chart-frame { height: clamp(230px, 58vw, 320px); }
  .chart-topline { left: 18px; right: 18px; top: 18px; font-size: 6px; }
  .chart-bottomline { left: 18px; right: 18px; bottom: 18px; font-size: 6px; }
  .mission-dossier { padding: 12px; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .mission-number { font-size: 18px; padding-right: 7px; }
  .mission-title-row strong { font-size: 16px; }
  .mission-state .stars { font-size: 9px; }
  .ops-list-heading h3 { font-size: 21px; }
  .game-topbar {
    flex: 0 0 58px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 0 10px;
  }
  .game-op { gap: 8px; }
  .game-op-kicker { font-size: 7px; letter-spacing: .1em; }
  .game-op-copy h2 { font-size: 15px; letter-spacing: .1em; }
  .turn-status { min-width: 0; padding: 5px 8px; gap: 6px; }
  .turn-copy span { display: none; }
  .turn-copy b { font-size: 9px; }
  .top-actions { gap: 4px; }
  .cp-display { gap: 5px; padding: 5px 7px; min-height: 29px; }
  .cp-label, .cp-pips { display: none; }
  .cp-display b { font-size: 12px; }
  .cp-display b::before { content: "指令 "; font-family: var(--sans); font-size: 7px; color: var(--faint); font-weight: 400; }
  .top-actions .icon-btn { width: 30px; height: 30px; }
  .side-panel {
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    width: 100%;
    height: min(78vh, 620px);
    height: min(78dvh, 620px);
    transform: translateY(calc(100% + 80px));
    border: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 0 -22px 55px rgba(0,0,0,.45);
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
  }
  .intel-panel { right: 0; left: 0; transform: translateY(calc(100% + 80px)); }
  .game-screen.show-fleet .fleet-panel,
  .game-screen.show-intel .intel-panel { transform: translateY(0); }
  .panel-head { padding: 13px 16px 10px; }
  .panel-head h3 { font-size: 15px; }
  .roster { padding-bottom: 20px; }
  .map-hud-left { top: 10px; left: 10px; gap: 4px; }
  .map-sector { padding: 6px 9px; }
  .map-sector strong { font-size: 9px; }
  .sector-kicker { font-size: 6px; }
  .weather-chip { font-size: 7px; padding: 3px 6px; }
  .map-tools { top: 10px; right: 10px; }
  .map-tool { width: 26px; height: 26px; font-size: 12px; }
  .map-legend { left: 10px; bottom: 56px; gap: 8px; padding: 5px 7px; font-size: 7px; }
  .map-legend .legend-drag { display: none; }
  .mobile-panel-nav { bottom: 12px; }
  .command-bar { flex: 0 0 63px; gap: 10px; padding: 0 10px calc(0px + var(--safe-bottom)); }
  .command-hint { gap: 7px; }
  .hint-label { font-size: 7px; letter-spacing: .06em; }
  #hint-text { font-size: 9px; }
  .command-actions .btn { min-width: 0; min-height: 35px; padding: 0 12px; font-size: 10px; }
  .command-actions #btn-next-ship { display: none; }
  .end-turn-btn { min-width: 105px !important; }
  .end-turn-btn small { display: none; }
  .map-tooltip { display: none !important; }
  .turn-banner { width: 86%; }
  .turn-banner strong { font-size: 25px; }
  .turn-banner .banner-sub { font-size: 8px; }
  .intel-scroll { padding: 12px; }
  .ship-hero h4 { font-size: 21px; }
  .combat-log { max-height: 160px; }
  .modal-backdrop { padding: 10px; }
  .modal-card { width: 100%; max-height: calc(100dvh - 20px); padding: 22px 18px; }
  .briefing-head { gap: 10px; }
  .briefing-stamp { font-size: 10px; padding: 5px 7px; }
  .briefing-intro { font-size: 16px !important; }
  .briefing-copy p { font-size: 11px; line-height: 1.85; }
  .briefing-actions { flex-wrap: wrap; }
  .briefing-actions .completion-note { width: 100%; }
  .briefing-actions .btn { flex: 1; min-width: 110px; }
  .manual-grid { grid-template-columns: 1fr; gap: 14px; }
  .manual-footer .btn { margin-left: 0; width: 100%; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .result-actions .btn { flex: 1; min-width: 120px; }
  .result-stamp { font-size: 34px; padding: 6px 16px 8px; }
  .toast-root { bottom: 72px; }
  .global-toast { font-size: 9px; }
}

@media (max-width: 430px) {
  .title-copy { text-align: left; }
  .logo-subrow { gap: 13px; }
  .year-mark { font-size: 25px; }
  .title-tagline { font-size: 12px; line-height: 1.6; }
  .title-actions { flex-direction: column; }
  .title-actions .btn { width: 100%; }
  .title-topbar .emblem-kicker { display: none; }
  .emblem-line { font-size: 10px; }
  .ops-heading .kicker { display: none; }
  .chart-bottomline span:last-child { display: none; }
  .mission-title-row em { display: none; }
  .mission-meta .battle-label { display: none; }
  .mission-state .state-label { font-size: 7px; }
  .map-legend span:nth-child(3) { display: none; }
  .game-op-copy h2 { font-size: 13px; }
  .game-op-kicker { display: none; }
  .turn-status { padding: 5px 6px; }
  .turn-copy b { font-size: 8px; }
  .top-actions .icon-btn#game-help { display: none; }
  .cp-display { padding: 5px 6px; }
  .panel-head h3 { font-size: 14px; }
  .command-hint .hint-label { display: none; }
  #hint-text { font-size: 8.5px; white-space: normal; line-height: 1.35; max-height: 28px; }
  .command-bar { gap: 8px; }
  .end-turn-btn { min-width: 92px !important; }
  .weather-chip { display: none; }
  .map-legend { bottom: 53px; }
  .mobile-panel-nav button { padding: 6px 11px; font-size: 8px; }
  .ship-silhouette { height: 66px; }
  .ship-silhouette svg { width: 120px; height: 56px; }
}

@media (max-height: 600px) and (min-width: 761px) {
  .game-topbar { flex-basis: 54px; }
  .command-bar { flex-basis: 56px; }
  .map-legend { bottom: 12px; }
  .title-logo .logo-top { font-size: clamp(64px, 9vw, 110px); }
  .logo-bottom { font-size: clamp(44px, 6vw, 70px); }
  .title-copy { padding-bottom: 0; }
  .title-actions { margin-top: 18px; }
  .title-progress { margin-top: 14px; }
  .eyebrow { margin-bottom: 12px; }
  .title-footer { padding-top: 12px; padding-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* mobile briefing: keep title and launch action in view, scroll the dossier */
@media (max-width: 760px) {
  .briefing-stamp { display: none; }
  .briefing-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }
  .briefing-card .briefing-head { flex: 0 0 auto; padding-right: 38px; }
  .briefing-card .briefing-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(199,168,103,.25) transparent;
  }
  .briefing-card .briefing-grid::-webkit-scrollbar { width: 3px; }
  .briefing-card .briefing-grid::-webkit-scrollbar-thumb { background: rgba(199,168,103,.25); }
  .briefing-card .briefing-actions {
    flex: 0 0 auto;
    margin: 14px -18px -22px;
    padding: 13px 18px calc(13px + env(safe-area-inset-bottom, 0px));
    background: rgba(4, 15, 18, 0.98);
    border-top: 1px solid var(--line);
    z-index: 3;
  }
}

/* mobile map hint when the chart is in a closer, pannable default view */
@media (max-width: 760px) {
  .map-legend::after { content: "拖曳 · 雙指縮放"; color: var(--faint); }
}

@media (max-width: 920px) {
  .ops-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
  .ops-list-wrap { overscroll-behavior: contain; }
}
