/* Master Brewer Prague: dark brewhouse-HMI glass console over full-bleed Unreal renders.
   Brand: navy #1F3A4A, gold #C8A96A; copper #E0915F for actions. */
:root {
  --night: #0b110f; --glass: rgba(12, 19, 17, 0.84); --glass-2: rgba(20, 30, 27, 0.72); --line: rgba(222, 232, 226, 0.14); --line-2: rgba(222, 232, 226, 0.26);
  --ink: #eef2ef; --muted: #a3b1a9; --faint: #6f7d76;
  --copper: #ed8b3a; --copper-hi: #f6a860; --copper-deep: #c0641f; --gold: #d4a94e; --navy: #1f3a4a;
  --ok: #6fd39a; --warn: #f0c35a; --bad: #ff7a6b; --hop: #9fd06a; --cold: #7fc0f0;
  --display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif; --body: "IBM Plex Sans", system-ui, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 12px; --r-s: 8px; --gap: 14px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: var(--ink); font: 400 15px/1.45 var(--body); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
h1, h2, h3 { margin: 0; }
small { color: var(--muted); }

/* ---------------------------------------------------------------- stage and backdrop */
#stage { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
#scene { position: absolute; inset: -3%; will-change: transform; transform-origin: 60% 50%; }
.bgl { position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat; opacity: 0; transition: opacity 1.2s var(--ease); }
.bgl.on { opacity: 1; }
#vapour { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,10,9,.62) 0%, rgba(6,10,9,0) 18%, rgba(6,10,9,0) 60%, rgba(6,10,9,.55) 100%),
              linear-gradient(90deg, rgba(6,10,9,0) 45%, rgba(6,10,9,.45) 100%); }
#stage:not(.playing) #shade { background: radial-gradient(120% 90% at 30% 50%, rgba(6,10,9,.35) 0%, rgba(6,10,9,.85) 100%); }

/* ---------------------------------------------------------------- top bar */
#top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px;
  padding: calc(10px + var(--sat)) max(16px, var(--sar)) 0 max(16px, var(--sal)); opacity: 0; transform: translateY(-8px); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
#stage.playing #top { opacity: 1; transform: none; pointer-events: auto; }
.logo { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); flex: none; }
#rail { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex: 1; min-width: 0; }
#rail li { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; border-radius: 8px; position: relative; color: var(--muted); font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
#rail li::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.16); transition: background .4s; }
#rail li i { font-style: normal; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 11px; flex: none; }
#rail li span { overflow: hidden; text-overflow: ellipsis; }
#rail li.done { color: var(--ink); } #rail li.done::after { background: var(--ok); } #rail li.done i { background: var(--ok); color: #0b110f; border-color: var(--ok); }
#rail li.now { color: var(--ink); background: var(--glass-2); } #rail li.now::after { background: linear-gradient(90deg, var(--copper), var(--gold)); } #rail li.now i { border-color: var(--copper); color: var(--copper); }
#clock, .chipbtn { font: 500 13px var(--mono); color: var(--ink); background: var(--glass); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; white-space: nowrap; font-variant-numeric: tabular-nums; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chipbtn { cursor: pointer; } .chipbtn:hover { border-color: var(--gold); }
#codex-count { color: var(--gold); margin-left: 4px; }

