/* Echoes of Sherborne (first story: Pack Monday). Bradex palette: abbey green, Ham-stone gold, cream. */
:root {
  --green-950: #04160f;
  --green-900: #07261d;
  --green-800: #0b3628;
  --gold: #bca036;
  --gold-light: #e6cf7c;
  --gold-pale: #f3e4ae;
  --cream: #f4efe4;
  --ink: rgba(4, 22, 15, .72);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--green-950); color: var(--cream); font-family: var(--sans); font-weight: 300; -webkit-font-smoothing: antialiased; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
a { color: var(--gold-light); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; min-width: 150px;
  font-family: var(--sans); font-size: .76rem; font-weight: 400; letter-spacing: .22em; text-transform: uppercase;
  border: 1px solid transparent; border-radius: 2px; cursor: pointer; text-decoration: none;
  transition: transform .4s var(--ease), background .3s, border-color .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 3px; }
.btn--gold { background: linear-gradient(135deg, #e2c569, #bca036 50%, #9a8129); color: var(--green-950); }
.btn--ghost { background: rgba(4, 22, 15, .35); border-color: rgba(230, 207, 124, .45); color: var(--gold-light); }
.btn--ghost:hover { border-color: var(--gold-light); background: rgba(230, 207, 124, .08); }

/* ---------------- title screen ---------------- */
.title {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; overflow-y: auto;
  padding: 32px 16px;
  /* light enough to see Sherborne turning behind the title */
  background:
    radial-gradient(ellipse 60% 55% at 50% 55%, rgba(4, 22, 15, .62), rgba(4, 22, 15, .25) 75%),
    linear-gradient(180deg, rgba(4, 22, 15, .1) 0%, rgba(4, 22, 15, .35) 55%, rgba(4, 22, 15, .78) 100%);
  transition: opacity 1.2s var(--ease);
}
.title__inner > * { text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.title__inner > .title__name { text-shadow: none; filter: drop-shadow(0 4px 22px rgba(0, 0, 0, .6)); }
.title.is-leaving { opacity: 0; pointer-events: none; }
.title__inner { width: min(780px, 100%); text-align: center; }
.title__roundel { width: clamp(84px, 14vw, 124px); height: auto; margin: 0 auto 18px; display: block; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .45)); }
.title__eyebrow { margin: 0 0 6px; font-size: .7rem; letter-spacing: .38em; text-transform: uppercase; color: var(--gold); }
.title__name {
  margin: 0; font-family: var(--serif); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  font-size: clamp(2.4rem, 8.4vw, 5rem); line-height: .95; white-space: nowrap;
  background: linear-gradient(105deg, #8a7326 0%, #d9bd57 22%, #f6e9b4 38%, #c9a53a 55%, #8a7326 75%, #e2c569 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 9s linear infinite;
}
@keyframes shimmer { to { background-position: 250% 50%; } }
/* the name in two sizes: a small "Echoes of" over a big "Sherborne" */
.title__pre, .menu__pre { display: block; font-size: .4em; letter-spacing: .42em; margin: 0 0 .22em .42em; color: var(--gold-pale); }
.title__sub { margin: 10px 0 20px; font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--gold-pale); }
.title__lede { margin: 0 auto 26px; max-width: 520px; font-family: var(--serif); font-size: clamp(1.05rem, 2.2vw, 1.22rem); line-height: 1.5; color: rgba(244, 239, 228, .88); }
.title__load { margin: 0 auto 22px; width: min(360px, 100%); }
.title__bar { height: 2px; background: rgba(230, 207, 124, .18); overflow: hidden; }
.title__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .4s var(--ease); }
.title__status { margin: 10px 0 0; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(230, 207, 124, .8); min-height: 1.2em; }
.title__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.title__keys { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 8px 26px; margin: 0 0 22px; }
.title__keys div { display: grid; gap: 2px; }
.title__keys dt { font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.title__keys dd { margin: 0; font-family: var(--serif); font-size: 1.05rem; }
.title__credit { margin: 0; font-size: .74rem; line-height: 1.6; color: rgba(244, 239, 228, .6); }
.title__home { display: inline-block; margin-left: 6px; letter-spacing: .12em; text-decoration: none; border-bottom: 1px solid rgba(230, 207, 124, .4); }
@media (hover: none) and (pointer: coarse) { .title__keys { display: none; } }

/* ---------------- HUD ---------------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud__where { position: absolute; left: 22px; top: 18px; display: grid; gap: 2px; text-shadow: 0 1px 12px rgba(0, 0, 0, .7); transition: opacity .6s; }
.hud__street { font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2.4vw, 1.7rem); color: var(--cream); }
.hud__area { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); }
.hud__purse { position: absolute; right: 116px; top: 14px; display: grid; justify-items: end; gap: 6px; }
/* the corner: sound and the menu */
.hud__corner { position: absolute; z-index: 2; right: 16px; top: 14px; display: flex; gap: 8px; pointer-events: auto; }
.hud__btn {
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid rgba(230, 207, 124, .55); background: rgba(4, 22, 15, .5); color: var(--gold-light);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .25s, border-color .25s, color .25s, transform .3s var(--ease);
}
.hud__btn:hover, .hud__btn[aria-expanded="true"] { background: rgba(230, 207, 124, .16); border-color: var(--gold-light); }
.hud__btn:active { transform: scale(.93); }
.hud__btn:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 3px; }
.hud__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.hud__btn svg path:first-child { fill: currentColor; fill-opacity: .18; }
#hud-menu svg path:first-child { fill: none; }
.hud__btn .w1, .hud__btn .w2, .hud__btn .x { transition: opacity .2s; }
.hud__btn .x { opacity: 0; }
.hud__btn[data-level="0"] .w1, .hud__btn[data-level="0"] .w2, .hud__btn[data-level="1"] .w2 { opacity: 0; }
.hud__btn[data-level="muted"] { color: rgba(230, 207, 124, .62); }
.hud__btn[data-level="muted"] .w1, .hud__btn[data-level="muted"] .w2 { opacity: 0; }
.hud__btn[data-level="muted"] .x { opacity: 1; }
/* the sound popover, under the corner buttons */
.vol {
  position: absolute; right: 0; top: 50px; width: 264px; display: grid; gap: 9px; padding: 12px 14px 12px;
  background: linear-gradient(180deg, rgba(11, 54, 40, .97), rgba(4, 22, 15, .98)); border: 1px solid rgba(230, 207, 124, .45);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55); text-shadow: none;
}
.vol__head { display: flex; align-items: center; justify-content: space-between; font-size: .64rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.vol__mute { padding: 4px 10px; border: 1px solid rgba(230, 207, 124, .4); border-radius: 2px; background: none; color: var(--gold-light); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
.vol__mute:hover, .vol__mute.is-on { background: rgba(230, 207, 124, .14); border-color: var(--gold-light); }
.vol__row, .set__row { display: grid; grid-template-columns: 70px 1fr 38px; align-items: center; gap: 10px; font-size: .8rem; color: rgba(244, 239, 228, .88); }
.vol__row output, .set__row output { text-align: right; font-family: var(--serif); font-size: 1.02rem; color: var(--gold-pale); font-variant-numeric: tabular-nums; }
/* a slider in the house style: a thin gold rule and a brass knob */
.slide { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
.slide::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--gold-light) var(--v, 50%), rgba(230, 207, 124, .2) var(--v, 50%)); }
.slide::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; margin-top: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4cf, #d9bd57 55%, #8a7326); border: 1px solid #5a4a14; box-shadow: 0 0 0 3px rgba(4, 22, 15, .55); }
.slide::-moz-range-track { height: 3px; border-radius: 2px; background: rgba(230, 207, 124, .2); }
.slide::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--gold-light); }
.slide::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4cf, #d9bd57 55%, #8a7326); border: 1px solid #5a4a14; }
.slide:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 2px; }
.slide:disabled { opacity: .35; cursor: default; }
.hud__money { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: .04em; color: var(--gold-light); text-shadow: 0 1px 14px rgba(0, 0, 0, .7); }
.hud__money.is-up { animation: bump .6s var(--ease); }
@keyframes bump { 30% { transform: scale(1.12); color: #fff4cf; } }
.hud__heat { display: flex; gap: 3px; }
.hud__heat svg { width: 22px; height: 22px; fill: rgba(244, 239, 228, .16); transition: fill .3s, transform .3s; }
.hud__heat svg.on { fill: #eef2ff; filter: drop-shadow(0 0 6px rgba(120, 150, 255, .8)); }
.hud__heat.is-flash svg.on { animation: siren .5s steps(2) infinite; }
@keyframes siren { 50% { fill: #6d8cff; } }
.helmet__badge { fill: var(--gold-light); }
.hud__radar {
  position: absolute; left: 20px; bottom: calc(20px + var(--safe-b));
  width: clamp(150px, 20vw, 196px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(230, 207, 124, .75), 0 0 0 5px rgba(4, 22, 15, .55), 0 10px 30px rgba(0, 0, 0, .5);
  background: #0c1d15;
}
.hud__radar canvas { width: 100%; height: 100%; display: block; }
.hud__nav { position: absolute; left: calc(20px + clamp(150px, 20vw, 196px) + 14px); bottom: calc(24px + var(--safe-b)); white-space: nowrap; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #d8ebff; background: rgba(8, 24, 44, .72); border: 1px solid rgba(74, 163, 255, .6); padding: 3px 10px; border-radius: 999px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.hud__nav.is-on { opacity: 1; }
.hud__north { position: absolute; left: 50%; top: 50%; font-size: .62rem; font-weight: 500; letter-spacing: .1em; color: var(--gold-light); transform: translate(-50%, -50%); text-shadow: 0 0 4px #000; }
.hud__time { position: absolute; right: 20px; bottom: calc(20px + var(--safe-b)); display: flex; align-items: center; gap: 12px; }
.hud__clock { display: grid; justify-items: end; gap: 2px; text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.hud__clock > span:first-child { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; color: var(--cream); }
.hud__speed { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--gold-light); min-height: 1em; }
.dial { width: 68px; height: 68px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55)); }
.dial__case { fill: #b8922c; stroke: #f0d77f; stroke-width: 1.5; }
.dial__face { fill: #0e5a3c; stroke: #3f2e08; stroke-width: 1; }
.dial__tick { stroke: #e0c066; stroke-width: 1.6; }
.dial__word { font-family: var(--serif); font-weight: 600; font-size: 7px; letter-spacing: 1px; fill: #e0c066; text-anchor: middle; }
.dial__hand { stroke: #f3dc8c; stroke-linecap: round; }
.dial__hand--h { stroke-width: 3.2; }
.dial__hand--m { stroke-width: 2; }
.dial__cap { fill: #f3dc8c; }
.hud__health { position: absolute; left: 20px; bottom: calc(20px + var(--safe-b) + clamp(150px, 20vw, 196px) + 12px); width: clamp(150px, 20vw, 196px); height: 3px; background: rgba(244, 239, 228, .15); }
.hud__health i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8a3a2a, #d05a3a); transition: width .3s; }
.hud__health.is-car i { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.hud__objective {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%); max-width: min(560px, 60vw);
  text-align: center; font-family: var(--serif); font-size: clamp(1.02rem, 2vw, 1.3rem); line-height: 1.3; color: var(--cream);
  padding: 8px 18px; background: linear-gradient(90deg, transparent, rgba(4, 22, 15, .6) 20%, rgba(4, 22, 15, .6) 80%, transparent);
  opacity: 0; transition: opacity .6s;
}
.hud__objective.is-on { opacity: 1; }
.hud__objective b { font-weight: 600; color: var(--gold-light); font-style: italic; }
.hud__timer { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--gold-light); text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.hud__timer.is-low { color: #ff8a6a; }
.hud__prompt {
  position: absolute; left: 50%; bottom: calc(200px + var(--safe-b)); transform: translateX(-50%);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--cream);
  padding: 8px 14px; background: rgba(4, 22, 15, .72); border: 1px solid rgba(230, 207, 124, .35);
  opacity: 0; transition: opacity .25s;
}
.hud__prompt.is-on { opacity: 1; }
.hud__prompt kbd { font-family: var(--serif); font-size: 1rem; color: var(--gold-light); margin-right: 8px; }
.hud__subtitle {
  position: absolute; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%);
  width: min(720px, calc(100% - 32px)); text-align: center;
  font-family: var(--serif); font-size: clamp(1.1rem, 2.2vw, 1.38rem); line-height: 1.38; color: var(--cream);
  text-shadow: 0 1px 3px #000, 0 0 18px rgba(0, 0, 0, .8);
  opacity: 0; transition: opacity .4s;
}
.hud__subtitle.is-on { opacity: 1; }
.hud__subtitle .who { display: block; margin-bottom: 2px; font-family: var(--sans); font-size: .64rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); }
.hud__toast { position: absolute; right: 22px; top: 124px; display: grid; justify-items: end; gap: 6px; }
.hud__toast div { font-family: var(--serif); font-size: 1.1rem; color: var(--gold-pale); text-shadow: 0 1px 10px #000; animation: toast 3.2s var(--ease) forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 12%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.hud__flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 40%, rgba(160, 20, 10, .45)); opacity: 0; transition: opacity .5s; }
.hud__flash.is-on { opacity: 1; transition: none; }

/* ---------------- title cards ---------------- */
.card { position: fixed; inset: 0; z-index: 20; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 16px; }
.card__eyebrow { font-size: .72rem; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); opacity: 0; transform: translateY(8px); transition: all .9s var(--ease); }
.card__title { margin: 8px 0; font-family: var(--serif); font-weight: 600; font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1; letter-spacing: .06em; color: var(--cream); text-shadow: 0 4px 40px rgba(0, 0, 0, .7); opacity: 0; transform: translateY(12px); transition: all 1s var(--ease) .1s; }
.card__sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.5rem); color: var(--gold-pale); text-shadow: 0 2px 20px rgba(0, 0, 0, .8); opacity: 0; transform: translateY(8px); transition: all 1s var(--ease) .25s; }
.card.is-on .card__eyebrow, .card.is-on .card__title, .card.is-on .card__sub { opacity: 1; transform: none; }
/* Guy Ritchie freeze-frame name card: bottom left, slightly askew */
.card.is-name { place-content: end start; padding: 0 0 calc(18vh + var(--safe-b)) 7vw; text-align: left; }
.card.is-name .card__title { font-size: clamp(2rem, 6vw, 3.8rem); transform: translateX(-20px) rotate(-2deg); }
.card.is-name.is-on .card__title { transform: rotate(-2deg); }
.card.is-name .card__sub { max-width: 440px; }
.card.is-bad .card__title { color: #f0e0d0; }
.card.is-portrait { background: radial-gradient(ellipse at center, rgba(10, 12, 20, .55), transparent 70%); }
.card.is-portrait .card__title { font-style: italic; color: #f6e7b8; text-shadow: 0 0 30px rgba(170, 200, 255, .45), 0 4px 40px rgba(0, 0, 0, .8); }
.card.is-portrait .card__eyebrow { color: #cfe0ff; }
.card.is-portrait .card__sub { max-width: 560px; margin: 0 auto; }
.letterbox i { position: fixed; left: 0; right: 0; height: 11vh; background: #000; z-index: 15; transition: transform .8s var(--ease); pointer-events: none; }
.letterbox i:first-child { top: 0; transform: translateY(-100%); }
.letterbox i:last-child { bottom: 0; transform: translateY(100%); }
.letterbox.is-on i { transform: none; }
.freeze #game { filter: saturate(.35) contrast(1.15) sepia(.25); transition: filter .15s; }

/* ---------------- pause menu ---------------- */
.menu { position: fixed; inset: 0; z-index: 25; display: flex; overflow-y: auto; padding: 16px; background: rgba(4, 22, 15, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.menu__inner { width: min(420px, 100%); margin: auto; text-align: center; }
.menu__roundel { width: 72px; height: 72px; display: block; margin: 0 auto 10px; }
.menu__title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 2.2rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-light); }
.menu__chapter { margin: 4px 0 22px; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--gold-pale); }
.menu__buttons { display: grid; gap: 10px; }
.menu__credit { margin: 22px 0 0; font-size: .66rem; line-height: 1.6; color: rgba(244, 239, 228, .55); }
.menu__head { margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: 1.55rem; letter-spacing: .08em; color: var(--gold-light); }
.menu__back { width: 100%; margin-top: 16px; }
/* chosen with the keys or a gamepad */
.menu .btn.is-sel { border-color: var(--gold-light); background: rgba(230, 207, 124, .14); box-shadow: inset 0 0 0 1px var(--gold-light); }
.menu .btn--gold.is-sel { box-shadow: 0 0 0 2px var(--green-950), 0 0 0 3px var(--gold-pale); }
.menu .set__row.is-sel, .menu .set__check.is-sel { background: rgba(230, 207, 124, .08); box-shadow: inset 0 0 0 1px rgba(230, 207, 124, .55); }
.menu .chip.is-sel { box-shadow: inset 0 0 0 1px var(--gold-light); }
@media (max-height: 640px) { .menu__roundel { display: none; } .menu__chapter { margin-bottom: 14px; } }
/* settings */
.set { display: grid; gap: 7px; text-align: left; }
.set__group { margin: 10px 0 2px; padding-bottom: 5px; font-size: .62rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid rgba(230, 207, 124, .2); }
.set__group:first-child { margin-top: 0; }
.set__row { padding: 4px 8px; margin: 0 -8px; }
.btn--row { min-width: 0; width: 100%; justify-content: space-between; padding: 10px 14px; letter-spacing: .18em; }
.btn--row b { font-family: var(--serif); font-size: 1.05rem; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--cream); }
.set__note { margin: -2px 0 0; font-size: .72rem; line-height: 1.4; color: rgba(244, 239, 228, .55); }
.set__check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; font-size: .84rem; color: rgba(244, 239, 228, .88); cursor: pointer; }
.set__check input { accent-color: #bca036; width: 18px; height: 18px; margin: 0; }
/* waiting for a later hour */
.wait__dial { display: block; width: min(232px, 62vw); height: auto; margin: 0 auto 10px; touch-action: none; cursor: pointer; overflow: visible; }
.clock__ring { fill: none; stroke: rgba(230, 207, 124, .16); stroke-width: 16; }
.clock__day { fill: none; stroke: rgba(230, 207, 124, .2); stroke-width: 16; }
.clock__night { fill: none; stroke: rgba(70, 92, 150, .42); stroke-width: 16; }
.clock__arc { fill: none; stroke: var(--gold-light); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(243, 220, 140, .5)); }
.clock__tick { stroke: rgba(244, 239, 228, .45); stroke-width: 1; }
.clock__tick.is-big { stroke: rgba(244, 239, 228, .8); stroke-width: 1.6; }
.clock__num { font-family: var(--sans); font-size: 9px; letter-spacing: .06em; fill: rgba(244, 239, 228, .7); text-anchor: middle; dominant-baseline: central; }
.clock__glyph { font-size: 12px; text-anchor: middle; dominant-baseline: central; }
.clock__now { fill: var(--cream); stroke: var(--green-950); stroke-width: 2; }
.clock__hand { stroke: var(--gold-light); stroke-width: 2.4; stroke-linecap: round; }
.clock__knob { fill: #d9bd57; stroke: var(--green-950); stroke-width: 2.5; }
.clock__time { font-family: var(--serif); font-weight: 600; font-size: 25px; fill: var(--cream); text-anchor: middle; }
.clock__in { font-family: var(--sans); font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; fill: var(--gold-light); text-anchor: middle; }
.wait__presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 10px; }
.chip {
  display: grid; gap: 1px; justify-items: center; padding: 7px 2px 6px; border: 1px solid rgba(230, 207, 124, .32); border-radius: 2px;
  background: rgba(4, 22, 15, .35); color: var(--gold-light); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.chip b { font-family: var(--serif); font-size: .98rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--cream); }
.chip:hover, .chip.is-on { border-color: var(--gold-light); background: rgba(230, 207, 124, .14); }
.wait__fine { margin: 0 -8px 8px; }
.wait__why { margin: 0 0 10px; font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: #f0b08a; }
.wait__go { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wait__go .btn { min-width: 0; }
.wait__go .btn:disabled { opacity: .4; cursor: default; transform: none; }
/* the fade, over everything (the map and the menu) while you travel or wait */
.fade.is-top { z-index: 40; }

/* ---------------- big map ---------------- */
.bigmap { position: fixed; inset: 0; z-index: 24; background: #efe6cf; cursor: grab; }
.bigmap:active { cursor: grabbing; }
.bigmap canvas { width: 100%; height: 100%; display: block; -webkit-touch-callout: none; }
.bigmap__legend { position: absolute; left: 20px; bottom: calc(18px + var(--safe-b)); display: grid; gap: 2px; padding: 10px 14px; background: rgba(239, 230, 207, .9); border: 1px solid #b49a5a; color: #3a2e18; font-size: .72rem; letter-spacing: .08em; }
.bigmap__title { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; letter-spacing: .16em; text-transform: uppercase; color: #07261d; }
.bigmap__tip { color: #14325a; }
/* right-click (or long-press) on the map: where's this, and go there */
.mapmenu {
  position: absolute; z-index: 2; width: 248px; padding: 10px 0 4px; cursor: default;
  background: rgba(246, 240, 222, .97); border: 1px solid #b49a5a; box-shadow: 0 14px 34px rgba(40, 30, 10, .35); color: #2c2414;
}
.mapmenu__place { margin: 0 14px; font-family: var(--serif); font-weight: 600; font-size: 1.22rem; line-height: 1.15; color: #07261d; }
.mapmenu__area { margin: 2px 14px 8px; font-size: .6rem; letter-spacing: .26em; text-transform: uppercase; color: #8a6a20; }
.mapmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px dotted rgba(120, 90, 40, .35);
  background: none; color: #07261d; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; text-align: left; cursor: pointer;
}
.mapmenu button::before { content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg); background: #b8922c; border: 1px solid #1a1405; }
.mapmenu button[data-mm="pin"]::before { background: #4aa3ff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.mapmenu button:hover, .mapmenu button.is-sel { background: rgba(180, 154, 90, .22); }
.mapmenu button:disabled { color: rgba(44, 36, 20, .4); cursor: default; background: none; }
.mapmenu button:disabled::before { opacity: .4; }
.mapmenu__why { margin: 6px 14px 6px; font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.3; color: #8a3a1a; }

/* ---------------- touch ---------------- */
.touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.touch__stick { position: absolute; left: 0; bottom: 0; width: 50%; height: 60%; pointer-events: auto; }
.touch__knob { position: absolute; left: 90px; bottom: calc(110px + var(--safe-b)); width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(230, 207, 124, .25); border: 1px solid rgba(230, 207, 124, .6); transition: transform .08s; }
.touch__stick.is-active .touch__knob { background: rgba(230, 207, 124, .4); }
.touch__buttons { position: absolute; right: 16px; bottom: calc(120px + var(--safe-b)); display: grid; grid-template-columns: repeat(2, 58px); gap: 12px; pointer-events: auto; }
.touch__buttons button { width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(230, 207, 124, .6); background: rgba(4, 22, 15, .55); color: var(--gold-light); font-family: var(--serif); font-size: 1.2rem; }
.touch__buttons button:active { background: rgba(230, 207, 124, .3); }
@media (hover: none) and (pointer: coarse) { .hud__radar { width: 128px; } .hud__nav { left: 158px; } .hud__health { width: 128px; bottom: calc(160px + var(--safe-b)); } .dial { width: 54px; height: 54px; } .hud__objective { top: 60px; max-width: 86vw; } }
/* a phone held upright: smaller corner buttons, the purse beside them, long street names cut short */
@media (max-width: 560px) {
  .hud__corner { right: 10px; top: 10px; gap: 6px; }
  .hud__btn { width: 36px; height: 36px; }
  .hud__btn svg { width: 18px; height: 18px; }
  .hud__purse { right: 96px; top: 9px; gap: 4px; }
  .hud__money { font-size: 1.32rem; }
  .hud__heat svg { width: 16px; height: 16px; }
  .hud__where { left: 14px; top: 12px; max-width: calc(100% - 214px); }
  .hud__street { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hud__toast { right: 12px; top: 88px; }
  .vol { position: fixed; right: 10px; top: 54px; width: min(280px, calc(100vw - 20px)); }
}

.noscript { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 1.4rem; }

/* ---------------- doors, plaques, the crosshair, the hint ---------------- */
.fade { position: fixed; inset: 0; z-index: 19; background: #000; opacity: 0; pointer-events: none; transition: opacity .22s; }
.fade.is-on { opacity: 1; }
.hud__cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(244, 239, 228, .85); box-shadow: 0 0 0 1px rgba(4, 22, 15, .6); opacity: 0; transition: opacity .2s; }
.hud__cross.is-on { opacity: .75; }
.hud__plaque {
  position: absolute; left: 22px; top: 34%; width: min(360px, calc(100% - 44px)); display: grid; gap: 6px;
  padding: 14px 18px; background: rgba(4, 22, 15, .82); border-left: 3px solid var(--gold); color: var(--cream);
  font-size: .86rem; line-height: 1.5; opacity: 0; transform: translateX(-10px); transition: opacity .4s, transform .4s var(--ease); pointer-events: none;
}
.hud__plaque.is-on { opacity: 1; transform: none; }
.hud__plaque b { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--gold-light); letter-spacing: .02em; }
.hud__hint { position: absolute; left: 22px; top: 76px; font-size: .64rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(244, 239, 228, .85); text-shadow: 0 1px 8px #000; opacity: 0; transition: opacity .8s; }
.hud__hint.is-on { opacity: 1; }
.hud__hint kbd, .controls kbd { font-family: var(--serif); font-size: .95rem; letter-spacing: 0; color: var(--gold-light); margin-right: 4px; }
.hud__hint span { margin: 0 6px; color: var(--gold); }
@media (hover: none) and (pointer: coarse) { .hud__hint { display: none; } .hud__plaque { top: 22%; font-size: .8rem; } }

/* ---------------- controls ---------------- */
.controls { position: fixed; inset: 0; z-index: 26; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(4, 22, 15, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.controls__inner { width: min(980px, 100%); }
.controls__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.controls__title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 2.2rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-light); }
.controls__close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(230, 207, 124, .5); background: transparent; color: var(--gold-light); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.controls__close:hover { background: rgba(230, 207, 124, .1); }
.controls__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.controls__card { padding: 16px 18px; border: 1px solid rgba(230, 207, 124, .22); background: rgba(4, 22, 15, .45); }
.controls__card h3 { margin: 0 0 10px; font-size: .7rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.controls__card dl { margin: 0; display: grid; gap: 7px; }
.controls__card dl div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px dotted rgba(230, 207, 124, .15); padding-bottom: 5px; }
.controls__card dt { font-size: .86rem; color: rgba(244, 239, 228, .85); }
.controls__card dd { margin: 0; font-family: var(--serif); font-size: 1.05rem; color: var(--gold-pale); text-align: right; white-space: nowrap; }
.controls__opts { display: flex; flex-wrap: wrap; gap: 14px 28px; margin: 18px 0 8px; font-size: .84rem; color: rgba(244, 239, 228, .85); }
.controls__opts label { display: inline-flex; align-items: center; gap: 10px; }
.controls__opts input[type=range] { accent-color: #bca036; width: 160px; }
.controls__opts input[type=checkbox] { accent-color: #bca036; width: 18px; height: 18px; }
.controls__foot { margin: 8px 0 0; font-size: .78rem; color: rgba(244, 239, 228, .6); }
.touch__look { position: absolute; right: 0; top: 60px; width: 50%; height: calc(52% - 60px); pointer-events: auto; }   /* (clear of the corner buttons) */

@media (prefers-reduced-motion: reduce) {
  .title__name { animation: none; }
}

/* ---------------- conversations ---------------- */
.talk {
  position: fixed; left: 50%; bottom: calc(34px + var(--safe-b)); z-index: 18; transform: translate(-50%, 12px);
  width: min(760px, calc(100% - 32px)); padding: 13px 22px 14px;
  background: linear-gradient(180deg, rgba(7, 38, 29, .93), rgba(4, 22, 15, .96)); border-top: 1px solid var(--gold); border-bottom: 1px solid rgba(230, 207, 124, .25);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); color: var(--cream); opacity: 0; transition: opacity .25s, transform .35s var(--ease); pointer-events: auto; cursor: pointer;
}
.talk.is-on { opacity: 1; transform: translate(-50%, 0); }
.talk__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; min-height: 1em; }
.talk__who { font-family: var(--sans); font-size: .7rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-light); }
.talk__title { font-family: var(--serif); font-style: italic; font-size: 1rem; color: rgba(243, 228, 174, .75); }
.talk__text { margin: 0; min-height: 1.4em; font-family: var(--serif); font-size: clamp(1.12rem, 2.2vw, 1.4rem); line-height: 1.42; }
.talk.is-narration .talk__text { font-style: italic; color: var(--gold-pale); }
.talk.is-ghost { background: linear-gradient(180deg, rgba(18, 34, 58, .9), rgba(8, 16, 30, .95)); border-top-color: #9fc2ff; box-shadow: 0 0 40px rgba(120, 170, 255, .25), 0 18px 50px rgba(0, 0, 0, .55); }
.talk.is-ghost .talk__who { color: #cfe0ff; text-shadow: 0 0 10px rgba(140, 180, 255, .8); }
.talk.is-ghost .talk__text { color: #eef3ff; text-shadow: 0 0 14px rgba(140, 180, 255, .35); }
.talk__choices { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.talk__choices:empty { display: none; }
.talk__choices button {
  display: flex; align-items: baseline; gap: 10px; text-align: left; padding: 6px 12px; cursor: pointer;
  background: rgba(230, 207, 124, .05); border: 1px solid rgba(230, 207, 124, .22); color: var(--cream); font-family: var(--serif); font-size: 1.08rem;
}
.talk__choices button:hover, .talk__choices button.is-sel { background: rgba(230, 207, 124, .16); border-color: var(--gold-light); }
.talk__choices kbd, .shop kbd, .book kbd { font-family: var(--serif); font-size: .95rem; color: var(--gold-light); }
.talk__more { position: absolute; right: 18px; bottom: 10px; font-size: .64rem; letter-spacing: .2em; color: var(--gold); opacity: 0; transition: opacity .2s; }
.talk__more.is-on { opacity: .9; animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(3px); } }
body.is-talking .hud__subtitle, body.is-talking .hud__prompt, body.is-shopping .hud__prompt { opacity: 0 !important; }

/* ---------------- shops ---------------- */
.shop { position: fixed; inset: 0; z-index: 22; display: grid; place-items: center; padding: 16px; background: rgba(4, 22, 15, .45); }
.shop__inner { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px 20px 12px; scrollbar-width: thin; scrollbar-color: rgba(230, 207, 124, .45) transparent; background: linear-gradient(180deg, #0b3628, #07261d); border: 1px solid rgba(230, 207, 124, .45); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.shop__inner.is-shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shop__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.shop__title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: .06em; color: var(--gold-light); }
.shop__sub { margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold-pale); }
.shop__purse, .book__purse { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; color: var(--gold-light); white-space: nowrap; }
.shop__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.shop__list button {
  width: 100%; display: grid; grid-template-columns: 22px 1fr auto; grid-template-areas: "k n p" "k d p"; column-gap: 12px; align-items: baseline; text-align: left;
  padding: 6px 12px; cursor: pointer; background: rgba(4, 22, 15, .5); border: 1px solid rgba(230, 207, 124, .18); color: var(--cream);
}
.shop__list button:hover, .shop__list button.is-sel { background: rgba(230, 207, 124, .13); border-color: var(--gold-light); }
.shop__list button.is-poor .shop__price { color: #d88a6a; }
.shop__list kbd { grid-area: k; }
.shop__name { grid-area: n; font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.shop__name em { font-size: .9rem; color: var(--gold); }
.shop__desc { grid-area: d; font-size: .76rem; line-height: 1.3; color: rgba(244, 239, 228, .68); }
.shop__price { grid-area: p; align-self: center; font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--gold-light); }
.shop__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: .74rem; letter-spacing: .08em; color: rgba(244, 239, 228, .7); }
.shop__foot .btn { min-width: 0; padding: 10px 18px; }

/* ---------------- the pocketbook ---------------- */
.book { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; padding: 16px; background: rgba(4, 22, 15, .72); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.book__inner {
  width: min(760px, 100%); height: min(620px, calc(100vh - 32px)); display: grid; grid-template-rows: auto 1fr auto;
  background: #f1e8cf linear-gradient(90deg, rgba(120, 90, 40, .08), transparent 6%, transparent 94%, rgba(120, 90, 40, .08)); color: #2c2414;
  border: 1px solid #b49a5a; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 60px rgba(120, 90, 40, .15);
}
.book__head { display: flex; align-items: center; gap: 18px; padding: 16px 22px 10px; border-bottom: 1px solid rgba(120, 90, 40, .3); }
.book__title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.7rem; letter-spacing: .08em; color: #07261d; }
.book__tabs { display: flex; gap: 4px; flex: 1; }
.book__tabs button { padding: 6px 14px; border: 1px solid transparent; background: none; cursor: pointer; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: #6a5a38; }
.book__tabs button.is-on { border-color: #b49a5a; background: rgba(180, 154, 90, .15); color: #07261d; }
.book__purse { color: #7a5a10; font-size: 1.4rem; }
.book__close { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #b49a5a; background: none; color: #5a4a20; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.book__page { overflow-y: auto; padding: 8px 26px 16px; }
.book__page h4 { margin: 16px 0 6px; font-size: .64rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: #8a6a20; }
.book__entry, .book__item { padding: 10px 0; border-bottom: 1px dotted rgba(120, 90, 40, .35); }
.book__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.book__entry h3, .book__item h3 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: #1e2a1a; }
.book__item h3 span { font-weight: 400; color: #8a6a20; }
.book__entry p, .book__item p { margin: 3px 0 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.4; color: #3a301c; }
.book__entry .book__obj { font-style: italic; color: #07261d; }
.book__entry.is-done h3 { color: #7a6a4a; text-decoration: line-through; text-decoration-color: rgba(120, 90, 40, .5); }
.book__item .btn { min-width: 0; padding: 8px 14px; color: #07261d; border-color: #b49a5a; background: rgba(180, 154, 90, .12); }
.book__empty, .book__note { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: #6a5a38; }
.book__foot { margin: 0; padding: 8px 22px 12px; font-size: .68rem; letter-spacing: .12em; color: #6a5a38; border-top: 1px solid rgba(120, 90, 40, .2); }
.book kbd { color: #7a5a10; }
.book__foot span { margin: 0 6px; }
@media (hover: none) and (pointer: coarse) { .talk { bottom: calc(150px + var(--safe-b)); } .talk__text { min-height: 2em; } }

/* ---------------- Becoming a Local (local.js): the chip, the rank card, the pocketbook's Goals and People, the week ---------------- */
.hud__rank { display: grid; justify-items: end; gap: 3px; margin-top: 1px; text-shadow: 0 1px 10px rgba(0, 0, 0, .75); }
.hud__rank b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.04rem; letter-spacing: .02em; color: var(--gold-pale); }
.hud__rank i { display: block; width: 96px; height: 2px; background: rgba(244, 239, 228, .18); box-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.hud__rank span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width .8s var(--ease); }
.hud__rank.is-up b { animation: bump .9s var(--ease); }
@media (max-width: 560px) { .hud__rank b { font-size: .9rem; } .hud__rank i { width: 72px; } }
/* the rank-up card: a gold seal over the title */
.card.is-rank { background: radial-gradient(ellipse at center, rgba(4, 22, 15, .55), transparent 62%); }
.card.is-rank::before {
  content: ""; justify-self: center; width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff4cf, #e2c569 28%, #bca036 58%, #7a6420);
  box-shadow: inset 0 0 0 7px rgba(122, 100, 32, .35), inset 0 0 0 9px rgba(255, 244, 207, .45), 0 0 0 2px #7a6420, 0 0 0 6px rgba(230, 207, 124, .3), 0 10px 34px rgba(0, 0, 0, .55);
  opacity: 0; transform: scale(.6) rotate(-25deg); transition: opacity .8s var(--ease), transform 1s var(--ease);
}
.card.is-rank.is-on::before { opacity: 1; transform: none; }
.card.is-rank .card__title { color: var(--gold-light); letter-spacing: .1em; }
/* (the prompt steps aside while the rank card is up: it sat behind the title) */
body:has(#card.is-rank.is-on) .hud__prompt { opacity: 0; }
/* the rank card goes along the top, the seal beside its words, where the objective sits (that steps aside
   for it): in the middle it covered the picture (the tankard on its hook). hud.js holds it back while a
   conversation, a scene, a shop or a minigame is up, or a toast; one starting meanwhile hides it */
.card.is-rank {
  place-content: start center; grid-template-columns: auto minmax(0, auto); column-gap: 14px; align-items: center; text-align: left;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 0;
  background: radial-gradient(ellipse min(420px, 74vw) 100px at 50% 54px, rgba(4, 22, 15, .74), transparent 100%);
}
.card.is-rank::before { grid-row: 1 / span 3; grid-column: 1; width: 54px; height: 54px; margin: 0; }
.card.is-rank > * { grid-column: 2; }
.card.is-rank .card__eyebrow { font-size: .62rem; letter-spacing: .34em; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
body:has(#card.is-rank.is-on) .hud__hint { opacity: 0; }
.card.is-rank .card__title { margin: 3px 0 4px; font-size: clamp(1.5rem, 3.4vw, 2.3rem); }
.card.is-rank .card__sub { max-width: 380px; font-size: clamp(.95rem, 1.8vw, 1.12rem); line-height: 1.3; }
body:has(#card.is-rank.is-on) .hud__objective { opacity: 0; }
body.is-talking #card.is-rank, body.is-cine #card.is-rank { opacity: 0; transition: opacity .25s; }
/* (a phone held upright: under the street name and the purse, where its objective goes) */
@media (max-width: 560px) { .card.is-rank { padding-top: calc(96px + env(safe-area-inset-top, 0px)); } .card.is-rank .card__sub { max-width: 250px; } }
/* a minigame's own panel up (the rave's floor, the week card; turing.js asides the plaque for its wheel
   itself): the plaque steps aside */
body:has(#rave-ui, #week:not([hidden]), .tur-wheel) .hud__plaque { visibility: hidden; }
/* the title screen and the pause menu */
.title__rank { margin: -12px 0 22px; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--gold-pale); }
.title__rank:empty, .menu__rank:empty { display: none; }
.menu__rank { margin: -16px 0 20px; font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
/* seals and padlocks (drawn, not emoji) */
.seal { display: block; width: 64px; height: 64px; margin: 0 auto; filter: drop-shadow(0 3px 6px rgba(60, 40, 0, .35)); }
.seal__rim { fill: #c9a53a; stroke: #7a6420; stroke-width: 1; }
.seal__ring { fill: #e2c569; stroke: #7a6420; stroke-width: 1.2; }
.seal__mark { fill: none; stroke: #5a4410; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lock { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
/* the pocketbook: four tabs, which wrap on a narrow screen */
.book__tabs { flex-wrap: wrap; }
@media (max-width: 680px) { .book__head { flex-wrap: wrap; gap: 8px 14px; } .book__title { font-size: 1.35rem; } .book__tabs { order: 3; flex-basis: 100%; } .book__tabs button { padding: 6px 9px; letter-spacing: .14em; } .book__page { padding: 6px 16px 14px; } }
.book__page h4 span { margin-left: 8px; letter-spacing: .1em; color: #6a5a38; }
.book__tag { margin-left: 6px; font-family: var(--sans); font-size: .58rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; vertical-align: 3px; color: #8a6a20; }
/* Goals: the standing meter, then the checklists */
.standing { display: flex; gap: 18px; align-items: center; margin: 12px 0 4px; padding: 14px 16px; border: 1px solid rgba(180, 154, 90, .6); background: rgba(180, 154, 90, .1); }
.standing__seal .seal { width: 68px; height: 68px; }
.standing__body { flex: 1; min-width: 0; }
.standing__eyebrow { margin: 0; font-size: .6rem; letter-spacing: .32em; text-transform: uppercase; color: #8a6a20; }
.standing__title { margin: 2px 0 0; font-family: var(--serif); font-weight: 600; font-size: 1.75rem; letter-spacing: .06em; color: #07261d; }
.standing__blurb { margin: 0 0 9px; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: #3a301c; }
.standing__bar { height: 4px; background: rgba(120, 90, 40, .18); }
.standing__bar i { display: block; height: 100%; background: linear-gradient(90deg, #9a8129, #d9bd57); }
.standing__next { margin: 6px 0 0; font-size: .76rem; letter-spacing: .06em; color: #5a4a20; }
.standing__lock { margin-left: 8px; color: #8a3a1a; white-space: nowrap; }
.goals { list-style: none; margin: 0; padding: 0; }
.goal { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dotted rgba(120, 90, 40, .3); }
.goal__tick { flex: none; position: relative; width: 13px; height: 13px; border: 1.5px solid #8a6a20; border-radius: 2px; transform: translateY(1px); }
.goal.is-done .goal__tick { background: #07261d; border-color: #07261d; }
.goal.is-done .goal__tick::after { content: ""; position: absolute; left: 3px; top: 0; width: 3.5px; height: 7px; border: solid #f1e8cf; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.goal__body { flex: 1; min-width: 0; display: grid; }
.goal__body b { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; color: #1e2a1a; }
.goal.is-done .goal__body b { color: #5a4a2a; }
.goal__hint { font-family: var(--serif); font-style: italic; font-size: .98rem; color: #6a5a38; }
.goal__count { font-size: .74rem; letter-spacing: .08em; color: #5a4a20; white-space: nowrap; }
.goal__nods { min-width: 2.2em; text-align: right; font-style: normal; font-family: var(--serif); font-weight: 600; font-size: 1rem; color: #8a6a20; }
.goal.is-secret .goal__body b { letter-spacing: .3em; color: #8a7a5a; }
.goals__foot { margin-top: 14px; font-size: 1.02rem; }
/* People: the cameos you've met (and those you haven't), then the echoes */
.people, .echoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.person, .echo { padding: 10px 12px 12px; border: 1px solid rgba(180, 154, 90, .55); background: rgba(255, 250, 235, .45); }
.person h3, .echo h3 { margin: 0; font-family: var(--serif); font-size: 1.22rem; font-weight: 600; color: #1e2a1a; }
.person:not(.is-met) { border-style: dashed; background: none; }
.person:not(.is-met) h3 { font-style: italic; font-weight: 500; color: #6a5a38; }
.person__title { margin: 1px 0 0; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #8a6a20; }
.person:not(.is-met) .person__title { font-family: var(--serif); font-size: 1rem; font-style: italic; letter-spacing: 0; text-transform: none; color: #5a4a2a; }
.person blockquote { margin: 7px 0 0; font-family: var(--serif); font-style: italic; font-size: 1rem; line-height: 1.35; color: #3a301c; }
.person__now { margin: 6px 0 0; font-size: .7rem; letter-spacing: .08em; color: #2f5a3a; }
.person__tip { margin: 6px 0 0; font-family: var(--serif); font-size: .98rem; color: #14325a; }
.person__tasks { list-style: none; margin: 8px 0 0; padding: 6px 0 0; display: grid; gap: 2px; border-top: 1px dotted rgba(120, 90, 40, .35); font-family: var(--serif); font-size: .98rem; color: #3a301c; }
.person__tasks li { display: flex; align-items: baseline; gap: 7px; }
.person__tasks li::before { content: ""; flex: none; width: 7px; height: 7px; border: 1.5px solid #8a6a20; border-radius: 50%; }
.person__tasks li.is-done { color: #7a6a4a; text-decoration: line-through; text-decoration-color: rgba(120, 90, 40, .5); }
.person__tasks li.is-done::before { background: #07261d; border-color: #07261d; }
.person__tasks li.is-on { color: #07261d; font-weight: 600; }
.echo__dates { font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; color: #3d5a8a; }
.echo p { margin: 4px 0 0; font-family: var(--serif); font-size: .98rem; line-height: 1.35; color: #3a301c; }
.echo .btn, .lore__back { min-width: 0; margin-top: 8px; padding: 6px 12px; font-size: .64rem; color: #07261d; border-color: #b49a5a; background: rgba(180, 154, 90, .12); }
/* a page to read (addPage: Alan Turing's, and the others) */
.lore { padding: 4px 0 12px; }
.lore__title { margin: 12px 0 2px; font-family: var(--serif); font-weight: 600; font-size: 1.8rem; letter-spacing: .02em; color: #07261d; }
.lore__sub { margin: 0 0 12px; font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: #8a6a20; }
.lore__body { font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; color: #2c2414; user-select: text; -webkit-user-select: text; }
.lore__body p { margin: 0 0 .7em; }
.lore__body b, .lore__body strong { font-weight: 600; color: #07261d; }
.lore__body blockquote { margin: .8em 0; padding-left: 14px; border-left: 3px solid #b49a5a; font-style: italic; color: #3a301c; }
.lore__body figure { margin: .8em 0; }
.lore__body img { max-width: 100%; height: auto; border: 1px solid #b49a5a; }
/* Your week in Sherborne: a parchment panel over the town, the game held still */
.week { position: fixed; inset: 0; z-index: 28; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(4, 22, 15, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .7s var(--ease); }
.week.is-on { opacity: 1; }
.week__inner {
  width: min(660px, 100%); padding: 24px 30px 18px; text-align: center; color: #2c2414;
  background: #f1e8cf linear-gradient(90deg, rgba(120, 90, 40, .08), transparent 6%, transparent 94%, rgba(120, 90, 40, .08));
  border: 1px solid #b49a5a; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 60px rgba(120, 90, 40, .15);
  transform: translateY(14px); transition: transform .9s var(--ease);
}
.week.is-on .week__inner { transform: none; }
.week__eyebrow { margin: 0 0 12px; font-size: .7rem; letter-spacing: .42em; text-transform: uppercase; color: #8a6a20; }
.week__seal .seal { width: 72px; height: 72px; }
.week__rank { margin: 8px 0 2px; font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 5vw, 2.5rem); letter-spacing: .1em; text-transform: uppercase; color: #07261d; }
.week__rank span { font-size: .5em; font-weight: 500; letter-spacing: .04em; text-transform: none; color: #8a6a20; }
.week__just { margin: 0 0 6px; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: #8a6a20; }
.week__verdict { margin: 0 0 18px; font-family: var(--serif); font-style: italic; font-size: 1.22rem; color: #3a301c; }
.week__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; margin: 0 0 20px; text-align: left; }
.week__stats div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 4px; border-bottom: 1px dotted rgba(120, 90, 40, .35); }
.week__stats dt { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #6a5a38; }
.week__stats dd { margin: 0; font-family: var(--serif); font-size: 1.14rem; font-weight: 600; color: #1e2a1a; text-align: right; }
.week__stats small { font-size: .86rem; font-weight: 400; color: #8a6a20; }
.week__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.week .btn--ghost { color: #07261d; border-color: #b49a5a; background: rgba(180, 154, 90, .12); }
.week .btn.is-sel { box-shadow: 0 0 0 2px #f1e8cf, 0 0 0 3px #07261d; }
.week__foot { margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: #6a5a38; }
@media (max-width: 560px) { .week__inner { padding: 18px 16px 14px; } .week__stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .card.is-rank::before, .week, .week__inner, .hud__rank span { transition: none; } .hud__rank.is-up b { animation: none; } }

/* ================= CONTROLS (Phase 5: controls.js) ================= */
/* ---------------- the keys, as the device in use shows them ---------------- */
kbd.gl {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; box-sizing: border-box;
  min-width: 22px; height: 22px; padding: 0 6px; margin: 0 2px; border-radius: 5px;
  font: 500 12px/1 var(--sans); letter-spacing: 0; text-transform: none; font-style: normal; white-space: nowrap;
  color: var(--cream); background: linear-gradient(180deg, rgba(244, 239, 228, .22), rgba(244, 239, 228, .08));
  border: 1px solid rgba(230, 207, 124, .7); border-bottom-width: 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); text-shadow: none;
}
kbd.gl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
kbd.gl--wide { padding: 0 8px; font-size: 11px; letter-spacing: .04em; }
kbd.gl--mouse { padding: 0 3px; }
kbd.gl--mouse svg { width: 17px; height: 17px; }
kbd.gl--mouse .on { fill: var(--gold-light); stroke: none; }
/* a pad: round face buttons in their own colours, shoulder buttons and triggers, the sticks, the D-pad */
kbd.gl--face { width: 22px; min-width: 22px; padding: 0; border-radius: 50%; border: 1.5px solid currentColor; font-weight: 600; font-size: 12px; background: radial-gradient(circle at 35% 30%, #3d4440, #0f1311 72%); }
kbd.gl--xb0 { color: #8bdc5e; } kbd.gl--xb1 { color: #f6705a; } kbd.gl--xb2 { color: #64a3ff; } kbd.gl--xb3 { color: #f7d24c; }
kbd.gl--ps0 { color: #9cbcff; } kbd.gl--ps1 { color: #ff8585; } kbd.gl--ps2 { color: #f7a2dd; } kbd.gl--ps3 { color: #62dbb3; }
kbd.gl--face svg { width: 13px; height: 13px; stroke-width: 2.1; }
kbd.gl--sh { min-width: 30px; padding: 0 5px; font-size: 10px; font-weight: 600; letter-spacing: .02em; border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, #3d4440, #121614); }
kbd.gl--tr { height: 24px; border-radius: 11px 11px 4px 4px; }
kbd.gl--stick { position: relative; width: 24px; min-width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 8.5px; font-weight: 600; background: radial-gradient(circle, #3d4440 50%, #121614 53%); }
kbd.gl--move svg { position: absolute; inset: 0; width: 100%; height: 100%; }
kbd.gl--move .ring { stroke: none; }
kbd.gl--move .tick { stroke: var(--gold-light); stroke-width: 1.5; }
kbd.gl--move i { position: relative; font-style: normal; font-size: 10px; }
kbd.gl--click { box-shadow: 0 0 0 2px rgba(230, 207, 124, .3), 0 1px 3px rgba(0, 0, 0, .35); }
kbd.gl--sys { width: 24px; min-width: 24px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3d4440, #0f1311 72%); }
kbd.gl--sys svg { width: 14px; height: 14px; stroke-width: 1.5; }
kbd.gl--pill { padding: 0 7px; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border-radius: 11px; background: linear-gradient(180deg, #3d4440, #121614); }
kbd.gl--dpad { width: 25px; min-width: 25px; height: 25px; padding: 0; border: 0; background: none; box-shadow: none; }
kbd.gl--dpad svg { width: 25px; height: 25px; stroke: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
kbd.gl--dpad .dp { fill: #59625d; stroke: rgba(230, 207, 124, .55); stroke-width: .7; }
kbd.gl--dpad .dp-on { fill: var(--gold-light); }
/* touch: the buttons as they are on the screen */
kbd.gl--tb { width: 24px; min-width: 24px; height: 24px; padding: 0; border-radius: 50%; border-bottom-width: 1px; font: 500 14px/1 var(--serif); color: var(--gold-light); background: rgba(4, 22, 15, .65) center / 17px no-repeat; }
kbd.gl--tjump, #touch-brake { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6cf7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 4.6h14M12 20V8.6M7.4 13.2L12 8.6l4.6 4.6'/></svg>"); }
kbd.gl--thand, #touch-brake[aria-label="Handbrake"] { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6cf7c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='6.6'/><path d='M10.3 15.7V8.3h2.2a2.1 2.1 0 0 1 0 4.2h-2.2M4.4 7.2a9.6 9.6 0 0 0 0 9.6M19.6 7.2a9.6 9.6 0 0 1 0 9.6'/></svg>"); }
kbd.gl--tstick, kbd.gl--tdrag { padding: 0 3px; border-radius: 12px; border-bottom-width: 1px; background: rgba(4, 22, 15, .65); }
kbd.gl--tstick svg { width: 18px; height: 18px; }
kbd.gl--tstick .on { fill: var(--gold-light); stroke: none; }
kbd.gl--tdrag svg { width: 22px; height: 15px; }
kbd.gl--tap { padding: 0 7px; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; border-radius: 11px; border-bottom-width: 1px; }
.gl-gap { display: inline-block; width: 22px; flex: none; }
/* where they sit */
.hud__prompt kbd.gl { margin: -3px 9px -3px 0; }
.hud__hint kbd.gl { margin: -2px 5px -2px 0; }
.hud__objective kbd.gl, .hud__subtitle kbd.gl { margin-top: -3px; margin-bottom: -2px; }
.talk__choices kbd.gl { align-self: center; margin: 0; }
.talk__more kbd.gl { height: 20px; min-width: 20px; margin: 0 2px 0 0; }
.cine-skip kbd.gl { margin: -3px 8px -3px 0; }
/* on the parchment (the pocketbook, the map's legend): dark keys */
.book kbd.gl--key, .book kbd.gl--wide, .bigmap kbd.gl--key, .bigmap kbd.gl--mouse { color: #2c2414; background: linear-gradient(180deg, rgba(255, 250, 235, .8), rgba(180, 154, 90, .2)); border-color: #8a6a20; box-shadow: none; }
.book kbd.gl--dpad .dp, .bigmap kbd.gl--dpad .dp { fill: rgba(60, 40, 10, .28); stroke: none; }
.book kbd.gl--dpad .dp-on, .bigmap kbd.gl--dpad .dp-on { fill: #7a5a10; }
.book__foot kbd.gl, .bigmap__legend kbd.gl { margin: -3px 2px -2px; }
.shop__foot kbd.gl { margin: -3px 2px -2px; }
.menu__keys { margin: 14px 0 0; font-size: .72rem; letter-spacing: .08em; color: rgba(244, 239, 228, .62); }
.menu__keys kbd.gl { margin: -3px 2px -2px; }
.menu__keys span, .bigmap__legend span span, .book__foot span span { margin: 0 6px; color: var(--gold); }
.is-empty { display: none !important; }
/* the title's buttons, chosen with a pad */
.title__actions .btn.is-sel { box-shadow: 0 0 0 2px var(--green-950), 0 0 0 3px var(--gold-pale); }
.title__keys dd { display: flex; justify-content: center; gap: 2px; min-height: 24px; }

/* ---------------- the first-time card: the essentials, for the device in use ---------------- */
.ccard { position: fixed; inset: 0; z-index: 17; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.ccard__inner {
  pointer-events: auto; width: min(700px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 26px 14px; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, rgba(11, 54, 40, .95), rgba(4, 22, 15, .97)); border: 1px solid rgba(230, 207, 124, .5); border-top: 2px solid var(--gold);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6); opacity: 0; transform: translateY(14px) scale(.985); transition: opacity .35s var(--ease), transform .5s var(--ease);
}
.ccard.is-on .ccard__inner { opacity: 1; transform: none; }
.ccard__eyebrow { margin: 0; font-size: .64rem; letter-spacing: .36em; text-transform: uppercase; color: var(--gold); }
.ccard__title { margin: 4px 0 0; font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: .06em; color: var(--gold-light); }
.ccard__dev { margin: 0 0 12px; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold-pale); }
.ccard__rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin: 0 0 10px; text-align: left; }
.ccard__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; border-bottom: 1px dotted rgba(230, 207, 124, .2); }
.ccard__row dt { font-size: .88rem; line-height: 1.25; color: rgba(244, 239, 228, .92); }
.ccard__row dd { margin: 0; display: flex; align-items: center; gap: 3px; white-space: nowrap; font-size: .74rem; color: rgba(244, 239, 228, .66); }
.ccard__note, .ccard__more { margin: 6px 0 0; font-size: .8rem; line-height: 1.5; color: rgba(244, 239, 228, .8); }
.ccard__note kbd.gl, .ccard__more kbd.gl { margin: -3px 2px -2px; }
.ccard__go { margin: 12px 0 0; font-size: .64rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold-light); animation: ccgo 2.4s ease-in-out infinite; }
@keyframes ccgo { 50% { opacity: .45; } }
@media (max-width: 560px) {
  .ccard__rows { grid-template-columns: 1fr; }
  .ccard__inner { padding: 14px 16px 12px; }
  .ccard__row { min-height: 30px; }
  .ccard__dev { margin-bottom: 8px; }
}
/* a phone on its side: two columns, tighter */
@media (max-height: 520px) {
  .ccard__inner { padding: 10px 18px 10px; }
  .ccard__title { font-size: 1.4rem; }
  .ccard__dev { margin-bottom: 4px; font-size: .95rem; }
  .ccard__rows { grid-template-columns: 1fr 1fr; }
  .ccard__row { min-height: 27px; }
  .ccard__go { margin-top: 6px; }
}

/* ---------------- a hint, the first few times something's possible ---------------- */
.hud__coach {
  position: absolute; left: 50%; bottom: calc(200px + var(--safe-b)); transform: translate(-50%, 6px); width: max-content; max-width: min(640px, calc(100% - 32px));
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 7px; border-radius: 999px;
  background: rgba(4, 22, 15, .82); border: 1px solid rgba(230, 207, 124, .42); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  font-size: .84rem; line-height: 1.35; color: var(--cream); opacity: 0; transition: opacity .35s, transform .45s var(--ease); pointer-events: none;
}
.hud__coach.is-on { opacity: 1; transform: translate(-50%, 0); }
.hud__coach.is-high { bottom: calc(250px + var(--safe-b)); }
.hud__coach-tip { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--gold); color: var(--green-950); font-size: .56rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; }
.hud__coach span b { color: var(--gold-light); font-weight: 600; }
.hud__coach kbd.gl { margin: -3px 2px -2px; }
body.is-talking .hud__coach { opacity: 0 !important; }

/* ---------------- the controls page: keyboard, gamepad (and touch) side by side ---------------- */
.controls { place-items: start center; }
.controls__inner { width: min(1200px, 100%); margin: auto 0; }
.controls__head { align-items: flex-start; margin-bottom: 12px; }
.controls__using { margin: 2px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold-pale); }
.controls__using b { font-style: normal; font-weight: 600; color: var(--gold-light); }
.controls__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 540px), 1fr)); gap: 12px; }
.cp { padding: 9px 14px 6px; border: 1px solid rgba(230, 207, 124, .22); background: rgba(4, 22, 15, .5); }
.cp h3 { margin: 0 0 2px; font-size: .68rem; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.cp__t { width: 100%; border-collapse: collapse; }
.cp__t thead th { padding: 2px 6px 3px; font-size: .58rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: rgba(230, 207, 124, .7); text-align: left; white-space: nowrap; }
.cp__t tbody th { width: 100%; padding: 3px 10px 3px 0; font-size: .86rem; font-weight: 300; line-height: 1.25; color: rgba(244, 239, 228, .9); text-align: left; }
.cp__t td { padding: 3px 6px; font-size: .74rem; color: rgba(244, 239, 228, .66); white-space: nowrap; }
.cp__t tbody tr > * { border-top: 1px dotted rgba(230, 207, 124, .14); }
.cp__t td kbd.gl { margin: 1px; }
.cp__none { color: rgba(244, 239, 228, .28); }
/* the column for the device in use */
.controls[data-dev="kb"] .c-kb, .controls[data-dev="pad"] .c-pad, .controls[data-dev="touch"] .c-touch { background: rgba(230, 207, 124, .07); }
.controls[data-dev="kb"] thead .c-kb, .controls[data-dev="pad"] thead .c-pad, .controls[data-dev="touch"] thead .c-touch { color: var(--gold-light); }
.controls__opts { margin: 12px 0 4px; }
@media (max-width: 640px) {
  .controls.has-touch .c-kb, .controls.has-touch .c-pad { display: none; }
  .controls__title { font-size: 1.7rem; }
  .cp__t tbody th { font-size: .82rem; }
  .cp__t td { white-space: normal; }
  /* (a touch screen, held upright: just the touch column, and only the rows a finger can do) */
  .controls.has-touch .cp__t td.c-touch { white-space: nowrap; }
  .controls.has-touch tr.no-touch { display: none; }
}

/* ---------------- touch: each button says what it does; the E button glows when there's something to do ---------------- */
.touch__buttons { gap: 22px 14px; }
.touch__buttons button { position: relative; -webkit-tap-highlight-color: transparent; }
.touch__buttons button::after {
  content: attr(data-label); position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%);
  font: 500 8.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 239, 228, .85); text-shadow: 0 1px 4px #000; white-space: nowrap; pointer-events: none;
}
#touch-brake { font-size: 0; background-position: center; background-repeat: no-repeat; background-size: 30px; }
#touch-brake::after { content: attr(aria-label); }
#touch-enter.is-ready { border-color: var(--gold-light); color: #fff4cf; box-shadow: 0 0 0 3px rgba(230, 207, 124, .22), 0 0 18px rgba(230, 207, 124, .5); animation: tready 1.6s ease-in-out infinite; }
@keyframes tready { 50% { box-shadow: 0 0 0 5px rgba(230, 207, 124, .12), 0 0 26px rgba(230, 207, 124, .6); } }
/* in a conversation or a scene the stick and buttons step aside (a tap on the words or the picture is what's wanted) */
body.is-talking .touch, body.is-cine .touch { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .ccard__go, #touch-enter.is-ready { animation: none; } .ccard__inner, .hud__coach { transition: none; } }
/* the map's close button (a finger has no M key) */
.bigmap__close { position: absolute; z-index: 3; right: max(16px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; border: 1px solid #b49a5a; background: rgba(239, 230, 207, .92); color: #07261d; font-size: 1.6rem; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(40, 30, 10, .25); }
.bigmap__close:hover { background: #f6f0de; }
/* ---------------- touch screens: nothing on top of anything (CONTROLS, Phase 5) ---------------- */
@media (hover: none) and (pointer: coarse) {
  /* the stick's knob sits above the radar, not on it; the toasts go to the middle, clear of the buttons */
  .touch__knob { left: 84px; bottom: calc(176px + var(--safe-b)); }
  .hud__toast { right: auto; left: 50%; transform: translateX(-50%); top: 102px; justify-items: center; }
  .hud__objective { max-width: min(520px, 52vw); }
  /* a notch, on its side */
  .hud__radar, .hud__health { left: max(20px, env(safe-area-inset-left)); }
  .hud__where { left: max(22px, env(safe-area-inset-left)); }
  .hud__corner { right: max(16px, env(safe-area-inset-right)); }
  .hud__time { right: max(20px, env(safe-area-inset-right)); }
  .touch__buttons { right: max(16px, env(safe-area-inset-right)); }
}
/* held upright: the prompt and hints above the buttons, the way-to-go pill over the clock */
@media (hover: none) and (pointer: coarse) and (max-width: 560px) {
  /* (centred by left: 50% and a shift, a box can only be half the screen wide: on a phone that's three lines) */
  .hud__objective { top: 96px; left: 16px; right: 16px; transform: none; width: fit-content; max-width: none; margin: 0 auto; }
  .hud__prompt { width: max-content; max-width: calc(100% - 32px); }
  .hud__toast { top: 176px; }
  .hud__nav { left: auto; right: 20px; bottom: calc(84px + var(--safe-b)); }
  .touch__buttons { bottom: calc(130px + var(--safe-b)); }       /* (their words clear of the way-to-go pill) */
  .hud__prompt, .hud__coach { bottom: calc(372px + var(--safe-b)); }
  .hud__coach.is-high { bottom: calc(422px + var(--safe-b)); }
}
/* (a notch at the top, held upright in full screen) */
@media (hover: none) and (pointer: coarse) {
  .hud__where { top: max(12px, env(safe-area-inset-top)); }
  .hud__corner, .hud__purse { top: max(10px, env(safe-area-inset-top)); }
}
/* touch: the conversation clear of the health bar under it */
@media (hover: none) and (pointer: coarse) { .talk { bottom: calc(168px + var(--safe-b)); } }
/* a phone on its side (412 px tall): the objective clear of the purse, toasts under the street name,
   a hint under the prompt (above it there's no room), and the objective out of a conversation's way */
@media (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .hud__objective { max-width: min(440px, 48vw); }
  .hud__toast { left: max(22px, env(safe-area-inset-left)); right: auto; transform: none; top: 62px; justify-items: start; }
  .hud__coach, .hud__coach.is-high { bottom: calc(144px + var(--safe-b)); max-width: min(560px, calc(100% - 340px)); }
  body.is-talking .hud__objective { opacity: 0; }
}
/* ---------------- touch, on the Ablebox forklift: its forks, held (main.js; R and Q on a keyboard), beside the other buttons ---------------- */
.touch__forks { position: absolute; right: calc(16px + 130px + 22px); bottom: calc(120px + var(--safe-b)); display: none; gap: 24px; pointer-events: auto; }
body.is-mount .touch__forks { display: grid; }
.touch__forks button { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 1px solid rgba(230, 207, 124, .6); background: rgba(4, 22, 15, .55); color: var(--gold-light); font: 1.05rem/1 var(--serif); -webkit-tap-highlight-color: transparent; }
.touch__forks button.is-held, .touch__forks button:active { background: rgba(230, 207, 124, .3); }
.touch__forks button::after { content: attr(data-label); position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); font: 500 8.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 239, 228, .85); text-shadow: 0 1px 4px #000; white-space: nowrap; pointer-events: none; }
@media (hover: none) and (pointer: coarse) { .touch__forks { right: calc(max(16px, env(safe-area-inset-right)) + 130px + 22px); } }
@media (hover: none) and (pointer: coarse) and (max-width: 560px) { .touch__forks { bottom: calc(130px + var(--safe-b)); } }
/* touch screens: the plaque clear of the toasts when upright; on its side, along the top in the objective's place
   (the objective steps aside meanwhile), under the purse, off the stick, the prompt and a conversation, and away
   while you drive the forklift (FIX PASS, ui) */
@media (hover: none) and (pointer: coarse) and (max-width: 560px) { .hud__plaque { top: 31%; } }
@media (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .hud__plaque { left: 50%; top: calc(78px + env(safe-area-inset-top, 0px)); width: min(460px, 50vw); padding: 8px 14px; gap: 3px; font-size: .72rem; line-height: 1.4; transform: translate(-50%, -6px); }
  .hud__plaque.is-on { transform: translate(-50%, 0); }
  .hud__plaque b { font-size: 1.05rem; }
  body:has(.hud__plaque.is-on) .hud__objective { opacity: 0; }
  body.is-talking .hud__plaque, body.is-mount .hud__plaque, body:has(#card.is-rank.is-on) .hud__plaque { opacity: 0; }
  .card.is-rank .card__sub { max-width: 300px; }
}
/* (in a conversation the way-to-go pill steps aside: it sat under the talk box's corner) */
body.is-talking .hud__nav { opacity: 0; }
/* touch: running (the stick dragged past its rim, input.js sets .is-run): the knob glows brighter */
.touch__stick.is-run .touch__knob { background: rgba(230, 207, 124, .55); box-shadow: 0 0 0 3px rgba(230, 207, 124, .22), 0 0 16px rgba(230, 207, 124, .45); }
