/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   DESKTOP FIRST (2026-10-15). Jon: "i dont want trials to be a mobile game. start optimizing it for
   computers." This sheet is loaded LAST and is the one place the game's chrome is sized for a monitor,
   a keyboard and a mouse. It overrides rather than edits the older sheets so the phone-shaped rules can
   be read in their own words and this layer can be reviewed as one thing.

   THE RULES IT IMPOSES
   - One gutter. Every corner element sits --hud-inset from its edge (the old sheets used 14, 15, 20,
     26 and 30px), and the HUD is four corners: title and meters top-left, the site row top-right, the
     place's words and the key legend bottom-left, the E button bottom-right.
   - One px scale. Nothing in the chrome grows with the viewport. At 2560 and up the seven chrome
     roots are zoomed by --ui so the same boxes read at the same angle on a bigger monitor.
   - Nothing full-width and nothing centred for a thumb. The fight's deck is one bar of hotkeyed
     controls, the exchange is a side panel over the standing world, the brink is a numbered list.
   - Every control names its key. <kbd class="hk"> is the one badge, drawn by app.js.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */
:root { --hud-inset: 24px; --ui: 1; }
@media (min-width: 2400px) { :root { --hud-inset: 32px; --ui: 1.15; } }
@media (min-width: 3600px) { :root { --hud-inset: 40px; --ui: 1.4; } }
/* the seven chrome roots, scaled as one on a big monitor (zoom keeps their px boxes and offsets intact) */
.hub.place .stage-top, body:has(.hub.place) .rail, .hub.place .place-say, .hub.place .place-keys, .hub.place .place-e,
.combat.cb3 .cb3-deck, .combat.cb3 .cs-hud, .combat.cb3 .cs-stam, body[data-view="play"] .topbar, .hub.place .w3-lock { zoom: var(--ui); }

