/* iZombie interface.
   Field-signal-station vocabulary: olive enamel plates, buff dispatch paper, signal-lamp amber.
   Type: Anton (stencil-poster display) + Roboto (variable width, condensed for labels). */

:root {
  --night: #0a0d10;
  --coat: #343b2e;
  --coat-dark: #23281f;
  --paper: #d9cfb3;
  --paper-shade: #c4b792;
  --ink: #1d1b17;
  --ink-soft: #55503f;
  --lamp: #f2a93b;
  --red: #c9392e;
  --arc: #7fd4e6;
  --bone: #ece6d6;
  --bone-dim: #a9a595;
  --display: 'Anton', Impact, 'Haettenschweiler', 'Arial Narrow Bold', sans-serif;
  --body: 'Roboto', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: clamp(11px, 1.7vh, 24px); }
html, body { margin: 0; height: 100%; background: #000; color: var(--bone); font-family: var(--body); overflow: hidden; user-select: none; -webkit-user-select: none; }
body.playing, body.playing #gl { cursor: none; }
canvas#gl, canvas#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#overlay { pointer-events: none; z-index: 2; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* The highlight for keyboard and controller is the game's own cursor (.cur, shown while #ui has .nav), so it
   does not depend on when a browser thinks focus should be visible. */
#ui:not(.nav) :focus, #ui :focus:not(.cur) { outline: none; }
.nav .cur { outline: 2px solid var(--lamp); outline-offset: 3px; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; }
kbd { font-family: var(--body); font-stretch: 80%; font-weight: 700; font-size: 0.72rem; padding: 0.08em 0.42em; border: 1px solid currentColor; border-radius: 3px; opacity: 0.85; }

/* ------------------------------------------------------------------ materials */
.plate {
  background: linear-gradient(180deg, #3a4233 0%, #2b3126 100%);
  border: 1px solid #0c0e0a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -1px 0 rgba(0, 0, 0, 0.5), 0 0.25rem 0.9rem rgba(0, 0, 0, 0.55);
  border-radius: 3px;
}
.paper {
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(60, 45, 20, 0.045) 0 1px, transparent 1px 4px),
    radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(90, 60, 20, 0.18), transparent 60%);
  box-shadow: 0 0.5rem 1.6rem rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.stamp {
  display: inline-block; font-family: var(--display); letter-spacing: 0.04em; color: var(--red);
  border: 0.2em double var(--red); padding: 0.05em 0.4em 0.1em; transform: rotate(-7deg); opacity: 0.86; mix-blend-mode: multiply;
}

/* ------------------------------------------------------------------ HUD */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.hud > div { position: absolute; }
.hud b { font-weight: 400; }

.hud-tl { left: 1.4rem; top: 1.2rem; }
.score { font-family: var(--display); font-size: 2.5rem; line-height: 1; text-shadow: 0 2px 0 #000, 0 0 1rem rgba(0, 0, 0, 0.8); letter-spacing: 0.01em; }
.streak { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; opacity: 0; transition: opacity 0.25s; }
.streak.on { opacity: 1; }
.streak b { font-family: var(--display); font-size: 1.25rem; color: var(--lamp); text-shadow: 0 2px 0 #000; }
.streak i { width: 6.5rem; height: 0.3rem; background: rgba(0, 0, 0, 0.6); display: block; }
.streak em { display: block; height: 100%; background: var(--lamp); width: 0; }
.streak span { font-size: 0.8rem; font-stretch: 82%; font-weight: 600; color: var(--bone-dim); text-shadow: 0 1px 0 #000; }

.hud-tc { left: 50%; top: 1rem; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.wave { display: flex; align-items: stretch; min-width: 21rem; transform: rotate(-0.4deg); }
.wave > div { padding: 0.35rem 0.8rem 0.4rem; }
.wv-n { display: flex; align-items: baseline; gap: 0.4rem; border-right: 1px dashed rgba(0, 0, 0, 0.35); }
.wv-n small, .wv-r small { font-size: 0.72rem; font-stretch: 80%; font-weight: 700; color: var(--ink-soft); }
.wv-n b, .wv-r b { font-family: var(--display); font-size: 1.9rem; line-height: 1; }
.wv-t { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 0.25rem; min-width: 10rem; }
.wv-t span { font-size: 0.95rem; font-weight: 600; font-style: italic; font-stretch: 88%; white-space: nowrap; }
.wv-t i, .boss i { display: block; height: 0.28rem; background: rgba(0, 0, 0, 0.22); }
.wv-t em { display: block; height: 100%; width: 0; background: var(--ink); }
.wv-r { display: flex; align-items: baseline; gap: 0.35rem; border-left: 1px dashed rgba(0, 0, 0, 0.35); }
.boss { width: min(46rem, 60vw); text-align: center; }
.boss span { font-family: var(--display); font-size: 1.15rem; letter-spacing: 0.06em; color: #ffd9d2; text-shadow: 0 2px 0 #000; }
.boss i { height: 0.7rem; background: rgba(0, 0, 0, 0.7); border: 1px solid #000; margin-top: 0.2rem; box-shadow: 0 0 0.8rem rgba(200, 40, 30, 0.35); }
.boss em { display: block; height: 100%; background: linear-gradient(180deg, #e2483b, #96251c); width: 100%; transition: width 0.15s; }

.hud-tr { right: 1.2rem; top: 1.1rem; }
#h-radar { width: 10.4rem; height: 10.4rem; display: block; border-radius: 50%; box-shadow: 0 0 0 2px #0b0d0a, 0 0 0 0.42rem #3a4233, 0 0 0 calc(0.42rem + 1px) #0b0d0a, 0 0.4rem 1.2rem rgba(0, 0, 0, 0.7); }

.hud-bl { left: 1.3rem; bottom: 1.2rem; width: 23rem; }
.vitals { display: flex; gap: 0.7rem; padding: 0.55rem 0.7rem 0.55rem 0.55rem; align-items: center; }
.vitals img { width: 3.6rem; height: 3.6rem; border-radius: 50%; object-fit: cover; object-position: 50% 28%; border: 2px solid #b08d4a; box-shadow: 0 0 0 1px #000; }
.bars { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.hp { display: flex; align-items: center; gap: 0.5rem; }
.hp i { flex: 1; position: relative; height: 1.15rem; background: #0f120d; border: 1px solid #000; overflow: hidden; display: block; }
.hp u { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #f1e3c2; opacity: 0.75; }
.hp em { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(180deg, #e04a3c, #a8281e); z-index: 1; }
.hp i::after { content: ''; position: absolute; inset: 0; z-index: 2; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.5) calc(10% - 1px) 10%); }
.hp b { font-family: var(--display); font-size: 1.35rem; min-width: 2.6rem; text-align: right; line-height: 1; }
.hp.low em { animation: pulse 0.6s infinite; }
@keyframes pulse { 50% { filter: brightness(1.8); } }
.xp { display: flex; align-items: center; gap: 0.5rem; }
.xp i { flex: 1; height: 0.32rem; background: #0f120d; border: 1px solid #000; display: block; }
.xp em { display: block; height: 100%; width: 0; background: var(--lamp); }
.xp span { font-size: 0.78rem; font-stretch: 82%; font-weight: 600; color: var(--bone-dim); min-width: 2.6rem; text-align: right; white-space: nowrap; }
.xp span b { color: var(--bone); font-weight: 700; }
.row2 { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.55rem; }
.lamp { position: relative; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; background: #14170f; box-shadow: 0 0 0 2px #0b0d0a, 0 0 0 0.26rem #3a4233, 0 0 0 calc(0.26rem + 1px) #0b0d0a; color: #5d6456; }
.lamp::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c, var(--arc)) calc(var(--p, 1) * 360deg), transparent 0); opacity: 0.28; }
.lamp svg { width: 1.5rem; height: 1.5rem; position: relative; }
.lamp.ready { color: var(--c, var(--arc)); box-shadow: 0 0 0 2px #0b0d0a, 0 0 0 0.26rem #3a4233, 0 0 0 calc(0.26rem + 1px) #0b0d0a, 0 0 1.1rem color-mix(in srgb, var(--c, var(--arc)) 55%, transparent); }
.lamp.ready::before { opacity: 0.2; }
.lamp kbd { position: absolute; bottom: -0.55rem; left: 50%; transform: translateX(-50%); background: #0b0d0a; color: var(--bone-dim); border-color: #000; font-size: 0.62rem; white-space: nowrap; }
.lamp em { position: absolute; top: -0.35rem; right: -0.35rem; font-style: normal; font-family: var(--display); font-size: 0.85rem; background: var(--lamp); color: #000; border-radius: 50%; width: 1.2rem; height: 1.2rem; display: grid; place-items: center; }
#h-dash { --c: var(--lamp); }
.scrap { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.4rem; font-family: var(--display); font-size: 1.35rem; text-shadow: 0 2px 0 #000; }
.scrap svg { width: 1.3rem; height: 1.3rem; color: #d7b25a; }
.buffs { display: flex; gap: 0.35rem; margin-left: auto; }
.buff { font-family: var(--display); font-size: 0.9rem; padding: 0.15rem 0.5rem; background: #000; border: 1px solid var(--c); color: var(--c); box-shadow: 0 0 0.8rem color-mix(in srgb, var(--c) 45%, transparent); white-space: nowrap; }

.hud-br { right: 1.3rem; bottom: 1.2rem; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.gun { padding: 0.45rem 0.9rem 0.55rem; min-width: 15rem; transform: rotate(0.5deg); position: relative; }
.gun-name { font-size: 0.82rem; font-stretch: 80%; font-weight: 700; color: var(--ink-soft); display: flex; justify-content: space-between; gap: 1rem; }
.ammo { display: flex; align-items: baseline; gap: 0.5rem; justify-content: flex-end; }
.ammo b { font-family: var(--display); font-size: 3.1rem; line-height: 1; }
.ammo b.low { color: var(--red); }
.ammo span { font-family: var(--display); font-size: 1.3rem; color: var(--ink-soft); min-width: 2.2rem; }
.gun .reload { display: block; height: 0.3rem; background: rgba(0, 0, 0, 0.2); margin-top: 0.25rem; }
.gun .reload em { display: block; height: 100%; width: 0; background: var(--red); }
.slots { display: flex; gap: 0.3rem; }
.slot { display: flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.5rem; font-size: 0.74rem; font-stretch: 80%; font-weight: 700; background: rgba(8, 10, 7, 0.75); border: 1px solid #000; color: var(--bone-dim); }
.slot kbd { font-size: 0.6rem; }
.slot.on { background: var(--lamp); color: #000; }
.slot.empty { color: #7c4a44; }

.banner { left: 50%; top: 23%; transform: translate(-50%, -50%); text-align: center; opacity: 0; pointer-events: none; }
.banner.show { animation: banner 3.2s both; }
.banner b { display: block; font-family: var(--display); font-size: 5.2rem; line-height: 0.95; letter-spacing: 0.02em; color: var(--bone); text-shadow: 0 0.2rem 0 #000, 0 0 3rem rgba(0, 0, 0, 0.9); white-space: nowrap; }
.banner span { display: inline-block; margin-top: 0.5rem; font-size: 1.15rem; font-weight: 600; font-stretch: 88%; color: var(--lamp); text-shadow: 0 2px 0 #000; }
.banner.danger b { color: #ff8d7f; }
@keyframes banner { 0% { opacity: 0; letter-spacing: 0.4em; } 10% { opacity: 1; letter-spacing: 0.02em; } 80% { opacity: 1; } 100% { opacity: 0; } }

.hint { left: 50%; bottom: 17%; transform: translateX(-50%) rotate(-0.6deg); padding: 0.5rem 1.1rem; font-size: 1rem; font-weight: 600; font-stretch: 90%; opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.hint.show { opacity: 1; }
.hint kbd { margin: 0 0.15em; font-size: 0.85rem; }

.toasts { left: 1.4rem; bottom: 13.2rem; display: flex; flex-direction: column-reverse; gap: 0.25rem; }
.toast { font-size: 0.95rem; font-weight: 700; font-stretch: 85%; color: var(--c, var(--bone)); text-shadow: 0 2px 0 #000, 0 0 0.6rem #000; animation: toast 2.4s both; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translateX(-1rem); } 10% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

.threat { right: 1.3rem; top: 13.6rem; width: 19rem; display: flex; gap: 0.8rem; padding: 0.6rem; transform: translateX(120%) rotate(1deg); transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.threat.show { transform: rotate(1deg); }
.threat img { width: 5.2rem; height: 6.6rem; object-fit: cover; object-position: 50% 12%; background: #2a2f25; border: 1px solid rgba(0, 0, 0, 0.5); }
.threat small { font-size: 0.72rem; font-stretch: 80%; font-weight: 700; color: var(--red); }
.threat b { display: block; font-family: var(--display); font-size: 1.35rem; line-height: 1.05; margin: 0.1rem 0 0.3rem; }
.threat p { margin: 0; font-size: 0.82rem; line-height: 1.3; font-stretch: 92%; }

.pausebtn { position: fixed; right: 12.4rem; top: 1.2rem; z-index: 4; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; color: var(--bone-dim); pointer-events: auto; }
.pausebtn:hover { color: var(--lamp); }

/* ------------------------------------------------------------------ screens */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; }
.scrim { background: radial-gradient(120% 120% at 50% 40%, rgba(6, 8, 10, 0.55), rgba(3, 4, 5, 0.9)); align-items: center; justify-content: center; padding: 2rem; }

/* title */
#title { background: linear-gradient(90deg, rgba(4, 6, 8, 0.92) 0%, rgba(4, 6, 8, 0.7) 28%, rgba(4, 6, 8, 0.12) 55%, rgba(4, 6, 8, 0) 70%); }
.title-col { width: min(34rem, 92vw); padding: 5.5vh 0 4.5vh 4.5vw; display: flex; flex-direction: column; }
.logo { font-family: var(--display); font-size: 8.2rem; line-height: 0.86; letter-spacing: 0.005em; margin: 0; color: var(--bone); text-shadow: 0 0.35rem 0 #000; }
.logo i { font-style: normal; color: var(--lamp); }
.logo small { display: block; font-size: 1.55rem; letter-spacing: 0.34em; color: var(--lamp); margin-top: 0.9rem; text-shadow: 0 2px 0 #000; }
.pitch { margin: 1.6rem 0 0; font-size: 1.05rem; line-height: 1.5; color: #cfc9b9; max-width: 29rem; text-shadow: 0 1px 0 #000; }
.menu { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; padding-top: 2rem; }
.menu button { font-family: var(--display); font-size: 2.1rem; line-height: 1.22; letter-spacing: 0.02em; color: #b9b4a4; text-shadow: 0 2px 0 #000; position: relative; padding-left: 0; transition: padding 0.12s, color 0.12s; }
.menu button:first-child { font-size: 3.3rem; color: var(--bone); }
.menu button:hover { color: var(--lamp); padding-left: 1.4rem; outline: none; }
.nav .menu button.cur { color: var(--lamp); padding-left: 1.4rem; outline: none; }
.menu button:hover::before { content: ''; position: absolute; left: 0; top: 50%; width: 0.9rem; height: 0.26rem; margin-top: -0.13rem; background: var(--lamp); }
.nav .menu button.cur::before { content: ''; position: absolute; left: 0; top: 50%; width: 0.9rem; height: 0.26rem; margin-top: -0.13rem; background: var(--lamp); }
.foot { margin-top: 2rem; font-size: 0.8rem; color: #8b8777; line-height: 1.5; }
.foot kbd { font-size: 0.68rem; }
.record { position: absolute; right: 2.5vw; bottom: 4.5vh; padding: 0.8rem 1.2rem 0.9rem; transform: rotate(1.2deg); min-width: 15rem; }
.record h3 { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.05em; }
.record dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.12rem 1.4rem; font-size: 0.88rem; font-stretch: 90%; }
.record dd { margin: 0; font-weight: 700; text-align: right; }

/* sheets (paper dialogs) */
.sheet { position: relative; width: min(62rem, 94vw); max-height: 92vh; display: flex; flex-direction: column; padding: 1.6rem 2rem 1.5rem; transform: rotate(-0.35deg); }
.sheet.narrow { width: min(38rem, 94vw); }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2.9rem; line-height: 1; letter-spacing: 0.015em; }
.sheet .lede { margin: 0.45rem 0 1.1rem; font-size: 1rem; color: var(--ink-soft); max-width: 46rem; line-height: 1.4; }
.sheet .scroll { overflow-y: auto; min-height: 0; padding-right: 0.4rem; }
.sheet-foot { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 2px solid var(--ink); }
.sheet-foot .grow { flex: 1; font-size: 0.86rem; color: var(--ink-soft); }
.btn { font-family: var(--display); font-size: 1.35rem; letter-spacing: 0.04em; padding: 0.5rem 1.4rem 0.55rem; background: var(--ink); color: var(--paper); border: 2px solid var(--ink); transition: transform 0.08s, background 0.12s; }
.btn:hover:not(:disabled) { background: #000; transform: translateY(-1px); }
.nav .btn.cur { background: #000; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.go { background: var(--red); border-color: #7d1f18; color: #fff3e6; }
.btn.go:hover { background: #dd4336; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(0, 0, 0, 0.08); }
.btn:disabled { opacity: 0.4; cursor: default; }
.close { position: absolute; right: 1rem; top: 0.9rem; width: 2.2rem; height: 2.2rem; font-family: var(--display); font-size: 1.5rem; color: var(--ink); }

/* difficulty orders */
.orders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.order { text-align: left; padding: 1rem 1.1rem 1.1rem; border: 2px solid rgba(0, 0, 0, 0.55); background: rgba(255, 255, 255, 0.16); display: flex; flex-direction: column; gap: 0.35rem; min-height: 12rem; transition: background 0.12s, transform 0.12s; }
.order:hover { background: rgba(255, 255, 255, 0.4); transform: translateY(-2px); }
.nav .order.cur { background: rgba(255, 255, 255, 0.4); transform: translateY(-2px); }
.order.sel { background: var(--ink); color: var(--paper); }
/* the card already chosen stays dark under the controller's cursor (its light text would vanish on the hover wash) */
.nav .order.sel.cur { background: var(--ink); }
.order b { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1; }
.order p { margin: 0; font-size: 0.93rem; line-height: 1.35; }
.order ul { margin: 0.2rem 0 0; padding: 0 0 0 1rem; font-size: 0.83rem; line-height: 1.45; opacity: 0.85; }
.order .best { margin-top: auto; font-size: 0.8rem; font-weight: 700; font-stretch: 85%; opacity: 0.8; }

/* armory ledger */
.ledger { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.6rem; min-height: 0; }
.ledger h3 { margin: 0 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: 0.05em; border-bottom: 2px solid var(--ink); padding-bottom: 0.2rem; }
.line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.35); }
.line b { font-weight: 800; font-size: 1.02rem; font-stretch: 88%; display: flex; align-items: center; gap: 0.5rem; }
.line b em { font-style: normal; font-size: 0.68rem; font-weight: 800; padding: 0.05rem 0.35rem; background: var(--ink); color: var(--paper); }
.line p { margin: 0.1rem 0 0; font-size: 0.84rem; color: var(--ink-soft); line-height: 1.3; }
.line .cost { font-family: var(--display); font-size: 1.3rem; min-width: 3.4rem; text-align: right; }
.line .cost.short { color: var(--red); }
.line .btn { font-size: 0.98rem; padding: 0.3rem 0.8rem 0.35rem; min-width: 6.6rem; }
.line.owned .cost { opacity: 0.4; }
.purse { font-family: var(--display); font-size: 1.9rem; display: flex; align-items: center; gap: 0.4rem; }
.purse svg { width: 1.6rem; height: 1.6rem; }
.kit { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.8rem; }

/* after-action report */
.report-grid { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: start; }
.report-grid dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 2rem; font-size: 1.05rem; }
.report-grid dt { border-bottom: 1px dotted rgba(0, 0, 0, 0.4); }
.report-grid dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.rankbox { text-align: center; padding: 0.4rem 1rem; }
.rankbox .stamp { font-size: 8rem; line-height: 1; padding: 0 0.25em 0.06em; animation: thump 0.35s 0.5s both cubic-bezier(0.3, 1.6, 0.5, 1); }
.rankbox p { margin: 0.8rem 0 0; font-weight: 700; font-stretch: 88%; }
.rankbox .new { color: var(--red); font-weight: 800; margin-top: 0.3rem; }
@keyframes thump { from { opacity: 0; transform: rotate(-7deg) scale(2.6); } to { opacity: 0.86; transform: rotate(-7deg) scale(1); } }
.score-big { font-family: var(--display); font-size: 4.2rem; line-height: 1; margin: 0.2rem 0 1rem; }

/* settings + how to + dossier */
.opts { display: grid; grid-template-columns: 12rem 1fr 3.4rem; gap: 0.7rem 1rem; align-items: center; font-size: 1rem; }
.opts label { font-weight: 700; font-stretch: 90%; }
.opts output { font-family: var(--display); font-size: 1.1rem; text-align: right; }
.opts input[type='range'] { width: 100%; accent-color: var(--red); height: 1.4rem; }
.seg { display: flex; grid-column: span 2; }
.seg button { flex: 1; padding: 0.35rem 0.4rem; border: 2px solid var(--ink); margin-right: -2px; font-weight: 800; font-stretch: 85%; font-size: 0.9rem; }
.seg button.on { background: var(--ink); color: var(--paper); }
.opts .note { grid-column: 1 / -1; margin: -0.2rem 0 0.3rem; font-size: 0.82rem; color: var(--ink-soft); }
.keys { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 0.5rem 1rem; font-size: 0.98rem; align-items: center; }
.keys kbd { font-size: 0.86rem; justify-self: start; white-space: nowrap; }
.howto h3 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; letter-spacing: 0.04em; margin: 1.1rem 0 0.45rem; }
.howto p { margin: 0 0 0.5rem; line-height: 1.45; max-width: 52rem; }
.dossier { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.9rem; }
.file { display: flex; gap: 0.75rem; padding: 0.6rem; border: 1px solid rgba(0, 0, 0, 0.45); background: rgba(255, 255, 255, 0.18); }
.file .pic { flex: none; width: 5rem; height: 6.4rem; background: #2a2f25; }
.file img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 12%; }
.file.locked .pic { background: rgba(0, 0, 0, 0.13); }
.file.locked img { filter: brightness(0); opacity: 0.5; }
.file small { font-size: 0.7rem; font-weight: 800; font-stretch: 80%; color: var(--red); }
.file b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.25rem; line-height: 1.05; margin: 0.1rem 0 0.3rem; }
.file p { margin: 0; font-size: 0.82rem; line-height: 1.32; }
.file .tally { margin-top: 0.35rem; font-size: 0.76rem; font-weight: 800; color: var(--ink-soft); }

/* pause */
.pause-list { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; margin-top: 1rem; }
.pause-list .btn { text-align: left; }
.perkrow { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.9rem; }

/* loading */
#loading { position: fixed; inset: 0; z-index: 30; background: #050607 center / cover no-repeat; display: flex; align-items: flex-end; transition: opacity 0.6s; }
#loading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4, 5, 6, 0.96) 0%, rgba(4, 5, 6, 0.55) 45%, rgba(4, 5, 6, 0.75) 100%); }
#loading .box { position: relative; padding: 0 4.5vw 6vh; width: 100%; }
#loading .logo { font-size: 6rem; }
#loading .bar { margin-top: 1.4rem; width: min(30rem, 80vw); height: 0.4rem; background: rgba(255, 255, 255, 0.12); }
#loading .bar em { display: block; height: 100%; width: 0; background: var(--lamp); transition: width 0.15s; }
#loading p { margin: 0.6rem 0 0; font-size: 0.95rem; color: #a7a290; min-height: 1.3em; }
#loading.done { opacity: 0; pointer-events: none; }
#fade { position: fixed; inset: 0; z-index: 20; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.45s; }
#fade.on { opacity: 1; }
.fatal { position: fixed; inset: 0; z-index: 40; background: #0a0c0e; color: var(--bone); padding: 8vh 8vw; overflow: auto; }
.fatal h1 { font-family: var(--display); font-weight: 400; font-size: 3rem; margin: 0 0 1rem; color: var(--lamp); }
.fatal pre { white-space: pre-wrap; font-size: 0.85rem; color: #b5ae9c; user-select: text; }

@media (max-width: 900px) {
  .orders { grid-template-columns: 1fr; }
  .ledger, .report-grid { grid-template-columns: 1fr; }
  .logo { font-size: 5.4rem; }
  .record { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .banner.show, .rankbox .stamp, .toast { animation-duration: 0.01s; }
  .promo, .promo-chip { transition: none; }
  .promo-chip.show { animation: none; }
}

/* late additions */
.fatal p { max-width: 46rem; line-height: 1.5; font-size: 1.05rem; }
#loading .box { opacity: 0; transition: opacity 0.35s; }
body.fonts #loading .box { opacity: 1; }
.order { color: var(--ink); }
.order.sel ul, .order.sel .best { opacity: 0.9; }
img { -webkit-user-drag: none; user-select: none; }
.fatal .btn { margin: 0.6rem 0 1rem; }
.photo { height: 8.6rem; margin: 0 0 1.2rem; background: #15181a center / cover no-repeat; border: 0.32rem solid #f0e9d6; box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.45); transform: rotate(0.3deg); }
@media (max-height: 700px) { .photo { display: none; } }
.notice { position: fixed; left: 50%; top: 1rem; z-index: 25; max-width: min(46rem, 92vw); padding: 0.55rem 1.1rem; font-size: 0.95rem; font-weight: 600; font-stretch: 92%; line-height: 1.35; pointer-events: none; transform: translate(-50%, -160%) rotate(-0.4deg); transition: transform 0.35s; }
.notice.show { transform: translate(-50%, 0) rotate(-0.4deg); }
.opts .note:empty { display: none; }

/* controls */
kbd.none { border-style: dashed; opacity: 0.6; font-weight: 600; }
#controls .sheet { width: min(58rem, 94vw); }
.tabs { margin: 0 0 0.9rem; max-width: 30rem; }
.binds { display: grid; grid-template-columns: minmax(9rem, 1.25fr) repeat(3, minmax(6rem, 1fr)); gap: 0.4rem 0.6rem; align-items: center; font-size: 1rem; }
.binds.pad { grid-template-columns: minmax(9rem, 1.25fr) repeat(2, minmax(7rem, 1fr)) minmax(0, 1fr); }
.binds.pad .act { grid-column: 1; }
.binds h3 { grid-column: 1 / -1; margin: 0.9rem 0 0.1rem; padding-bottom: 0.15rem; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.05em; border-bottom: 2px solid var(--ink); }
.binds h3:first-child { margin-top: 0; }
.binds .act { font-weight: 700; font-stretch: 90%; }
.binds .fixed { font-size: 0.9rem; font-weight: 600; font-stretch: 88%; color: var(--ink-soft); padding: 0 0.55rem; }
.slotb { min-height: 2.15rem; padding: 0.3rem 0.5rem; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.24); font-weight: 800; font-stretch: 85%; font-size: 0.92rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background 0.1s; }
.slotb:hover { background: rgba(255, 255, 255, 0.55); }
.nav .slotb.cur { background: rgba(255, 255, 255, 0.55); }
.slotb.empty { border: 1px dashed rgba(0, 0, 0, 0.4); background: none; color: var(--ink-soft); font-weight: 600; }
.slotb.listen { background: var(--ink); color: var(--paper); border-style: solid; border-color: var(--red); animation: listen 0.9s steps(2, jump-none) infinite; }
@keyframes listen { 50% { border-color: var(--ink); } }
#c-opts { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed rgba(0, 0, 0, 0.4); max-width: 40rem; }
#c-note { font-weight: 600; color: var(--ink); }
.keys .k { justify-self: start; white-space: nowrap; }
.keys { grid-template-columns: auto 1fr; }
.fps { position: fixed; left: 50%; bottom: 0.35rem; transform: translateX(-50%); z-index: 6; padding: 0.1rem 0.5rem; font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #cfd6c4; background: rgba(8, 10, 7, 0.6); pointer-events: none; white-space: nowrap; }
@media (max-width: 760px) {
  .binds, .binds.pad { grid-template-columns: minmax(6rem, 1fr) repeat(3, minmax(4rem, 1fr)); font-size: 0.9rem; }
}

/* Signal colours carry from deploy and difficulty through to the field ledger. */
#title {background-image:linear-gradient(90deg,rgba(8,19,22,.96),rgba(12,24,25,.75) 30%,rgba(12,24,25,.10) 73%);}
.preparing-plaza #title {background-color:#152327;background-image:linear-gradient(90deg,#0a1518ef,#102024b8 40%,#16262726 83%),var(--title-art);background-size:cover;background-position:center;}
.menu button:first-child {color:#f4cf87;}
.menu button[data-act="howto"] {color:#bcd8d2;}
.menu button[data-act="dossier"] {color:#d7b3a2;}
.menu button:hover,.nav .menu button.cur {color:white;}
.sheet.paper {border-top:.32rem solid #416962;}
#difficulty .order:nth-child(1){border-top:.32rem solid #437967;}
#difficulty .order:nth-child(2){border-top:.32rem solid #a07832;}
#difficulty .order:nth-child(3){border-top:.32rem solid #9f5243;}
#armory .ledger h3 {color:#244d49;}
.armory-summary {display:flex;justify-content:space-between;flex-wrap:wrap;gap:.2rem 1rem;font-size:.88rem;color:#3c4d49;border-bottom:1px solid #7d806c;}
.armory-summary p {margin:.15rem 0 .55rem;}
#armory .line .cost {font-size:1.05rem;font-variant-numeric:tabular-nums;color:#5b431b;}
#armory .line .cost.short {color:#7a3527;}
#armory .cost small {display:block;font:600 .71rem var(--body);}
#a-purse {color:#473515;background:#e6c985;border:1px solid #826737;padding:.35rem .65rem;border-radius:3px;}
.scrap small {font:700 .74rem var(--body);color:#e7cd8b;}
#armory .btn.go,.sheet .btn.go {background:#28534d;color:#fbefd8;border-color:#183e38;}
.nav .btn.cur,.nav .order.cur,.nav .seg button.cur,.nav .slotb.cur,.nav input.cur {outline:3px solid #164b51;outline-offset:2px;box-shadow:0 0 0 4px #e6d4aa;}
.nav .btn.ghost.cur {background:rgba(0,0,0,.14);}
.nav .btn.go.cur {background:#1c3f3a;}
@media(max-width:640px){.armory-summary{display:block;}#armory .line{gap:.35rem;}#armory .line .cost{min-width:3rem;}}

/* ------------------------------------------------------------------ 2.3.3 */
/* Safari will not let you type in a field that inherits user-select: none */
input[type='text'] { -webkit-user-select: text; user-select: text; }

/* promotions: a paper card with a medal ribbon down its edge in the colours of its branch (--c and --s) */
.pcard {
  position: relative; display: flex; align-items: center; gap: 0.7rem; min-width: 0; text-align: left; color: var(--ink);
  padding: 0.5rem 0.8rem 0.55rem 1.3rem; border: 1px solid rgba(0, 0, 0, 0.6); box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.6);
  background-color: var(--paper);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--c) 24%, transparent), transparent 66%), repeating-linear-gradient(0deg, rgba(60, 45, 20, 0.045) 0 1px, transparent 1px 4px);
}
.pband { position: absolute; left: 0; top: 0; bottom: 0; width: 0.66rem; border-right: 1px solid rgba(0, 0, 0, 0.55); background: linear-gradient(90deg, var(--c) 0 24%, var(--s) 24% 40%, var(--c) 40% 60%, var(--s) 60% 76%, var(--c) 76%); }
.pbadge { flex: none; width: 3.1rem; height: 3.1rem; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); }
.pbadge svg, .rib i svg { width: 100%; height: 100%; display: block; }
.pbody { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.pbody b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.05; letter-spacing: 0.01em; padding-right: 1.8rem; }
.pdesc { font-size: 0.86rem; line-height: 1.24; font-stretch: 92%; }
.prank { display: flex; align-items: center; gap: 0.22rem; margin-top: 0.2rem; font-size: 0.72rem; font-weight: 700; font-stretch: 85%; color: color-mix(in srgb, var(--c) 68%, #000); }
.prank i { width: 0.72rem; height: 0.38rem; border: 1px solid var(--c); display: block; }
.prank i.on { background: var(--c); }
.prank i.new { background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 4px); }
.prank span { margin-left: 0.3rem; white-space: nowrap; }
.pcard kbd { position: absolute; right: 0.4rem; top: 0.38rem; background: var(--ink); color: var(--paper); border-color: var(--ink); opacity: 1; font-size: 0.8rem; padding: 0.1em 0.5em; }
.pcard .ptier { font-size: 0.74rem; margin-left: 0.5rem; vertical-align: 0.18em; transform: rotate(-4deg); letter-spacing: 0.05em; }
.pcard.t1 { border-top: 0.18rem solid #aab3b6; }
.pcard.t2 { border-top: 0.18rem solid #d1a233; }
.promo-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }

/* the tray on the HUD: along the bottom, between the vitals and the weapon, while the fight goes on */
/* (the vitals on the left are wider than the weapon on the right: the tray is centred in what is left between them) */
.promo { left: 25.4rem; right: 17.8rem; bottom: 1.2rem; max-width: 60rem; margin: 0 auto; transform: translateY(130%); opacity: 0; transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.08), opacity 0.2s; }
.promo.show { transform: none; opacity: 1; }
/* still arriving: the cards cannot be chosen yet, so the keys that will choose them are not offered yet */
.promo .pcard > kbd, .promo-head span { transition: opacity 0.12s; }
.promo.arming .pcard > kbd, .promo.arming .promo-head span { opacity: 0; }
.promo-head { margin: 0 0 0.3rem; display: flex; align-items: baseline; gap: 0.8rem; text-shadow: 0 2px 0 #000, 0 0 0.6rem #000; }
.promo-head b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; color: var(--lamp); letter-spacing: 0.03em; }
.promo-head span { font-size: 0.82rem; font-weight: 600; color: var(--bone); }
.promo-chip { left: 50%; bottom: 1.2rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.32rem 0.8rem 0.36rem 0.6rem; font-size: 0.92rem; font-weight: 700; font-stretch: 88%; white-space: nowrap; border-left: 0.5rem solid var(--lamp); transform: translate(-50%, 220%) rotate(-0.4deg); transition: transform 0.25s; }
.promo-chip.show { transform: translate(-50%, 0) rotate(-0.4deg); animation: chip 2.6s 1.2s infinite; }
.promo-chip svg { width: 1.15rem; height: 1.15rem; color: #6b4a10; fill: #e6b53c; }
@keyframes chip { 0%, 86%, 100% { filter: none; } 93% { filter: brightness(1.35); } }
/* a tall or narrow window has no room between the corner panels: the tray sits above them */
@media (max-aspect-ratio: 7/5) {
  .promo { bottom: 12.6rem; left: 3vw; right: 3vw; }
  .promo-chip { bottom: 12.6rem; }
}

/* ... and the same offer as buttons, in the armory and on the pause screen */
.promo-block { margin: 0 0 1rem; padding: 0.6rem 0.7rem 0.7rem; background: rgba(0, 0, 0, 0.07); border: 1px dashed rgba(0, 0, 0, 0.45); }
.promo-block h3 { margin: 0 0 0.45rem; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.05em; color: #244d49; }
.promo-block .pcard { cursor: pointer; transition: transform 0.1s, box-shadow 0.1s; }
.promo-block .pcard:hover, .nav .promo-block .pcard.cur { transform: translateY(-2px); box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.5), 0 0 0 3px var(--c); outline: none; }
#pause .promo-cards { grid-template-columns: 1fr; }
#pause .pcard { box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, 0.4); }
.rib { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; font-weight: 700; font-stretch: 85%; padding: 0.12rem 0.5rem 0.12rem 0.22rem; border: 1px solid rgba(0, 0, 0, 0.5); border-left: 0.42rem solid var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.rib i { width: 1.25rem; height: 1.25rem; display: block; }
.rib b { font-weight: 800; color: color-mix(in srgb, var(--c) 72%, #000); }

/* choosing the ground */
.grounds { grid-template-columns: repeat(2, 1fr); }
.order.ground { padding: 0 0 1rem; min-height: 0; overflow: hidden; }
.order.ground > :not(.shot) { margin-left: 1.1rem; margin-right: 1.1rem; }
.order.ground .shot { display: block; height: 11rem; margin-bottom: 0.5rem; background: #15181a center / cover no-repeat; border-bottom: 2px solid rgba(0, 0, 0, 0.6); }
.order.ground.sel .shot { box-shadow: inset 0 -0.3rem 0 var(--lamp); }
#sector .order:nth-child(1) { border-top: 0.32rem solid #a07832; }
#sector .order:nth-child(2) { border-top: 0.32rem solid #4b6f8e; }
@media (max-height: 640px) { .order.ground .shot { height: 7rem; } }
@media (max-width: 900px) { .grounds { grid-template-columns: 1fr; } .order.ground .shot { height: 6rem; } .promo-cards { grid-template-columns: 1fr; } }

/* scoreboard */
.board-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.8rem; }
.board-filters .seg { flex: 1.5 1 17rem; }
.board-filters .seg:last-child { flex: 1 1 11rem; }
.board-filters .seg button { white-space: nowrap; font-size: 0.86rem; padding-left: 0.2rem; padding-right: 0.2rem; }
.seg button.off { opacity: 0.45; cursor: default; }
.board { min-height: 8rem; max-height: 42vh; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.sheet .board.scroll { padding-right: 0; }
.brow { display: grid; grid-template-columns: 2.6rem minmax(7rem, 1.3fr) 6.6rem 3.4rem 4.2rem 4rem minmax(8rem, 1.5fr) 7.2rem; gap: 0 0.8rem; align-items: baseline; padding: 0.3rem 0.5rem; border-bottom: 1px dashed rgba(0, 0, 0, 0.3); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.brow > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow.head { position: sticky; top: 0; z-index: 1; background: var(--paper-shade); font-size: 0.76rem; font-weight: 800; font-stretch: 85%; color: var(--ink-soft); border-bottom: 1px solid var(--ink); }
.brow .n { text-align: right; }
.brow .who { font-weight: 800; font-stretch: 90%; letter-spacing: 0.02em; }
.brow .sc { font-family: var(--display); font-size: 1.15rem; }
.brow.you { background: #e6c985; box-shadow: inset 0.35rem 0 0 var(--red); }
.board-empty { margin: 2.4rem 1rem; text-align: center; color: var(--ink-soft); }
.board-id, .board-link { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.8rem; }
.board-id label, .board-link label { font-weight: 700; font-stretch: 90%; min-width: 7.2rem; }
.board-id .grow, .board-link .grow { flex: 1; min-width: 0; font-size: 0.86rem; color: var(--ink-soft); }
.sheet input[type='text'] { font: inherit; font-weight: 700; color: var(--ink); background: rgba(255, 255, 255, 0.42); border: 2px solid var(--ink); border-radius: 0; padding: 0.3rem 0.55rem; min-width: 0; }
.sheet input[type='text']::placeholder { color: var(--ink-soft); font-weight: 500; opacity: 0.85; }
#sc-name { width: 12.5rem; letter-spacing: 0.04em; text-transform: uppercase; }
#sc-url { flex: 1; font-weight: 500; }
.board-link .link-url { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-id .btn, .board-link .btn { font-size: 1rem; padding: 0.3rem 0.9rem 0.35rem; white-space: nowrap; }
.board-line { margin: 0.9rem 0 0; font-weight: 700; font-stretch: 92%; color: #244d49; }
.board-line:empty { display: none; }
@media (max-width: 760px) {
  .brow { grid-template-columns: 2rem minmax(5rem, 1fr) 5.6rem 3rem; }
  .brow > span:nth-child(n+5) { display: none; }
  .board-id, .board-link { flex-wrap: wrap; }
}
.binds .bnote { grid-column: 1 / -1; margin: 0 0 0.2rem; font-size: 0.84rem; line-height: 1.35; color: var(--ink-soft); max-width: 46rem; }

/* ---- 2.3.4: the armory says what the Scrap in hand is for */
.target { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.8rem; margin: 0 0 0.8rem; padding: 0.45rem 0.75rem 0.5rem; border-left: 0.5rem solid #a07832; background: rgba(160, 120, 50, 0.13); }
.target .tlabel { font-size: 0.8rem; font-weight: 700; color: #6b4a10; }
.target b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; letter-spacing: 0.02em; }
.target .tbar { flex: 1 1 8rem; min-width: 6rem; height: 0.55rem; background: rgba(0, 0, 0, 0.2); }
.target .tbar i { display: block; height: 100%; background: #a07832; }
.target .tnum { font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.target.ready { border-left-color: #2f7d4f; background: rgba(47, 125, 79, 0.13); }
.target.ready .tlabel { color: #1f5a37; }
.target.ready .tbar i { background: #2f7d4f; }
.target.start { border-left-color: #164b51; background: rgba(22, 75, 81, 0.1); }
.target.start .tlabel { color: #164b51; }
#armory .line.aim { box-shadow: inset 0.25rem 0 0 #a07832; padding-left: 0.65rem; }

/* Potatoman touch controls: scoped to the active touch device. */
#gl { touch-action: none; }
#iz-touch { position: fixed; inset: 0; z-index: 5; pointer-events: none; --ts: clamp(80px, 21vmin, 136px); --edge: max(12px, env(safe-area-inset-left)); --bottom: max(10px, env(safe-area-inset-bottom)); }
#iz-touch button, .iz-t-stick { pointer-events: auto; touch-action: none; -webkit-user-select: none; user-select: none; }
.iz-t-side { position: absolute; bottom: var(--bottom); display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; }
.iz-t-left { left: var(--edge); } .iz-t-right { right: max(12px, env(safe-area-inset-right)); }
.iz-t-stick { position: relative; width: var(--ts); height: var(--ts); border-radius: 50%; border: 2px solid rgba(236,230,214,.55); background: rgba(10,13,16,.43); box-shadow: inset 0 0 0 8px rgba(236,230,214,.07); }
.iz-t-stick i { position: absolute; left: 50%; top: 50%; width: 43%; height: 43%; border: 2px solid var(--lamp); background: rgba(242,169,59,.28); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.iz-t-stick span { position: absolute; bottom: 6%; left: 0; right: 0; font: 700 10px/1 system-ui,sans-serif; text-align: center; color: var(--bone); pointer-events: none; }
.iz-t-buttons, .iz-t-centre { display: flex; gap: 5px; }
#iz-touch button { background: rgba(20,25,23,.88); border: 1px solid #94886b; border-radius: 6px; color: var(--bone); font: 700 12px/1.1 system-ui,sans-serif; padding: 6px; min-width: 44px; min-height: 44px; }
#iz-touch button:active { color: #111; background: var(--lamp); }
.iz-t-centre { position: absolute; left: 50%; bottom: var(--bottom); transform: translateX(-50%); justify-content: center; flex-wrap: wrap; width: 190px; }
.iz-touch-active .hud-bl { bottom: calc(max(10px, env(safe-area-inset-bottom)) + clamp(80px,21vmin,136px) + 60px); width: min(23rem, 44vw); }
.iz-touch-active .hud-br { bottom: calc(max(10px, env(safe-area-inset-bottom)) + clamp(80px,21vmin,136px) + 60px); }
.iz-touch-active .promo, .iz-touch-active .promo-chip { bottom: calc(max(10px, env(safe-area-inset-bottom)) + clamp(80px,21vmin,136px) + 120px); }
.iz-touch-active .promo { left: 3vw; right: 3vw; }
.iz-touch-active .promo.show { pointer-events: auto; z-index: 6; }
.iz-touch-active .promo-chip.show { pointer-events: auto; }
.iz-touch-active .hud { z-index: 6; }
.iz-touch-active #h-pause { display: none; }
.iz-touch-active .hud .lamp kbd, .iz-touch-active .hud .slot kbd { display:none; }
.iz-touch-active .hint { bottom: auto; top: 30%; white-space: normal; max-width: 80vw; }
.iz-touch-active .toasts { bottom: 48%; }
@media (pointer: coarse) {
  #ui button, #pm-home { touch-action: manipulation; }
  #ui .btn, #ui .close, #ui .seg button { min-height: 44px; }
  #ui .scroll, #ui .sheet { touch-action: pan-y; }
  #title .title-col { overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(20px,env(safe-area-inset-bottom)); }
  #title .menu { padding-top: 12px; } #title .menu button { min-height: 44px; }
  #title .foot { margin-top: 12px; color: var(--bone-dim); }
  .sheet { transform: none; overflow-y: auto; overscroll-behavior: contain; max-height: 92dvh; padding: 12px; }
  .scrim { padding: 8px; }
  .sheet-foot { flex-wrap: wrap; margin-top: 8px; padding-top: 8px; }
  .sheet .scroll { flex-shrink: 1; }
  .orders { overflow-y: auto; min-height: 0; }
  .sheet h2 { padding-right: 32px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .iz-t-centre { width: 96px; }
  .iz-t-buttons { flex-wrap: wrap; max-width: 148px; justify-content: center; }
  .iz-touch-active .hud-bl { width: 47vw; left: 7px; }
  .iz-touch-active .hud-br { right: 7px; }
  .iz-touch-active .gun { min-width: 0; padding: .35rem .5rem; }
  .iz-touch-active .vitals img { display:none; }
  .iz-touch-active .slots { flex-wrap: wrap; max-width: 43vw; justify-content: end; }
  .iz-touch-active #h-radar { width: 6rem; height: 6rem; }
  .iz-touch-active .promo-cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .iz-touch-active .promo .pcard { min-width: 0; padding: 4px; }
  .iz-touch-active .promo .pcard p { font-size: .72rem; }
  .iz-touch-active .promo .pcard kbd { display:none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #iz-touch { --ts: clamp(76px,22vmin,106px); }
  .iz-touch-active .hud-bl, .iz-touch-active .hud-br { bottom: calc(max(10px,env(safe-area-inset-bottom)) + clamp(76px,22vmin,106px) + 54px); }
  .iz-touch-active .hud-bl { width: min(17rem,35vw); }
  .iz-touch-active .promo, .iz-touch-active .promo-chip { bottom: 100px; left: 24vw; right: 24vw; }
  .iz-touch-active .promo-chip { left:50%;right:auto; }
  .iz-touch-active #h-radar { width: 6rem; height: 6rem; }
  .iz-touch-active .banner b { font-size: 3.2rem; }
  .iz-touch-active .promo-cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .iz-touch-active .promo .pcard { padding: 4px; min-width: 0; }
}
