:root {
  --bg: #14181d;
  --surface: #1b2027;
  --surface2: #232a33;
  --line: #2e3640;
  --text: #e9e5db;
  --dim: #9aa3ad;
  --accent: #e0a43a;
  --accent-ink: #1a1405;
  --pass: #8cbf8c;
  --fail: #e0806f;
  --mixed: #e0b76f;
  --display: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; height: 100dvh; background: var(--bg); color: var(--text); font-family: var(--body); overscroll-behavior: none; }
html { background: #05070a; position: fixed; inset: 0; width: 100%; overflow: hidden; touch-action: manipulation; }
body { position: fixed; inset: 0; width: 100%; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--bg); transition: filter 1.4s ease; touch-action: none; }
#gl.dead { filter: grayscale(0.85) brightness(0.55) blur(1.5px); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: none; -webkit-overflow-scrolling: touch; background:
  radial-gradient(120% 80% at 50% -10%, #232b36 0%, var(--bg) 60%); padding: calc(var(--safe-t) + 28px) calc(var(--safe-r) + 20px) calc(var(--safe-b) + 40px) calc(var(--safe-l) + 20px); z-index: 20; }
.screen.overlay { background: rgba(20, 24, 29, 0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; z-index: 40; }
.wrap { max-width: 1040px; margin: 0 auto; }
.wrap.narrow { max-width: 620px; }
.wrap.center { text-align: center; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; margin: 0; }
h1 { font-size: clamp(56px, 11vw, 124px); line-height: 0.9; color: var(--text); }
h2 { font-size: clamp(40px, 7vw, 72px); line-height: 0.95; }
h3 { font-size: 22px; letter-spacing: 0.08em; color: var(--accent); margin: 28px 0 10px; }
p { line-height: 1.55; margin: 0 0 12px; }

.tag { font-family: var(--display); font-size: clamp(28px, 4.4vw, 46px); letter-spacing: 0.08em; color: var(--accent); margin: 16px 0 0; }
.fine { color: var(--dim); font-size: 12px; margin: 14px 0 0; }
.kicker { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }

/* ---------- landing ---------- */
.screen.landing { display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; overflow: hidden;
  background: radial-gradient(70% 62% at 50% 46%, rgba(12, 15, 20, 0.62) 0%, rgba(12, 15, 20, 0.28) 62%, transparent 100%), linear-gradient(0deg, rgba(12, 15, 20, 0.7) 0%, transparent 26%), linear-gradient(180deg, rgba(12, 15, 20, 0.5) 0%, transparent 20%); }
.land-top { align-self: flex-start; display: flex; align-items: center; gap: 10px; min-height: 28px; }
.land-top .emblem { color: var(--accent); margin: 0; }
.land-main { margin: auto 0; display: flex; flex-direction: column; align-items: center; padding-bottom: 3vh; }
.logo { display: flex; flex-direction: column; align-items: center; font-size: inherit; line-height: 1; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.logo .l-a, .logo .l-b { font-size: clamp(54px, 9.5vw, 128px); line-height: 0.88; letter-spacing: 0.015em; color: var(--text); }
.logo .l-or { display: flex; align-items: center; gap: 16px; font-size: clamp(18px, 2.4vw, 30px); letter-spacing: 0.4em; color: var(--accent); margin: 10px 0 8px; padding-left: 0.4em; }
.logo .l-or::before, .logo .l-or::after { content: ""; width: clamp(36px, 7vw, 96px); height: 2px; background: var(--accent); opacity: 0.8; }
.screen.landing .tag { font-size: clamp(16px, 1.8vw, 22px); letter-spacing: 0.22em; color: #c9c4b6; margin: 18px 0 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.menu-list { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: clamp(22px, 5vh, 46px); gap: 2px 6px; width: min(96vw, 900px); }
.menu-list .menu-item.sub { padding: 5px 14px; white-space: nowrap; }
.menu-list .menu-item.sub::before, .menu-list .menu-item.sub::after { display: none; }
.menu-list .menu-item.primary { flex: 0 0 100%; justify-content: center; }
.menu-item { background: none; border: 0; color: #d4cfc1; font-family: var(--display); font-size: clamp(24px, 2.8vw, 34px); letter-spacing: 0.14em; padding: 5px 22px; min-height: 44px; cursor: pointer; display: flex; align-items: center; gap: 14px; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); transition: color 0.15s; }
.menu-item::before, .menu-item::after { content: ""; border-top: 7px solid transparent; border-bottom: 7px solid transparent; opacity: 0; transition: opacity 0.15s; }
.menu-item::before { border-left: 10px solid var(--accent); }
.menu-item::after { border-right: 10px solid var(--accent); }
.menu-item:hover, .menu-item:focus-visible { color: #fff; outline: none; }
.menu-item:hover::before, .menu-item:hover::after, .menu-item:focus-visible::before, .menu-item:focus-visible::after { opacity: 1; }
.menu-item.primary { color: var(--accent); font-size: clamp(36px, 4.6vw, 58px); margin-bottom: 10px; }
.menu-item.primary::before, .menu-item.primary::after { opacity: 1; }
.menu-list:hover .menu-item.primary:not(:hover)::before, .menu-list:hover .menu-item.primary:not(:hover)::after { opacity: 0; }
.menu-item.sub { font-size: clamp(18px, 1.9vw, 23px); color: #a9a597; }
.screen.landing .land-foot { margin: 0; width: 100%; font-size: 12px; color: #8f8b7f; display: flex; justify-content: space-between; align-items: baseline; gap: 6px 24px; flex-wrap: wrap; }
.land-foot p { margin: 0; }
.land-foot .land-dedic { order: -1; margin-top: 0; font-family: var(--display); font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; color: #b9b3a2; }
.emblem { color: var(--accent); display: block; margin-bottom: 18px; opacity: 0.95; }
.landing .emblem.shield { margin: 0 0 16px; filter: drop-shadow(0 3px 14px rgba(0, 0, 0, 0.6)); }
.btn.big { font-family: var(--display); font-size: 28px; letter-spacing: 0.1em; padding: 12px 40px; min-height: 58px; margin-top: 10px; }

/* opening: hold the copy back while the camera drops, then glitch it in */
.screen.landing.pre .land-main, .screen.landing.pre .land-foot { visibility: hidden; }
@keyframes glitchIn {
  0% { opacity: 0; transform: translateX(-18px) skewX(14deg); clip-path: inset(42% 0 42% 0); text-shadow: -6px 0 #ff2a4a, 6px 0 #2a8cff; }
  14% { opacity: 1; transform: translateX(12px); clip-path: inset(8% 0 62% 0); text-shadow: -5px 0 #ff2a4a, 5px 0 #2a8cff; }
  28% { transform: translateX(-9px) skewX(-8deg); clip-path: inset(58% 0 6% 0); }
  42% { transform: translateX(6px); clip-path: inset(0 0 0 0); text-shadow: 4px 0 #ff2a4a, -4px 0 #2a8cff; }
  56% { transform: translateX(-4px); clip-path: inset(32% 0 28% 0); opacity: 0.6; }
  70% { transform: none; clip-path: inset(0); opacity: 1; text-shadow: 2px 0 rgba(255, 42, 74, 0.55), -2px 0 rgba(42, 140, 255, 0.55); }
  84% { transform: translateX(2px); clip-path: inset(0); }
  100% { transform: none; clip-path: inset(0); opacity: 1; }
}
.screen.landing.glitch .shield, .screen.landing.glitch .logo span, .screen.landing.glitch .tag, .screen.landing.glitch .menu-item { animation: glitchIn 0.8s steps(1, end) both; }
.screen.landing.glitch .logo .l-a { animation-delay: 0s; }
.screen.landing.glitch .logo .l-or { animation-delay: 0.22s; }
.screen.landing.glitch .logo .l-b { animation-delay: 0.1s; }
.screen.landing.glitch .tag { animation-delay: 0.4s; }
.screen.landing.glitch .menu-item:nth-child(1) { animation-delay: 0.55s; }
.screen.landing.glitch .menu-item:nth-child(2) { animation-delay: 0.65s; }
.screen.landing.glitch .menu-item:nth-child(3) { animation-delay: 0.75s; }
.screen.landing.glitch .menu-item:nth-child(4) { animation-delay: 0.85s; }

@media (max-height: 520px) {
  .landing .emblem.shield { width: 30px; height: 34px; margin-bottom: 6px; }
  .logo { flex-direction: row; gap: 14px; }
  .logo .l-a, .logo .l-b { font-size: clamp(34px, 11vh, 60px); }
  .logo .l-or { margin: 0; font-size: 16px; letter-spacing: 0.2em; }
  .logo .l-or::before, .logo .l-or::after { display: none; }
  .screen.landing .tag { margin-top: 8px; }
  .menu-list { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 12px; gap: 0 8px; }
  .menu-item, .menu-item.primary { font-size: 22px; margin: 0; min-height: 38px; padding: 2px 12px; }
  .menu-item.sub { font-size: 16px; }
  .menu-item::before, .menu-item::after { display: none; }
  .screen.landing .land-fine { display: none; }
  .land-foot .land-dedic { margin-top: 0; font-size: 13px; }
  .screen.landing .land-foot { justify-content: center; }
}

/* ---------- buttons ---------- */
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.btn { background: var(--surface2); border: 1px solid var(--line); padding: 14px 22px; border-radius: 3px; font-weight: 700; letter-spacing: 0.04em; min-height: 48px; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #ecb349; }

/* ---------- brief: same centered title-screen layout as the landing ---------- */
.screen.brief { display: flex; align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(75% 70% at 50% 48%, rgba(12, 15, 20, 0.7) 0%, rgba(12, 15, 20, 0.34) 65%, transparent 100%), linear-gradient(0deg, rgba(12, 15, 20, 0.72) 0%, transparent 28%), linear-gradient(180deg, rgba(12, 15, 20, 0.5) 0%, transparent 20%); }
.brief-grid { width: 100%; max-width: 780px; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.b-head { display: flex; flex-direction: column; align-items: center; }
.b-head .kicker { color: var(--accent); letter-spacing: 0.3em; margin-bottom: 12px; }
.b-head h2 { font-size: clamp(54px, 8.4vw, 112px); line-height: 0.88; letter-spacing: 0.015em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.place { color: #c9c4b6; font-size: clamp(14px, 1.6vw, 18px); letter-spacing: 0.22em; text-transform: uppercase; margin: 16px 0 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
.b-body { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; }
.dispatch { background: rgba(14, 17, 22, 0.58); border: 1px solid rgba(233, 229, 219, 0.14); padding: 16px 26px 20px; max-width: 62ch; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dispatch b { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: 0.4em; color: var(--accent); margin-bottom: 10px; padding-left: 0.4em; }
.dispatch b::before, .dispatch b::after { content: ""; width: 34px; height: 2px; background: var(--accent); opacity: 0.8; }
.dispatch p { margin: 0; font-size: clamp(16px, 1.7vw, 19px); line-height: 1.5; }
.b-sub { display: none; }
.keys { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; max-width: 700px; }
.keys div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.keys dt { flex: none; font-family: var(--display); font-size: 15px; letter-spacing: 0.06em; line-height: 1; padding: 5px 8px 3px; background: rgba(27, 32, 39, 0.85); border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 3px; min-width: 30px; text-align: center; }
.keys dd { margin: 0; font-size: 13px; color: #c6c2b8; }
.b-note { margin: 0; color: #9f9b8f; font-size: 13px; line-height: 1.5; max-width: 52ch; }
.brief .row { margin: 4px 0 0; flex-direction: column; align-items: center; gap: 0; }
.brief .menu-item.primary { margin-bottom: 4px; }
@media (max-width: 760px), (max-height: 600px) {
  .screen.brief { align-items: flex-start; }
  .brief-grid { gap: 14px; }
  .b-head h2 { font-size: clamp(44px, 13vw, 76px); }
  .b-body { gap: 14px; }
  .keys { gap: 6px 12px; }
  .keys dd { font-size: 12px; }
}
@media (max-height: 600px) and (min-width: 761px) {
  .b-head h2 { font-size: clamp(38px, 12vh, 64px); }
  .dispatch { padding: 10px 18px 12px; }
  .dispatch p { font-size: 15px; }
  .keys dd { font-size: 12px; }
  .b-note { display: none; }
  .brief .row { flex-direction: row; justify-content: center; }
  .brief .menu-item.primary { font-size: 30px; margin: 0; }
}
.screen.brief.glitch .b-head > *, .screen.brief.glitch .dispatch, .screen.brief.glitch .keys, .screen.brief.glitch .menu-item { animation: glitchIn 0.7s steps(1, end) both; }
.screen.brief.glitch .b-head h2 { animation-delay: 0.05s; }
.screen.brief.glitch .place { animation-delay: 0.2s; }
.screen.brief.glitch .dispatch { animation-delay: 0.32s; }
.screen.brief.glitch .keys { animation-delay: 0.44s; }
.screen.brief.glitch .menu-item.primary { animation-delay: 0.56s; }
.screen.brief.glitch .menu-item.sub { animation-delay: 0.66s; }

/* ---------- debrief ---------- */
.verdict { padding: 8px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.verdict h2 { color: var(--text); }
.verdict.pass h2 { color: var(--pass); }
.verdict.fail h2 { color: var(--fail); }
.verdict.mixed h2 { color: var(--mixed); }
.sum { font-size: 19px; margin-top: 8px; color: #d6d2c8; }
.stills { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 0 0 18px; }
.still { margin: 0; background: var(--surface); border: 1px solid var(--line); }
.still img { width: 100%; display: block; aspect-ratio: 16 / 9; max-height: 34vh; object-fit: cover; background: var(--surface2); }
.still figcaption { padding: 8px 12px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }

.tl { position: relative; height: 26px; margin: 4px 0 12px; }
.tl::before { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--line); }
.tl .m { position: absolute; top: 6px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg); background: var(--dim); border: 2px solid var(--bg); }
.tl .m.threat { background: var(--accent); }
.tl .m.player { background: #8aa4c4; }
.tl .m.safe { background: var(--pass); }
.tl .m.fatal { background: var(--fail); }
.tlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.tlist li { display: grid; grid-template-columns: 54px 1fr; gap: 8px; color: #c6c2b8; }
.tlist time { color: var(--dim); font-variant-numeric: tabular-nums; }
.tlist li.threat { color: var(--accent); }
.tlist li.fatal { color: var(--fail); }
.tlist li.safe { color: var(--pass); }

.facts { margin: 0; display: grid; gap: 0; }
.facts div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.lesson p { max-width: 70ch; font-size: 16px; color: #d6d2c8; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse 62% 62% at 50% 50%, transparent 40%, rgba(10, 12, 18, 0.92) 100%); }
#flash { position: absolute; inset: 0; background: #ffe9c2; opacity: 0; transition: opacity 0.12s ease-out; }
#flash.on { opacity: 0.16; transition: none; }
#hurt { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, rgba(150, 20, 16, 0.35), rgba(120, 8, 8, 0.85)); opacity: 0; transition: opacity 1.2s ease-out; }
#hurt.on { opacity: 1; transition: opacity 0.08s ease-out; }
#reticle { position: absolute; left: 50%; top: 50%; width: calc(14px + var(--ret, 0px)); height: calc(14px + var(--ret, 0px)); transform: translate(-50%, -50%); border: 1.5px solid rgba(233, 229, 219, 0.55); border-radius: 50%; transition: width 0.1s, height 0.1s; }
#reticle { transition: width 0.1s, height 0.1s, opacity 0.25s; }
#reticle.off { opacity: 0; }
#reticle i { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: rgba(233, 229, 219, 0.95); }
#caption { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -100%); justify-content: flex-end; width: min(760px, 90vw); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#caption .cl { display: flex; flex-direction: column; gap: 2px; background: rgba(8, 10, 16, 0.86); border-left: 4px solid var(--accent); padding: 8px 16px 10px; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; }
#caption .cl.in { opacity: 1; transform: none; }
#caption .cl:not(:last-child).in { opacity: 0.62; }
#caption .cl.me { border-left-color: #8aa4c4; }
#caption .cl.ally { border-left-color: #8fc79a; }
#caption .cl.them { border-left-color: #e0a43a; }
#caption b { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: #aab1bd; }
#caption .cl.me b { color: #8aa4c4; }
#caption .cl.ally b { color: #8fc79a; }
#caption .cl.them b { color: #e0a43a; }
#caption span { font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; line-height: 1.25; color: #f3efe4; }

.touch-only { display: none; }
body.touch .touch-only { display: block; }


/* ---------- small screens ---------- */
@media (max-width: 560px) {
  .screen { padding-left: calc(var(--safe-l) + 16px); padding-right: calc(var(--safe-r) + 16px); }
  .facts div { grid-template-columns: 96px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, #gl { transition: none; }
}

/* command list */
#cmdList { position: absolute; left: 18px; bottom: 22px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#cmdList[hidden] { display: none; }
#cmdList button { display: flex; align-items: center; gap: 10px; font: 600 13px/1 'DM Sans', system-ui, sans-serif; color: #e9e5db; background: rgba(12, 16, 26, 0.72); border: 1px solid rgba(233, 229, 219, 0.22); border-left: 3px solid #5b8cff; padding: 8px 12px; text-align: left; }
#cmdList kbd { font: 700 11px/1 'DM Sans', system-ui, sans-serif; color: #9fb4e8; min-width: 34px; }

/* service record */
.rankline { margin: 10px 0 0; font-size: 14px; color: var(--accent); font-weight: 600; letter-spacing: 0.02em; }
.rankline:empty { display: none; }
.career { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 12px 14px; margin: 0 0 18px; }
.career .rankup { font-family: var(--display); font-size: 26px; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 8px; }
.car-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); }
.car-head b { color: var(--accent); font-size: 18px; }
.car-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.car-items li { display: flex; justify-content: space-between; color: #d6d2c8; }
.car-items b { color: var(--pass); }
.award { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 8px 10px; background: var(--surface2); }
.award i { width: 14px; height: 14px; flex: none; transform: rotate(45deg); background: var(--accent); }
.award div { display: grid; font-size: 13px; color: var(--dim); }
.award b { color: var(--text); font-size: 15px; }
.car-rank { display: flex; justify-content: space-between; margin-top: 12px; font-size: 13px; color: var(--dim); }
.car-rank span:first-child { color: var(--text); font-weight: 600; }
.career .bar { height: 5px; background: var(--line); margin-top: 6px; }
.career .bar i { display: block; height: 100%; background: var(--accent); }

/* intro deck */
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; margin-bottom: 6px; }
.screen.deck { display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(120% 90% at 20% 30%, rgba(20, 24, 29, 0.78), rgba(10, 12, 16, 0.96)); }
.deck-stage { position: relative; flex: 1; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; max-width: 1040px; margin: 0 auto; padding: 0 8px; opacity: 0; transform: translateY(18px); pointer-events: none; transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.slide.on { opacity: 1; transform: none; pointer-events: auto; }
.slide.past { transform: translateY(-18px); }
.slide .emblem { color: var(--accent); margin-bottom: 18px; }
.s-big { font-family: var(--display); font-weight: 400; font-size: clamp(56px, 12vw, 150px); line-height: 0.92; letter-spacing: 0.01em; margin: 0; }
.s-num { font-family: var(--display); font-weight: 400; font-size: clamp(72px, 17vw, 210px); line-height: 0.9; margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.s-sub { font-size: clamp(17px, 2.2vw, 26px); line-height: 1.35; max-width: 34em; margin: 18px 0 0; color: #d6d2c8; }
.s-src { margin-top: 14px; font-size: 13px; color: var(--dim); width: fit-content; }
.s-src:hover { color: var(--accent); }
.slide .row { margin-top: 26px; }
.deck-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 1040px; width: 100%; margin: 0 auto; padding: 14px 0 calc(var(--safe-b) + 6px); }
.dots { display: flex; gap: 8px; }
.dots i { position: relative; width: 22px; height: 3px; background: var(--line); overflow: hidden; transition: width 0.3s; }
.dots i.done { background: var(--accent); }
.dots i.on { width: 38px; }
.dots i.on::after { content: ''; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: dotfill var(--d, 6s) linear forwards; }
.dots.paused i.on::after { animation-play-state: paused; }
.dots.static i.on::after { animation: none; }
@keyframes dotfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.deck-left { display: flex; gap: 16px; align-items: center; }
.deck-left .linkbtn { margin: 0; }
.deck-nav { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .slide { transition: opacity 0.2s; transform: none; } }
@media (max-width: 560px) { .dots i { width: 12px; } .dots i.on { width: 22px; } }

/* lethal threat cue */
#threatGlow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.18s ease-out; box-shadow: inset 0 0 90px 26px rgba(230, 30, 30, 0.55), inset 0 0 220px 40px rgba(180, 10, 10, 0.35); }
#threatGlow.on { opacity: 1; animation: threatPulse 0.9s ease-in-out infinite; }
@keyframes threatPulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #threatGlow.on { animation: none; } }

/* stance */
#stance { position: absolute; top: calc(var(--safe-t, 0px) + 14px); left: 50%; transform: translateX(-50%); padding: 5px 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; background: rgba(8, 10, 16, 0.7); border: 1px solid rgba(233, 229, 219, 0.2); color: #c6c2b8; pointer-events: none; }
#stance[data-s='l'] { color: #e0a43a; border-color: #e0a43a; }
#stance[data-s='t'] { color: #ff8a7a; border-color: #ff8a7a; }

/* service record screen */
.rec-pts { margin: 4px 0 10px; font-size: 17px; color: #d6d2c8; }
.rec-bar { height: 6px; background: var(--line); margin-bottom: 8px; }
.rec-bar i { display: block; height: 100%; background: var(--accent); width: 0; }
.ladder { list-style: none; margin: 8px 0 18px; padding: 0; display: grid; gap: 4px; }
.ladder li { display: flex; justify-content: space-between; padding: 7px 12px; background: var(--surface); border-left: 3px solid var(--line); font-size: 15px; color: var(--dim); }
.ladder li.done { color: #d6d2c8; border-left-color: var(--pass); }
.ladder li.now { color: var(--text); border-left-color: var(--accent); background: var(--surface2); font-weight: 700; }
.medals { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 22px; }
.medal { display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); opacity: 0.5; }
.medal.got { opacity: 1; border-color: var(--accent); }
.medal i { width: 16px; height: 16px; flex: none; transform: rotate(45deg); background: var(--line); }
.medal.got i { background: var(--accent); }
.medal div { display: grid; font-size: 13px; color: var(--dim); }
.medal b { color: var(--text); font-size: 15px; }

/* ---------- one screen, no scroll (iPad and up) ---------- */
.screen { padding-top: calc(var(--safe-t) + 18px); padding-bottom: calc(var(--safe-b) + 18px); }
#debrief .stills { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; margin-bottom: 10px; }
#debrief .still img { max-height: 15vh; }
#debrief .still figcaption { padding: 5px 10px; font-size: 11px; }
#debrief p { margin-bottom: 8px; line-height: 1.45; }
#debrief .facts div { padding: 6px 0; }
#debrief .career { margin-bottom: 10px; padding: 10px 12px; }
#debrief .tlist { font-size: 13px; gap: 3px; }
#record .ladder { margin: 6px 0 10px; gap: 3px; }
#record .ladder li { padding: 5px 12px; }
#record .medals { margin-bottom: 12px; gap: 6px; }

/* ---------- touch controls: stick on the left, gestures on the right ---------- */
#pauseBtn { position: absolute; top: calc(var(--safe-t) + 8px); right: calc(var(--safe-r) + 10px); width: 40px; height: 34px; background: rgba(12, 14, 20, 0.55); border: 1px solid rgba(233, 229, 219, 0.28); border-radius: 2px; pointer-events: auto; font-size: 12px; letter-spacing: 3px; padding-left: 3px; }
#touch { position: absolute; inset: 0; pointer-events: none; }
#joy { position: absolute; width: 92px; height: 92px; margin: -46px 0 0 -46px; border: 1.5px solid rgba(233, 229, 219, 0.22); border-radius: 50%; transition: opacity 0.15s; opacity: 0.7; }
#joy.on { border-color: rgba(233, 229, 219, 0.5); opacity: 1; transition: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: 0; border-radius: 50%; background: rgba(233, 229, 219, 0.3); transform: translate(-50%, -50%); }
#joy.on i { background: rgba(233, 229, 219, 0.55); }
#touch .acts { position: absolute; right: calc(var(--safe-r) + 10px); bottom: calc(var(--safe-b) + 10px); display: flex; gap: 6px; }
#touch .acts button { pointer-events: auto; touch-action: none; height: 34px; padding: 0 12px; background: rgba(12, 14, 20, 0.55); border: 1px solid rgba(233, 229, 219, 0.28); border-radius: 2px; color: var(--text); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; }
#touch .acts button:active { background: rgba(224, 164, 58, 0.5); }
#gestureHint { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 14px); transform: translateX(-50%); margin: 0; max-width: 44vw; text-align: center; font-size: 12px; line-height: 1.35; color: #d6d2c8; background: rgba(8, 10, 16, 0.7); padding: 6px 12px; }
body.touch #cmdList { left: auto; right: calc(var(--safe-r) + 10px); bottom: calc(var(--safe-b) + 52px); pointer-events: auto; }
body.touch #cmdList button { padding: 7px 10px; font-size: 12px; }

/* captions: small, top left, out of the way of the action */
body.touch #caption { left: calc(var(--safe-l) + 12px); right: auto; top: calc(var(--safe-t) + 8px); bottom: auto; transform: none; width: min(42vw, 360px); gap: 3px; }
body.touch #caption .cl { flex-direction: row; align-items: baseline; gap: 7px; padding: 4px 9px 5px; border-left-width: 3px; background: rgba(8, 10, 16, 0.62); }
body.touch #caption .cl:not(:last-child).in { opacity: 0.5; }
body.touch #caption b { font-size: 9px; letter-spacing: 0.12em; flex: none; }
body.touch #caption span { font-size: 13px; font-weight: 500; line-height: 1.3; }
body.touch #stance { top: calc(var(--safe-t) + 8px); font-size: 10px; padding: 3px 10px; }

@media (orientation: portrait) {
  body.touch #caption { top: calc(var(--safe-t) + 42px); width: calc(100vw - var(--safe-l) - var(--safe-r) - 24px); }
  body.touch #caption span { font-size: 14px; }
  #gestureHint { max-width: 90vw; bottom: calc(var(--safe-b) + 54px); }
  #joy { margin-top: -46px; }
}

/* intro deck: controls sit right under the slide, not pinned to the bottom edge */
.screen.deck { justify-content: center; }
.deck-stage { flex: none; height: clamp(250px, 64vh, 560px); }
.s-big { font-size: clamp(48px, min(12vw, 17vh), 150px); }
.s-num { font-size: clamp(64px, min(17vw, 24vh), 210px); }
.deck-bar { padding-top: 18px; }

/* slide titles carry the story on their own: big, not a label */
.s-kick { font-family: var(--display); font-weight: 400; font-size: clamp(30px, min(5vw, 7vh), 54px); line-height: 1; letter-spacing: 0.03em; color: var(--accent); margin: 0 0 16px; }
.slide .row { margin-top: 18px; }
@media (max-height: 520px) {
  .deck-stage { height: calc(100dvh - 104px); }
  .s-big { font-size: clamp(40px, min(10vw, 13vh), 80px); }
  .s-num { font-size: clamp(56px, min(15vw, 20vh), 110px); }
  .slide .row { margin-top: 10px; }
  .slide .emblem { display: none; }
  .s-sub { margin-top: 10px; font-size: clamp(15px, 2.2vw, 20px); }
  .s-kick { margin-bottom: 8px; }
}

/* graduation video */
#cine { position: fixed; inset: 0; z-index: 35; pointer-events: none; }
#cineFade { position: absolute; inset: 0; background: #000; opacity: 0; }
#cineCap { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: min(900px, 90vw); text-align: center; margin: 0; font-family: var(--display); font-size: clamp(26px, 4vw, 44px); letter-spacing: 0.04em; color: #f1ecdf; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); opacity: 0; transition: opacity 0.4s; }
#cineCap.on { opacity: 1; }
#cineCard { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; opacity: 0; transition: opacity 0.7s; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.8); }
#cineCard.on { opacity: 1; }
#cineCard h2 { font-size: clamp(54px, 11vw, 130px); color: var(--text); }
#cineCard p { margin: 10px 0 0; font-size: clamp(18px, 2.6vw, 28px); color: var(--accent); font-weight: 600; }
#cineSkip { position: absolute; right: calc(var(--safe-r) + 20px); top: calc(var(--safe-t) + 16px); pointer-events: auto; margin: 0; font-size: 14px; }

/* the debrief has to read at arm's length on a phone */
@media (max-width: 700px) {
  #debrief .still figcaption { font-size: 14px; letter-spacing: 0.02em; text-transform: none; color: #c6c2b8; }
  #debrief .facts div { font-size: 16px; padding: 10px 0; }
  #debrief .facts dt { color: #c6c2b8; }
  #debrief .tlist { font-size: 15px; }
  #debrief .tlist li { color: #e0dcd1; }
  #debrief .car-head, #debrief .car-rank { font-size: 15px; color: #c6c2b8; }
  #debrief .car-items { font-size: 16px; }
}

#cineOath { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 20px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 20px); background: rgba(6, 8, 12, 0.88); pointer-events: auto; }
#cineOath[hidden] { display: none; }
.oath { max-width: 40rem; }
.oath h2 { font-size: clamp(34px, 6vw, 60px); color: var(--accent); margin-bottom: 14px; }
.oath-text { font-size: clamp(15px, min(2.1vw, 3.2vh), 21px); line-height: 1.55; color: #f1ede3; margin: 0 0 12px; }
.oath-text .blank { display: inline-block; width: 7em; border-bottom: 1.5px solid #c6c2b8; transform: translateY(2px); }
.oath-src { font-size: 14px; color: var(--dim); margin: 0 0 4px; }
.oath .btn.big { margin-top: 12px; }

/* ---------- debrief and service record: same title-screen language as the landing ---------- */
#debrief, #record, #board { background: radial-gradient(90% 60% at 50% 0%, rgba(34, 42, 54, 0.9) 0%, var(--bg) 70%); }
#debrief h3 { display: flex; align-items: center; gap: 12px; font-size: 16px; letter-spacing: 0.3em; color: var(--accent); }
#debrief h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#debrief .still { border-color: rgba(233, 229, 219, 0.14); }
#debrief .still figcaption { letter-spacing: 0.2em; color: #b3ae9f; }
#record .ladder li, #record .medal { text-align: left; }
.screen.glitch .pp-head > *, .screen.glitch .pp-actions, .screen.glitch .pp-pager { animation: glitchIn 0.7s steps(1, end) both; }
.screen.glitch .pp-head > h2 { animation-delay: 0.06s; }
.screen.glitch .pp-head > .sum, .screen.glitch .pp-head > .sub, .screen.glitch .rec-pts { animation-delay: 0.2s; }
.screen.glitch .pp-actions, .screen.glitch .rec-bar { animation-delay: 0.32s; }
.screen.glitch .pp-pager { animation-delay: 0.44s; }
@media (prefers-reduced-motion: reduce) { .screen.glitch * { animation: none !important; } }

@media (min-width: 700px) {
  #record .ladder { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
  }

/* wordmark: each word is cut on a slant, and its lower half slips and turns amber */
.logo .l-a, .logo .l-b { position: relative; display: block; font-style: normal; }
.logo .l-a i, .logo .l-b i { font-style: normal; display: block; }
.logo .l-a .t, .logo .l-b .t { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 62%); }
.logo .l-a .b, .logo .l-b .b { position: absolute; inset: 0; clip-path: polygon(0 62%, 100% 44%, 100% 100%, 0 100%); transform: translate(0.075em, 0.02em); color: var(--accent); text-shadow: none; }

/* ---------- certificate ---------- */
.cert-wrap { width: 100%; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 24px; }
#certCanvas { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.cert-name { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; width: 100%; }
.cert-name input { width: min(420px, 100%); text-align: center; font: 500 20px 'DM Sans', system-ui, sans-serif; color: var(--text); background: rgba(27, 32, 39, 0.85); border: 1px solid var(--line); border-bottom: 3px solid var(--accent); border-radius: 3px; padding: 10px 12px; }
.cert-name input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#certSave:disabled { opacity: 0.35; pointer-events: none; }
.cert-sheet { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; background: rgba(10, 12, 16, 0.96); text-align: center; }
.cert-sheet[hidden] { display: none; }
.cert-sheet p { margin: 0; color: var(--text); font-size: 15px; max-width: 34ch; }
.cert-sheet img { max-width: 100%; max-height: 62vh; border: 1px solid var(--line); -webkit-touch-callout: default; user-select: auto; }

/* ---------- the board ---------- */
#board.screen.brief { align-items: flex-start; padding-top: 20px; padding-bottom: 28px; }
.board-sub { margin: 0; color: var(--dim); font-size: 14px; max-width: 54ch; }
.board-join { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.board-join b { font-family: var(--display); font-size: 26px; letter-spacing: 0.08em; color: var(--text); font-weight: 400; }
#boardBody { width: 100%; text-align: left; }
.bt { width: 100%; border-collapse: collapse; font-size: 14px; }
.bt th { font-weight: 500; color: var(--dim); font-size: 12px; text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.bt th:nth-child(-n+2) { text-align: left; }
.bt td { padding: 7px 8px; border-bottom: 1px solid rgba(46, 54, 64, 0.6); text-align: right; font-variant-numeric: tabular-nums; }
.bt td:nth-child(1) { text-align: left; width: 34px; color: var(--dim); }
.bt td:nth-child(2) { text-align: left; font-family: var(--display); font-size: 20px; letter-spacing: 0.06em; }
.bt tr.me td { background: rgba(224, 164, 58, 0.12); }
.bt .bad { color: var(--fail); }
.board-h { margin: 18px 0 6px; font-family: var(--display); font-size: 24px; letter-spacing: 0.08em; font-weight: 400; color: var(--text); }
.struggle { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.struggle li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 7px 10px; background: rgba(27, 32, 39, 0.7); border-left: 3px solid var(--accent); font-size: 14px; }
.struggle li small { grid-column: 1 / -1; color: var(--dim); }
@media (max-width: 600px) { .bt .hide-s { display: none; } }
.cs-pick { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 28px; letter-spacing: 0.08em; }
.cs-pick input, .cs-pick select { font: 400 24px var(--display); letter-spacing: 0.06em; color: var(--text); background: rgba(27, 32, 39, 0.85); border: 1px solid var(--line); border-bottom: 3px solid var(--accent); border-radius: 3px; padding: 4px 8px; }
.cs-pick input { width: 3.2em; text-align: center; }
.cs-pick input:focus-visible, .cs-pick select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lead-note { margin: 6px 0 8px; padding: 8px 10px; font-size: 13px; line-height: 1.45; border-left: 3px solid var(--mixed); background: rgba(224, 183, 111, 0.1); color: var(--text); }
.lead-note.review { border-left-color: var(--fail); background: rgba(224, 128, 111, 0.12); }
.lead-note.good { border-left-color: var(--pass); background: rgba(140, 191, 140, 0.1); }

/* intro deck: centered like the other screens, and the controls wrap instead of running off a phone */
.slide { align-items: center; text-align: center; }
.s-sub { margin-left: auto; margin-right: auto; }
.s-src { margin-left: auto; margin-right: auto; }
@media (max-width: 600px) {
  .deck-bar { flex-wrap: wrap; justify-content: space-between; gap: 10px 14px; padding-left: 16px; padding-right: 16px; }
  .deck-bar .deck-nav { margin-left: auto; }
  .deck-bar .dots { order: -1; width: 100%; justify-content: center; }
  .deck-bar .deck-left { order: 1; }
  .deck-bar .deck-nav { order: 2; }
}

/* iOS Home Screen app: innerHeight can come up short of the real screen, leaving a strip. Use the large viewport height. */
@media (display-mode: standalone) {
  html, body, #gl, .screen { height: 100lvh; bottom: auto; }
}

/* memorial card */
.land-dedic button { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(185, 179, 162, 0.45); pointer-events: auto; padding: 4px 6px; }
.land-dedic button:hover, .land-dedic button:focus-visible { color: var(--accent); text-decoration-color: var(--accent); }
.screen.mem { justify-content: center; z-index: 60; }
.mem-card { width: min(92vw, 520px); margin: 0 auto; padding: 28px 26px 22px; text-align: center; background: #0d1015; border: 1px solid rgba(233, 168, 53, 0.35); border-radius: 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; max-height: 94dvh; overflow-y: auto; }
.mem-card h2 { margin: 0; font-size: clamp(34px, 7vw, 52px); color: var(--text); }
.mem-line { margin: 0; color: #b9b3a2; font-size: 15px; }
.mem-eow { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: #8f8b7f; line-height: 1.7; }
.mem-eow b { white-space: nowrap; font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: 0.1em; color: var(--accent); }
.mem-note { margin: 0; max-width: 40ch; color: #d7d2c4; font-size: 15px; line-height: 1.5; }
.mem-card .row { justify-content: center; margin-top: 12px; }
.mem-card a.menu-item { text-decoration: none; }
.mem-fine { margin: 4px 0 0; font-size: 12px; color: #8f8b7f; }
@media (max-height: 460px) { .mem-card { padding: 14px 20px; gap: 4px; } .mem-card h2 { font-size: 28px; } .mem-eow b { font-size: 20px; } .mem-note { font-size: 13px; line-height: 1.35; } .mem-card .row { margin-top: 6px; } }
.mem-card .menu-item, .mem-card .menu-item.primary { font-size: 22px; margin: 0; }
.mem-card .menu-item.sub { font-size: 16px; }
.mem-card .menu-item::before, .mem-card .menu-item::after { display: none; }

/* no one-word last lines */
h1, h2, h3, .tag, .board-sub, .lead-note, .mem-line { text-wrap: balance; }
.screen p, .screen li, .screen div, .mem-note { text-wrap: pretty; }

.mem-card { border-top: 3px solid var(--accent); padding-top: 26px; gap: 8px; }
.mem-emblem { margin: 0 0 4px; }
.mem-card .kicker { margin: 0; }
.mem-card h2 { margin-bottom: 4px; }
.mem-rule { width: 44px; border: 0; border-top: 1px solid rgba(233, 168, 53, 0.5); margin: 6px 0 8px; }
@media (max-height: 460px) { .mem-emblem { display: none; } .mem-card { padding-top: 14px; } }

.land-foot .land-why { order: 0; all: unset; cursor: pointer; font-family: var(--body); font-size: 12px; color: #8f8b7f; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(143, 139, 127, 0.4); padding: 8px 6px; pointer-events: auto; }
.land-foot .land-why:hover, .land-foot .land-why:focus-visible { color: var(--accent); }
@media (max-width: 900px) and (max-height: 460px) { .land-foot .land-why { font-size: 13px; } }
@media (max-width: 600px) {
  .screen.landing .land-foot { flex-direction: column; align-items: center; text-align: center; gap: 0; }
  .land-foot .land-dedic { order: -2; }
  .menu-list .menu-item.sub { padding: 5px 8px; font-size: 17px; letter-spacing: 0.1em; }
}

.mem-card { position: relative; }
.mem-x { all: unset; box-sizing: border-box; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; color: #6f6c62; transition: color 0.15s; }
.mem-x:hover, .mem-x:focus-visible { color: var(--accent); }

/* dim past the screen edges so no strip shows on iPad */
.screen.overlay { box-shadow: 0 0 0 100vmax rgba(20, 24, 29, 0.82); clip-path: none; }
/* quieter footer: the disclaimer and the intro link sit back behind the dedication */
.screen.landing .land-fine, .land-foot .land-why { color: #6a675e; font-size: 11px; }
.land-foot .land-why { text-decoration-color: rgba(106, 103, 94, 0.45); }
.land-foot .land-why:hover, .land-foot .land-why:focus-visible { color: var(--accent); }

/* a black dip between the debrief, the halfway video and the next briefing */
#xfade { position: fixed; inset: -4px; background: #000; opacity: 0; pointer-events: none; z-index: 80; }

#csSave[hidden] { display: none; }
#certX[hidden] { display: none; }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.share-row[hidden], .share-note[hidden] { display: none; }
.share-row button { font: 500 14px var(--body, "DM Sans", system-ui, sans-serif); color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); padding: 9px 14px; cursor: pointer; }
.share-row button:hover { border-color: var(--accent); color: var(--accent); }
.share-note { font-size: 13px; color: #9aa3ad; text-align: center; margin: 8px 0 0; }

#wpnHint { position: absolute; right: calc(var(--safe-r) + 18px); bottom: calc(var(--safe-b) + 18px); display: flex; gap: 8px; }
#wpnHint button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; background: rgba(12, 14, 20, 0.72); border: 1px solid rgba(233, 229, 219, 0.28); border-left: 4px solid var(--accent); color: var(--text); font: 600 14px var(--body, inherit); cursor: pointer; }
#wpnScope[hidden] { display: none; }
#wpnHint kbd { font: 700 13px var(--body, inherit); border: 1px solid rgba(233, 229, 219, 0.45); padding: 1px 7px; }
#wpnHint[hidden], body.touch #wpnHint { display: none; }

/* the rifle's optic: a round view with a dark ring and a fine crosshair */
#scope { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0, transparent min(37vh, 37vw), #000 calc(min(37vh, 37vw) + 2px)); }
#scope i { position: absolute; left: 50%; top: 50%; width: min(74vh, 74vw); height: min(74vh, 74vw); transform: translate(-50%, -50%); border-radius: 50%; box-shadow: inset 0 0 40px 6px rgba(0, 0, 0, 0.6); background: linear-gradient(#e33 0 0) center / 1px 100% no-repeat, linear-gradient(#e33 0 0) center / 100% 1px no-repeat; background-blend-mode: normal; opacity: 0.9; }

#lockHint { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 12px 22px; background: rgba(12, 14, 20, 0.8); border: 1px solid rgba(233, 229, 219, 0.28); border-left: 4px solid var(--accent); color: var(--text); font: 600 16px var(--body, inherit); pointer-events: none; }
#lockHint[hidden] { display: none; }

/* the call: see-through, so the scene stays in view, with a draining bar while it is read */
#caption .cl.ally { background: rgba(8, 10, 16, 0.46); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
#caption .cl.reading { position: relative; overflow: hidden; }
#caption .cl .rt { margin-left: auto; font-style: normal; color: #f3efe4; font-size: 13px; letter-spacing: 0.06em; }
#caption .cl.reading b { display: flex; align-items: baseline; }
#caption .cl .rb { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #8fc79a; transform-origin: left center; transform: scaleX(1); opacity: 0.85; }

/* ---------- report, service record, board: one shell, locked to the viewport ---------- */
.screen.pp { height: 100dvh; bottom: auto; overflow: hidden; display: flex; align-items: stretch; }
@media (hover: none) { .screen.pp { padding-bottom: calc(var(--safe-b) + 84px); } }
.pp-wrap { width: 100%; max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.pp-head { flex: none; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pp-head .kicker { color: var(--accent); letter-spacing: 0.3em; font-size: 13px; margin: 0 0 6px; }
.pp-head h2 { font-size: clamp(34px, min(8vw, 8vh), 80px); line-height: 0.9; letter-spacing: 0.015em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); margin: 0; }
.pp-head .sum, .pp-head .sub, .pp-head .rec-pts { font-size: clamp(15px, 2.1vh, 18px); margin: 4px auto 0; max-width: 62ch; color: #d6d2c8; }
.pp-head .rec-bar { width: min(100%, 420px); margin: 6px 0 0; }
.pp-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; margin: 0; padding: 0; gap: 0 10px; }
.pp-actions .menu-item.primary { margin: 0; font-size: clamp(22px, 3.4vh, 32px); }
.pp-actions .menu-item { font-size: clamp(17px, 2.6vh, 22px); }
.pp-actions .menu-item.sub { font-size: clamp(14px, 2.2vh, 18px); }
.pp-pager { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; background: rgba(14, 17, 22, 0.62); border: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pp-pager::-webkit-scrollbar { display: none; }
.pp-page { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; min-height: 0; overflow-y: auto; padding: 12px clamp(14px, 3vw, 24px); box-sizing: border-box; text-align: left; }
.pp-page > h3:first-child { margin-top: 0; }
.pp-page .stills { margin: 0 0 4px; }
.pp-tabs { flex: none; display: flex; justify-content: center; gap: 4px; }
.pp-tabs button { flex: 1 1 0; max-width: 200px; min-height: 40px; padding: 6px 4px; background: transparent; border: 0; border-bottom: 3px solid var(--line); color: var(--dim); font: 400 clamp(15px, 2.6vw, 19px) var(--display); letter-spacing: 0.06em; }
.pp-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.pp-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#board .board-join { margin-bottom: 8px; }
#board .bt { margin-bottom: 4px; }
@media (max-width: 700px) {
  .pp-actions .menu-item { font-size: 16px; padding: 4px 12px; gap: 8px; min-height: 38px; }
  .pp-actions .menu-item.primary { font-size: 22px; flex: 0 0 100%; justify-content: center; }
  .pp-actions .menu-item.sub { font-size: 14px; }
  .pp-actions .menu-item:not(.primary)::before, .pp-actions .menu-item:not(.primary)::after { display: none; }
  .pp-tabs button { font-size: 14px; letter-spacing: 0.02em; }
  .pp-head .sum, .pp-head .sub, .pp-head .rec-pts { font-size: 15px; }
  .pp-page h3 { font-size: 19px; margin: 10px 0 4px; }
  .pp-page p, .pp-page .lesson p { font-size: 16px; line-height: 1.5; }
  #debrief .still img { max-height: 9vh; }
  #debrief .stills { grid-template-columns: repeat(3, 1fr); }
  #debrief .still figcaption { font-size: 12px; padding: 4px 6px; }
  #debrief .facts div { font-size: 14px; padding: 5px 0; }
  #debrief .tlist { gap: 2px; font-size: 14px; }
}
@media (max-width: 700px) {
  #record .medals { grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
  #record .medal { padding: 8px; gap: 8px; align-items: flex-start; }
  #record .medal b { font-size: 14px; }
  #record .medal span { font-size: 12px; line-height: 1.3; }
  #board .bt td:nth-child(2) { white-space: nowrap; font-size: 17px; }
}

/* ---------- Apple Watch: the same game, gestures only ----------
   --wm is the margin: nothing important sits closer to an edge than this (the corners are round). */
.watch { --wm: 16px; }
.watch #touch, .watch #pauseBtn, .watch #cmdList, .watch #wpnHint, .watch #lockHint, .watch #stance, .watch #gestureHint { display: none !important; }
.watch #caption { left: var(--wm); right: var(--wm); bottom: calc(var(--wm) + 4px); width: auto; max-width: none; transform: none; text-align: center; }
.watch #caption .cl { font-size: 13px; line-height: 1.2; padding: 6px 10px; }
.watch #caption .cl b { display: none; }
.watch .screen.landing, .watch .screen.pp { padding: var(--wm) !important; }
.watch .land-top, .watch .land-foot, .watch #recBtn, .watch #boardBtn, .watch #gradBtn, .watch .landing .tag { display: none !important; }
.watch .landing .land-main { justify-content: center; margin: auto 0; }
.watch .landing .emblem.shield { width: 28px; height: 32px; margin: 0 0 10px; }
.watch .landing .logo { flex-direction: column; gap: 0; }
.watch .logo .l-a, .watch .logo .l-b { font-size: min(34px, 16vw); }
.watch .logo .l-or { margin: 6px 0; font-size: 12px; gap: 8px; }
.watch .logo .l-or::before, .watch .logo .l-or::after { display: block; width: 14px; }
.watch .landing .menu-list { margin-top: 14px; }
.watch .landing .menu-item.primary { font-size: 28px; padding: 8px 18px; }
.watch #debrief .pp-pager, .watch #debrief .pp-tabs, .watch #debrief .kicker, .watch #debrief .sum, .watch #dvMenu, .watch #dvCert { display: none !important; }
.watch #debrief .pp-wrap { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.watch #debrief .pp-head { padding: 0; border: 0; background: none; flex: none; }
.watch #debrief h2 { font-size: min(34px, 16vw); line-height: 1; margin: 0; text-align: center; }
.watch #debrief .pp-actions { flex-direction: column; flex-wrap: nowrap; gap: 6px; align-items: stretch; }
.watch #debrief .pp-actions .menu-item, .watch #debrief .pp-actions .menu-item.primary { flex: none; justify-content: center; min-height: 40px; font-size: 20px; padding: 6px 10px; width: 100%; }
.watch #debrief .pp-actions .menu-item::before, .watch #debrief .pp-actions .menu-item::after { display: none; }
.watch-note { display: none; }
.watch .watch-note { display: block; margin: 12px 0 0; font-size: 11px; line-height: 1.3; color: var(--dim); max-width: 150px; }