/* ---- the key badge --------------------------------------------------------------------------------- */
kbd.hk {
  display: inline-block; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  font: 500 10.5px/15px var(--sans, system-ui, sans-serif); letter-spacing: 0.02em; text-transform: uppercase;
  color: #e8d6aa; background: rgba(0,0,0,0.38); border: 1px solid rgba(232,214,170,0.42); border-radius: 3px;
  text-align: center; vertical-align: middle; margin-right: 7px; flex: 0 0 auto;
}
.btn kbd.hk, .choice kbd.hk { margin-right: 8px; }
.btn:hover kbd.hk { color: #17120a; border-color: rgba(23,18,10,0.5); background: rgba(255,255,255,0.3); }
.btn.cguard:hover kbd.hk, .cmove.cability:hover kbd.hk, .cmove.csubdue:hover kbd.hk, .btn.ghost:hover kbd.hk { color: #e8d6aa; border-color: rgba(232,214,170,0.42); background: rgba(0,0,0,0.38); }
.topnav .linkbtn kbd.hk { margin: 0 0 0 7px; opacity: 0.7; }

/* ---- the place's chrome: four corners, one gutter ------------------------------------------------- */
/* the title block is a local scrim in the corner, not a band across the whole top of the picture */
.hub.place .stage-top {
  right: auto; width: max-content; max-width: 560px; padding: 16px var(--hud-inset) 30px; padding-right: 56px;
  background: radial-gradient(130% 150% at 0% 0%, rgba(9,6,3,0.78) 0%, rgba(9,6,3,0.5) 45%, rgba(9,6,3,0) 75%);
}
.hub.place .stage-loc { font-size: 26px; }
body:has(.hub.place) .rail { left: var(--hud-inset); }
.hub.place .place-say { padding-left: var(--hud-inset); width: 440px; bottom: calc(var(--rail-h, 0px) + 56px); }
.hub.place .place-say > * { font-size: 15px; max-width: 46ch; }
/* the key legend: one 11px row of key and verb pairs, 16px up, nothing 3px from anything */
.hub.place .place-keys { left: var(--hud-inset); bottom: 16px; height: 25px; box-sizing: border-box; font-size: 11px; line-height: 17px; letter-spacing: 0.05em; padding: 0 9px; display: flex; gap: 0 14px; align-items: center; white-space: nowrap; }
.hub.place .place-keys kbd { font-size: 10.5px; line-height: 15px; height: 17px; box-sizing: border-box; padding: 0 4px; margin-right: 1px; display: inline-block; }
.hub.place .place-keys .lg { display: inline-flex; align-items: center; gap: 1px; height: 17px; }
.hub.place .place-say { bottom: calc(var(--rail-h, 0px) + 64px); }
/* (the legend rule above outranks the older hide rules by order, so the fight's and the exchange's hides are restated here) */
.hub.place .place-stage.fighting .place-keys, .hub.place .place-stage.fighting .place-e { display: none; }
.hub.place .place-stage.plated .place-keys { opacity: 0; }
.hub.place .place-keys .lg b { font-weight: 400; margin-left: 5px; color: var(--ink-dim); }
.hub.place .place-e { right: var(--hud-inset); bottom: 14px; }
body[data-view="play"] .topbar { padding-right: var(--hud-inset); padding-left: var(--hud-inset); }
/* the mouse-look hint is a toast at the foot of the picture, not a label in the corner the nav uses */
.hub.place .w3-lock { top: auto; bottom: 48px; left: 50%; right: auto; transform: translateX(-50%); max-width: none; font-size: 11.5px; }
/* the save warning joins the site row instead of covering Settings and About */
#saveTrouble { top: 12px; right: auto; left: 50%; transform: translateX(-50%); }
/* the HUD stays anchored under an open action menu (it is a 600px card; the corners it occupied were bare) */
body:has(.place-menu:is(.open,.closing)) .rail { visibility: visible; opacity: 0.55; pointer-events: none; }
.hub.place:has(.place-menu:is(.open,.closing)) .stage-top { visibility: visible; opacity: 0.55; }
.hub.place:has(.place-menu.open) .w3-lock { display: none; }
/* the action menu's tiles carry their keys */
.place-menu .hub-act { display: flex; align-items: center; }
.place-menu .hub-act kbd.hk { order: -1; margin-right: 9px; }
/* the verse card docks under the site row, not in the sky over the picture */
body:has(.hub.place) .reflection { right: var(--hud-inset); top: 64px; width: 320px; }
/* settings controls at a mouse's size */
.reading-row select { min-height: 32px; }
.reading-actions .btn { min-height: 0; }

/* ---- the exchange is a side panel over the standing world --------------------------------------- */
.hub.place .place-plate {
  top: 0; bottom: 0; left: auto; right: 0; width: clamp(520px, 34vw, 760px); max-height: none;
  overflow-y: auto; overscroll-behavior: contain; z-index: 49;
  background: linear-gradient(90deg, rgba(9,14,17,0.9), rgba(9,14,17,0.97) 18%);
  border-left: 1px solid rgba(217,184,102,0.28); box-shadow: -18px 0 48px rgba(0,0,0,0.45);
}
.hub.place .place-plate.open { animation: plate-slide 0.3s cubic-bezier(0.16,1,0.3,1) both; }
/* the panel's words start under the site row (which is fixed over everything), and the verse card that
   would dock in the same corner hangs beside the panel over the world instead */
.hub.place .place-plate { padding-top: 62px; }
body:has(.hub.place .place-plate.open) .reflection { right: calc(clamp(520px, 34vw, 760px) + var(--hud-inset)); }
@keyframes plate-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hub.place .place-plate.open { animation: none; } }
.place-plate .scene, .place-plate .outcome, .place-plate .nook-body, .place-plate .approach, .place-plate .simple, .place-plate .lesson,
.place-plate .shop, .place-plate .ask, .place-plate .inventory, .place-plate .madrasa, .place-plate .panel {
  background: none; padding: 26px 28px 28px; max-width: none; margin: 0;
}
.place-plate .dialogue { margin: 0 0 16px; }
.place-plate .scene-text, .place-plate .outcome-text { font-size: 16px; line-height: 1.6; }
.place-plate .choices { max-width: none; gap: 6px; }
.place-plate .choice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 10px; padding: 10px 14px; text-align: left; }
.place-plate .choice .choice-tag { text-align: right; }
.place-plate .onward, .place-plate .simple .btn, .place-plate .lesson .btn { margin-top: 10px; }
.place-plate #continue, .place-plate #simpleOn, .place-plate #lessonOn { width: auto; min-width: 180px; display: inline-flex; align-items: center; gap: 8px; }
.place-plate .lesson { border: 0; border-radius: 0; }
.place-plate .action-ring { justify-content: flex-start; }
/* the world is not dimmed to black behind a side panel; the picture is the point */
.hub.place .place-stage.plated .place-dim { opacity: 0.25; }
.hub.place .place-stage.halted ~ .place-say { opacity: 0; }

/* ---- the reading sheets at a monitor's width ---------------------------------------------------- */
#character .modal-card, #journal .modal-card, #system .modal-card { max-width: 920px; }
#character .modal-card { max-width: 980px; }
#character .char-block.char-stats .char-stat-grid { grid-template-columns: repeat(7, 1fr); }
#system .sys-list { display: grid; gap: 8px; margin: 14px 0 6px; }
#system .sys-list .btn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; text-align: left; }

