@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
:root {
  --navy: #0c2a3e; --deep: #06192a; --yellow: #ffc20e; --orange: #ff6a13; --port: #d7263d; --stbd: #21a179;
  --white: #f4f7f9; --mist: #b8cad6; --panel: rgba(8, 30, 47, 0.84);
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif; --body: "Barlow", "Segoe UI", Arial, sans-serif;
  font-size: clamp(11px, 0.95vw, 24px); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep); color: var(--white); font-family: var(--body); cursor: default; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
.panel { background: var(--panel); border-left: 0.3rem solid var(--yellow); border-radius: 0.25rem 0.6rem 0.6rem 0.25rem; backdrop-filter: blur(6px); }
#hud { position: fixed; inset: 0; pointer-events: none; }
body[data-phase="lobby"] #hud > :not(#banner):not(#popups) { display: none; }

.score-panel { position: absolute; left: 1.2rem; top: 1.2rem; padding: 0.5rem 1.2rem 0.7rem; }
#team-label { font: 700 1.1rem var(--display); color: var(--mist); }
#score { font: 800 3.6rem/1 var(--display); color: var(--yellow); font-variant-numeric: tabular-nums; }
#stars { display: flex; gap: 0.6rem; font-size: 1.15rem; color: #4b6b80; margin-top: 0.2rem; }
#stars .got { color: var(--yellow); } #stars em { font-style: normal; color: #4b6b80; }

