/* Battle stations: mission blocks on the cards, the mini game overlay, the
   battle HUD and the leaderboard. Uses the colour tokens from styles.css, so
   it follows day / dusk / night. */

/* ---------------------------------------------------------------- missions on the cards */
.mission {
  margin-top: 22px; padding: 14px 16px; border: 1px dashed var(--magenta); background: var(--tint);
  display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center;
}
.mission-k { grid-column: 1 / -1; font: 500 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--magenta); }
.mission b { font: italic 500 20px/1.2 var(--serif); color: var(--ink); }
.mission-best { font: 500 11px/1 var(--mono); color: var(--ink-faint); grid-column: 1; }
.mission .mission-go { grid-column: 2; grid-row: 2 / span 2; }
.mission.final { grid-template-columns: 1fr; border-style: solid; }
.mission.final p { margin: 4px 0 8px; color: var(--ink-soft); }
.mission-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.game-btn { border-style: dashed; }
.log .bt-board { margin: 0 10px 10px 0; }

.gm-chip {
  /* sits under the top bar (same row as the Drone button) so it never covers the Day / Dusk / Night controls */
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 22; white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 14px; border: 1px solid var(--magenta); color: var(--ink); background: var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; border-radius: 2px;
}
.gm-chip span { color: var(--magenta); }
.in-battle .gm-chip { display: none; }
/* phones: top-left under the brand, clear of the right-hand Drone/Helm column and
   of the page cards (at the bottom it covered the Set sail / Résumé buttons) */
@media (max-width: 759px) { .gm-chip { left: 12px; top: 60px; transform: none; white-space: normal; max-width: calc(100vw - 112px); line-height: 1.45; text-align: left; padding: 7px 11px; } }

