/* Sim 07 dressed as a test lab: graphite panels with a safety-yellow
   edge, a condensed engineering face (Barlow Condensed) for headings,
   Barlow for text, IBM Plex Mono for readings. Only this sim is restyled. */
:root {
  --bg: #0b1016;
  --panel: rgba(17, 23, 30, 0.94);
  --panel-2: #1a222c;
  --ink: #eef2f5;
  --muted: #a9b5c1;
  --dim: #7d8a97;
  --line: rgba(160, 180, 200, 0.18);
  --hazard: #f2c230;
  --hazard-lo: #b8901c;
  --data: #5fd3ea;
  --roll: #f2c230;
  --wave: #5fb4ff;
  --red: #ff5a4e;
  --ok: #7ee08f;
  --cyan: var(--data);
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --ui: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
body { background: var(--bg); color: var(--ink); font: 15px/1.4 var(--ui); }
#view::after { background: radial-gradient(130% 95% at 55% 45%, transparent 64%, rgba(3, 6, 10, 0.5) 100%); }

.glass, #intro {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--hazard);
  border-radius: 4px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
#intro { padding: 14px 16px 12px; pointer-events: auto; width: 350px; }
h2 { font: 600 13px/1 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hazard); margin: 12px 0 7px; }
h2::after { background: var(--line); }
.brand { color: var(--ink); font: 700 15px/1 var(--display); letter-spacing: 0.06em; }
.brand .ic { color: var(--hazard); }
.brand span { font: 400 12px var(--mono); color: var(--muted); }
.all-sims { font: 500 11px/1 var(--mono); color: var(--muted); border-radius: 3px; }
.eyebrow { font: 600 12.5px/1 var(--display); letter-spacing: 0.18em; color: var(--data); margin: 14px 0 4px; }
h1 {
  font: 700 40px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink);
  background: none; -webkit-background-clip: border-box; background-clip: border-box; filter: none; margin: 0 0 6px;
}
.lede { color: var(--muted); font: 400 14px/1.4 var(--ui); margin: 4px 0 10px; }
.chip { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: 3px; backdrop-filter: none; min-width: 0; flex: 1 1 0; padding: 6px 8px; }
.chip span { font: 600 11px/1 var(--display); letter-spacing: 0.1em; color: var(--dim); }
.chip b { font: 600 15px/1.15 var(--mono); color: var(--data); white-space: nowrap; }
#explain { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-left: 4px solid var(--hazard); border-radius: 3px; color: var(--ink); backdrop-filter: none; font-size: 14.5px; padding: 10px 12px; }
#explain b { color: var(--hazard); font-weight: 600; }
#explain .tag { font: 700 15px/1.1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--data); }
#explain .goal { margin: 8px 0 0; padding: 7px 0 0; border-top: 1px dashed var(--line); font-size: 14px; }
#explain .goal li { margin: 3px 0 3px 18px; list-style: none; position: relative; }
#explain .goal li::before { content: "○"; position: absolute; left: -17px; color: var(--dim); }
#explain .goal li.done { color: var(--ok); }
#explain .goal li.done::before { content: "●"; color: var(--ok); }
#explain .src { margin-top: 6px; font-size: 12.5px; color: var(--dim); }