/* ---- the fight: one bar, every verb with its key, the HUD in the corners ------------------------ */
/* the walking HUD stands down: its meters and the place's name plate are the fight's to show */
body:has(.place-stage.fighting) .rail, .hub.place.fighting .stage-top { display: none; }
body[data-view="play"]:has(.combat) .combat.cb3 .cs-hud, .combat.cb3 .cs-hud { top: 22px; width: 320px; max-width: 320px; }
.combat.cb3 .cs-hud.you { left: var(--hud-inset); }
.combat.cb3 .cs-hud.foe { right: var(--hud-inset); }
.combat.cb3 .cs-stam { left: var(--hud-inset); top: 62px; width: 320px; max-width: 320px; }
.combat.cb3 .aim-gauge { top: 72px; left: var(--hud-inset); width: 320px; max-width: 320px; }
/* while S.run.combat is set the site row is dim and inert so Tab goes to the deck first (app.js sets tabindex) */
body:has(.place-stage.fighting) .topbar > * { opacity: 0.3; }
/* the cursor says what the mouse can do: nothing over the ground, a crosshair on his lines */
.place-stage.fighting, .place-stage.fighting .w3-stage, .combat.cb3 .cb3-deck, .combat.cb3 .combat-ctrl { cursor: default; }
.combat.cb3 .strike-zone, .combat-stage .strike-zone { cursor: crosshair; }
/* the deck: a bar across the foot, 24px in, nothing stacked, disabled verbs kept in place */
.combat.cb3 .cb3-deck { padding: 8px 0 12px; background: linear-gradient(to top, rgba(7,10,12,0.9), rgba(7,10,12,0.72) 55%, rgba(7,10,12,0.25) 85%, transparent); }
body[data-view="play"]:has(.combat) .combat.cb3 .combat-ctrl, .combat.cb3 .combat-ctrl, .combat.cb3 .brink-panel { max-width: none; width: auto; }
.combat.cb3 .combat-ctrl:not(.aiming) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
  padding: 2px var(--hud-inset) 0; margin: 0;
}
.combat.cb3 .btn.cguard { width: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 16px; margin: 0; }
.combat.cb3 .cg-l { font-size: 16px; }
.combat.cb3 .cg-m { font-size: 11px; }
.combat.cb3 .cbtn-row, .combat.cb3 .range-row { margin: 0; flex: 0 0 auto; flex-wrap: nowrap; gap: 8px; display: flex; align-items: center; }
.combat.cb3 .cbtn-row .cmove { flex: 0 0 auto; }
.combat.cb3 .cmove.small { padding: 7px 12px; }
.combat.cb3 .cmove .mv-label { display: inline-flex; align-items: center; }
.combat.cb3 .range-row .crange { min-width: 0; }
.combat.cb3 .range-say { font-size: 12px; min-width: 150px; max-width: 190px; line-height: 1.3; }
.combat.cb3 .range-say .arc-say { display: block; }
.combat.cb3 .combat-stances { margin: 0; display: flex; gap: 5px; }
.combat.cb3 .cstance { font-size: 11.5px; padding: 5px 11px; }
.combat.cb3 .combat-stances kbd.hk { margin-right: 4px; }
.combat.cb3 .carc { min-width: 0; padding: 7px 10px; }
.combat.cb3 .carc .mv-label { font-size: 14px; }
/* the edge thumb pads are retired: Q and E sit in the bar beside Close and Give ground */
.combat.cb3 .cb-circle { display: none; }
/* the round reads in one place: the result line and the narration, left-aligned above the bar */
body[data-view="play"]:has(.combat) .combat.cb3 .combat-log, .combat.cb3 .combat-log,
.combat.cb3 .combat-feedback { margin: 0 var(--hud-inset) 2px; text-align: left; max-width: 640px; }
.combat.cb3 .combat-feedback { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 0 3px 10px; background: none; color: #d8c9a2; }
.combat.cb3 .combat-log { font-size: 15px; margin-bottom: 6px; }
/* the charge is drawn on the line you are holding, not in a far corner */
.combat.cb3 .charge-meter, .combat.cb3 .charge-hint { display: none; }
.strike-zone::after {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; width: calc(var(--charge, 0) * 100%);
  background: linear-gradient(90deg, #e8b45c, #f0d99a); opacity: 0; transition: opacity 0.1s; pointer-events: none;
}
.strike-zone.charging::after { opacity: 1; }
.strike-zone.full::after { background: #fff4d6; box-shadow: 0 0 8px rgba(240,217,154,0.9); }
/* the lines are read at rest and explained on hover */
.strike-zone { overflow: visible; }
.strike-zone::before { opacity: 0.35; }
.sz-tag { font-size: 11px; opacity: 0.92; }
.sz-arm { font-size: 10px; opacity: 0.85; }
.strike-zone kbd.hk { position: absolute; left: 5px; top: 5px; margin: 0; }
.sz-tip {
  display: none; position: absolute; left: calc(100% + 12px); top: 0; width: 230px; z-index: 9; text-align: left;
  font: 13px/1.45 var(--serif); font-style: normal; letter-spacing: 0; text-transform: none; color: #e8ddc7;
  background: rgba(10,14,16,0.95); border: 1px solid rgba(217,184,102,0.45); padding: 9px 11px; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.strike-zone[data-zone="high"] .sz-tip { top: auto; bottom: 0; }
.sz-tip b { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #eab9a4; margin-bottom: 3px; }
.sz-tip i { display: block; color: #cbb98a; margin-top: 4px; }
.sz-tip .sz-odds { display: block; margin-top: 5px; color: #f0d99a; font-size: 12.5px; }
.strike-zone:hover .sz-tip { display: block; }
.combat.cb3.charging .sz-tip { display: none; }
/* hover states that keep each verb's own colour instead of the gold slab */
.combat .btn.cguard:hover { color: #eaf4ff; border-color: var(--blue, #7fa8c9); background: linear-gradient(180deg, rgba(127,168,201,0.32), rgba(127,168,201,0.12)); box-shadow: 0 0 0 1px rgba(127,168,201,0.3); }
.combat .btn.cguard:hover .cg-l { color: #eaf4ff; }
.combat .btn.cguard:hover .cg-m { color: #cfe0f0; }
.combat .btn.cguard:hover::before, .combat .cmove.cability:hover::before, .combat .cmove.csubdue:hover::before { content: none; }
.combat .cmove.cability:hover { color: var(--ink); background: rgba(217,184,102,0.2); border-color: var(--gold); }
.combat .cmove.cability:hover .mv-label { color: #f6e8bd; }
.combat .cmove.cability:hover .mv-meta { color: #d9c282; }
.combat .cmove.csubdue:hover { color: var(--ink); background: rgba(143,191,122,0.22); border-color: #a9d497; }
.combat .cmove.csubdue:hover .mv-label { color: #c2e4b1; }
/* a heavy blow coming lights the Guard that answers it, not only a pill over his head */
.combat.telegraph .btn.cguard { border-color: #e06a55; box-shadow: 0 0 0 2px rgba(224,106,85,0.45), 0 0 18px rgba(224,106,85,0.35); animation: tele-pulse 1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .combat.telegraph .btn.cguard { animation: none; } }
/* the brink: a numbered list on the right, under his kneeling figure's side of the frame */
.combat.cb3 .brink-panel { position: absolute; right: var(--hud-inset); bottom: 120px; width: 460px; margin: 0; padding: 0; text-align: left; }
.combat.cb3 .brink-line { margin: 0 0 8px; font-size: 15.5px; max-width: none; }
.combat.cb3 .brink-info { margin: 0 0 10px; max-width: none; }
.combat.cb3 .brink-choices { display: flex; flex-direction: column; gap: 4px; max-width: none; margin: 0; }
.combat.cb3 .brink-choice { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 10px; text-align: left; padding: 7px 12px; }
.combat.cb3 .brink-choice .mv-meta { grid-column: 2; }
.combat.cb3 .brink-choice .mv-label { display: inline-flex; align-items: center; }
/* the aiming layer: a hint line, not a thumb button */
.combat.cb3 .combat-ctrl.aiming { padding: 0 var(--hud-inset) 4px; gap: 6px; }
.combat.cb3 .combat-ctrl.aiming .aim-say { font-size: 13.5px; }
.combat.cb3 .combat-ctrl.aiming #aimRelease { padding: 6px 14px; min-width: 0; }
.combat.cb3 .combat-ctrl.aiming #aimRelease .mv-meta { font-size: 11px; }
/* the painted fallback stage (?cb3=0 or no world): the same bar and the same keys */
body[data-view="play"]:has(.combat) .combat:not(.cb3) .combat-ctrl, body[data-view="play"]:has(.combat) .combat:not(.cb3) .brink-panel { max-width: none; }
body[data-view="play"]:has(.combat) .combat:not(.cb3) .combat-ctrl:not(.aiming) { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; padding: 4px var(--hud-inset) 0; }
.combat:not(.cb3) .btn.cguard { width: auto; display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 16px; }
.combat:not(.cb3) .cbtn-row, .combat:not(.cb3) .range-row { margin: 0; flex: 0 0 auto; flex-wrap: nowrap; }
.combat:not(.cb3) .combat-stances { margin: 0; }
.combat:not(.cb3) .charge-meter, .combat:not(.cb3) .charge-hint { display: none; }
.combat:not(.cb3) .cb-circle { display: none; }