#mission { position: absolute; top: 1.2rem; left: 50%; transform: translateX(-50%); width: min(46rem, 52vw); padding: 0.6rem 1.3rem 0.8rem; border-left: 0; border-top: 0.45rem solid transparent; border-image: repeating-linear-gradient(-45deg, var(--yellow) 0 0.9rem, #111 0.9rem 1.8rem) 8; border-radius: 0.6rem; text-align: center; }
.m-head { display: flex; justify-content: space-between; font: 700 1.15rem var(--display); color: var(--mist); }
#m-timer { font: 800 2.2rem/1 var(--display); color: var(--white); font-variant-numeric: tabular-nums; }
#m-timer.low { color: var(--orange); animation: blink 0.8s steps(2) infinite; }
#m-title { font: 800 2.6rem/1 var(--display); color: var(--yellow); text-transform: uppercase; margin-top: -0.4rem; }
#m-obj { font: 600 1.3rem/1.35 var(--body); margin: 0.35rem 0; }
#m-progress { display: flex; gap: 0.5rem; justify-content: center; align-items: center; font: 700 1.3rem var(--display); color: var(--mist); min-height: 2.2rem; }
.big-n { font: 800 2rem var(--display); color: var(--yellow); }
.valve { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font: 800 1.1rem var(--display); color: var(--white); background: conic-gradient(var(--yellow) var(--p), #24435a 0); }
.valve.done { background: var(--stbd); }
.drum { width: 1.5rem; height: 2rem; border-radius: 0.35rem; background: #2a5d8a; border: 2px solid #8fb6d6; }
.drum.done { background: var(--yellow); border-color: #fff3b0; } .drum.lost { background: transparent; border-style: dashed; border-color: var(--port); }
.hold { width: 10rem; height: 0.9rem; border-radius: 0.5rem; background: #24435a; overflow: hidden; display: inline-block; } .hold i { display: block; height: 100%; background: var(--stbd); }

#join-mini { position: absolute; right: 1.2rem; top: 1.2rem; display: flex; gap: 0.7rem; align-items: center; padding: 0.5rem 0.8rem; }
#join-mini p { margin: 0; display: flex; flex-direction: column; font: 700 1.1rem var(--display); }
#join-mini span { font: 600 0.9rem var(--body); color: var(--mist); }
.qr svg { display: block; width: 100%; height: 100%; background: #fff; border-radius: 0.35rem; }
.qr-small { width: 6rem; height: 6rem; }
.qr-big { width: 15rem; height: 15rem; margin: 0 auto; }

#stability { position: absolute; left: 1.2rem; bottom: 1.2rem; width: 22rem; padding: 0.6rem 0.8rem 0.8rem; transition: transform 0.4s, box-shadow 0.4s; transform-origin: left bottom; }
#stability.focus { transform: scale(1.22); box-shadow: 0 0 0 0.25rem var(--yellow); }
.st-head { display: flex; justify-content: space-between; align-items: baseline; font: 700 1.1rem var(--display); margin-bottom: 0.3rem; }
.st-head span { color: var(--mist); font-size: 0.95rem; }
#stab-svg { width: 100%; display: block; border-radius: 0.3rem; }
.svg-tiny { font: 700 9px var(--display); letter-spacing: 0.06em; }
.heel-row { display: flex; align-items: baseline; gap: 0.6rem; margin: 0.4rem 0.1rem 0.2rem; font-family: var(--display); }
#heel-val { font: 800 2rem/1 var(--display); font-variant-numeric: tabular-nums; } #heel-dir { font-size: 1.2rem; color: var(--mist); }
#pump-state { margin-left: auto; font: 700 1.05rem var(--display); } #pump-state.port { color: #ff8a98; } #pump-state.stbd { color: #5fe0a8; }
.formula { background: #0a2236; border-radius: 0.4rem; padding: 0.4rem 0.6rem; margin: 0.3rem 0; }
.eq { font: 700 1.05rem var(--display); display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.frac { display: inline-flex; flex-direction: column; text-align: center; line-height: 1.05; font-size: 0.95rem; }
.frac span:first-child { border-bottom: 1px solid var(--mist); padding: 0 0.2rem; }
.eq b { color: var(--yellow); font-size: 1.2rem; }
.parts { font: 600 0.85rem var(--body); color: var(--mist); margin-top: 0.15rem; }
.gw-row { display: flex; gap: 0.7rem; align-items: center; margin-top: 0.3rem; }
.lamp { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #444; flex: none; }
.lamp.green { background: #29e070; box-shadow: 0 0 1rem #29e070; } .lamp.amber { background: #ffb000; box-shadow: 0 0 1rem #ffb000; animation: blink 0.7s steps(2) infinite; } .lamp.red { background: #ff2a2a; box-shadow: 0 0 0.7rem #ff2a2a; }
@keyframes blink { 50% { opacity: 0.35; } }
.gw-text { display: flex; flex-direction: column; font-family: var(--display); line-height: 1.15; } .gw-text b { font-size: 1.3rem; } .gw-text span { font-size: 1rem; color: var(--mist); }
.meter { margin-top: 0.4rem; font: 600 0.95rem var(--display); color: var(--mist); }
.meter .bar { position: relative; height: 0.65rem; background: #0a2236; border-radius: 0.4rem; overflow: hidden; margin-top: 0.2rem; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 0.4rem; transition: width 0.15s linear; }
.meter .bar em { position: absolute; top: 0; bottom: 0; left: 83.3%; width: 2px; background: var(--white); }

#roster { position: absolute; left: 25rem; right: 1.2rem; bottom: 1.2rem; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
#roster li { display: flex; align-items: center; gap: 0.5rem; background: var(--panel); border-radius: 2rem; padding: 0.3rem 0.9rem 0.3rem 0.4rem; border: 0.18rem solid var(--c); font-family: var(--display); }
#roster i { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--c); } #roster b { font-size: 1.25rem; } #roster span { font-size: 1rem; color: var(--mist); }

#banner { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); width: min(44rem, 80vw); text-align: center; background: var(--panel); border-radius: 0.6rem; padding: 0.9rem 1.4rem; border-top: 0.5rem solid var(--orange); animation: drop 0.35s ease-out; }
#banner strong { display: block; font: 800 2.6rem/1.05 var(--display); color: var(--yellow); }
#banner p { margin: 0.4rem 0 0; font-size: 1.3rem; line-height: 1.4; }
@keyframes drop { from { transform: translate(-50%, -1rem); opacity: 0; } }
#popups { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; font: 800 2rem var(--display); text-shadow: 0 0.15rem 0 #000; animation: rise 1.1s ease-out forwards; transform: translate(-50%, -50%); }
@keyframes rise { to { transform: translate(-50%, -160%); opacity: 0; } }

.card-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; background: radial-gradient(ellipse at center, rgba(6,25,42,.55), rgba(6,25,42,.88)); }
#debrief { background: none; }
.lobby-card { width: min(78rem, 94vw); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); background: rgba(8, 30, 47, 0.94); border-radius: 0.8rem; overflow: hidden; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.5); }
.brand { padding: 2.6rem; background: radial-gradient(120% 90% at 0% 100%, #1d4f8c 0%, transparent 70%), #0c2a3e; }
.org { margin: 0; font: 700 1.3rem var(--display); color: var(--yellow); }
h1 { font: 800 9rem/0.85 var(--display); margin: 0.6rem 0 1rem; text-transform: uppercase; }
.hazard { height: 0.9rem; background: repeating-linear-gradient(-45deg, var(--yellow) 0 1rem, #111 1rem 2rem); border-radius: 2px; }
.pitch { font-size: 1.45rem; line-height: 1.5; color: #dbe6ee; max-width: 34ch; margin: 1.4rem 0 0; }
.join { padding: 2rem 2.4rem; text-align: center; display: flex; flex-direction: column; gap: 0.6rem; }
.step { margin: 0; font: 800 1.8rem var(--display); }
.big-url { margin: 0; font: 700 1.4rem var(--display); color: var(--yellow); }
.crew-title { margin: 0.6rem 0 0; font: 700 1.3rem var(--display); color: var(--mist); }
#lobby-crew { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
#lobby-crew li { display: flex; gap: 0.5rem; align-items: center; font: 800 1.5rem var(--display); background: #0a2236; padding: 0.35rem 0.8rem; border-radius: 2rem; border: 0.2rem solid var(--c); animation: pop 0.3s; }
#lobby-crew li i { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c); } #lobby-crew small { font: 700 0.9rem var(--display); color: var(--yellow); }
#lobby-crew li.empty { border-color: #24435a; color: var(--mist); font-weight: 600; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.start-hint { margin: 0.4rem 0 0; font: 700 1.3rem var(--display); color: var(--mist); }
.btn { pointer-events: auto; align-self: center; border: 0; border-radius: 0.5rem; padding: 0.7rem 1.6rem; font: 800 1.5rem var(--display); background: var(--yellow); color: #111; box-shadow: 0 0.3rem 0 #a37b00; cursor: pointer; }
.small { font-size: 1rem; color: var(--mist); margin: 0; line-height: 1.4; }
kbd { font: 700 0.9rem var(--display); background: #24435a; padding: 0.1rem 0.4rem; border-radius: 0.25rem; color: #fff; }
.mcard { width: min(56rem, 90vw); background: rgba(8, 30, 47, 0.95); border-radius: 0.8rem; padding: 2rem 2.4rem; border-top: 0.6rem solid transparent; border-image: repeating-linear-gradient(-45deg, var(--yellow) 0 1rem, #111 1rem 2rem) 10; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.5); }
.mcard h2 { font: 800 5rem/0.95 var(--display); margin: 0.3rem 0 0.6rem; text-transform: uppercase; }
.obj { font: 600 1.7rem/1.35 var(--body); margin: 0 0 1.2rem; }
.lesson { background: #0f3550; border-radius: 0.5rem; padding: 1rem 1.2rem; border-left: 0.35rem solid var(--stbd); }
.lesson b { font: 800 1.6rem var(--display); color: #5fe0a8; } .lesson p { margin: 0.3rem 0 0; font-size: 1.35rem; line-height: 1.5; }
.ibar { height: 0.5rem; background: #24435a; border-radius: 0.3rem; margin-top: 1.2rem; overflow: hidden; } .ibar i { display: block; height: 100%; width: 0; background: var(--yellow); }
.small-card { width: min(34rem, 80vw); text-align: center; position: absolute; top: 24%; }
.dstars { font-size: 5rem; color: var(--yellow); line-height: 1; margin: 0.4rem 0 0.8rem; } .dstars em, .results-card em { font-style: normal; color: #2b4a60; }
.results-card { text-align: center; }
.r-score { margin: 0.2rem 0 0.8rem; } #r-score { font: 800 7rem/1 var(--display); color: var(--yellow); } .r-score small { font: 700 1.6rem var(--display); color: var(--mist); margin-left: 0.6rem; }
#r-stars { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
#r-stars li { background: #0a2236; border-radius: 0.4rem; padding: 0.5rem; display: flex; flex-direction: column; } #r-stars b { font: 700 1.15rem var(--display); color: var(--mist); } #r-stars span { font-size: 1.8rem; color: var(--yellow); }
#r-awards { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: left; }
#r-awards li { background: #0a2236; border-radius: 0.4rem; padding: 0.5rem 0.8rem; border-left: 0.3rem solid var(--c); display: flex; flex-direction: column; }
#r-awards b { font: 700 1rem var(--display); color: var(--mist); } #r-awards span { font: 800 1.5rem var(--display); } #r-awards small { color: var(--mist); font-size: 0.95rem; }
.lessons { text-align: left; background: #0f3550; border-radius: 0.5rem; padding: 0.8rem 1.2rem; margin-bottom: 0.8rem; } .lessons p { margin: 0.3rem 0; font-size: 1.2rem; line-height: 1.45; } .lessons b { color: var(--yellow); }
#loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 1rem; background: var(--deep); text-align: center; font: 700 2rem var(--display); z-index: 10; }
#loading .hazard { width: 16rem; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }

/* Mission rhythm: readable warnings stay visible without covering the playfield. */
#mission-track { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 0 0 .65rem; gap: .35rem; }
#mission-track li { color: var(--mist); font: 600 .85rem var(--display); border-bottom: 3px solid #355267; padding-bottom: .35rem; }
#mission-track span { display: inline-block; margin-right: .25rem; font-weight: 800; }
#mission-track .current { color: var(--yellow); border-color: var(--yellow); }
#mission-track .complete { color: #5fe0a8; border-color: #21a179; }
#weather-strip { display: grid; gap: .2rem; margin-top: .65rem; padding: .5rem .7rem; background: #0a2236; border-left: 4px solid #648399; border-radius: .25rem; }
#weather-title { font: 800 1.2rem var(--display); }
#weather-detail { color: var(--mist); font-size: .95rem; line-height: 1.3; }
#weather-strip[data-kind="warning"] { border-color: var(--yellow); background: #493c18; }
#weather-strip[data-kind="active"] { border-color: var(--orange); background: #492b20; }
#weather-strip[data-kind="warning"] b { color: var(--yellow); }
.next-mission { font: 700 1.4rem var(--display); color: var(--yellow); margin: .8rem 0 0; }

#weather-strip[data-kind="quiet"] #weather-detail { display: none; }
/* Crew Arena v3: the stage is the hero; UI stays at its edges. */
:root { --deep:#0d293a; --navy:#15364a; --panel:rgba(15,43,59,.94); --yellow:#ffdc83; --orange:#ff9a5c; --mist:#bdd4da; --white:#fff6de; --stbd:#47dfb0; --port:#ff718d; font-size:clamp(11px,.92vw,20px); }
.panel { border:1px solid #b4ddd62b; border-radius:1.1rem; box-shadow:0 .5rem 2rem #08243122; backdrop-filter:blur(12px); }
#stage-caption { position:fixed;left:2rem;top:1.6rem;pointer-events:none;font:800 1.65rem var(--display);letter-spacing:.06em;color:var(--white); }
#stage-caption span { display:block;font:600 .7rem var(--body);letter-spacing:.17em;color:var(--mist);margin-top:.25rem; }
body:not([data-phase="lobby"]) #stage-caption { display:none; }
.score-panel { left:1.4rem;top:1.2rem;padding:.65rem 1rem;min-width:10rem; }
#team-label { text-transform:uppercase;letter-spacing:.12em;font-size:.75rem; }
#score { font-size:3.2rem;line-height:1; }
#stars { font-size:.8rem; }
#mission { top:1.2rem;width:min(52rem,57vw);padding:.7rem 1.2rem;border-image:none;border:1px solid #c6e5d94d;border-radius:1rem;text-align:left; }
#mission-track { margin-bottom:.35rem; }
#mission-track li { font-size:.75rem; }
#m-title { font-size:2.1rem;line-height:1; margin:.1rem 0 .3rem; }
#m-obj { font-size:.95rem;line-height:1.3; }
#m-progress { margin-top:.45rem; }
.m-head { font-size:.8rem; }
#m-timer { position:absolute;right:1.1rem;top:2.5rem;font-size:2.4rem; }
#weather-strip { margin-top:.45rem;padding:.35rem .6rem;gap:.12rem; }
#weather-title { font-size:1.05rem; }
#weather-detail { font-size:.83rem; }
#weather-strip[data-kind="quiet"] { display:none; }
#join-mini { top:1.2rem;right:1.3rem;gap:.4rem;padding:.5rem; }
.qr-small { width:4.5rem;height:4.5rem; }
#join-mini p { max-width:11rem;overflow-wrap:anywhere;font-size:1rem; }
#join-mini span { font-size:.75rem; }
#stability { left:auto;right:1.3rem;bottom:6.2rem;width:17rem;padding:.55rem .8rem;transform:none; }
#stability #stab-svg, #stability .formula, #stability .meter { display:none; }
#stability .st-head { font-size:.95rem; }
#stability .st-head span { display:none; }
#stability .heel-row { margin:.3rem 0; }
#heel-val { font-size:1.7rem; }
#heel-dir { font-size:.95rem; }
#pump-state { font-size:.8rem; }
#stability .gw-text b { font-size:1.2rem; }
#stability .gw-text span { font-size:.85rem; }
#stability .lamp { width:1rem;height:1rem; }
#stability.focus { transform:none;border-color:var(--yellow);box-shadow:0 0 0 2px #ffdc8333; }
#stability.focus #stab-svg { display:block;max-height:9rem; }
#stability.focus .formula { display:block; }
#stability.focus .eq { font-size:.85rem; }
#stability.focus .frac { font-size:.85rem; }
#roster { bottom:1.2rem;left:1.4rem;right:1.4rem;justify-content:center;gap:.45rem; }
#roster li { background:var(--panel);border:1px solid #b2dbd644;border-bottom:3px solid var(--c);border-radius:.7rem;padding:.4rem .7rem; }
#roster i { width:.7rem;height:.7rem; }
#roster b { font-size:1.2rem; }
#roster span { font-size:.85rem; }
#banner { top:auto;bottom:7rem;width:min(40rem,65vw);padding:.65rem 1rem;border-top:0;border-left:4px solid var(--orange);border-radius:.8rem;text-align:left; }
#banner strong { font-size:1.7rem; }
#banner p { font-size:.95rem;line-height:1.3; }
.card-wrap { background:rgba(9,32,46,.38);padding:2rem;backdrop-filter:blur(3px); }
#lobby { padding:7rem 3rem 3rem;background:linear-gradient(90deg,#0c293beb, #0c293b77 58%, #0c293b99);backdrop-filter:blur(0); }
.lobby-card { width:min(92rem,95vw);grid-template-columns:1fr 26rem;gap:8rem; background:none;box-shadow:none;overflow:visible;border-radius:0; }
.brand { padding:0;background:none;align-self:center; }
.org { color:var(--mist);font:600 .9rem var(--body);letter-spacing:.15em;text-transform:uppercase; }
.edition { display:inline-block;margin:0 0 1.2rem;padding:.45rem .7rem;border:1px solid #ffdc8380;border-radius:2rem;color:var(--yellow);font:700 .85rem var(--body);letter-spacing:.1em; }
h1 { font-size:clamp(6rem,10vw,12rem);line-height:.83;margin:1rem 0 1.8rem;letter-spacing:-.015em; }
h1 span { color:var(--yellow); }
.brand .org { margin-bottom:1rem; }
.brand .hazard { width:6rem;height:.4rem;background:var(--orange); }
.pitch { font-size:1.7rem;line-height:1.4; }
.join { background:#123446ee;border:1px solid #c0e1d33b;border-radius:1.4rem;padding:1.7rem;gap:.8rem;align-self:center;box-shadow:0 1rem 4rem #071e3433; }
.mission-chips { display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem;margin-bottom:.5rem;text-align:left; }
.mission-chips span { font:700 .8rem var(--body);color:var(--mist);padding:.4rem;border-bottom:1px solid #bfded12b; }
.step { font-size:1.55rem; }
.btn { border-radius:.7rem;font-size:1.5rem;box-shadow:none;width:100%;padding:.8rem 1rem;background:var(--yellow); }
.btn.secondary { background:#20495b;color:var(--white);border:1px solid #9ad4d733;font-size:1.25rem; }
.qr-big { width:10rem;height:10rem; }
.big-url { font-size:1rem;overflow-wrap:anywhere; }
#kb-hint { font-size:.85rem; }
.start-hint { font-size:1.1rem; }
.mcard { border-image:none;border:1px solid #b7d9d34d;border-top:5px solid var(--orange);border-radius:1.4rem;background:#123446f5; }
.mcard h2 { font-size:4rem; }
.obj { font-size:1.4rem; }
.lesson { background:#21495b;border-left-color:var(--yellow); }
.lesson b { color:var(--yellow);font-size:1.4rem; }
.lesson p { font-size:1.1rem; }
.small-card { top:auto; }
#debrief { backdrop-filter:none; }
.results-card .r-score #r-score { font-size:5rem; }
@media (max-width:900px) { .lobby-card { gap:3rem;grid-template-columns:1fr 24rem; } #roster span { display:none; } #stability { width:15rem; } }
@media (max-height:620px) { #lobby { padding-top:5rem; } .join { padding:1rem;gap:.5rem; } h1 { font-size:8rem; } .pitch { font-size:1.3rem; } .qr-big { width:7rem;height:7rem; } .mcard { padding:1.2rem 1.7rem; } .mcard h2 { font-size:3rem; } .lesson p { font-size:1rem; } }

.btn.watch-demo { background:transparent;color:var(--mist);border:1px solid #a4d7d633;font-size:1.1rem; }

#player-tags, #tag-leaders { position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none; }
#tag-leaders line { stroke-width:1.4;opacity:.65; }
.crew-tag { position:absolute;left:0;top:0;width:108px;height:25px;display:flex;align-items:center;background:#102b3cf2;border:1px solid var(--c);border-radius:7px;font:700 15px var(--display);box-shadow:0 2px 4px #071c3830; }
.crew-tag b { display:grid;place-items:center;align-self:stretch;width:25px;flex:none;border-radius:6px 0 0 6px;background:var(--c);color:#102b3c;font-size:17px; }
.crew-tag span { padding:0 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
/* Crane mission: permanent teaching panel and a stationary isometric playfield. */
:root { --sidebar:300px; }
#stability { position:fixed;left:0;top:0;bottom:0;right:auto;width:var(--sidebar);padding:22px 18px;background:linear-gradient(180deg,#102f43,#0a2537);border:0;border-right:1px solid #9bcdd133;border-radius:0;overflow:auto;scrollbar-width:thin;pointer-events:auto;box-shadow:10px 0 30px #071c3020; }
#stability .section-kicker { font:700 11px var(--body);letter-spacing:.18em;color:#88bbc9;margin:0 0 7px; }
#stability h2 { font:800 30px/1 var(--display);margin:0 0 14px; }
.section-heel { display:flex;align-items:baseline;gap:12px;margin:0 0 8px; }.section-heel b { font:800 43px/1 var(--display);color:var(--yellow); }.section-heel span { font:600 13px var(--body);color:var(--mist); }
#stability-status { display:inline-block;padding:5px 8px;border-radius:5px;background:#275345;color:#9ae4b9;font:700 10px var(--body);letter-spacing:.05em; }
#stability-status[data-level="warning"] { background:#5b4a27;color:#ffda8e; }#stability-status[data-level="danger"] { background:#663546;color:#ffbecb; }
#hydro-svg { display:block;width:100%;margin:12px 0 3px;max-height:275px; }#hydro-svg text { font:800 13px var(--display); }.section-label { font-size:9px!important;letter-spacing:1px;fill:#9ec3ce; }
.force-legend { display:flex;justify-content:space-between;font:600 11px var(--body);gap:5px; }.force-legend i { width:7px;height:7px;display:inline-block;border-radius:50%;margin-right:4px; }.g-key { background:#ffcf79; }.b-key { background:#65dcea; }
#stability-why { min-height:60px;margin:12px 0;font:400 12px/1.45 var(--body);color:#c8dde3; }
.stability-values { display:grid;grid-template-columns:1fr 1fr;gap:12px 8px;margin:0;padding:13px 0;border-top:1px solid #a1cacf26;border-bottom:1px solid #a1cacf26; }.stability-values div { display:grid;gap:3px; }.stability-values dt { color:#88b5c3;font:400 10px var(--body); }.stability-values dd { margin:0;font:700 19px var(--display); }
.curve-head { display:flex;justify-content:space-between;margin-top:12px;font:700 12px var(--display); }.curve-head span { color:#88b5c3;font:400 10px var(--body); }#righting-svg { width:100%;max-height:126px; }#righting-svg text { font:400 9px var(--body);fill:#88b5c3; }
#live-pump { font:700 12px var(--display);color:#98c8c9;margin:2px 0 8px; }.model-note { color:#6f9faf;font:400 9px/1.45 var(--body);margin:0; }
body[data-phase="lobby"] #stability { display:block!important; }body[data-phase="lobby"] #stability { opacity:.70; }
#mission { left:calc(var(--sidebar) + (100% - var(--sidebar))*.45);width:calc(100% - var(--sidebar) - 240px);max-width:650px;top:14px;padding:12px 15px; }
#mission-track { display:none; }#m-title { font-size:27px; }#m-obj { font-size:12px;max-width:calc(100% - 45px); }#m-num { font-size:10px; }#m-timer { top:16px;font-size:30px; }
.score-panel { left:auto;right:18px;top:14px;min-width:120px;padding:10px 15px; }#score { font-size:36px; }#stars { font-size:11px; }
#join-mini { top:110px;right:18px; }#join-mini p { max-width:90px; }
.cargo-dots { display:inline-flex;gap:6px; }.cargo-dots i { display:grid;place-items:center;width:22px;height:22px;border:1px solid #b5d5d440;border-radius:5px;font:700 12px var(--display);font-style:normal;color:#9bbac4; }.cargo-dots .landed { background:#65562f;color:#ffde8b; }.cargo-dots .lashed { background:#275749;color:#a0efc8; }
.crane-hint { display:block;font-size:11px;color:#a8c6cf;margin-top:6px; }
#roster { left:calc(var(--sidebar) + 16px);right:16px;bottom:15px; }#roster li { padding:4px 8px; }#roster b { font-size:15px; }#roster span { font-size:11px; }
#banner { left:calc(var(--sidebar) + (100% - var(--sidebar))*.5);bottom:85px;width:calc(100% - var(--sidebar) - 90px);max-width:520px; }
#lobby { left:var(--sidebar);padding:75px 35px 35px;background:linear-gradient(90deg,#0b283bc9,#0b283b88); }.lobby-card { width:100%;grid-template-columns:1fr minmax(260px,330px);gap:35px; }h1 { font-size:clamp(65px,8vw,120px); }.pitch { font-size:20px; }.join { padding:18px;gap:8px; }.join .btn { font-size:17px;padding:10px; }.join .watch-demo { font-size:14px; }.mission-chips span { font-size:9px; }#kb-hint { font-size:10px; }
#intro,#debrief,#results { left:var(--sidebar); }.mcard { max-width:90%; }.mcard h2 { font-size:42px; }.lesson p { font-size:14px; }.obj { font-size:17px; }.results-card #r-stars { grid-template-columns:1fr; }
#stage-caption { left:calc(var(--sidebar) + 25px);font-size:18px; }
@media(max-height:760px){#stability { padding:14px; }#hydro-svg { max-height:200px;margin:4px 0; }#stability h2 { font-size:25px; }.section-heel b { font-size:34px; }#stability-why { font-size:11px;min-height:45px;margin:8px 0; }.stability-values { gap:7px;padding:8px 0; }.stability-values dd { font-size:17px; }#righting-svg { max-height:90px; }.curve-head { margin-top:8px; }}

/* v5: roll stopwatch */
.roll-clock { margin: .7rem 0 .4rem; padding: .6rem .7rem; border-radius: .7rem; background: #0a2a3c; border: 1px solid #65dcea33; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); }
.rc-head b { font-size: 1.05rem; } #roll-verdict { font-weight: 700; font-size: .95rem; color: #ffcf79; }
#roll-verdict[data-k="stiff"] { color: #65dcea; } #roll-verdict[data-k="tender"] { color: #ffb36b; } #roll-verdict[data-k="danger"] { color: #ff718d; }
.rc-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .35rem; }
.rc-row span { display: block; font-size: .72rem; color: #9fc3cf; } .rc-row strong { font: 800 1.35rem var(--display); font-variant-numeric: tabular-nums; }
#roll-why { margin: .35rem 0 0; font-size: .78rem; line-height: 1.35; color: #c9dde4; }

.physics-log { list-style: none; margin: .7rem 0 0; padding: 0; text-align: left; display: grid; gap: .35rem; }
.physics-log li { background: #0a2a3c; border-left: .25rem solid #65dcea; border-radius: .4rem; padding: .45rem .7rem; font-size: .95rem; line-height: 1.4; }

/* v5.3 fun batch */
#quiz { position: absolute; right: 1.2rem; top: 8.5rem; width: 22rem; padding: .9rem 1rem; border-radius: 1rem; background: rgba(9,32,46,.92); border: 2px solid #ffde59; pointer-events: none; animation: drop .35s ease-out; }
.qz-head { display: flex; align-items: baseline; gap: .6rem; font-family: var(--display); } .qz-head b { font-size: 1.6rem; color: #ffde59; letter-spacing: .03em; }
.qz-head span { color: #9fc3cf; } .qz-head em { margin-left: auto; font-style: normal; font: 800 1.6rem var(--display); color: #fff; }
#quiz-ref { margin: .4rem 0 .6rem; font-size: 1rem; line-height: 1.45; color: #e4f3f7; } #quiz-ref b { color: #ffde59; }
#quiz-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.qz-opt { border-radius: .7rem; background: #0a2a3c; padding: .45rem .3rem; text-align: center; font-family: var(--display); border: 2px solid #ffffff22; }
.qz-opt b { display: block; font-size: 1.6rem; } .qz-opt span { font-size: 1.2rem; font-weight: 800; } .qz-opt small { display: block; color: #9fc3cf; font-size: .85rem; }
.qz-opt.right { border-color: #44e9b1; background: #0f4b3c; } .qz-opt.wrong { opacity: .45; }
#quiz-foot { margin: .6rem 0 0; font: 700 1.05rem var(--display); color: #ffde59; min-height: 1.2em; }
#splashcam { position: absolute; pointer-events: none; border: 3px solid #ff6a13; border-radius: .6rem; box-shadow: 0 .4rem 1.6rem #0008; }
#splashcam span { position: absolute; left: .5rem; top: .4rem; font: 800 1rem var(--display); color: #fff; background: #ff6a13; padding: .1rem .5rem; border-radius: .3rem; letter-spacing: .06em; }
#splashcam span::before { content: "● "; color: #ffdddd; animation: blink 1s steps(2) infinite; }
#splashcam b { position: absolute; left: .5rem; bottom: .4rem; font: 800 1.2rem var(--display); color: #fff; text-shadow: 0 2px 4px #000; }

/* v5.4.1 keyboard guide */
#keyguide { position: absolute; left: 50%; transform: translateX(-50%); bottom: 4.2rem; margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; pointer-events: none; z-index: 5; }
#keyguide li { background: rgba(6,25,42,.86); border: 1px solid #ffffff22; border-left: .3rem solid var(--c, #ffde59); border-radius: .5rem; padding: .3rem .7rem; font: 600 .95rem var(--body); color: #e4f3f7; white-space: nowrap; }
#keyguide li span { font: 800 1rem var(--display); color: #fff; margin-right: .3rem; } #keyguide li b { color: #ffde59; }
#keyguide li i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); margin-right: .35rem; }

/* Incline! section panel */
#incline-panel { position: absolute; right: 1.2rem; top: 7.6rem; width: 23rem; padding: .8rem .9rem; border-radius: 1rem; background: rgba(9,32,46,.92); border: 2px solid #ffde5966; pointer-events: none; }
.ip-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); } .ip-head b { font-size: 1.7rem; color: #ffde59; letter-spacing: .02em; } .ip-head span { color: #9fc3cf; font-weight: 700; }
#ip-target { font: 800 2rem/1.05 var(--display); color: #fff; margin: .1rem 0 .4rem; }
#ip-svg { width: 100%; display: block; } .ip-s { font: 700 11px var(--display); letter-spacing: .05em; }
.ip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .5rem; text-align: center; }
.ip-row span { display: block; font-size: .78rem; color: #9fc3cf; } .ip-row b { font: 800 1.35rem var(--display); font-variant-numeric: tabular-nums; } #ip-t { color: #ffde59; } #ip-m.ok { color: #44e9b1; }
.ip-hold { position: relative; height: 1.5rem; margin-top: .5rem; border-radius: .75rem; background: #0a2236; overflow: hidden; }
#ip-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: #ffb000; transition: width .1s linear; } #ip-bar.ok { background: #29e070; }
#ip-hold-t { position: absolute; inset: 0; display: grid; place-items: center; font: 800 .95rem var(--display); color: #fff; font-style: normal; text-shadow: 0 1px 2px #000; }
#ip-window { margin: .3rem 0 0; font-size: .75rem; color: #9fc3cf; text-align: center; }
#ip-steps { list-style: none; display: flex; gap: .35rem; margin: .5rem 0 0; padding: 0; justify-content: center; }
#ip-steps li { font: 800 .95rem var(--display); padding: .2rem .55rem; border-radius: .5rem; background: #0a2236; color: #9fc3cf; border: 2px solid transparent; }
#ip-steps li.done { background: #0f4b3c; color: #b6ffe0; } #ip-steps li.now { border-color: #ffde59; color: #fff; }

/* One scrollable instrument console, with generous deck viewport. */
.incline-playful #stability { overflow-y:auto; background:linear-gradient(160deg,#163652,#163f50); border-right:3px solid #70e5d0; }
.incline-playful #incline-panel { position:relative; inset:auto; width:auto; margin:0 0 16px; padding:12px; background:#15314d; border:2px solid #ffcf67; border-radius:20px; }
.incline-playful #incline-panel svg { max-height:170px; }
.incline-playful #stability h2 { color:#ffcf67; }
.incline-playful .btn { border-radius:18px; box-shadow:0 4px 0 #102a43; }
.incline-playful .mission-chips span { background:#805bc4; color:white; border-radius:14px; }

#team-name{font:700 20px var(--body);padding:10px;border:3px solid #ffce65;border-radius:14px;max-width:100%;box-sizing:border-box;background:#fff6dc;color:#14384a}#leaderboard,#results-board{text-align:left;font:600 15px var(--body);line-height:1.8}.join{max-height:85vh;overflow:auto}#results{overflow:auto}

/* ===== v8 polish: the decks dominate; one compact instrument; small name tags ===== */
#stability, #mission, #quiz, .score-panel, #team-score, #stab-console { display: none !important; }
#incline-panel { position: absolute !important; left: 1rem !important; top: 1rem !important; right: auto !important; width: 15.5rem !important; padding: .6rem .7rem .7rem !important;
  border-radius: .9rem !important; background: rgba(9,32,46,.86) !important; border: 2px solid #ffde5980 !important; box-shadow: 0 .4rem 1.4rem #0006; z-index: 6; }
#incline-panel .ip-head b { font-size: 1.2rem !important; } #incline-panel #ip-target { font-size: 1.75rem !important; margin: 0 0 .25rem !important; }
#incline-panel #ip-svg { max-height: 7.5rem; } #ip-window, .ip-hold, #incline-panel .ip-row > div:nth-child(2) { display: none !important; }
#incline-panel .ip-row { grid-template-columns: 1fr 1fr !important; margin-top: .3rem !important; } #incline-panel .ip-row b { font-size: 1.5rem !important; }
#incline-panel #ip-steps li { font-size: .85rem !important; padding: .12rem .42rem !important; }
.crew-tag { width: 78px !important; height: 19px !important; font: 700 11.5px var(--display) !important; border-radius: 5px !important; background: #102b3cd9 !important; }
.crew-tag b { width: 18px !important; font-size: 12px !important; } .crew-tag span { padding: 0 5px !important; }
#tag-leaders line { stroke-width: 1.2 !important; opacity: .7; }
#keyguide { bottom: 3.4rem !important; } #keyguide li { font-size: .8rem !important; padding: .2rem .55rem !important; }
#roster li { font-size: .9rem; }
#incline-panel { left: auto !important; right: 1rem !important; }
#incline-panel #ip-steps li { white-space: nowrap; font-size: .78rem !important; }
#join-mini { top: auto !important; bottom: 1rem !important; right: 1rem !important; transform: scale(.85); transform-origin: right bottom; }

/* v9: no ghost sidebar in the lobby; no eyebrows or subtitles on the first page */
html body[data-phase] #stability, html body #stability { display: none !important; }
#lobby .step, #start-hint, #kb-hint, #board-note, #lobby details p, .keyboard-edition #lobby .join-url, #stage-caption span { display: none !important; }

/* v12: live righting-lever section */
#incline-panel { width: 19rem !important; }
#incline-panel #ip-svg { max-height: none !important; }
.ip-lab { font: 800 13px var(--display); } .ip-lab2 { font: 800 12px var(--display); }
.ip-gzrow { display: flex; justify-content: space-between; gap: .3rem; margin-top: .35rem; font: 700 .72rem var(--display); color: #9fc3cf; }
.ip-gzrow b { display: block; font-size: 1.05rem; color: #fff; font-variant-numeric: tabular-nums; } #ip-gzv { color: #ffde59; }

/* v13: Lemon Milk for titles (drop the font files in public/fonts or install it on the big-screen laptop) */
@font-face { font-family: "Lemon Milk"; font-weight: 700; src: local("LEMON MILK Bold"), local("LEMONMILK-Bold"), local("Lemon Milk Bold"), url("fonts/LEMONMILK-Bold.woff2") format("woff2"), url("fonts/LEMONMILK-Bold.otf") format("opentype"); }
@font-face { font-family: "Lemon Milk"; font-weight: 400; src: local("LEMON MILK"), local("LEMONMILK-Regular"), local("Lemon Milk"), url("fonts/LEMONMILK-Regular.woff2") format("woff2"), url("fonts/LEMONMILK-Regular.otf") format("opentype"); }
:root { --title: "Lemon Milk", var(--display); }
h1, #banner strong, #incline-panel .ip-head b, #incline-panel #ip-target, #results h2, .results h2, .lobby-card h2, #stage-caption, .dc-top b { font-family: var(--title) !important; }
#join-mini { top: 1rem !important; left: 1rem !important; right: auto !important; bottom: auto !important; transform-origin: left top !important; }
/* v14: DRFT MRKS monitor – portrait live feed, waterline detection, numeral recognition, draught time history */
#dronecam { position: absolute; right: 1rem; bottom: 1rem; pointer-events: none; z-index: 6; border-radius: .9rem; overflow: hidden;
  background: transparent; border: 2px solid #ffde5980; box-shadow: 0 .4rem 1.4rem #0006; }   /* the video window must stay clear */
#dronecam .dc-head { background: rgba(9,32,46,.94); display: flex; justify-content: space-between; align-items: baseline; padding: .45rem .7rem .35rem; }
#dronecam .dc-head b { font: 800 1.05rem var(--title); color: #ffde59; letter-spacing: .06em; }
#dc-draft { font: 800 1.35rem var(--display); color: #fff; font-variant-numeric: tabular-nums; }
#dc-video { position: relative; background: transparent; outline: 1px solid #0b1b28; }
#dc-ov { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#dc-ov .wl { fill: none; stroke: #23f0ff; stroke-width: 2.4; filter: drop-shadow(0 0 3px #23f0ff); }
#dc-ov .wl-tag { font: 800 11px ui-monospace, Menlo, Consolas, monospace; fill: #23f0ff; paint-order: stroke; stroke: #001018; stroke-width: 3px; }
#dc-ov .ocr { fill: rgba(64,255,128,.08); stroke: #40ff80; stroke-width: 1.4; }
#dc-ov .ocr-tag { font: 700 9.5px ui-monospace, Menlo, Consolas, monospace; fill: #40ff80; paint-order: stroke; stroke: #001018; stroke-width: 3px; }
#dronecam .dc-grain { position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay; animation: grain .5s steps(4) infinite;
  box-shadow: inset 0 0 30px rgba(0,0,0,.35); }
@keyframes grain { 0% { background-position: 0 0; } 25% { background-position: -23px 11px; } 50% { background-position: 17px -29px; } 75% { background-position: -7px 31px; } }
#dc-graph { display: block; width: 100%; height: 74px; }
/* v14: welcome screen – Tymor logo prominent, "Maritime Pathways – Dynamically Inclined" */
.lobby-logo { display: block; width: min(30rem, 42vw); height: auto; margin: 0 0 1.4rem; }
.lobby-kicker { margin: 0; font: 700 clamp(1.4rem, 2.4vw, 2.4rem) var(--title); color: #e8f3f8; letter-spacing: .04em; text-transform: uppercase; }
#lobby h1 { font-family: var(--title) !important; font-size: clamp(3.4rem, 6.4vw, 7rem) !important; line-height: .95 !important; margin: .2rem 0 0 !important; letter-spacing: .01em !important; }
#lobby h1 span { color: #00aedb; }
@keyframes blink { 50% { opacity: 0.35; } }
.gw-text { display: flex; flex-direction: column; font-family: var(--display); line-height: 1.15; } .gw-text b { font-size: 1.3rem; } .gw-text span { font-size: 1rem; color: var(--mist); }
.meter { margin-top: 0.4rem; font: 600 0.95rem var(--display); color: var(--mist); }
.meter .bar { position: relative; height: 0.65rem; background: #0a2236; border-radius: 0.4rem; overflow: hidden; margin-top: 0.2rem; }
.meter .bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 0.4rem; transition: width 0.15s linear; }
.meter .bar em { position: absolute; top: 0; bottom: 0; left: 83.3%; width: 2px; background: var(--white); }

#roster { position: absolute; left: 25rem; right: 1.2rem; bottom: 1.2rem; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
#roster li { display: flex; align-items: center; gap: 0.5rem; background: var(--panel); border-radius: 2rem; padding: 0.3rem 0.9rem 0.3rem 0.4rem; border: 0.18rem solid var(--c); font-family: var(--display); }
#roster i { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--c); } #roster b { font-size: 1.25rem; } #roster span { font-size: 1rem; color: var(--mist); }

#banner { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); width: min(44rem, 80vw); text-align: center; background: var(--panel); border-radius: 0.6rem; padding: 0.9rem 1.4rem; border-top: 0.5rem solid var(--orange); animation: drop 0.35s ease-out; }
#banner strong { display: block; font: 800 2.6rem/1.05 var(--display); color: var(--yellow); }
#banner p { margin: 0.4rem 0 0; font-size: 1.3rem; line-height: 1.4; }
@keyframes drop { from { transform: translate(-50%, -1rem); opacity: 0; } }
#popups { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; font: 800 2rem var(--display); text-shadow: 0 0.15rem 0 #000; animation: rise 1.1s ease-out forwards; transform: translate(-50%, -50%); }
@keyframes rise { to { transform: translate(-50%, -160%); opacity: 0; } }

.card-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 2rem; background: radial-gradient(ellipse at center, rgba(6,25,42,.55), rgba(6,25,42,.88)); }
#debrief { background: none; }
.lobby-card { width: min(78rem, 94vw); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); background: rgba(8, 30, 47, 0.94); border-radius: 0.8rem; overflow: hidden; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.5); }
.brand { padding: 2.6rem; background: radial-gradient(120% 90% at 0% 100%, #1d4f8c 0%, transparent 70%), #0c2a3e; }
.org { margin: 0; font: 700 1.3rem var(--display); color: var(--yellow); }
h1 { font: 800 9rem/0.85 var(--display); margin: 0.6rem 0 1rem; text-transform: uppercase; }
.hazard { height: 0.9rem; background: repeating-linear-gradient(-45deg, var(--yellow) 0 1rem, #111 1rem 2rem); border-radius: 2px; }
.pitch { font-size: 1.45rem; line-height: 1.5; color: #dbe6ee; max-width: 34ch; margin: 1.4rem 0 0; }
.join { padding: 2rem 2.4rem; text-align: center; display: flex; flex-direction: column; gap: 0.6rem; }
.step { margin: 0; font: 800 1.8rem var(--display); }
.big-url { margin: 0; font: 700 1.4rem var(--display); color: var(--yellow); }
.crew-title { margin: 0.6rem 0 0; font: 700 1.3rem var(--display); color: var(--mist); }
#lobby-crew { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
#lobby-crew li { display: flex; gap: 0.5rem; align-items: center; font: 800 1.5rem var(--display); background: #0a2236; padding: 0.35rem 0.8rem; border-radius: 2rem; border: 0.2rem solid var(--c); animation: pop 0.3s; }
#lobby-crew li i { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c); } #lobby-crew small { font: 700 0.9rem var(--display); color: var(--yellow); }
#lobby-crew li.empty { border-color: #24435a; color: var(--mist); font-weight: 600; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.start-hint { margin: 0.4rem 0 0; font: 700 1.3rem var(--display); color: var(--mist); }
.btn { pointer-events: auto; align-self: center; border: 0; border-radius: 0.5rem; padding: 0.7rem 1.6rem; font: 800 1.5rem var(--display); background: var(--yellow); color: #111; box-shadow: 0 0.3rem 0 #a37b00; cursor: pointer; }
.small { font-size: 1rem; color: var(--mist); margin: 0; line-height: 1.4; }
kbd { font: 700 0.9rem var(--display); background: #24435a; padding: 0.1rem 0.4rem; border-radius: 0.25rem; color: #fff; }
.mcard { width: min(56rem, 90vw); background: rgba(8, 30, 47, 0.95); border-radius: 0.8rem; padding: 2rem 2.4rem; border-top: 0.6rem solid transparent; border-image: repeating-linear-gradient(-45deg, var(--yellow) 0 1rem, #111 1rem 2rem) 10; box-shadow: 0 1.5rem 4rem rgba(0,0,0,.5); }
.mcard h2 { font: 800 5rem/0.95 var(--display); margin: 0.3rem 0 0.6rem; text-transform: uppercase; }
.obj { font: 600 1.7rem/1.35 var(--body); margin: 0 0 1.2rem; }
.lesson { background: #0f3550; border-radius: 0.5rem; padding: 1rem 1.2rem; border-left: 0.35rem solid var(--stbd); }
.lesson b { font: 800 1.6rem var(--display); color: #5fe0a8; } .lesson p { margin: 0.3rem 0 0; font-size: 1.35rem; line-height: 1.5; }
.ibar { height: 0.5rem; background: #24435a; border-radius: 0.3rem; margin-top: 1.2rem; overflow: hidden; } .ibar i { display: block; height: 100%; width: 0; background: var(--yellow); }
.small-card { width: min(34rem, 80vw); text-align: center; position: absolute; top: 24%; }
.dstars { font-size: 5rem; color: var(--yellow); line-height: 1; margin: 0.4rem 0 0.8rem; } .dstars em, .results-card em { font-style: normal; color: #2b4a60; }
.results-card { text-align: center; }
.r-score { margin: 0.2rem 0 0.8rem; } #r-score { font: 800 7rem/1 var(--display); color: var(--yellow); } .r-score small { font: 700 1.6rem var(--display); color: var(--mist); margin-left: 0.6rem; }
#r-stars { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
#r-stars li { background: #0a2236; border-radius: 0.4rem; padding: 0.5rem; display: flex; flex-direction: column; } #r-stars b { font: 700 1.15rem var(--display); color: var(--mist); } #r-stars span { font-size: 1.8rem; color: var(--yellow); }
#r-awards { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; text-align: left; }
#r-awards li { background: #0a2236; border-radius: 0.4rem; padding: 0.5rem 0.8rem; border-left: 0.3rem solid var(--c); display: flex; flex-direction: column; }
#r-awards b { font: 700 1rem var(--display); color: var(--mist); } #r-awards span { font: 800 1.5rem var(--display); } #r-awards small { color: var(--mist); font-size: 0.95rem; }
.lessons { text-align: left; background: #0f3550; border-radius: 0.5rem; padding: 0.8rem 1.2rem; margin-bottom: 0.8rem; } .lessons p { margin: 0.3rem 0; font-size: 1.2rem; line-height: 1.45; } .lessons b { color: var(--yellow); }
#loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 1rem; background: var(--deep); text-align: center; font: 700 2rem var(--display); z-index: 10; }
#loading .hazard { width: 16rem; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } }

/* Mission rhythm: readable warnings stay visible without covering the playfield. */
#mission-track { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 0 0 .65rem; gap: .35rem; }
#mission-track li { color: var(--mist); font: 600 .85rem var(--display); border-bottom: 3px solid #355267; padding-bottom: .35rem; }
#mission-track span { display: inline-block; margin-right: .25rem; font-weight: 800; }
#mission-track .current { color: var(--yellow); border-color: var(--yellow); }
#mission-track .complete { color: #5fe0a8; border-color: #21a179; }
#weather-strip { display: grid; gap: .2rem; margin-top: .65rem; padding: .5rem .7rem; background: #0a2236; border-left: 4px solid #648399; border-radius: .25rem; }
#weather-title { font: 800 1.2rem var(--display); }
#weather-detail { color: var(--mist); font-size: .95rem; line-height: 1.3; }
#weather-strip[data-kind="warning"] { border-color: var(--yellow); background: #493c18; }
#weather-strip[data-kind="active"] { border-color: var(--orange); background: #492b20; }
#weather-strip[data-kind="warning"] b { color: var(--yellow); }
.next-mission { font: 700 1.4rem var(--display); color: var(--yellow); margin: .8rem 0 0; }

#weather-strip[data-kind="quiet"] #weather-detail { display: none; }
/* Crew Arena v3: the stage is the hero; UI stays at its edges. */
:root { --deep:#0d293a; --navy:#15364a; --panel:rgba(15,43,59,.94); --yellow:#ffdc83; --orange:#ff9a5c; --mist:#bdd4da; --white:#fff6de; --stbd:#47dfb0; --port:#ff718d; font-size:clamp(11px,.92vw,20px); }
.panel { border:1px solid #b4ddd62b; border-radius:1.1rem; box-shadow:0 .5rem 2rem #08243122; backdrop-filter:blur(12px); }
#stage-caption { position:fixed;left:2rem;top:1.6rem;pointer-events:none;font:800 1.65rem var(--display);letter-spacing:.06em;color:var(--white); }
#stage-caption span { display:block;font:600 .7rem var(--body);letter-spacing:.17em;color:var(--mist);margin-top:.25rem; }
body:not([data-phase="lobby"]) #stage-caption { display:none; }
.score-panel { left:1.4rem;top:1.2rem;padding:.65rem 1rem;min-width:10rem; }
#team-label { text-transform:uppercase;letter-spacing:.12em;font-size:.75rem; }
#score { font-size:3.2rem;line-height:1; }
#stars { font-size:.8rem; }
#mission { top:1.2rem;width:min(52rem,57vw);padding:.7rem 1.2rem;border-image:none;border:1px solid #c6e5d94d;border-radius:1rem;text-align:left; }
#mission-track { margin-bottom:.35rem; }
#mission-track li { font-size:.75rem; }
#m-title { font-size:2.1rem;line-height:1; margin:.1rem 0 .3rem; }
#m-obj { font-size:.95rem;line-height:1.3; }
#m-progress { margin-top:.45rem; }
.m-head { font-size:.8rem; }
#m-timer { position:absolute;right:1.1rem;top:2.5rem;font-size:2.4rem; }
#weather-strip { margin-top:.45rem;padding:.35rem .6rem;gap:.12rem; }
#weather-title { font-size:1.05rem; }
#weather-detail { font-size:.83rem; }
#weather-strip[data-kind="quiet"] { display:none; }
#join-mini { top:1.2rem;right:1.3rem;gap:.4rem;padding:.5rem; }
.qr-small { width:4.5rem;height:4.5rem; }
#join-mini p { max-width:11rem;overflow-wrap:anywhere;font-size:1rem; }
#join-mini span { font-size:.75rem; }
#stability { left:auto;right:1.3rem;bottom:6.2rem;width:17rem;padding:.55rem .8rem;transform:none; }
#stability #stab-svg, #stability .formula, #stability .meter { display:none; }
#stability .st-head { font-size:.95rem; }
#stability .st-head span { display:none; }
#stability .heel-row { margin:.3rem 0; }
#heel-val { font-size:1.7rem; }
#heel-dir { font-size:.95rem; }
#pump-state { font-size:.8rem; }
#stability .gw-text b { font-size:1.2rem; }
#stability .gw-text span { font-size:.85rem; }
#stability .lamp { width:1rem;height:1rem; }
#stability.focus { transform:none;border-color:var(--yellow);box-shadow:0 0 0 2px #ffdc8333; }
#stability.focus #stab-svg { display:block;max-height:9rem; }
#stability.focus .formula { display:block; }
#stability.focus .eq { font-size:.85rem; }
#stability.focus .frac { font-size:.85rem; }
#roster { bottom:1.2rem;left:1.4rem;right:1.4rem;justify-content:center;gap:.45rem; }
#roster li { background:var(--panel);border:1px solid #b2dbd644;border-bottom:3px solid var(--c);border-radius:.7rem;padding:.4rem .7rem; }
#roster i { width:.7rem;height:.7rem; }
#roster b { font-size:1.2rem; }
#roster span { font-size:.85rem; }
#banner { top:auto;bottom:7rem;width:min(40rem,65vw);padding:.65rem 1rem;border-top:0;border-left:4px solid var(--orange);border-radius:.8rem;text-align:left; }
#banner strong { font-size:1.7rem; }
#banner p { font-size:.95rem;line-height:1.3; }
.card-wrap { background:rgba(9,32,46,.38);padding:2rem;backdrop-filter:blur(3px); }
#lobby { padding:7rem 3rem 3rem;background:linear-gradient(90deg,#0c293beb, #0c293b77 58%, #0c293b99);backdrop-filter:blur(0); }
.lobby-card { width:min(92rem,95vw);grid-template-columns:1fr 26rem;gap:8rem; background:none;box-shadow:none;overflow:visible;border-radius:0; }
.brand { padding:0;background:none;align-self:center; }
.org { color:var(--mist);font:600 .9rem var(--body);letter-spacing:.15em;text-transform:uppercase; }
.edition { display:inline-block;margin:0 0 1.2rem;padding:.45rem .7rem;border:1px solid #ffdc8380;border-radius:2rem;color:var(--yellow);font:700 .85rem var(--body);letter-spacing:.1em; }
h1 { font-size:clamp(6rem,10vw,12rem);line-height:.83;margin:1rem 0 1.8rem;letter-spacing:-.015em; }
h1 span { color:var(--yellow); }
.brand .org { margin-bottom:1rem; }
.brand .hazard { width:6rem;height:.4rem;background:var(--orange); }
.pitch { font-size:1.7rem;line-height:1.4; }
.join { background:#123446ee;border:1px solid #c0e1d33b;border-radius:1.4rem;padding:1.7rem;gap:.8rem;align-self:center;box-shadow:0 1rem 4rem #071e3433; }
.mission-chips { display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem;margin-bottom:.5rem;text-align:left; }
.mission-chips span { font:700 .8rem var(--body);color:var(--mist);padding:.4rem;border-bottom:1px solid #bfded12b; }
.step { font-size:1.55rem; }
.btn { border-radius:.7rem;font-size:1.5rem;box-shadow:none;width:100%;padding:.8rem 1rem;background:var(--yellow); }
.btn.secondary { background:#20495b;color:var(--white);border:1px solid #9ad4d733;font-size:1.25rem; }
.qr-big { width:10rem;height:10rem; }
.big-url { font-size:1rem;overflow-wrap:anywhere; }
#kb-hint { font-size:.85rem; }
.start-hint { font-size:1.1rem; }
.mcard { border-image:none;border:1px solid #b7d9d34d;border-top:5px solid var(--orange);border-radius:1.4rem;background:#123446f5; }
.mcard h2 { font-size:4rem; }
.obj { font-size:1.4rem; }
.lesson { background:#21495b;border-left-color:var(--yellow); }
.lesson b { color:var(--yellow);font-size:1.4rem; }
.lesson p { font-size:1.1rem; }
.small-card { top:auto; }
#debrief { backdrop-filter:none; }
.results-card .r-score #r-score { font-size:5rem; }
@media (max-width:900px) { .lobby-card { gap:3rem;grid-template-columns:1fr 24rem; } #roster span { display:none; } #stability { width:15rem; } }
@media (max-height:620px) { #lobby { padding-top:5rem; } .join { padding:1rem;gap:.5rem; } h1 { font-size:8rem; } .pitch { font-size:1.3rem; } .qr-big { width:7rem;height:7rem; } .mcard { padding:1.2rem 1.7rem; } .mcard h2 { font-size:3rem; } .lesson p { font-size:1rem; } }

.btn.watch-demo { background:transparent;color:var(--mist);border:1px solid #a4d7d633;font-size:1.1rem; }

#player-tags, #tag-leaders { position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none; }
#tag-leaders line { stroke-width:1.4;opacity:.65; }
.crew-tag { position:absolute;left:0;top:0;width:108px;height:25px;display:flex;align-items:center;background:#102b3cf2;border:1px solid var(--c);border-radius:7px;font:700 15px var(--display);box-shadow:0 2px 4px #071c3830; }
.crew-tag b { display:grid;place-items:center;align-self:stretch;width:25px;flex:none;border-radius:6px 0 0 6px;background:var(--c);color:#102b3c;font-size:17px; }
.crew-tag span { padding:0 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
/* Crane mission: permanent teaching panel and a stationary isometric playfield. */
:root { --sidebar:300px; }
#stability { position:fixed;left:0;top:0;bottom:0;right:auto;width:var(--sidebar);padding:22px 18px;background:linear-gradient(180deg,#102f43,#0a2537);border:0;border-right:1px solid #9bcdd133;border-radius:0;overflow:auto;scrollbar-width:thin;pointer-events:auto;box-shadow:10px 0 30px #071c3020; }
#stability .section-kicker { font:700 11px var(--body);letter-spacing:.18em;color:#88bbc9;margin:0 0 7px; }
#stability h2 { font:800 30px/1 var(--display);margin:0 0 14px; }
.section-heel { display:flex;align-items:baseline;gap:12px;margin:0 0 8px; }.section-heel b { font:800 43px/1 var(--display);color:var(--yellow); }.section-heel span { font:600 13px var(--body);color:var(--mist); }
#stability-status { display:inline-block;padding:5px 8px;border-radius:5px;background:#275345;color:#9ae4b9;font:700 10px var(--body);letter-spacing:.05em; }
#stability-status[data-level="warning"] { background:#5b4a27;color:#ffda8e; }#stability-status[data-level="danger"] { background:#663546;color:#ffbecb; }
#hydro-svg { display:block;width:100%;margin:12px 0 3px;max-height:275px; }#hydro-svg text { font:800 13px var(--display); }.section-label { font-size:9px!important;letter-spacing:1px;fill:#9ec3ce; }
.force-legend { display:flex;justify-content:space-between;font:600 11px var(--body);gap:5px; }.force-legend i { width:7px;height:7px;display:inline-block;border-radius:50%;margin-right:4px; }.g-key { background:#ffcf79; }.b-key { background:#65dcea; }
#stability-why { min-height:60px;margin:12px 0;font:400 12px/1.45 var(--body);color:#c8dde3; }
.stability-values { display:grid;grid-template-columns:1fr 1fr;gap:12px 8px;margin:0;padding:13px 0;border-top:1px solid #a1cacf26;border-bottom:1px solid #a1cacf26; }.stability-values div { display:grid;gap:3px; }.stability-values dt { color:#88b5c3;font:400 10px var(--body); }.stability-values dd { margin:0;font:700 19px var(--display); }
.curve-head { display:flex;justify-content:space-between;margin-top:12px;font:700 12px var(--display); }.curve-head span { color:#88b5c3;font:400 10px var(--body); }#righting-svg { width:100%;max-height:126px; }#righting-svg text { font:400 9px var(--body);fill:#88b5c3; }
#live-pump { font:700 12px var(--display);color:#98c8c9;margin:2px 0 8px; }.model-note { color:#6f9faf;font:400 9px/1.45 var(--body);margin:0; }
body[data-phase="lobby"] #stability { display:block!important; }body[data-phase="lobby"] #stability { opacity:.70; }
#mission { left:calc(var(--sidebar) + (100% - var(--sidebar))*.45);width:calc(100% - var(--sidebar) - 240px);max-width:650px;top:14px;padding:12px 15px; }
#mission-track { display:none; }#m-title { font-size:27px; }#m-obj { font-size:12px;max-width:calc(100% - 45px); }#m-num { font-size:10px; }#m-timer { top:16px;font-size:30px; }
.score-panel { left:auto;right:18px;top:14px;min-width:120px;padding:10px 15px; }#score { font-size:36px; }#stars { font-size:11px; }
#join-mini { top:110px;right:18px; }#join-mini p { max-width:90px; }
.cargo-dots { display:inline-flex;gap:6px; }.cargo-dots i { display:grid;place-items:center;width:22px;height:22px;border:1px solid #b5d5d440;border-radius:5px;font:700 12px var(--display);font-style:normal;color:#9bbac4; }.cargo-dots .landed { background:#65562f;color:#ffde8b; }.cargo-dots .lashed { background:#275749;color:#a0efc8; }
.crane-hint { display:block;font-size:11px;color:#a8c6cf;margin-top:6px; }
#roster { left:calc(var(--sidebar) + 16px);right:16px;bottom:15px; }#roster li { padding:4px 8px; }#roster b { font-size:15px; }#roster span { font-size:11px; }
#banner { left:calc(var(--sidebar) + (100% - var(--sidebar))*.5);bottom:85px;width:calc(100% - var(--sidebar) - 90px);max-width:520px; }
#lobby { left:var(--sidebar);padding:75px 35px 35px;background:linear-gradient(90deg,#0b283bc9,#0b283b88); }.lobby-card { width:100%;grid-template-columns:1fr minmax(260px,330px);gap:35px; }h1 { font-size:clamp(65px,8vw,120px); }.pitch { font-size:20px; }.join { padding:18px;gap:8px; }.join .btn { font-size:17px;padding:10px; }.join .watch-demo { font-size:14px; }.mission-chips span { font-size:9px; }#kb-hint { font-size:10px; }
#intro,#debrief,#results { left:var(--sidebar); }.mcard { max-width:90%; }.mcard h2 { font-size:42px; }.lesson p { font-size:14px; }.obj { font-size:17px; }.results-card #r-stars { grid-template-columns:1fr; }
#stage-caption { left:calc(var(--sidebar) + 25px);font-size:18px; }
@media(max-height:760px){#stability { padding:14px; }#hydro-svg { max-height:200px;margin:4px 0; }#stability h2 { font-size:25px; }.section-heel b { font-size:34px; }#stability-why { font-size:11px;min-height:45px;margin:8px 0; }.stability-values { gap:7px;padding:8px 0; }.stability-values dd { font-size:17px; }#righting-svg { max-height:90px; }.curve-head { margin-top:8px; }}

/* v5: roll stopwatch */
.roll-clock { margin: .7rem 0 .4rem; padding: .6rem .7rem; border-radius: .7rem; background: #0a2a3c; border: 1px solid #65dcea33; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); }
.rc-head b { font-size: 1.05rem; } #roll-verdict { font-weight: 700; font-size: .95rem; color: #ffcf79; }
#roll-verdict[data-k="stiff"] { color: #65dcea; } #roll-verdict[data-k="tender"] { color: #ffb36b; } #roll-verdict[data-k="danger"] { color: #ff718d; }
.rc-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .35rem; }
.rc-row span { display: block; font-size: .72rem; color: #9fc3cf; } .rc-row strong { font: 800 1.35rem var(--display); font-variant-numeric: tabular-nums; }
#roll-why { margin: .35rem 0 0; font-size: .78rem; line-height: 1.35; color: #c9dde4; }

.physics-log { list-style: none; margin: .7rem 0 0; padding: 0; text-align: left; display: grid; gap: .35rem; }
.physics-log li { background: #0a2a3c; border-left: .25rem solid #65dcea; border-radius: .4rem; padding: .45rem .7rem; font-size: .95rem; line-height: 1.4; }

/* v5.3 fun batch */
#quiz { position: absolute; right: 1.2rem; top: 8.5rem; width: 22rem; padding: .9rem 1rem; border-radius: 1rem; background: rgba(9,32,46,.92); border: 2px solid #ffde59; pointer-events: none; animation: drop .35s ease-out; }
.qz-head { display: flex; align-items: baseline; gap: .6rem; font-family: var(--display); } .qz-head b { font-size: 1.6rem; color: #ffde59; letter-spacing: .03em; }
.qz-head span { color: #9fc3cf; } .qz-head em { margin-left: auto; font-style: normal; font: 800 1.6rem var(--display); color: #fff; }
#quiz-ref { margin: .4rem 0 .6rem; font-size: 1rem; line-height: 1.45; color: #e4f3f7; } #quiz-ref b { color: #ffde59; }
#quiz-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.qz-opt { border-radius: .7rem; background: #0a2a3c; padding: .45rem .3rem; text-align: center; font-family: var(--display); border: 2px solid #ffffff22; }
.qz-opt b { display: block; font-size: 1.6rem; } .qz-opt span { font-size: 1.2rem; font-weight: 800; } .qz-opt small { display: block; color: #9fc3cf; font-size: .85rem; }
.qz-opt.right { border-color: #44e9b1; background: #0f4b3c; } .qz-opt.wrong { opacity: .45; }
#quiz-foot { margin: .6rem 0 0; font: 700 1.05rem var(--display); color: #ffde59; min-height: 1.2em; }
#splashcam { position: absolute; pointer-events: none; border: 3px solid #ff6a13; border-radius: .6rem; box-shadow: 0 .4rem 1.6rem #0008; }
#splashcam span { position: absolute; left: .5rem; top: .4rem; font: 800 1rem var(--display); color: #fff; background: #ff6a13; padding: .1rem .5rem; border-radius: .3rem; letter-spacing: .06em; }
#splashcam span::before { content: "● "; color: #ffdddd; animation: blink 1s steps(2) infinite; }
#splashcam b { position: absolute; left: .5rem; bottom: .4rem; font: 800 1.2rem var(--display); color: #fff; text-shadow: 0 2px 4px #000; }

/* v5.4.1 keyboard guide */
#keyguide { position: absolute; left: 50%; transform: translateX(-50%); bottom: 4.2rem; margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; pointer-events: none; z-index: 5; }
#keyguide li { background: rgba(6,25,42,.86); border: 1px solid #ffffff22; border-left: .3rem solid var(--c, #ffde59); border-radius: .5rem; padding: .3rem .7rem; font: 600 .95rem var(--body); color: #e4f3f7; white-space: nowrap; }
#keyguide li span { font: 800 1rem var(--display); color: #fff; margin-right: .3rem; } #keyguide li b { color: #ffde59; }
#keyguide li i { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); margin-right: .35rem; }

/* Incline! section panel */
#incline-panel { position: absolute; right: 1.2rem; top: 7.6rem; width: 23rem; padding: .8rem .9rem; border-radius: 1rem; background: rgba(9,32,46,.92); border: 2px solid #ffde5966; pointer-events: none; }
.ip-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); } .ip-head b { font-size: 1.7rem; color: #ffde59; letter-spacing: .02em; } .ip-head span { color: #9fc3cf; font-weight: 700; }
#ip-target { font: 800 2rem/1.05 var(--display); color: #fff; margin: .1rem 0 .4rem; }
#ip-svg { width: 100%; display: block; } .ip-s { font: 700 11px var(--display); letter-spacing: .05em; }
.ip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .5rem; text-align: center; }
.ip-row span { display: block; font-size: .78rem; color: #9fc3cf; } .ip-row b { font: 800 1.35rem var(--display); font-variant-numeric: tabular-nums; } #ip-t { color: #ffde59; } #ip-m.ok { color: #44e9b1; }
.ip-hold { position: relative; height: 1.5rem; margin-top: .5rem; border-radius: .75rem; background: #0a2236; overflow: hidden; }
#ip-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: #ffb000; transition: width .1s linear; } #ip-bar.ok { background: #29e070; }
#ip-hold-t { position: absolute; inset: 0; display: grid; place-items: center; font: 800 .95rem var(--display); color: #fff; font-style: normal; text-shadow: 0 1px 2px #000; }
#ip-window { margin: .3rem 0 0; font-size: .75rem; color: #9fc3cf; text-align: center; }
#ip-steps { list-style: none; display: flex; gap: .35rem; margin: .5rem 0 0; padding: 0; justify-content: center; }
#ip-steps li { font: 800 .95rem var(--display); padding: .2rem .55rem; border-radius: .5rem; background: #0a2236; color: #9fc3cf; border: 2px solid transparent; }
#ip-steps li.done { background: #0f4b3c; color: #b6ffe0; } #ip-steps li.now { border-color: #ffde59; color: #fff; }

/* One scrollable instrument console, with generous deck viewport. */
.incline-playful #stability { overflow-y:auto; background:linear-gradient(160deg,#163652,#163f50); border-right:3px solid #70e5d0; }
.incline-playful #incline-panel { position:relative; inset:auto; width:auto; margin:0 0 16px; padding:12px; background:#15314d; border:2px solid #ffcf67; border-radius:20px; }
.incline-playful #incline-panel svg { max-height:170px; }
.incline-playful #stability h2 { color:#ffcf67; }
.incline-playful .btn { border-radius:18px; box-shadow:0 4px 0 #102a43; }
.incline-playful .mission-chips span { background:#805bc4; color:white; border-radius:14px; }

#team-name{font:700 20px var(--body);padding:10px;border:3px solid #ffce65;border-radius:14px;max-width:100%;box-sizing:border-box;background:#fff6dc;color:#14384a}#leaderboard,#results-board{text-align:left;font:600 15px var(--body);line-height:1.8}.join{max-height:85vh;overflow:auto}#results{overflow:auto}

/* ===== v8 polish: the decks dominate; one compact instrument; small name tags ===== */
#stability, #mission, #quiz, .score-panel, #team-score, #stab-console { display: none !important; }
#incline-panel { position: absolute !important; left: 1rem !important; top: 1rem !important; right: auto !important; width: 15.5rem !important; padding: .6rem .7rem .7rem !important;
  border-radius: .9rem !important; background: rgba(9,32,46,.86) !important; border: 2px solid #ffde5980 !important; box-shadow: 0 .4rem 1.4rem #0006; z-index: 6; }
#incline-panel .ip-head b { font-size: 1.2rem !important; } #incline-panel #ip-target { font-size: 1.75rem !important; margin: 0 0 .25rem !important; }
#incline-panel #ip-svg { max-height: 7.5rem; } #ip-window, .ip-hold, #incline-panel .ip-row > div:nth-child(2) { display: none !important; }
#incline-panel .ip-row { grid-template-columns: 1fr 1fr !important; margin-top: .3rem !important; } #incline-panel .ip-row b { font-size: 1.5rem !important; }
#incline-panel #ip-steps li { font-size: .85rem !important; padding: .12rem .42rem !important; }
.crew-tag { width: 78px !important; height: 19px !important; font: 700 11.5px var(--display) !important; border-radius: 5px !important; background: #102b3cd9 !important; }
.crew-tag b { width: 18px !important; font-size: 12px !important; } .crew-tag span { padding: 0 5px !important; }
#tag-leaders line { stroke-width: 1.2 !important; opacity: .7; }
#keyguide { bottom: 3.4rem !important; } #keyguide li { font-size: .8rem !important; padding: .2rem .55rem !important; }
#roster li { font-size: .9rem; }
#incline-panel { left: auto !important; right: 1rem !important; }
#incline-panel #ip-steps li { white-space: nowrap; font-size: .78rem !important; }
#join-mini { top: auto !important; bottom: 1rem !important; right: 1rem !important; transform: scale(.85); transform-origin: right bottom; }

/* v9: no ghost sidebar in the lobby; no eyebrows or subtitles on the first page */
html body[data-phase] #stability, html body #stability { display: none !important; }
#lobby .step, #start-hint, #kb-hint, #board-note, #lobby details p, .keyboard-edition #lobby .join-url, #stage-caption span { display: none !important; }

/* v12: live righting-lever section */
#incline-panel { width: 19rem !important; }
#incline-panel #ip-svg { max-height: none !important; }
.ip-lab { font: 800 13px var(--display); } .ip-lab2 { font: 800 12px var(--display); }
.ip-gzrow { display: flex; justify-content: space-between; gap: .3rem; margin-top: .35rem; font: 700 .72rem var(--display); color: #9fc3cf; }
.ip-gzrow b { display: block; font-size: 1.05rem; color: #fff; font-variant-numeric: tabular-nums; } #ip-gzv { color: #ffde59; }

/* v13: Lemon Milk for titles (drop the font files in public/fonts or install it on the big-screen laptop) */
@font-face { font-family: "Lemon Milk"; font-weight: 700; src: local("LEMON MILK Bold"), local("LEMONMILK-Bold"), local("Lemon Milk Bold"), url("fonts/LEMONMILK-Bold.woff2") format("woff2"), url("fonts/LEMONMILK-Bold.otf") format("opentype"); }
@font-face { font-family: "Lemon Milk"; font-weight: 400; src: local("LEMON MILK"), local("LEMONMILK-Regular"), local("Lemon Milk"), url("fonts/LEMONMILK-Regular.woff2") format("woff2"), url("fonts/LEMONMILK-Regular.otf") format("opentype"); }
:root { --title: "Lemon Milk", var(--display); }
h1, #banner strong, #incline-panel .ip-head b, #incline-panel #ip-target, #results h2, .results h2, .lobby-card h2, #stage-caption, .dc-top b { font-family: var(--title) !important; }
#join-mini { top: 1rem !important; left: 1rem !important; right: auto !important; bottom: auto !important; transform-origin: left top !important; }
/* v13: DRFT MRKS drone feed */
#dronecam { position: absolute; pointer-events: none; overflow: hidden; border-radius: .5rem; box-shadow: 0 .5rem 1.6rem #000a; outline: 2px solid #0b1b28; z-index: 6; }
#dronecam .dc-scan { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.13) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.45) 100%); mix-blend-mode: multiply; }
#dronecam .dc-corners { position: absolute; inset: 10px; background:
  linear-gradient(#fff,#fff) left top/18px 2px no-repeat, linear-gradient(#fff,#fff) left top/2px 18px no-repeat,
  linear-gradient(#fff,#fff) right top/18px 2px no-repeat, linear-gradient(#fff,#fff) right top/2px 18px no-repeat,
  linear-gradient(#fff,#fff) left bottom/18px 2px no-repeat, linear-gradient(#fff,#fff) left bottom/2px 18px no-repeat,
  linear-gradient(#fff,#fff) right bottom/18px 2px no-repeat, linear-gradient(#fff,#fff) right bottom/2px 18px no-repeat; opacity: .85; }
#dronecam .dc-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%,-50%); background: linear-gradient(#ffffffcc,#ffffffcc) center/2px 100% no-repeat, linear-gradient(#ffffffcc,#ffffffcc) center/100% 2px no-repeat; opacity: .7; }
#dronecam .dc-top { position: absolute; left: 16px; right: 16px; top: 12px; display: flex; justify-content: space-between; align-items: center; color: #fff; text-shadow: 0 1px 3px #000; }
#dronecam .dc-top b { font-size: 1.05rem; letter-spacing: .08em; }
#dronecam .dc-live { font: 700 .8rem var(--display); color: #ff4d4d; animation: blink 1.2s steps(2) infinite; }
#dronecam .dc-sub { position: absolute; left: 16px; top: 34px; font: 600 .68rem var(--display); color: #e8f3f8; letter-spacing: .06em; text-shadow: 0 1px 3px #000; }
#dronecam .dc-bot { position: absolute; left: 16px; right: 16px; bottom: 10px; display: flex; justify-content: space-between; font: 600 .72rem ui-monospace, Menlo, Consolas, monospace; color: #fff; text-shadow: 0 1px 3px #000; }
#dc-draft { color: #ffde59; font-weight: 800; }
@keyframes blink { 50% { opacity: 0.15; } }
#stage-caption { display: none !important; } /* v14: the welcome screen carries the title */

/* v15: waterline = a ring at the intersection point; no grain */
#dc-ov .wl-ring { fill: none; stroke: #23f0ff; stroke-width: 2.4; filter: drop-shadow(0 0 3px #23f0ff); }
#dc-ov .wl-dot { fill: #23f0ff; }
#dronecam .dc-grain { display: none !important; }

/* v15: 12 crew – a compact roster that stays on one row on a projector */
#roster { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 23rem); gap: .3rem !important; }
#roster li { font-size: .78rem !important; padding: .18rem .5rem !important; }
#roster li span, #roster li small { font-size: .7rem !important; }
#fps-meter { position: fixed; left: .6rem; bottom: .5rem; z-index: 50; font: 700 .85rem ui-monospace, Menlo, Consolas, monospace; color: #3ee07a; background: #000a; padding: .15rem .45rem; border-radius: .3rem; }

/* v15: with more than 8 crew the roster shows names only, so 12 fit on one row */
#roster:has(li:nth-child(9)) li > :not(b):not(i):not(.dot) { display: none !important; }

/* v16: Inclining Test Report */
#results.report-wrap { position: fixed; inset: 0; display: grid; place-items: center; padding: 1.2rem; background: rgba(4,14,22,.82); z-index: 30; }
#results.report-wrap[hidden] { display: none; }
.report { width: min(1500px, 100%); max-height: 100%; overflow: auto; background: #f7f4ec; color: #142231; border-radius: .8rem; box-shadow: 0 1rem 3rem #000a;
  display: grid; grid-template-rows: auto auto auto; font-family: var(--body); }
.rep-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.4rem; padding: 1rem 1.6rem; background: #27306a; color: #fff; border-bottom: .35rem solid #00aedb; }
.rep-logo { height: 3.4rem; width: auto; }
.rep-title h2 { margin: 0; font: 700 1.9rem var(--title); letter-spacing: .05em; text-transform: uppercase; }
.rep-title p { margin: .15rem 0 0; color: #bfe9f5; font: 600 1rem var(--display); letter-spacing: .04em; }
.rep-result { text-align: right; } .rep-result span { display: block; font: 700 .95rem var(--display); color: #ffde59; text-transform: uppercase; letter-spacing: .05em; }
.rep-result b { font: 800 2.6rem var(--display); font-variant-numeric: tabular-nums; } .rep-result small { margin-left: .3rem; color: #bfe9f5; }
.rep-body { display: grid; grid-template-columns: 19rem 1fr 22rem; gap: 1.2rem; padding: 1rem 1.6rem; min-height: 0; }
.report h3 { margin: .2rem 0 .45rem; font: 700 .85rem var(--title); letter-spacing: .08em; text-transform: uppercase; color: #27306a; border-bottom: 2px solid #00aedb; padding-bottom: .2rem; }
.report table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: .8rem; } .report td { padding: .22rem .3rem; border-bottom: 1px solid #d8d2c4; }
.report td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; } .report tr.miss td { color: #a33; }
#rep-mvp p { margin: .25rem 0; font-size: .88rem; } #rep-mvp b { color: #27306a; }
.rep-chart { min-width: 0; } #rep-canvas { width: 100%; height: auto; background: #fff; border: 1px solid #d8d2c4; border-radius: .4rem; }
.rep-log { min-height: 0; } #rep-log { list-style: none; margin: 0; padding: 0; max-height: 31rem; overflow: auto; font-size: .82rem; }
#rep-log li { display: grid; grid-template-columns: 3.4rem 1fr; gap: .4rem; padding: .16rem .2rem; border-bottom: 1px dotted #d8d2c4; }
#rep-log li time { font: 700 .8rem ui-monospace, Menlo, Consolas, monospace; color: #6b7280; }
#rep-log li.k-target { background: #e5f8ee; font-weight: 700; } #rep-log li.k-overboard, #rep-log li.k-lost { color: #b42318; }
#rep-log li.k-container, #rep-log li.k-container-lost { color: #b45309; } #rep-log li.k-deckhand { color: #6d28d9; }
#rep-log li.k-slip, #rep-log li.k-bump, #rep-log li.k-dropped { color: #0e7490; } #rep-log li.k-finish { background: #27306a; color: #fff; font-weight: 700; }
.rep-foot { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: end; padding: .8rem 1.6rem 1.1rem; border-top: 1px solid #d8d2c4; }
.rep-board ol { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; padding-left: 1.2rem; font-size: .88rem; }
.rep-sign { display: flex; align-items: center; gap: 1rem; } .rep-sign span { font: italic 600 .8rem var(--display); color: #6b7280; }
@media (max-width: 1250px) { .rep-body { grid-template-columns: 16rem 1fr; } .rep-log { grid-column: 1 / -1; } #rep-log { max-height: 12rem; columns: 2; } }

.rep-body { align-items: start; } .report td { padding: .18rem .3rem !important; } .report table { font-size: .86rem !important; }

/* v18: Tymor test edition – one player + Kevin, Emma, David & Manuela */
.test-only { display: none !important; }
body.tymor-test .test-only { display: block !important; }
body.tymor-test #btn-start-host, body.tymor-test #btn-add-kb, body.tymor-test #btn-bots, body.tymor-test .crew-title, body.tymor-test #crew-list, body.tymor-test .empty { display: none !important; }
body.tymor-test #btn-test { width: 100%; margin-top: .6rem; }
.test-keys { margin: .7rem 0 0; font-size: .85rem; line-height: 1.45; color: #cfe3ec; } .test-keys b { color: #ffde59; }
body.tymor-test .test-only label { display: block; margin-bottom: .3rem; }
#test-name { display: block; width: 100%; font: 700 20px var(--body); padding: 10px; border: 3px solid #ffce65; border-radius: 14px; box-sizing: border-box; background: #fff6dc; color: #14384a; margin-bottom: .6rem; }

#rep-log li.k-capsize { background: #b91c1c; color: #fff; font-weight: 800; }

/* v19: Reset game – bottom left, two-step so a stray click can't end a race */
.reset-btn { position: fixed; left: 1rem; bottom: 1rem; z-index: 40; pointer-events: auto; font: 700 .85rem var(--display); letter-spacing: .03em;
  padding: .45rem .8rem; border-radius: .6rem; border: 2px solid #ffffff40; background: rgba(9,32,46,.88); color: #e8f3f8; cursor: pointer; }
.reset-btn:hover { border-color: #ffde59; color: #ffde59; }
.reset-btn.armed { background: #b91c1c; border-color: #fff; color: #fff; }
#fps-meter { bottom: 3.4rem !important; }

#rep-log li.k-flood { color: #1d4ed8; font-weight: 700; }

#clear-board.armed { background: #b91c1c !important; color: #fff !important; border-color: #fff !important; }
/* v29: event joining and expandable team history */
#lobby .lobby-card{grid-template-columns:minmax(220px,.65fr) minmax(600px,1.35fr);gap:24px;max-width:1500px}
#lobby .join{max-height:88vh;overflow:auto}
.join-codes{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.join-codes article{background:#fff8e8;color:#13394a;border-radius:18px;padding:16px;min-width:0}
.join-codes h2{font:800 23px var(--body);margin:0 0 12px}
.join-codes h2 b{display:inline-grid;place-items:center;background:#ffcb53;color:#13394a;border-radius:50%;width:34px;height:34px}
.join-qr{width:min(100%,235px);aspect-ratio:1;min-height:170px;margin:auto;background:white;display:grid;place-items:center;color:#324f5c}
.join-qr svg{width:100%;height:100%}
#lobby #join-setup p,#lobby #board-note,#lobby #leaderboard p{display:block!important}
#join-setup p{font:600 14px var(--body);overflow-wrap:anywhere;margin:10px 0}
.hotspot-settings{text-align:left;border:1px solid #52717c;padding:12px;border-radius:12px;margin:12px 0}
.hotspot-settings label{display:block;margin:8px 0}.hotspot-settings input,.hotspot-settings select{display:block;box-sizing:border-box;width:100%;padding:10px;font:16px var(--body);border-radius:8px;border:1px solid #567783;background:#f4f7f2;color:#173646}
.hotspot-settings small{display:block;line-height:1.4;margin-top:8px}
#leaderboard,#results-board{list-style:none;padding:0;max-height:500px;overflow:auto}
#leaderboard>li,#results-board>li{margin:8px 0}
#leaderboard details,#results-board details{border:1px solid #67838b;border-radius:12px;padding:12px;background:#123747;color:#fff8e8}
#leaderboard summary,#results-board summary{cursor:pointer;font-weight:800;line-height:1.6}
#leaderboard img,#results-board img{width:100%;max-height:320px;object-fit:contain;border-radius:8px;margin-top:12px}
#leaderboard p,#results-board p{font:500 14px var(--body);line-height:1.5}
#replay-dialog{width:min(1100px,90vw);background:#123747;color:#fff8e8;border:2px solid #ffc85c;border-radius:18px;padding:20px;max-height:90vh;overflow:auto}
#replay-dialog::backdrop{background:#00131ddd}#replay-video{width:100%;max-height:65vh}#download-replay{display:inline-block;margin-top:12px}
.replay-option{font:600 15px var(--body)}#replay-status{line-height:1.5}
@media(max-width:1000px){#lobby .lobby-card{grid-template-columns:1fr}#lobby .brand{display:none}#lobby .join{width:100%;box-sizing:border-box}}
@media(max-width:540px){.join-codes{grid-template-columns:1fr}.join-qr{width:210px}}

/* v29.1: large new-target orders, then a persistent compact reminder. */
#heel-order { --order-colour: #ffd65c; position: absolute; z-index: 12; bottom: 1rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: 94vw; padding: .55rem 1.4rem; border: 3px solid var(--order-colour); border-radius: 1.2rem; background: rgba(6,25,42,.96); text-align: center; box-shadow: 0 6px 24px #0005; pointer-events: none; }
#heel-order[data-side="port"] { --order-colour: #ff8490; }
#heel-order[data-side="starboard"] { --order-colour: #62efac; }
#heel-order strong { display: block; color: var(--order-colour); font: 800 clamp(24px,2.7vw,54px)/1.1 var(--display); }
#heel-order small { display: none; font-weight: 800; letter-spacing: .16em; }
#heel-order p { display: none; margin: .65rem 0 0; font-size: clamp(16px,1.6vw,30px); }
#heel-order.announce { bottom: auto; top: 1.2rem; width: min(820px, calc(100vw - 2 * min(23rem, 30vw))); padding: 1.1rem 1.8rem; border-width: 5px; }   /* v30.2: top centre, clear of the instrument card */
#heel-order.announce strong { font-size: clamp(32px,4.4vw,84px); }
#heel-order.announce small, #heel-order.announce p { display: block; }

/* ===== v30.3: the lobby always fits – the title never runs under the join panel, the QR codes never leave the screen ===== */
#lobby { overflow-y: auto; place-items: start center; }
#lobby .lobby-card { margin: auto 0; }                       /* centred when there's room, starts at the top when there isn't */
#lobby .brand { min-width: 0; container-type: inline-size; }
#lobby .lobby-logo { width: min(30rem, 100%) !important; }
#lobby h1 { font-size: clamp(2.4rem, 6.4vw, 7rem) !important; font-size: min(13.5cqi, 7rem) !important; white-space: nowrap; }
@media (max-height: 860px) {                                   /* laptops and projectors: QR codes and Start on one screen */
  #lobby { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
  #lobby .join { padding: 1rem 1.2rem; gap: .45rem; }
  #lobby .join-codes article { padding: 10px; }
  #lobby .join-codes h2 { font-size: 18px; margin-bottom: 6px; }
  #lobby .join-qr { width: min(100%, 165px); min-height: 0; }
  #lobby #join-setup p { margin: 4px 0; font-size: 13px; }
  #lobby .hotspot-settings { margin: 6px 0; padding: 8px; }
}

/* v31: video replays removed for now */
.replay-option, #watch-latest, #watch-result-replay, #replay-status { display: none !important; }

/* ===== v33: online rooms – a player's view ===== */
body.mirror #lobby, body.mirror #btn-reset, body.mirror #new-race, body.mirror #btn-certs { display: none !important; }
#room-panel { position: fixed; left: 1rem; top: 1rem; z-index: 60; width: min(22rem, 40vw); padding: .8rem 1rem; border-radius: .9rem;
  background: rgba(9,32,46,.92); color: #e8f3f8; font: 600 15px var(--body, system-ui); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
#room-panel .rp-head { font: 800 15px var(--display, system-ui); letter-spacing: .02em; margin-bottom: .5rem; }
#room-panel .rp-head b { color: #ffde59; letter-spacing: .12em; }
#room-panel input { width: 100%; box-sizing: border-box; margin: .25rem 0; padding: .5rem .6rem; border-radius: .5rem; border: 2px solid #ffde59; background: #fff7dd; color: #102838; font: 600 15px system-ui; }
#room-panel .btn { width: 100%; margin-top: .3rem; }
#room-panel .rp-keys { margin-top: .5rem; font-size: 13px; opacity: .8; }
#room-panel #rp-msg { margin-top: .4rem; font-size: 13px; color: #ffde59; min-height: 1em; }

/* v33.2: hosting a room in this browser */
#room-invite { margin: 0 0 .7rem; padding: .6rem .8rem; border-radius: .6rem; background: #ffde59; color: #102838; font: 600 14px system-ui; line-height: 1.4; }
#room-invite span { font-family: ui-monospace, monospace; font-weight: 700; word-break: break-all; }
#room-invite em { font-style: normal; font-weight: 800; }