/* controls */
#controls { width: 318px; }
.boats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.boats button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, 0.03);
  color: var(--ink); font: 600 15px/1.1 var(--display); letter-spacing: 0.03em; cursor: pointer; text-align: left;
}
.boats button small { font: 400 11.5px var(--mono); color: var(--muted); letter-spacing: 0; }
.boats button:last-child:nth-child(odd) { grid-column: 1 / -1; }
.boats button:hover { border-color: var(--hazard); }
.boats button.on { background: var(--hazard); border-color: var(--hazard); color: #15110a; }
.boats button.on small { color: #3b3220; }
.ctl label { font: 500 14px var(--ui); color: var(--ink); }
.ctl label small { color: var(--dim); font-size: 12.5px; }
.ctl output { font: 600 13.5px var(--mono); color: var(--data); }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--hazard) var(--p, 50%), #33404d var(--p, 50%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: #33404d; }
input[type="range"]::-moz-range-progress { height: 4px; background: var(--hazard); }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; border-radius: 2px; background: #f4f6f8; border: 2px solid var(--hazard); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 2px; background: #f4f6f8; border: 2px solid var(--hazard); }
.presets button, .seg button, .tog, .key {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); border-radius: 3px; color: var(--ink);
  font: 600 13.5px/1.15 var(--display); letter-spacing: 0.06em; text-transform: uppercase;
}
.seg button:hover, .tog:hover, .key:hover { border-color: var(--hazard); color: #fff; }
.seg button.on { background: var(--ink); color: #0b1016; border-color: var(--ink); }
.seg.four { display: grid; grid-template-columns: repeat(4, 1fr); }
.seg button { padding: 6px 2px; }
.toggles.two { grid-template-columns: repeat(2, 1fr); margin-top: 4px; }
.tog { padding: 6px 3px; font-size: 12.5px; color: var(--dim); }
.tog.on { color: var(--data); border-color: var(--data); background: rgba(95, 211, 234, 0.08); }
.key { min-width: 44px; height: 36px; padding: 0 12px; }
.key.wide { width: 100%; margin-top: 6px; }
.key.warn { background: repeating-linear-gradient(-45deg, rgba(242, 194, 48, 0.16) 0 10px, rgba(0, 0, 0, 0) 10px 20px); border-color: var(--hazard); color: var(--hazard); }
.key.warn:disabled { opacity: 0.5; cursor: default; }
.key.accent { background: var(--hazard); border-color: var(--hazard); color: #15110a; }
.key.accent:hover { color: #000; }
.key.on { background: var(--data); color: #06131a; border-color: var(--data); }
.hint { margin: 4px 0 2px; font-size: 12.5px; line-height: 1.35; color: var(--dim); }
.hint kbd { font: 500 11px var(--mono); padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
#wh-hint.bad { color: var(--hazard); }
.challenges { display: grid; grid-template-columns: 1fr; gap: 4px; }
.challenges button { display: flex; gap: 8px; align-items: baseline; text-align: left; padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, 0.03); color: var(--ink); font: 600 14.5px/1.15 var(--display); letter-spacing: 0.03em; cursor: pointer; }
.challenges button i { font: 600 12px var(--mono); font-style: normal; color: var(--hazard); flex: none; width: 14px; }
.challenges button small { display: block; font: 400 12.5px/1.25 var(--ui); color: var(--muted); letter-spacing: 0; margin-top: 1px; }
.challenges button:hover { border-color: var(--hazard); }
.challenges button.on { border-color: var(--hazard); background: rgba(242, 194, 48, 0.12); }
.challenges button.won i::before { content: "✓"; color: var(--ok); }
.challenges button.won i span { display: none; }

/* the deck: instruments */
#deck { padding: 8px 12px 8px 14px; gap: 12px; }
.gauge { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 0; }
.dial { width: 104px; height: 68px; flex: none; }
.compass { width: 64px; height: 64px; flex: none; }
.trace { width: 150px; height: 58px; flex: none; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 3px; }
.gauge-foot { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gauge-foot b { font: 600 15px/1.1 var(--mono); color: var(--ink); white-space: nowrap; }
.gauge-foot span { font: 400 13px/1.25 var(--ui); color: var(--muted); }
.gauge-foot b.bad { color: var(--red); }
.gauge-foot b.warn { color: var(--hazard); }
.transport { border-left: 1px solid var(--line); flex-direction: column; }
#foot { color: var(--muted); }

/* the event flash over the scene */
#flash { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#flash div { font: 700 22px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: #15110a; background: var(--hazard); padding: 7px 14px; border-radius: 3px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); animation: pop 2.6s ease-out forwards; white-space: nowrap; }
#flash div small { font: 600 14px var(--mono); letter-spacing: 0; margin-left: 8px; }
#flash div.bad { background: var(--red); color: #fff; }
#flash div.ok { background: var(--ok); color: #06200b; }
#flash div.info { background: rgba(17, 23, 30, 0.92); color: var(--data); border: 1px solid var(--data); }
@keyframes pop { 0% { opacity: 0; transform: translateY(-8px) scale(1.08); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 600 18px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
#loading[hidden] { display: none; }

/* on-screen driving: a throttle lever and two steering pads */
#drive { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--deck-h, 90px) + 32px); z-index: 2; display: flex; align-items: center; gap: 10px; background: rgba(17, 23, 30, 0.86); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
#drive .pad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 62px; height: 54px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255, 255, 255, 0.05); color: var(--ink); font-size: 18px; line-height: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
#drive .pad small { font: 600 10.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#drive .pad.on { background: var(--hazard); color: #15110a; border-color: var(--hazard); }
#drive .pad.on small { color: #15110a; }
#drive .lever { display: flex; flex-direction: column; width: 200px; }
#drive .lever-head { display: flex; justify-content: space-between; align-items: baseline; }
#drive .lever-head span { font: 600 11.5px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
#drive .lever-head b { font: 600 12px/1 var(--mono); color: var(--hazard); }
#drive .lever-track { position: relative; }
#drive .lever input { width: 100%; position: relative; z-index: 1; }
#drive .lever input::-webkit-slider-runnable-track { background: linear-gradient(90deg, #33404d var(--a, 33.3%), var(--hazard) var(--a, 33.3%), var(--hazard) var(--b, 33.3%), #33404d var(--b, 33.3%)); }
#drive .lever input::-moz-range-track { background: linear-gradient(90deg, #33404d var(--a, 33.3%), var(--hazard) var(--a, 33.3%), var(--hazard) var(--b, 33.3%), #33404d var(--b, 33.3%)); }
#drive .lever input::-moz-range-progress { background: transparent; }
/* the stop position: 0 on a -50…100 scale, a third of the way along (the thumb is 16 px wide) */
#drive .stop-tick { position: absolute; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; left: calc(8px + (100% - 16px) / 3); background: var(--ink); opacity: 0.7; }
#drive .lever-scale { position: relative; height: 12px; font: 500 10px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
#drive .lever-scale span { position: absolute; top: 0; }
#drive .lever-scale span:first-child { left: 0; }
#drive .lever-scale span:last-child { right: 0; }
#drive .lever-scale .stop { left: calc(8px + (100% - 16px) / 3); transform: translateX(-50%); color: var(--muted); }

/* 3D labels */
.tag3d { font: 600 12.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: rgba(11, 16, 22, 0.82); border: 1px solid var(--line); border-radius: 3px; padding: 4px 8px; }
.tag3d::before { background: var(--hazard); box-shadow: none; }
.tag3d.boat { color: #15110a; background: var(--hazard); border-color: var(--hazard); }
.tag3d.boat::before { display: none; }
#labels { z-index: 0; }
body.shot #flash, body.shot #drive, body.shot #explain, body.shot #loading { display: none; }

@media (max-width: 1360px) {
  #intro { width: 320px; }
  h1 { font-size: 34px; }
  .chip b { font-size: 13.5px; }
  .dial { width: 88px; height: 58px; }
  .trace { width: 120px; }
  .gauge-foot b { font-size: 14px; }
  .gauge-foot span { font-size: 12px; }
}
@media (min-width: 901px) and (max-height: 820px) {
  .lede { display: none; }
  #controls { padding: 10px 14px; }
  #controls h2 { margin: 8px 0 6px; }
  #controls h2:first-child { margin-top: 0; }
  .challenges button small { display: none; }
  #explain { font-size: 13.5px; }
}
@media (max-width: 900px) {
  #intro { width: auto; }
  #controls { width: auto; }
  #drive { bottom: 10px; }
  .gauge { flex: 1 1 150px; }
  .dial { width: 80px; height: 52px; }
  .trace { width: 120px; }
  .transport { flex-direction: row; }
  #flash div { font-size: 17px; }
}