/* ---------------------------------------------------------------- modal */
.gm-open { overflow: hidden; }
.gm-modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  grid-template-columns: minmax(0, 1fr); /* a wide child can't stretch the column past the screen */
  background: rgba(8, 14, 24, 0.45); opacity: 0; transition: opacity 0.25s;
}
.gm-modal.show { opacity: 1; }
.gm-panel {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--card-solid); color: var(--ink); border: 1px solid var(--rule); box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 30px);
}
.gm-panel.wide { width: min(860px, 100%); }
.gm-panel h2 { font: italic 500 clamp(28px, 4vw, 40px)/1.05 var(--serif); margin: 4px 0 12px; }
.gm-panel h2 small { font-size: 0.5em; color: var(--ink-faint); }
.gm-panel .eyebrow { font: 500 11px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--magenta); margin: 0; }
.gm-panel p { color: var(--ink-soft); line-height: 1.55; }
.gm-panel .dim, .gm-table .dim { color: var(--ink-faint); }
.gm-panel .note { font-size: 13px; color: var(--ink-faint); }
.gm-list { list-style: none; padding: 0; margin: 16px 0; border-top: 1px solid var(--rule); }
.gm-list li { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.gm-list .k { font: 500 10.5px/1 var(--mono); color: var(--magenta); letter-spacing: 0.1em; }
.gm-list .v { font: 500 13px/1 var(--mono); color: var(--ink-soft); }
.gm-list b { font-weight: 600; }
.gm-help ul { padding-left: 18px; line-height: 1.6; color: var(--ink-soft); }

/* ---------------------------------------------------------------- mini game */
.gm-mini header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.gm-mini header .tag { font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--magenta); }
.gm-mini header b { font: italic 500 22px/1 var(--serif); flex: 1; }
.gm-mini header > * { min-width: 0; } /* long titles wrap instead of widening the panel */
.gm-mini header .tag, .gm-mini header b { overflow-wrap: anywhere; }
.gm-time, .gm-score { font: 600 15px/1 var(--mono); min-width: 44px; text-align: right; }
.gm-score { color: var(--magenta); min-width: 64px; }
.gm-x { border: 0; background: none; color: var(--ink); font-size: 18px; cursor: pointer; padding: 4px 6px; }
.gm-stage { position: relative; aspect-ratio: 16 / 10; max-height: calc(100dvh - 170px); width: 100%; margin-inline: auto; border: 1px solid var(--rule); background: #f4f1e8; touch-action: none; }
.gm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.gm-cover {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 20px; background: rgba(250, 249, 244, 0.93); color: #23241f;
}
.gm-cover[hidden] { display: none; }
.gm-cover h3 { font: italic 500 clamp(26px, 4vw, 38px)/1.1 var(--serif); margin: 0 0 6px; }
.gm-cover p { max-width: 520px; margin: 0 0 6px; color: #46483f; }
.gm-cover .how { font: 500 12px/1.4 var(--mono); color: #b4106c; letter-spacing: 0.04em; }
.gm-cover .btn { color: #23241f; border-color: #23241f; }
.gm-cover .btn.primary { color: #fff; background: #b4106c; border-color: #b4106c; }
.gm-cover .mission-row { justify-content: center; margin-top: 8px; }
.gm-bar { height: 4px; background: var(--rule); margin-top: 8px; }
.gm-bar i { display: block; height: 100%; background: var(--magenta); transform-origin: left; }
@media (max-width: 600px) {
  .gm-stage { aspect-ratio: 3 / 4; }
  /* phones: the waypoint tag gets its own line so the title, timer and score fit */
  .gm-mini header { flex-wrap: wrap; gap: 6px 10px; }
  .gm-mini header .tag { flex: 1 0 100%; }
  .gm-mini header b { font-size: 19px; }
  .gm-time { min-width: 32px; }
  .gm-score { min-width: 48px; }
}

/* ---------------------------------------------------------------- results + leaderboard */
.gm-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 640px) { .gm-cols { grid-template-columns: 1fr; } }
.gm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gm-table td, .gm-table th { padding: 7px 6px; border-bottom: 1px solid var(--rule); text-align: left; }
.gm-table td:last-child, .gm-table th:last-child { text-align: right; }
.gm-table th { font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.gm-table .sum td { font-weight: 700; }
.gm-table.board td:nth-child(3) { text-align: right; font-family: var(--mono); }
.gm-table.board td:nth-child(1) { font-family: var(--mono); color: var(--ink-faint); width: 36px; }
.gm-table tr.me td { background: var(--tint); color: var(--magenta); font-weight: 700; }
.gm-stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-stats li { border: 1px solid var(--rule); padding: 8px 10px; font-size: 12px; color: var(--ink-faint); }
.gm-stats b { display: block; font: 600 20px/1.1 var(--mono); color: var(--ink); }
.gm-name { margin: 18px 0 12px; }
.gm-name label { display: block; font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.gm-name input { flex: 1; min-width: 180px; padding: 11px 12px; font: 500 16px var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 2px; }
.gm-name .err { color: #d0343c; min-height: 1em; font-size: 13px; margin: 6px 0 0; }
.gm-rank { font-size: 16px; }
.gm-rank b { color: var(--magenta); }

/* ---------------------------------------------------------------- battle */
.in-battle body { overflow: hidden; }
.in-battle #scene { touch-action: none; } /* drags orbit the camera, pinches zoom */
.bt-cam[hidden] { display: none; }
.bt-cam { width: auto; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.in-battle main, .in-battle .rail, .in-battle #labels, .in-battle .instruments, .in-battle #tip, .in-battle .topbar, .in-battle #progress { display: none !important; }
.bt-veil { position: fixed; inset: 0; z-index: 70; background: #050a10; opacity: 0; pointer-events: none; transition: opacity 0.6s; }
.bt-veil.show { opacity: 1; }

.bt-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; display: none; font-family: var(--mono); }
.bt-layer.on { display: block; }
.bt-tag { position: absolute; left: 0; top: 0; will-change: transform; color: #ff6b5e; font-size: 10.5px; line-height: 1.25; white-space: nowrap; }
.bt-tag i { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border: 1.5px solid currentColor; opacity: 0.85;
  clip-path: polygon(0 0, 35% 0, 35% 2px, 2px 2px, 2px 35%, 0 35%, 0 65%, 2px 65%, 2px calc(100% - 2px), 35% calc(100% - 2px), 35% 100%, 65% 100%, 65% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 65%, 100% 65%, 100% 35%, calc(100% - 2px) 35%, calc(100% - 2px) 2px, 65% 2px, 65% 0, 100% 0, 100% 0); }
.bt-tag.missile { color: #ff3b3b; }
.bt-tag.missile i { width: 16px; height: 16px; left: -8px; top: -8px; border-radius: 50%; clip-path: none; animation: bt-pulse 0.5s infinite alternate; }
.bt-tag b, .bt-tag .r, .bt-tag .hp { position: relative; left: 17px; top: -14px; display: block; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.bt-tag b { font-weight: 600; }
.bt-tag .r { color: #ffd7d2; }
.bt-tag .hp { width: 46px; height: 3px; background: rgba(0, 0, 0, 0.45); margin-top: 2px; }
.bt-tag .hp s { display: block; height: 100%; background: currentColor; transform-origin: left; text-decoration: none; }
.bt-tag.missile .hp, .bt-tag.far b { display: none; }
.bt-tag.sel { color: #ffe066; }
.bt-tag.sel i, .bt-tag.hov i { transform: scale(1.25); opacity: 1; }
.bt-tag.dead { color: #9aa; }
@keyframes bt-pulse { to { transform: scale(1.35); opacity: 0.5; } }
.bt-float { position: absolute; left: 0; top: 0; color: #ffe066; font: 700 14px/1 var(--mono); text-shadow: 0 1px 3px #000; white-space: nowrap; transform-origin: center; }

.bt-hud { position: fixed; inset: 0; z-index: 40; pointer-events: none; color: #e9f3ee; font-family: var(--mono); }
.bt-hud[hidden] { display: none; }
.bt-hud button { pointer-events: auto; font-family: var(--mono); cursor: pointer; }
.bt-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  background: linear-gradient(rgba(3, 10, 16, 0.7), rgba(3, 10, 16, 0)); }
.bt-wave { font: 600 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #ffd36b; min-width: 110px; }
.bt-score, .bt-hull { display: flex; align-items: center; gap: 8px; }
.bt-top .k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.bt-score b { font: 700 22px/1 var(--mono); }
.bt-hull { margin-left: auto; }
.bt-hull .bar { width: clamp(80px, 16vw, 180px); height: 8px; background: rgba(255, 255, 255, 0.15); }
.bt-hull .bar i { display: block; height: 100%; background: #4fe39a; transform-origin: left; transition: transform 0.3s; }
.bt-hull.low .bar i { background: #ff5a4f; }
.bt-hull b { font-size: 14px; min-width: 40px; }
.bt-icon { width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(3, 10, 16, 0.4); color: #fff; border-radius: 2px; font-size: 15px; }

.bt-msgs { position: absolute; left: 16px; top: 62px; width: min(420px, 70vw); }
.bt-msgs p { margin: 0 0 4px; font-size: 12.5px; padding: 5px 9px; background: rgba(3, 10, 16, 0.55); border-left: 3px solid #8ec5ff; transition: opacity 1s; }
.bt-msgs p.warn { border-color: #ff3b3b; color: #ffd0cc; }
.bt-msgs p.bad { border-color: #ff3b3b; background: rgba(120, 10, 10, 0.6); }
.bt-msgs p.good { border-color: #4fe39a; }
.bt-msgs p.dim { opacity: 0.75; border-color: #888; }
.bt-msgs p.old { opacity: 0.35; }

.bt-banner { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -10px); text-align: center; opacity: 0; transition: opacity 0.4s, transform 0.4s; }
.bt-banner.show { opacity: 1; transform: translate(-50%, 0); }
.bt-banner b { display: block; font: italic 500 clamp(32px, 6vw, 60px)/1 var(--serif); color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7); }
.bt-banner span { display: block; margin-top: 8px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: #ffd36b; text-shadow: 0 1px 4px #000; }

.bt-radar { position: absolute; left: 14px; bottom: 14px; width: 180px; height: 180px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(90, 255, 170, 0.35), 0 8px 30px rgba(0, 0, 0, 0.5); }

.bt-weapons { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; align-items: stretch; }
.bt-weapons button, .bt-ciws {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px;
  min-width: 78px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(3, 10, 16, 0.6); color: #e9f3ee; border-radius: 2px; text-align: left;
}
.bt-weapons b { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.bt-weapons .n { font-size: 11px; opacity: 0.8; }
.bt-weapons .k { position: absolute; right: 6px; top: 5px; font-size: 9px; opacity: 0.5; }
.bt-weapons i { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #ffd36b; transform-origin: left; transform: scaleX(0); }
.bt-weapons button[aria-pressed="true"] { border-color: #ffd36b; background: rgba(90, 70, 10, 0.55); }
.bt-ciws { border-style: dashed; }

.bt-helm { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 6px; align-items: stretch; }
.bt-helm > button, .bt-speed { min-width: 48px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(3, 10, 16, 0.6); color: #fff; border-radius: 2px; font-size: 16px; }
.bt-speed { display: flex; align-items: center; pointer-events: auto; }
.bt-speed button { border: 0; background: none; color: #fff; font-size: 18px; width: 32px; height: 100%; }
.bt-speed b { font-size: 12px; min-width: 44px; text-align: center; }
.bt-fire { display: none; background: #b4106c !important; border-color: #ff8fcf !important; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px !important; padding: 0 16px; }

.bt-hint { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); margin: 0; font-size: 12px; padding: 6px 12px; background: rgba(3, 10, 16, 0.55); white-space: nowrap; transition: opacity 1s; }
.bt-hint.gone { opacity: 0; }
.bt-hurt { position: absolute; inset: 0; box-shadow: inset 0 0 120px 30px rgba(255, 20, 10, 0.6); opacity: 0; }
.bt-hurt.hit { animation: bt-hurt 0.9s ease-out; }
.bt-hurt.hit.big { animation-duration: 1.6s; }
@keyframes bt-hurt { from { opacity: 1; } to { opacity: 0; } }
.in-battle #scene.pointing { cursor: crosshair; }
.in-battle #scene { cursor: crosshair; }

@media (max-width: 759px), (pointer: coarse) {
  .bt-radar { width: 120px; height: 120px; left: 10px; bottom: auto; top: 58px; }
  .bt-msgs { left: 140px; top: 58px; width: auto; right: 10px; }
  .bt-msgs p { font-size: 11px; }
  .bt-weapons { left: 8px; right: 8px; transform: none; bottom: 70px; justify-content: space-between; }
  .bt-weapons button, .bt-ciws { min-width: 0; flex: 1; padding: 7px 6px; }
  .bt-weapons .k { display: none; }
  .bt-ciws { display: none; }
  .bt-helm { left: 8px; right: 8px; bottom: 10px; }
  .bt-helm > button, .bt-speed { flex: 1; min-height: 50px; }
  .bt-fire { display: block; flex: 1.4 !important; }
  .bt-hint { display: none; }
  .bt-top { gap: 10px; padding: 10px; }
  .bt-cam span { display: none; }
  .bt-cam { padding: 0; width: 36px; }
  .bt-score b { font-size: 18px; }
  .bt-wave { min-width: 0; font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .bt-tag.missile i { animation: none; } }

/* ---------------------------------------------------------------- drone (js/drone.js) */
.dr-launch {
  position: fixed; right: 16px; top: 64px; z-index: 22; display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; border: 1px solid var(--rule); color: var(--ink); background: var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; border-radius: 999px;
}
.dr-launch[hidden], .in-battle .dr-launch, .in-drone .dr-launch, .gm-open .dr-launch { display: none; }
.in-drone body { overflow: hidden; }
.in-drone #scene { touch-action: none; }
.in-drone main, .in-drone .rail, .in-drone #labels, .in-drone .instruments, .in-drone #tip, .in-drone .topbar, .in-drone #progress, .in-drone .gm-chip { display: none !important; }
.dr-hud { position: fixed; inset: 0; z-index: 40; pointer-events: none; color: #e9f3ee; font-family: var(--mono); }
.dr-hud[hidden] { display: none; }
.dr-hud button, .dr-stick { pointer-events: auto; }
.dr-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(rgba(3, 10, 16, 0.7), rgba(3, 10, 16, 0)); }
.dr-read { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin-right: auto; }
.dr-read b { font: 600 12px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #ffd36b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-read span { font-size: 11px; opacity: 0.85; white-space: nowrap; }
.dr-btn { min-height: 38px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(3, 10, 16, 0.45); color: #fff; border-radius: 2px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.dr-btn.primary { border-color: #ffd36b; color: #ffd36b; }
.dr-btn[aria-pressed="true"] { background: #ffd36b; color: #10151b; }
.dr-stick { position: absolute; left: 20px; bottom: 24px; width: 128px; height: 128px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(3, 10, 16, 0.3); touch-action: none; }
.dr-stick i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.dr-alt { position: absolute; right: 20px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.dr-alt .dr-btn { width: 64px; height: 56px; font-size: 18px; }
.dr-hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); margin: 0; font-size: 12px; padding: 6px 12px; background: rgba(3, 10, 16, 0.55); white-space: nowrap; }
@media (max-width: 759px) {
  .dr-launch { right: 12px; top: 60px; padding: 8px 10px; }
  .dr-hint { display: none; }
  .dr-top { padding: 10px; gap: 8px; flex-wrap: wrap; }
  .dr-read { flex-basis: 100%; }
}
@media (pointer: fine) and (min-width: 760px) { .dr-stick, .dr-alt { opacity: 0.55; } }

/* ---------------------------------------------------------------- daily challenge */
.gm-list li.daily b .dim { font-weight: 400; color: var(--ink-faint); }
.gm-twist { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-left: 3px solid var(--magenta); background: color-mix(in srgb, var(--magenta) 8%, transparent); }
.gm-twist b { font-weight: 600; }
.gm-twist span { font-size: 14px; color: var(--ink-soft); }
.gm-tabs { display: flex; gap: 0; margin: 12px 0 4px; border-bottom: 1px solid var(--rule); }
.gm-tabs button { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--ink-soft); cursor: pointer; margin-bottom: -1px; }
.gm-tabs button[aria-selected="true"] { color: var(--magenta); border-bottom-color: var(--magenta); }
/* ---------------------------------------------------------------- messages in bottles (js/bottles.js) */
.bt-toss {
  position: fixed; right: 16px; top: 152px; z-index: 22; display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; border: 1px solid var(--rule); color: var(--ink); background: var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; border-radius: 999px;
}
/* ---------------------------------------------------------------- helm (js/helm.js) */
.hm-take {
  position: fixed; right: 16px; top: 108px; z-index: 22; display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; border: 1px solid var(--rule); color: var(--ink); background: var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; border-radius: 999px;
}
.bt-toss[hidden], .in-battle .bt-toss, .in-drone .bt-toss, .in-helm .bt-toss, .gm-open .bt-toss { display: none; }
.bt-dlg { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 10, 16, 0.45); }
.bt-dlg[hidden] { display: none; }
.bt-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 22px 20px; background: var(--paper, #f8f8f3); color: var(--ink);
  border: 1px solid var(--rule); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); font-family: var(--sans, system-ui); }
.bt-card h2 { margin: 0; font: italic 500 26px/1.1 var(--serif, Georgia, serif); }
.bt-lede { margin: 0; font-size: 14px; color: var(--ink-faint); }
.bt-card label { display: flex; flex-direction: column; gap: 5px; font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; position: relative; }
.bt-card .dim { text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
.bt-card textarea, .bt-card input { font: 15px/1.4 var(--sans, system-ui); padding: 9px 10px; border: 1px solid var(--rule); background: transparent; color: var(--ink); border-radius: 2px; resize: vertical; text-transform: none; letter-spacing: 0; }
.bt-count { position: absolute; right: 6px; bottom: 6px; font-size: 10px; color: var(--ink-faint); }
.bt-err { margin: 0; color: #c0392b; font-size: 13px; }
.bt-err[hidden] { display: none; }
.bt-row { display: flex; justify-content: flex-end; gap: 8px; }
.bt-card .dr-btn { color: var(--ink); background: transparent; border-color: var(--rule); }
.bt-card .dr-btn.primary { background: var(--magenta); border-color: var(--magenta); color: var(--paper); }
@media (max-width: 759px) { .bt-toss { right: 12px; top: 144px; padding: 8px 10px; } }
/* ---------------------------------------------------------------- postcard mode (js/postcard.js) */
.pc-snap {
  position: fixed; right: 16px; top: 196px; z-index: 22; display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 12px; border: 1px solid var(--rule); color: var(--ink); background: var(--hud);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: pointer; border-radius: 999px;
}
.hm-take[hidden], .in-battle .hm-take, .in-drone .hm-take, .in-helm .hm-take, .gm-open .hm-take { display: none; }
.in-helm .dr-launch { display: none; }
.in-helm body { overflow: hidden; }
.in-helm #scene { touch-action: none; }
.in-helm main, .in-helm .rail, .in-helm #labels, .in-helm .instruments, .in-helm #tip, .in-helm .topbar, .in-helm #progress, .in-helm .gm-chip { display: none !important; }
.hm-telegraph { position: absolute; right: 20px; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: auto; }
.hm-telegraph .dr-btn { width: 64px; height: 52px; font-size: 18px; }
.hm-telegraph b { font: 600 11px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #ffd36b; text-align: center; max-width: 90px;
  padding: 6px 8px; background: rgba(3, 10, 16, 0.55); }
.hm-warn { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); margin: 0; padding: 8px 14px; background: rgba(150, 30, 20, 0.85); color: #fff; font-size: 12px; letter-spacing: 0.06em; }
.hm-warn[hidden] { display: none; }
@media (max-width: 759px) { .hm-take { right: 12px; top: 102px; padding: 8px 10px; } }
@media (pointer: fine) and (min-width: 760px) { .hm-stick { opacity: 0.55; } }
.pc-snap[hidden], .in-battle .pc-snap, .gm-open .pc-snap { display: none; }
.in-drone .pc-snap, .in-helm .pc-snap { top: 64px; z-index: 45; }
.pc-dlg { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 10, 16, 0.6); }
.pc-dlg[hidden] { display: none; }
.pc-card { width: min(820px, 100%); display: flex; flex-direction: column; gap: 12px; }
.pc-card img { width: 100%; height: auto; display: block; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); transform: rotate(-1.2deg); }
.pc-card .bt-row { display: flex; justify-content: flex-end; gap: 8px; }
.pc-card .dr-btn { display: inline-flex; align-items: center; text-decoration: none; min-height: 38px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(3, 10, 16, 0.55); color: #fff; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.pc-card .dr-btn.primary { border-color: #ffd36b; color: #10151b; background: #ffd36b; }
@media (max-width: 759px) { .pc-snap { right: 12px; top: 186px; padding: 8px 10px; } }