/* ---------------------------------------------------------------- the panel */
#panel { position: absolute; z-index: 4; display: flex; flex-direction: column; overflow: hidden;
  right: max(16px, var(--sar)); top: calc(70px + var(--sat)); bottom: calc(16px + var(--sab)); width: min(470px, 44vw);
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .45s var(--ease), opacity .45s var(--ease); }
#stage:not(.playing) #panel { opacity: 0; transform: translateX(30px); pointer-events: none; }
#panel.out { opacity: 0; transform: translateX(24px) scale(.985); }
#panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), var(--copper), transparent); opacity: .7; }
#grab { display: none; }
#ph { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
#eyebrow { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
#title { font: 700 32px/1 var(--display); letter-spacing: .01em; margin: 6px 0 6px; text-wrap: balance; }
#sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0; }
#goal { margin: 10px 0 0; font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; background: rgba(200,169,106,.08); border: 1px solid rgba(200,169,106,.22); }
#goal:empty { display: none; }
#goal b { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-right: 6px; }
#pb { padding: 14px 20px 18px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--gap); flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
#pf { padding: 12px 20px calc(12px + var(--sab)); border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: center; background: rgba(0,0,0,.18); }
.tip { flex: 1; min-width: 0; display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tip img { width: 22px; height: 22px; object-fit: contain; flex: none; margin-top: -1px; opacity: .9; }
.tip.ok span { color: #c5efd6; } .tip.warn span { color: #f6dc9c; } .tip.bad span { color: #ffc0b6; }
.tip.flash { animation: tipflash .7s var(--ease); }
@keyframes tipflash { from { transform: translateY(4px); opacity: .2; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- buttons */
button { cursor: pointer; }
#next, .primary { font: 600 15px var(--body); color: #1a0f08; background: linear-gradient(180deg, var(--copper-hi), var(--copper)); border: 0; border-radius: 9px; padding: 12px 18px; white-space: nowrap; min-height: 46px;
  box-shadow: 0 4px 14px rgba(224,145,95,.25), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .15s, filter .2s, box-shadow .3s; }
#next:hover, .primary:hover { filter: brightness(1.06); }
#next:active, .primary:active { transform: translateY(1px); }
#next { background: linear-gradient(180deg, #4b5550, #39423e); color: var(--ink); box-shadow: none; }
#next.ready { background: linear-gradient(180deg, var(--copper-hi), var(--copper)); color: #1a0f08; box-shadow: 0 0 0 0 rgba(224,145,95,.6); animation: ready 2s infinite; }
@keyframes ready { 0% { box-shadow: 0 0 0 0 rgba(224,145,95,.55); } 70% { box-shadow: 0 0 0 12px rgba(224,145,95,0); } 100% { box-shadow: 0 0 0 0 rgba(224,145,95,0); } }
#next.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.ghost { font: 500 14px var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 14px; min-height: 44px; }
.ghost:hover { border-color: var(--gold); }
.ghost.small { padding: 8px 12px; font-size: 13.5px; min-height: 40px; }
.primary-ghost { font: 600 14px var(--body); color: var(--ink); background: rgba(224,145,95,.12); border: 1px solid rgba(224,145,95,.55); border-radius: 9px; padding: 10px 14px; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s; }
.primary-ghost:hover:not(:disabled) { background: rgba(224,145,95,.24); }
.primary-ghost.pulse { background: rgba(159,208,106,.2); border-color: var(--hop); animation: hoppulse 1s infinite alternate; }
@keyframes hoppulse { to { box-shadow: 0 0 18px rgba(159,208,106,.45); } }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, [role=slider]:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.kb { font: 500 10.5px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; line-height: 16px; display: inline-block; background: rgba(0,0,0,.25); }
@media (pointer: coarse) { .kb { display: none !important; } }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* hold buttons */
.hold { position: relative; display: flex; align-items: center; gap: 10px; text-align: left; color: var(--ink); background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; min-height: 52px; touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .1s, border-color .2s, background .2s; flex: 1; min-width: 0; }
.hold .hold-ring { width: 28px; height: 28px; border-radius: 50%; flex: none; background: conic-gradient(var(--copper) calc(var(--p, 0) * 360deg), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px); mask: radial-gradient(circle, transparent 9px, #000 10px); }
.hold .hold-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.hold .hold-txt b { font: 600 15px var(--body); } .hold .hold-txt small { font-size: 11.5px; }
.hold .kb { margin-left: auto; }
.hold.held { transform: scale(.98); border-color: var(--copper); background: rgba(224,145,95,.18); box-shadow: 0 0 22px rgba(224,145,95,.25) inset; }
.hold.held .hold-ring { background: conic-gradient(var(--copper) 360deg, transparent 0); animation: spin 1s linear infinite; }
.hold.big { min-height: 58px; }
.hold.ff { min-height: 44px; } .hold.ff .hold-ring { width: 22px; height: 22px; -webkit-mask: radial-gradient(circle, transparent 7px, #000 8px); mask: radial-gradient(circle, transparent 7px, #000 8px); }
.hold.ff.held { border-color: var(--gold); background: rgba(200,169,106,.16); }
@keyframes spin { to { transform: rotate(360deg); } }

/* switch */
.switch { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--ink); padding: 6px 0; min-height: 40px; text-align: left; font-size: 13.5px; }
.sw-track { width: 42px; height: 24px; border-radius: 12px; background: rgba(255,255,255,.14); position: relative; flex: none; transition: background .25s; border: 1px solid var(--line-2); }
.sw-dot { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #dfe6e2; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.switch.on .sw-track { background: var(--ok); border-color: var(--ok); } .switch.on .sw-dot { transform: translateX(18px); }
.switch .kb { margin-left: auto; }

/* lever: native range dressed as a brass lever in a slot */
.lever { display: grid; gap: 6px; }
.lever.off { opacity: .45; }
.lever-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.lever-head .lever-val { margin-left: auto; color: var(--ink); font: 600 17px var(--display); font-variant-numeric: tabular-nums; }
.lever-track { position: relative; height: 40px; --k: 0; }
.lever-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; background: #0a0f0d; box-shadow: inset 0 2px 4px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.06); }
.lever-track::after { content: ""; position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; width: calc(var(--k) * 100%); background: linear-gradient(90deg, var(--copper-deep), var(--copper)); pointer-events: none; }
.lever-band { position: absolute; top: 50%; height: 18px; margin-top: -9px; border-radius: 4px; background: rgba(111,211,154,.14); border: 1px dashed rgba(111,211,154,.55); pointer-events: none; }
.lever input[type=range] { -webkit-appearance: none; appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; cursor: grab; touch-action: pan-y; z-index: 1; }
.lever input[type=range]:active { cursor: grabbing; }
.lever input[type=range]::-webkit-slider-runnable-track { height: 40px; background: transparent; }
.lever input[type=range]::-moz-range-track { height: 40px; background: transparent; }
.lever input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 40px; border-radius: 7px; border: 1px solid #6b5326;
  background: linear-gradient(90deg, #8b6b32, #e4c98f 45%, #b48d4a 55%, #7c5e2a); box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.5); }
.lever input[type=range]::-moz-range-thumb { width: 24px; height: 38px; border-radius: 7px; border: 1px solid #6b5326; background: linear-gradient(90deg, #8b6b32, #e4c98f 45%, #b48d4a 55%, #7c5e2a); box-shadow: 0 3px 8px rgba(0,0,0,.6); }
.lever input[type=range]:focus-visible { outline: none; }
.lever input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--gold); outline-offset: 2px; }

/* handwheel */
.wheel { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 128px; }
.wheel.off { opacity: .45; }
.wheel-dial { position: relative; width: 112px; height: 112px; border-radius: 50%; cursor: grab; touch-action: none; user-select: none; }
.wheel-dial.grab { cursor: grabbing; }
.wheel-dial svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.wheel-dial .rot { transition: transform .06s linear; }
.wheel-dial .rim { fill: none; stroke-width: 8; }
.wheel-dial .spk line { stroke: #2a3330; stroke-width: 5; stroke-linecap: round; }
.wheel-dial .hub { fill: #c8a96a; stroke: #6b5326; stroke-width: 1.5; }
.wheel-dial .knob { fill: #e0915f; stroke: #6b3a20; stroke-width: 1; }
.wheel-arc { position: absolute; inset: 0; border-radius: 50%; --k: 0; background: conic-gradient(from 225deg, var(--copper) calc(var(--k) * 270deg), rgba(255,255,255,.1) 0 270deg, transparent 0); -webkit-mask: radial-gradient(circle, transparent 52px, #000 53px); mask: radial-gradient(circle, transparent 52px, #000 53px); }
.wheel-dial:focus-visible { outline-offset: 0; }
.wheel-cap { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.2; }
.wheel-cap b { color: var(--ink); font: 600 17px var(--display); font-variant-numeric: tabular-nums; }

.ctl-row { display: flex; gap: 12px; align-items: stretch; }
.ctl-col { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; justify-content: center; }

/* ---------------------------------------------------------------- readouts, gauges, mimic */
.read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.read.stack { grid-template-columns: 1fr; gap: 6px; flex: 1; min-width: 0; }
.read.stack.two { grid-template-columns: 1fr 1fr; }
.cell { border: 1px solid var(--line); border-radius: var(--r-s); padding: 7px 10px; min-width: 0; background: rgba(0,0,0,.18); transition: border-color .3s; }
.cell .k { font: 500 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .v { font: 600 22px/1.1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .v small { font-size: 13px; font-weight: 500; }
.cell[data-state=ok] { border-color: rgba(111,211,154,.5); } .cell[data-state=ok] .v { color: #c5efd6; }
.cell[data-state=warn] { border-color: rgba(240,195,90,.5); } .cell[data-state=warn] .v { color: #f6dc9c; }
.cell[data-state=bad] { border-color: rgba(255,122,107,.6); } .cell[data-state=bad] .v { color: #ffc0b6; }
.gauges { display: flex; gap: 10px; align-items: stretch; }
canvas.gauge { width: 118px; height: 106px; flex: none; display: block; }
canvas.mimic { width: 100%; height: 190px; display: block; border-radius: var(--r-s); border: 1px solid var(--line); background: #0b110f; flex: none; }
canvas.mimic.tall { height: 230px; }
canvas.mimic.pour { height: 290px; }
canvas.chart { width: 100%; height: 120px; display: block; border-radius: var(--r-s); border: 1px solid var(--line); flex: none; }

.meter { position: relative; height: 12px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--copper-deep), var(--copper)); transition: width .15s linear; }
.meter.big { height: 26px; border-radius: 8px; }
.meter.big > span { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 10px; font: 500 12px var(--mono); color: var(--ink); text-shadow: 0 1px 2px #000; }
.meter.target > u { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); }

.sieve { display: grid; gap: 5px; }
.sv { display: grid; grid-template-columns: 96px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.sv i { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.sv i b { display: block; height: 100%; background: linear-gradient(90deg, #a8864a, #e6cf9a); transition: width .3s var(--ease); }
.sv em { font: 500 11px var(--mono); font-style: normal; text-align: right; color: var(--ink); }

.rests { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 500 11px var(--mono); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(111,211,154,.45); background: rgba(111,211,154,.08); }
.pill.warn { color: var(--warn); border-color: rgba(240,195,90,.45); background: rgba(240,195,90,.06); }
.pill.bad { color: var(--bad); border-color: rgba(255,122,107,.45); background: rgba(255,122,107,.06); }

.note { font-size: 13px; line-height: 1.5; margin: 0; border-left: 3px solid var(--gold); padding: 2px 0 2px 10px; display: flex; gap: 8px; align-items: flex-start; }
.note.ok { border-color: var(--ok); } .note.bad { border-color: var(--bad); }
.note:empty { display: none; }
.drop { width: 16px; height: 16px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); flex: none; margin-top: 2px; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }

.hoplog { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; display: grid; gap: 4px; font-size: 13px; }
.hl-h { font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--hop); }
.hl-r { display: flex; gap: 8px; align-items: center; } .hl-r b { font-family: var(--mono); color: var(--hop); } .hl-r .pill { margin-left: auto; }
.phasebox { display: flex; flex-direction: column; gap: 12px; }

details.why { border: 1px solid var(--line); border-radius: var(--r-s); background: rgba(31,58,74,.22); }
details.why summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; gap: 8px; align-items: baseline; }
details.why summary::-webkit-details-marker { display: none; }
details.why summary b { font: 600 15px var(--display); letter-spacing: .03em; text-transform: uppercase; color: var(--gold); }
details.why summary span { font-size: 12px; color: var(--muted); }
details.why summary::after { content: "+"; margin-left: auto; color: var(--gold); font: 500 16px var(--mono); }
details.why[open] summary::after { content: "–"; }
details.why p, details.why ul { margin: 0 12px 10px; font-size: 13px; line-height: 1.55; color: #d6dfda; }
details.why ul { padding-left: 18px; } details.why li { margin-bottom: 6px; }
.goal-l b { font: 600 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-right: 4px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { font: 600 13px var(--body); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; min-height: 38px; }
.tab.on { color: #1a0f08; background: var(--gold); border-color: var(--gold); }

/* ---------------------------------------------------------------- results */
.card { border: 1px solid var(--line); border-radius: var(--r-s); padding: 14px; display: grid; gap: 10px; background: rgba(0,0,0,.16); }
.stars { font: 700 44px/1 var(--display); letter-spacing: 6px; display: flex; gap: 2px; }
.stars span { color: rgba(255,255,255,.14); }
.stars span.on { color: var(--gold); text-shadow: 0 0 16px rgba(200,169,106,.5); animation: star .6s var(--ease) both; }
@keyframes star { from { transform: scale(.2) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } to { transform: none; } }
.spec { display: grid; grid-template-columns: auto 1fr auto; gap: 7px 12px; font-size: 14px; align-items: baseline; }
.spec .t { color: var(--muted); font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.spec small { font-size: 11.5px; margin-left: 4px; }
.share-line { margin: 0; font: 13px/1.5 var(--mono); color: #d6dfda; padding: 10px; border-radius: 8px; background: rgba(0,0,0,.3); border: 1px dashed var(--line-2); user-select: all; -webkit-user-select: all; }
.cta-card { grid-template-columns: 64px 1fr; align-items: center; background: linear-gradient(135deg, rgba(31,58,74,.75), rgba(31,58,74,.35)); border-color: rgba(200,169,106,.45); }
.cta-card img { width: 64px; height: 64px; object-fit: contain; }
.cta-card b { font: 700 20px var(--display); letter-spacing: .02em; }
.cta-card p { margin: 4px 0 10px; font-size: 13.5px; color: #d6dfda; }
a.cta { display: inline-block; text-decoration: none; font: 600 15px var(--body); color: #1a0f08; background: linear-gradient(180deg, #ddc189, var(--gold)); border-radius: 9px; padding: 11px 16px; min-height: 44px; box-shadow: 0 4px 16px rgba(200,169,106,.3); }
a.cta:hover { filter: brightness(1.07); }

/* ---------------------------------------------------------------- curtain (station transition) */
#curtain { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease); background: radial-gradient(60% 50% at 50% 50%, rgba(6,10,9,.55), rgba(6,10,9,.0)); }
#curtain > div { display: flex; flex-direction: column; align-items: center; gap: 4px; transform: translateY(14px); transition: transform .6s var(--ease); text-align: center; padding: 0 16px; }
#curtain.in { opacity: 1; } #curtain.in > div { transform: none; }
.c-num { font: 600 12px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.c-cz { font: 700 clamp(44px, 9vw, 96px)/.95 var(--display); letter-spacing: .01em; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.c-en { font: 500 15px var(--body); color: var(--muted); }

/* ---------------------------------------------------------------- title screen */
#title-screen { position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; padding: calc(24px + var(--sat)) max(16px, var(--sar)) calc(24px + var(--sab)) max(16px, var(--sal)); overflow-y: auto; transition: opacity .6s var(--ease), transform .6s var(--ease); }
#title-screen.out { opacity: 0; transform: scale(1.02); }
#title-screen[hidden] { display: none; }
.ts-inner { width: min(640px, 100%); margin-left: clamp(0px, 6vw, 110px); display: flex; flex-direction: column; gap: 16px; animation: tsin 1.1s var(--ease) both; }
@keyframes tsin { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.ts-logo { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.6)); }
.ts-kicker { margin: 0; font: 600 12px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.ts-title { font: 700 clamp(56px, 11vw, 112px)/.86 var(--display); letter-spacing: -.005em; text-shadow: 0 8px 40px rgba(0,0,0,.55); }
.ts-title span { display: block; color: transparent; background: linear-gradient(180deg, #f2d9a6, var(--gold) 50%, var(--copper)); -webkit-background-clip: text; background-clip: text; }
.ts-lede { margin: 0; font-size: 16px; line-height: 1.55; color: #dfe6e2; max-width: 52ch; }
.ts-order { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-order div { border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 11px; background: rgba(12,19,17,.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ts-order span { display: block; font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ts-order b { font: 600 18px var(--display); }
.ts-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ts-actions .primary { font-size: 17px; padding: 14px 22px; min-height: 52px; display: flex; gap: 10px; align-items: center; }
.ts-actions .primary .kb { color: #4a2a14; border-color: rgba(26,15,8,.35); background: rgba(255,255,255,.2); }
.ts-actions .ghost { background: rgba(12,19,17,.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-height: 52px; }
.ts-best { margin: 0; font: 500 13px var(--mono); color: var(--gold); } .ts-best:empty { display: none; }
.ts-foot { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- codex */
#codex { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: calc(16px + var(--sat)) max(12px, var(--sar)) calc(16px + var(--sab)) max(12px, var(--sal)); background: rgba(4,7,6,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
#codex.in { opacity: 1; }
#codex[hidden] { display: none; }
.codex-box { width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; background: rgba(12,19,17,.96); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); transform: translateY(10px); transition: transform .3s var(--ease); }
#codex.in .codex-box { transform: none; }
.codex-box > header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.codex-box h2 { font: 700 26px var(--display); color: var(--gold); letter-spacing: .02em; }
.codex-box header .tabs { flex: 1; }
#codex-body { overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.codex-top { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.codex-top p { margin: 0; font-size: 13px; color: var(--muted); max-width: 52ch; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 62px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), var(--copper-deep)); opacity: .4; }
.tl { display: grid; grid-template-columns: 54px 1fr; gap: 18px; position: relative; scroll-margin: 60px; }
.tl-y { font: 700 20px/1.2 var(--display); color: var(--gold); text-align: right; padding-top: 10px; }
.tl::after { content: ""; position: absolute; left: 58px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(12,19,17,1); }
.tl-c { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: rgba(255,255,255,.025); }
.tl-c h3 { font: 700 20px/1.15 var(--display); letter-spacing: .01em; }
.tl-p { font: 500 11.5px var(--mono); color: var(--copper); margin: 3px 0 6px; }
.tl-c p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; color: #d6dfda; }
.tl-n { font-size: 12.5px !important; color: var(--warn) !important; } .tl-n b { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; margin-right: 4px; }
.tl-s { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tl-s a { color: var(--cold); text-decoration: none; } .tl-s a:hover { text-decoration: underline; }
.tl.locked .tl-c { border-style: dashed; opacity: .55; } .tl.locked .tl-y { color: var(--faint); } .tl.locked::after { background: var(--faint); }
.tl.focus .tl-c { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,169,106,.18); animation: focuscard 1.4s var(--ease); }
@keyframes focuscard { from { transform: translateX(10px); } to { transform: none; } }
.gloss { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; margin: 0; }
.gloss dt { font: 600 18px var(--display); color: var(--gold); } .gloss dd { margin: 0; font-size: 14px; color: #d6dfda; align-self: center; }
.keys-help h3 { font: 700 18px var(--display); color: var(--gold); margin: 8px 0 4px; }
.keys-help p, .keys-help li { font-size: 13.5px; color: #d6dfda; } .keys-help ul { padding-left: 18px; margin: 4px 0; } .keys-help kbd { font: 500 12px var(--mono); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }

/* ---------------------------------------------------------------- toasts and award cards */
#toasts { position: absolute; z-index: 10; left: max(16px, var(--sal)); top: calc(76px + var(--sat)); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; max-width: min(380px, calc(100vw - 32px)); }
.toast { pointer-events: auto; font: 600 14px var(--body); padding: 10px 14px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transform: translateX(-16px); transition: opacity .35s var(--ease), transform .35s var(--ease); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.in { opacity: 1; transform: none; }
.toast.bad { border-color: rgba(255,122,107,.6); color: #ffd0c8; }
.award { pointer-events: auto; text-align: left; color: var(--ink); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 12px; align-items: center; padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(200,169,106,.7); background: linear-gradient(135deg, rgba(31,58,74,.95), rgba(12,19,17,.95)); box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(200,169,106,.2) inset; opacity: 0; transform: perspective(600px) rotateY(-70deg); transform-origin: left center; transition: opacity .5s, transform .7s var(--ease); cursor: pointer; }
.award.in { opacity: 1; transform: none; }
.award-k { grid-column: 1 / -1; font: 600 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.award-y { font: 700 30px/1 var(--display); color: var(--gold); }
.award-t { font: 600 16px/1.2 var(--display); letter-spacing: .01em; }

/* ---------------------------------------------------------------- phone: panel docks at the bottom */
@media (max-width: 760px) {
  body { font-size: 14px; }
  #top { gap: 8px; padding-top: calc(8px + var(--sat)); }
  .logo { width: 36px; height: 36px; }
  #rail { gap: 3px; }
  #rail li { padding: 0; height: 22px; }
  #rail li i, #rail li span { display: none; }
  #rail li::after { left: 0; right: 0; bottom: 9px; }
  #rail li.now { background: none; }
  #clock { font-size: 11.5px; padding: 6px 7px; }
  .chipbtn { font-size: 11.5px; padding: 6px 8px; }
  #panel { left: max(8px, var(--sal)); right: max(8px, var(--sar)); width: auto; top: auto; bottom: 0; max-height: 64%; max-height: 64dvh; border-radius: 16px 16px 0 0; border-bottom: 0; }
  #stage:not(.playing) #panel { transform: translateY(30px); }
  #panel.out { transform: translateY(24px); }
  #grab { display: flex; justify-content: center; align-items: center; width: 100%; height: 22px; background: none; border: 0; padding: 0; flex: none; }
  #grab i { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); }
  #ph { padding: 2px 16px 10px; }
  #title { font-size: 26px; }
  #sub { display: none; }
  #eyebrow { font-size: 10px; }
  #goal { font-size: 12.5px; margin-top: 8px; padding: 6px 9px; }
  #pb { padding: 12px 14px 16px; }
  #pf { padding: 10px 14px calc(10px + var(--sab)); }
  #next { padding: 11px 14px; font-size: 14px; }
  #panel.collapsed #pb, #panel.collapsed #sub, #panel.collapsed #goal { display: none; }
  .tip img { display: none; }
  .wheel { width: 112px; } .wheel-dial { width: 100px; height: 100px; } .wheel-arc { -webkit-mask: radial-gradient(circle, transparent 46px, #000 47px); mask: radial-gradient(circle, transparent 46px, #000 47px); }
  canvas.gauge { width: 100px; height: 92px; }
  .cell .v { font-size: 19px; }
  canvas.mimic.tall { height: 200px; }
  #toasts { top: calc(56px + var(--sat)); }
  .ts-inner { margin: auto; gap: 12px; }
  .ts-logo { width: 76px; height: 76px; }
  .ts-lede { font-size: 15px; }
  #stage:not(.playing) #shade { background: linear-gradient(180deg, rgba(6,10,9,.6), rgba(6,10,9,.88)); }
  .tl { grid-template-columns: 44px 1fr; gap: 14px; } .timeline::before { left: 50px; } .tl::after { left: 46px; } .tl-y { font-size: 17px; }
  .gauges { flex-wrap: wrap; }
  .gauges .read.stack.two { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .read { grid-template-columns: 1fr 1fr; }
  .ctl-row { flex-wrap: wrap; }
}
@media (max-height: 520px) and (min-width: 761px) { #title { font-size: 26px; } canvas.mimic.tall { height: 180px; } }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .bgl { transition: opacity .2s linear !important; }
}

/* ---------------------------------------------------------------- idle guidance coach (guide.js) */
.guide-glow{
  outline:2px solid #ed8b3a !important;
  outline-offset:3px;
  border-radius:12px;
  animation:guideGlow 1.4s ease-in-out infinite;
}
@keyframes guideGlow{
  0%,100%{ box-shadow:0 0 0 0 rgba(237,139,58,0); }
  50%{ box-shadow:0 0 16px 4px rgba(237,139,58,.6); }
}
.guide-bubble{
  position:fixed; left:50%; bottom:92px; transform:translateX(-50%) translateY(10px);
  max-width:min(92vw,430px);
  background:#1c1410; color:#fff;
  border:1px solid rgba(237,139,58,.55); border-radius:12px;
  padding:10px 14px; font:600 13px/1.35 "IBM Plex Sans",system-ui,sans-serif;
  text-align:center; box-shadow:0 12px 34px rgba(0,0,0,.45);
  opacity:0; pointer-events:none; z-index:60;
  transition:opacity .3s ease, transform .3s ease;
}
.guide-bubble.in{ opacity:1; transform:translateX(-50%) translateY(0); }
.guide-bubble::before{ content:"\1F4A1  "; }
@media (prefers-reduced-motion: reduce){
  .guide-glow{ animation:none; box-shadow:0 0 14px 3px rgba(237,139,58,.55); }
  .guide-bubble{ transition:none; }
}
