/* blight/css/blight.css - THE BLIGHT's page: the curtain, the door over the key painting, the corner, a season's
 * HUD around the board (the forecast, the tools, the day's actions and End the day), the night's news, the first-time
 * tips, the sheets, and the Fields and Wardens rooms, laid over the field (blight/js/blight-render.js). The Herd's
 * colours are harvest gold, rust and leaf green; the Horde's violet, candy pink and toxic green (html[data-side], set by
 * blight/js/blight-main.js).
 *
 * The series' rules, kept here from the first draw (docs/READABILITY.md, ARCHITECTURE.md conventions 35 to 37,
 * docs/DUO-DEVELOPMENT-SPEC.md DUO-3, DUO-6, DUO-7): words never under 16 CSS px and 18 for reading on a phone; every
 * button 44 px or more (48 on a touch screen); nothing lies on a button; every edge steps in past an iPhone's camera
 * and rounded corners (env(safe-area-inset-*)); a short pane scrolls its panel and keeps End the day in reach.
 *
 * A SEASON'S LAYOUT is one grid (#hud): held upright, the top bar, the forecast, the board's slot, and the foot (what
 * a tile is, the tools, the actions); held sideways, the board on the left and a panel on the right. blight-main.js
 * measures #slot and fits the board into it, so the board always has the room the words leave it. The season's bars
 * are glass with no blur: a blur over a canvas that redraws every frame costs a phone its battery. */
:root {
  --ink: #160F0A;
  --glass: rgba(30, 19, 11, 0.82);
  --glass-2: rgba(52, 34, 18, 0.9);
  --line: rgba(255, 224, 170, 0.22);
  --text: #FBF3E7;
  --muted: #EBDCC2;
  --gold: #F5C242;
  --a: #FF8A3D;
  --b: #A6E36F;
  --foe: #E0662A;
  --shine: #FFD95A;
  --font: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --title-font: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --edge-l: var(--sotc-edge-l, env(safe-area-inset-left, 0px));
  --edge-r: var(--sotc-edge-r, env(safe-area-inset-right, 0px));
  --tap: 48px;
  --panel: 340px;
}
html[data-side="horde"] {
  --ink: #0D0913; --glass: rgba(18, 12, 28, 0.84); --glass-2: rgba(34, 22, 50, 0.92); --line: rgba(201, 168, 245, 0.26);
  --muted: #DCCFF0; --gold: #C9F27A; --a: #A78BFA; --b: #9CFF6B; --foe: #FF8FC7; --shine: #C58BFF;
}
@media (pointer: fine) { :root { --tap: 44px; } }

html, body { margin: 0; padding: 0; height: 100%; background: var(--ink); color: var(--text); font-family: var(--font); overflow: hidden;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

#field { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
html:not([data-screen="play"]):not([data-screen="over"]) #field { visibility: hidden; }

/* ---- the loading curtain ------------------------------------------------------------------------------------------- */
.curtain { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 40%, #3A2614 0%, var(--ink) 72%); transition: opacity 0.5s ease; }
html[data-side="horde"] .curtain { background: radial-gradient(circle at 50% 40%, #2A1C4A 0%, var(--ink) 72%); }
.curtain.is-gone { opacity: 0; }
.curtain-art { width: 132px; height: 132px; object-fit: contain; animation: curtain-bob 1.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 24px rgba(255, 217, 90, 0.55)); }
@keyframes curtain-bob { from { transform: translateY(8px); } to { transform: translateY(-10px); } }
.curtain-title { margin: 0; font-family: var(--title-font); font-weight: bold; letter-spacing: 0.3em; font-size: 26px; color: var(--gold); text-align: center; }
.curtain-bar { width: min(280px, 70vw); height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.curtain-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--gold), var(--b)); transition: width 0.4s ease; }
.curtain-line { margin: 0; color: var(--muted); font-size: 18px; }

/* ---- buttons and chips --------------------------------------------------------------------------------------------- */
.btn { appearance: none; min-height: var(--tap); border: 1px solid var(--line); background: var(--glass-2); color: var(--text); border-radius: 14px;
  padding: 10px 18px; font-size: 18px; font-weight: bold; cursor: pointer; transition: transform 0.12s ease, filter 0.12s ease, background 0.2s;
  box-sizing: border-box; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .chip:focus-visible, .tool:focus-visible, .hud-menu:focus-visible, .hud-coach:focus-visible,
.bl-field:focus-visible, .bl-warden:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-ghost { background: var(--glass); }
.btn-play { position: relative; border: 0; min-height: 64px; padding: 14px 44px; font-size: 26px; letter-spacing: 0.16em; text-transform: uppercase; color: #22140A;
  background: linear-gradient(135deg, var(--gold), #FFE9A8 45%, var(--a)); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) inset, 0 10px 34px rgba(245, 194, 66, 0.45); }
html[data-side="horde"] .btn-play { color: #160C24; background: linear-gradient(135deg, #C9F27A, #F5E9A8 40%, #C58BFF); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) inset, 0 10px 34px rgba(156, 255, 107, 0.4); }
.btn-play::after { content: ''; position: absolute; inset: -5px; border-radius: 18px; border: 2px solid var(--gold); opacity: 0.6; animation: halo 2.4s ease-in-out infinite; pointer-events: none; }
.btn-play small { display: block; font-size: 16px; letter-spacing: 0.04em; text-transform: none; font-weight: bold; margin-top: 2px; }
@keyframes halo { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.05); opacity: 0.15; } }
.chip { appearance: none; min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--glass);
  color: var(--text); border-radius: 999px; padding: 6px 16px; font-size: 16px; font-weight: bold; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-sizing: border-box; }
.chip-side { padding: 4px 16px 4px 10px; cursor: default; }
.chip-side.side-badge--herd { border-color: rgba(255, 138, 61, 0.55); }
.chip-side.side-badge--horde { border-color: rgba(156, 255, 107, 0.5); }
.chip-side[role="button"] { cursor: pointer; }
/* the shared badge (js/side-picker.css) sets its two lines at 9 and 14 px; here every word is 16 px (the readable rule) */
.chip-side .side-badge__kick { font-size: 16px; letter-spacing: 0.02em; text-transform: none; opacity: 1; }
.chip-side .side-badge__name { font-size: 16px; letter-spacing: 0.1em; }

/* ---- the door ------------------------------------------------------------------------------------------------------ */
/* Over the key painting (the Herd's golden valley, the Horde's candy wave). Held upright: one column in the middle; on a
   wide screen a column on the left with the painting on the right. The column scrolls on a very short screen. */
.door { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto; overflow-x: hidden;
  box-sizing: border-box; padding: calc(72px + var(--safe-t)) calc(16px + var(--edge-r)) calc(122px + var(--safe-b)) calc(16px + var(--edge-l));
  background:
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(18, 10, 4, 0.74) 0%, rgba(18, 10, 4, 0.5) 52%, rgba(18, 10, 4, 0.12) 100%),
    url("../art/key-tall.webp") center 60% / cover no-repeat, var(--ink); }
html[data-side="horde"] .door { background:
    radial-gradient(ellipse 90% 70% at 50% 50%, rgba(10, 6, 20, 0.76) 0%, rgba(10, 6, 20, 0.5) 52%, rgba(10, 6, 20, 0.12) 100%),
    url("../art/key-horde.webp") 38% center / cover no-repeat, var(--ink); }
.door-col { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: auto 0; }
.door-kicker { margin: 0; color: var(--muted); letter-spacing: 0.3em; text-transform: uppercase; font-size: 16px; font-weight: bold; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.door-title { margin: 0; font-family: var(--title-font); font-weight: bold; line-height: 1; font-size: clamp(48px, min(15vw, 12vh), 104px); letter-spacing: 0.08em;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFF0C8 30%, var(--gold) 60%, var(--a) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(255, 180, 90, 0.45)); }
html[data-side="horde"] .door-title { background: linear-gradient(180deg, #FFFFFF 0%, #EADFFF 30%, #C58BFF 62%, var(--b) 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.55)) drop-shadow(0 0 26px rgba(160, 140, 255, 0.5)); }
.door-sub { margin: 0 0 4px; font-size: 20px; line-height: 1.35; font-style: italic; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85); }
/* RENOWN: the level in a gold disc, the title, the bar to the next level (press it: what each level opens) */
.renown { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 64px; padding: 8px 14px 8px 8px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text); font: inherit; text-align: left; cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.renown:hover { filter: brightness(1.12); }
.renown:focus-visible, .mode:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.renown__badge { flex: none; width: 52px; height: 52px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  color: #2A1606; background: radial-gradient(circle at 35% 30%, #FFF6D2, var(--gold) 55%, #B9741C); box-shadow: 0 0 0 3px rgba(255, 233, 168, 0.35), 0 0 18px rgba(245, 194, 66, 0.45); }
html[data-side="horde"] .renown__badge { color: #1A0E2C; background: radial-gradient(circle at 35% 30%, #F4FFE0, #C9F27A 52%, #7C55C9); box-shadow: 0 0 0 3px rgba(201, 242, 122, 0.3), 0 0 18px rgba(197, 139, 255, 0.45); }
.renown__k { font-size: 16px; font-weight: bold; }
.renown__lv { font: bold 22px/1 var(--title-font); }
.renown__words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.renown__name { font: bold 20px/1.15 var(--title-font); color: var(--gold); overflow-wrap: anywhere; }
.renown__bar { position: relative; display: block; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); overflow: hidden; }
.renown__bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 2%; border-radius: 5px; background: linear-gradient(90deg, var(--a), var(--gold), #FFF2C2); transition: width 0.6s ease; }
html[data-side="horde"] .renown__bar span { background: linear-gradient(90deg, #A78BFA, var(--b), #F0FFD8); }
.renown__text { font-size: 16px; line-height: 1.25; color: var(--muted); }
/* THE THREE WAYS TO PLAY: a card each, side by side, with its host's face */
.door-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
.mode { appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; box-sizing: border-box; min-height: 0;
  padding: 10px 6px 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); text-align: center; cursor: pointer; font: inherit; color: var(--text);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: transform 0.12s ease, filter 0.12s ease; }
.mode:hover { filter: brightness(1.14); }
.mode:active { transform: scale(0.98); }
.mode__art { flex: none; width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); background: #2A1A0C; box-shadow: 0 0 14px rgba(0, 0, 0, 0.45); }
#mode-campaign .mode__art { border-color: #7FD68E; }
#mode-quick .mode__art { border-color: #C9A2FF; }
#mode-puzzles .mode__art { border-color: #79D2F2; }
.mode__name { font: bold 18px/1.15 var(--title-font); color: var(--gold); }
.mode__sub { font-size: 16px; line-height: 1.2; color: var(--muted); }
.door-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn-shop { color: #22140A; border: 0; background: linear-gradient(135deg, #FFE9A8, var(--gold) 50%, var(--a)); }
html[data-side="horde"] .btn-shop { color: #160C24; background: linear-gradient(135deg, #F5E9A8, #C9F27A 50%, #C58BFF); }
.door-copy { position: fixed; left: calc(14px + var(--edge-l)); bottom: calc(8px + var(--safe-b)); margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 12px; z-index: 21; pointer-events: none; }
/* held upright on a phone: the title on one line, the three ways side by side as cards, so the door fits the screen
   above the World door (nothing under it: ARCHITECTURE.md convention 36) */
@media (max-aspect-ratio: 5/4) and (max-width: 620px) {
  .door { padding-top: calc(66px + var(--safe-t)); }
  .door-col { gap: 10px; }
  .door-title { font-size: min(10.6vw, 64px); letter-spacing: 0.06em; }
  .door-sub { font-size: 18px; margin: 0; }
  .mode { padding: 10px 4px 10px; }
  .mode__art { width: 56px; height: 56px; }
  .mode__name { font-size: 17px; }
  .door-row { gap: 8px; width: 100%; }
  .door-row .btn { flex: 1 1 auto; font-size: 16px; padding: 8px 12px; }
}
@media (max-aspect-ratio: 5/4) and (max-width: 360px) {
  .door-kicker { display: none; }
  .mode__name { font-size: 16px; }
}
/* THE DOOR'S ROOM, held upright (UI-23, the 320 point iPhone): the column starts under the corner, which can take two
   rows, and ends over the World door and the copyright, all measured (fitDoor in blight-main.js sets --corner-b and
   --door-foot). When the column is still too tall for what is left, fitDoor sets data-door-fit 1 to 4: the extra words
   go, then the hosts' faces, then the Play button's second line, and last the column scrolls in its own room (never
   under the World door). */
@media (max-aspect-ratio: 5/4) and (max-width: 620px) {
  .door { padding-top: max(calc(66px + var(--safe-t)), calc(var(--corner-b, 0px) + 8px)); padding-bottom: max(calc(16px + var(--safe-b)), calc(var(--door-foot, 116px) + 6px)); }
}
/* held upright, the first step sheds the extra words and draws the rest in */
@media (max-aspect-ratio: 5/4) {
  html[data-door-fit] .door-kicker, html[data-door-fit] .door-sub, html[data-door-fit] .renown__text, html[data-door-fit] .mode__sub { display: none; }
  html[data-door-fit] .door-col, html[data-door-fit] .door-row { gap: 6px; }
  html[data-door-fit] .door-title { font-size: min(10.6vw, 12vh, 44px); }
  html[data-door-fit] .renown { min-height: 48px; padding: 2px 12px 2px 4px; }
  html[data-door-fit] .renown__badge { width: 42px; height: 42px; }
  html[data-door-fit] .renown__lv, html[data-door-fit] .renown__name { font-size: 18px; }
  html[data-door-fit] .btn-play { min-height: 56px; padding: 8px 30px; font-size: 22px; }
  html[data-door-fit] .mode { padding-top: 6px; padding-bottom: 8px; }
  html[data-door-fit] .mode__art { width: 44px; height: 44px; }
}
/* held sideways (a 720 point window), the first step sets the title on one line, and only then do the words go */
@media (min-aspect-ratio: 5/4) {
  html[data-door-fit] .door-title { font-size: min(76px, 5.6vw, 12vh); white-space: nowrap; }
  html[data-door-fit]:not([data-door-fit="1"]) .door-kicker, html[data-door-fit]:not([data-door-fit="1"]) .door-sub,
  html[data-door-fit]:not([data-door-fit="1"]) .renown__text, html[data-door-fit]:not([data-door-fit="1"]) .mode__sub { display: none; }
}
html[data-door-fit="2"] .mode__art, html[data-door-fit="3"] .mode__art, html[data-door-fit="4"] .mode__art { display: none; }
html[data-door-fit="2"] .mode, html[data-door-fit="3"] .mode, html[data-door-fit="4"] .mode { justify-content: center; min-height: 52px; }
html[data-door-fit="3"] .btn-play small, html[data-door-fit="4"] .btn-play small { display: none; }
html[data-door-fit="4"] .door-col { box-sizing: border-box; max-height: 100%; overflow-y: auto; overflow-x: hidden; padding: 4px 6px; overscroll-behavior: contain; }
@media (min-aspect-ratio: 5/4) {
  .door { justify-content: flex-start; padding: calc(70px + var(--safe-t)) calc(24px + var(--edge-r)) calc(30px + var(--safe-b)) calc(max(24px, 6vw) + var(--edge-l));
    background: linear-gradient(90deg, rgba(18, 10, 4, 0.82) 0%, rgba(18, 10, 4, 0.55) 38%, rgba(18, 10, 4, 0) 62%), url("../art/key-wide.webp") 62% center / cover no-repeat, var(--ink); }
  html[data-side="horde"] .door { background: linear-gradient(90deg, rgba(10, 6, 20, 0.84) 0%, rgba(10, 6, 20, 0.55) 38%, rgba(10, 6, 20, 0) 62%), url("../art/key-horde.webp") 70% center / cover no-repeat, var(--ink); }
  .door-col { align-items: flex-start; text-align: left; width: min(540px, 46vw); }
  .door-row { justify-content: flex-start; }
  /* the copyright line goes left of the World door, clear of the column's buttons */
  .door-copy { left: auto; right: calc(124px + var(--edge-r)); }
}
/* a phone held sideways, or a fold's short pane: the column wider and tighter, the three ways side by side */
@media (min-aspect-ratio: 5/4) and (max-height: 560px) {
  .door { padding-top: calc(10px + var(--safe-t)); padding-bottom: calc(10px + var(--safe-b)); }
  .door-col { gap: 8px; width: min(620px, 64vw); }
  .door-kicker, .door-sub { display: none; }
  .door-title { font-size: clamp(34px, 10vh, 54px); }
  .renown { min-height: 52px; padding: 4px 12px 4px 4px; }
  .renown__badge { width: 44px; height: 44px; }
  .renown__lv { font-size: 18px; }
  .renown__name { font-size: 18px; }
  .mode { flex-direction: row; gap: 8px; min-height: 52px; padding: 4px 8px 4px 4px; text-align: left; }
  .mode__art { width: 44px; height: 44px; }
  .mode__name { font-size: 16px; }
  .mode__sub { display: none; }
  .btn-play { min-height: 56px; font-size: 22px; padding: 8px 34px; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 400px) {
  .door-title { font-size: 32px; }
  .renown__text { display: none; }
  .door-row .btn { padding: 6px 14px; }
}
/* the narrowest phone held sideways (568 x 320): a card is too narrow for a face and a name, so the name stands alone,
   and Renown and Play share a row so the door fits the height */
@media (min-aspect-ratio: 5/4) and (max-height: 400px) and (max-width: 680px) {
  .mode__art { display: none; }
  .mode { justify-content: center; padding: 4px 6px; text-align: center; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 340px) {
  .door-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; justify-items: stretch; }
  .door-title, .door-modes, .door-row { grid-column: 1 / -1; justify-self: start; }
  .door-modes, .door-row { justify-self: stretch; }
  .btn-play { min-height: 52px; padding: 6px 12px; font-size: 20px; letter-spacing: 0.1em; }
}

/* ---- the corner: top right ----------------------------------------------------------------------------------------- */
.corner { position: fixed; top: calc(12px + var(--safe-t)); right: calc(12px + var(--edge-r)); z-index: 45; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  max-width: calc(100vw - 24px - var(--edge-l) - var(--edge-r)); }
@media (max-width: 420px) { .corner { left: calc(12px + var(--edge-l)); justify-content: center; } .chip { padding: 6px 12px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) { .corner { flex-direction: column; align-items: flex-end; flex-wrap: nowrap; } }

/* ---- A SEASON ------------------------------------------------------------------------------------------------------ */
.hud { position: fixed; inset: 0; z-index: 30; pointer-events: none; box-sizing: border-box; display: grid; gap: 8px;
  padding: calc(8px + var(--safe-t)) calc(10px + var(--edge-r)) calc(8px + var(--safe-b)) calc(10px + var(--edge-l));
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "top" "cast" "slot" "foot"; }
.hud > * { pointer-events: auto; min-width: 0; }
.slot { grid-area: slot; pointer-events: none !important; }
.hud-top { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.hud-menu { flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid rgba(255, 233, 168, 0.6); background: var(--glass-2); cursor: pointer;
  display: grid; place-items: center; padding: 0; }
.hud-menu span, .hud-menu span::before, .hud-menu span::after { display: block; width: 18px; height: 3px; border-radius: 2px; background: #FFE9A8; content: ''; position: relative; }
.hud-menu span::before { position: absolute; top: -6px; }
.hud-menu span::after { position: absolute; top: 6px; }
.hud-menu:active { transform: scale(0.94); }
.hud-title { flex: 1 1 auto; min-width: 0; }
.hud-field { margin: 0; font-family: var(--title-font); font-weight: bold; font-size: 18px; line-height: 1.15; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-day { margin: 0; font-size: 16px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.hud-ears { flex: none; display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; }
.hud-ears__n { font-size: 22px; font-weight: bold; color: #FFE9A8; font-variant-numeric: tabular-nums; line-height: 1; }
html[data-side="horde"] .hud-ears__n { color: #E7FFCF; }
.hud-ears__q { font-size: 16px; color: var(--muted); white-space: nowrap; }
.hud-ears__bar { grid-column: 1 / 3; position: relative; width: 112px; height: 10px; margin-top: 4px; border-radius: 5px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); overflow: hidden; }
.hud-ears__bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width 0.4s ease; }
#hud-ears-fill { background: linear-gradient(90deg, var(--gold), #FFF2C2); z-index: 2; }
#hud-ears-ghost { background: rgba(255, 233, 168, 0.32); z-index: 1; }
html[data-side="horde"] #hud-ears-fill { background: linear-gradient(90deg, var(--b), #F0FFD8); }
html[data-side="horde"] #hud-ears-ghost { background: rgba(156, 255, 107, 0.28); }
.hud-face { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--foe); box-shadow: 0 0 12px rgba(0, 0, 0, 0.5); background: #000; }
.hud-face.is-mood { animation: face-pop 0.5s ease; }
@keyframes face-pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

.hud-cast { grid-area: cast; display: flex; align-items: center; gap: 8px; }
.cast { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 6px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line);
  box-sizing: border-box; min-height: var(--tap); }
.cast__icon { flex: none; width: 44px; height: 44px; object-fit: contain; }
.cast__words { flex: 1 1 auto; min-width: 0; }
.cast__name { margin: 0; font-size: 18px; font-weight: bold; line-height: 1.2; color: #FFF2D6; }
.cast__name small { font-size: 16px; font-weight: bold; color: var(--gold); }
.cast__line { margin: 0; font-size: 16px; line-height: 1.25; color: var(--muted); }
.cast__next { color: var(--gold); }
.cast__way { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #FFF2D6; }
.cast__way svg { display: block; }
.cast__way.is-still svg { display: none; }
.cast__way.is-still::before { content: ''; width: 14px; height: 14px; border: 3px solid #FFF2D6; border-radius: 50%; box-sizing: border-box; }
.btn-show { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: 16px; border-radius: 16px; background: var(--glass); line-height: 1.15; text-align: left; }
.btn-show::before { content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--a); box-sizing: border-box; }
.btn-show__short { display: none; }
.btn-show[aria-pressed="true"] { background: linear-gradient(135deg, rgba(255, 138, 61, 0.5), rgba(224, 102, 42, 0.3)); border-color: var(--a); }
.btn-show[aria-pressed="true"]::before { background: radial-gradient(circle, #FFF2D6 0 35%, var(--a) 40%); box-shadow: 0 0 8px var(--a); }
html[data-side="horde"] .btn-show::before { border-color: var(--foe); }
html[data-side="horde"] .btn-show[aria-pressed="true"] { background: linear-gradient(135deg, rgba(255, 143, 199, 0.42), rgba(167, 139, 250, 0.3)); border-color: var(--foe); }
html[data-side="horde"] .btn-show[aria-pressed="true"]::before { background: radial-gradient(circle, #FFF0FA 0 35%, var(--foe) 40%); box-shadow: 0 0 8px var(--foe); }

.hud-foot { grid-area: foot; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.hud-foot > * { flex-shrink: 0; }
.hud-scroll { display: flex; flex-direction: column; gap: 6px; }
.hud-scroll > * { flex-shrink: 0; }
.hud-info { margin: 0; min-height: 2.5em; font-size: 16px; line-height: 1.25; color: var(--text); }
.hud-info .is-tool { color: var(--gold); font-weight: bold; }
.hud-info b { color: var(--gold); }
.hud-info .is-bad { color: #FFB27A; }
html[data-side="horde"] .hud-info .is-bad { color: #FFB0DA; }
.hud-info .is-good { color: var(--b); }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 64px), 1fr)); gap: 6px; }
/* a tool too narrow for its name shows its picture alone (the line above the tools names the tool picked) */
.tools .tool { container-type: inline-size; }
@container (max-width: 87.9px) { .tool__name { display: none; } .tool img { width: 40px; height: 40px; } }
.tool { appearance: none; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 4px 4px 6px;
  border-radius: 14px; border: 2px solid var(--line); background: var(--glass-2); cursor: pointer; font: inherit; color: var(--text); box-sizing: border-box; }
.tool img { width: 36px; height: 36px; object-fit: contain; pointer-events: none; }
.tool__name { font-size: 16px; font-weight: bold; line-height: 1.1; text-align: center; overflow-wrap: normal; }
.tool__n { position: absolute; top: 3px; right: 4px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; display: grid; place-items: center;
  font-size: 16px; font-weight: bold; line-height: 1; background: var(--gold); color: #22140A; }
.tool.is-on { border-color: var(--gold); background: linear-gradient(180deg, rgba(245, 194, 66, 0.4), rgba(245, 194, 66, 0.12)); box-shadow: 0 0 14px rgba(245, 194, 66, 0.35); }
html[data-side="horde"] .tool.is-on { background: linear-gradient(180deg, rgba(156, 255, 107, 0.32), rgba(156, 255, 107, 0.08)); box-shadow: 0 0 14px rgba(156, 255, 107, 0.3); }
.tool.is-dim img { opacity: 0.45; filter: grayscale(0.7); }
.tool.is-dim .tool__name { color: var(--muted); }
.tool.is-dim .tool__n { background: rgba(255, 255, 255, 0.3); color: var(--text); }
.tool.is-new::after { content: 'New'; position: absolute; top: 3px; left: 4px; padding: 1px 6px; border-radius: 8px; font-size: 16px; font-weight: bold; line-height: 1.1;
  background: var(--b); color: #102008; }
.hud-end { display: flex; align-items: center; gap: 8px; }
.acts { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 28px; }
.acts i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--gold); box-sizing: border-box; background: transparent; }
.acts i.is-left { background: radial-gradient(circle at 40% 35%, #FFFFFF, var(--gold) 60%); box-shadow: 0 0 8px rgba(245, 194, 66, 0.6); }
.btn-undo { flex: none; padding: 6px 14px; background: var(--glass); }
.btn-end { flex: 0 1 auto; padding: 8px 20px; color: #22140A; border: 0; background: linear-gradient(135deg, var(--gold), #FFE9A8 55%, var(--a)); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
html[data-side="horde"] .btn-end { color: #160C24; background: linear-gradient(135deg, #C9F27A, #F5E9A8 50%, #C58BFF); }
.btn-end.is-sure { background: linear-gradient(135deg, #FFB27A, #FF7A4A); color: #200A04; }
.btn-end.is-glow { animation: end-glow 1.6s ease-in-out infinite; }
@keyframes end-glow { 0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); } 50% { box-shadow: 0 0 0 4px rgba(255, 233, 168, 0.5), 0 6px 22px rgba(245, 194, 66, 0.55); } }
.btn[disabled], .tool[disabled] { opacity: 0.5; cursor: default; }

/* the field's notes: only where a tall panel has the room (DUO-5: a bigger screen shows more, never less) */
.hud-notes { display: none; flex-direction: column; gap: 6px; }
.hud-notes__h { margin: 4px 0 0; font: bold 18px/1.2 var(--title-font); color: var(--gold); }
.hud-note { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.hud-note img { flex: none; width: 36px; height: 36px; object-fit: contain; }
.hud-note p { margin: 0; font-size: 16px; line-height: 1.3; }
.hud-note b { color: var(--gold); }
@media (min-aspect-ratio: 9/8) and (min-height: 700px) { .hud-notes { display: flex; } .tools { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }

/* the night's news drops over the top bars (never over the board, which the player wants to see after a night), and a
   first-time tip covers the foot until it is pressed away (never the board either) */
.hud-banner { grid-column: 1; grid-row: 1 / 3; align-self: start; justify-self: stretch; z-index: 5; margin: 0; box-sizing: border-box; padding: 8px 16px; min-height: 100%;
  display: flex; flex-direction: column; justify-content: center; border-radius: 18px; text-align: center; background: linear-gradient(180deg, #2A190B, #1A0F06);
  border: 2px solid var(--gold); pointer-events: none !important; animation: banner-in 0.35s ease both; }
html[data-side="horde"] .hud-banner { background: linear-gradient(180deg, #1E1330, #120A1E); }
.hud-banner__t { margin: 0; font-family: var(--title-font); font-weight: bold; font-size: 22px; line-height: 1.15; color: var(--gold); }
.hud-banner__s { margin: 2px 0 0; font-size: 16px; line-height: 1.3; color: var(--text); }
.hud-banner__s:empty { display: none; }
.hud-banner.is-shine { border-color: var(--shine); box-shadow: 0 0 22px rgba(255, 217, 90, 0.4); }
.hud-banner.is-bad .hud-banner__t { color: #FFB27A; }
html[data-side="horde"] .hud-banner.is-bad .hud-banner__t { color: #FFB0DA; }
@keyframes banner-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
/* the news stands in the top bars' place, as the tip does in the foot's: Menu and Show tonight are out of sight under it
   until it goes, so a tap on the news never opens what it hides (LESSONS-LEARNED UI-27: a passing note never sits over
   a control; found 2026-10-19 by check:blight's Duo fold test, which measures as it plays) */
.hud:has(> .hud-banner:not([hidden])) :is(.hud-top, .hud-cast) { visibility: hidden; }
.hud-coach { grid-area: foot; align-self: stretch; justify-self: stretch; z-index: 4; appearance: none; display: flex; align-items: center; gap: 12px;
  box-sizing: border-box; min-height: var(--tap); margin: 0; padding: 10px 12px 10px 16px; border-radius: 18px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
  background: linear-gradient(135deg, #33240B, #1F1407); border: 2px solid var(--gold); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
  animation: banner-in 0.35s ease both; }
html[data-side="horde"] .hud-coach { background: linear-gradient(135deg, #251838, #140C22); }
/* the tip stands in the foot's place: the foot's buttons are out of sight under it until it is pressed away */
.hud:has(> .hud-coach:not([hidden])) .hud-foot { visibility: hidden; }
.hud-coach__t { flex: 1 1 auto; font-size: 18px; line-height: 1.3; }
.hud-coach__t::before { content: 'Tip'; display: block; margin-bottom: 2px; font: bold 16px/1.2 var(--title-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.hud-coach__ok { flex: none; padding: 8px 12px; border-radius: 12px; background: var(--gold); color: #22140A; font-size: 16px; font-weight: bold; }

/* held sideways (or a wide window): the board on the left, the panel on the right */
@media (min-aspect-ratio: 9/8) {
  .hud { grid-template-columns: minmax(0, 1fr) min(var(--panel), 46vw); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "slot top" "slot cast" "slot foot"; column-gap: 10px; }
  .hud-banner { grid-column: 2; grid-row: 1 / 3; }
  .hud-cast { flex-direction: column; }
  .btn-show { max-width: none; min-height: var(--tap); }
  .hud-foot { overflow: hidden; min-height: 0; }
  .hud-scroll { flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
  .hud-foot .hud-end { margin-top: auto; }
  .hud-ears__bar { width: 96px; }
}
/* a short pane held sideways (a phone, a fold half open): the forecast and Show tonight side by side, the tools smaller */
@media (min-aspect-ratio: 9/8) and (max-height: 520px) {
  .hud { gap: 6px; padding-top: calc(6px + var(--safe-t)); padding-bottom: calc(6px + var(--safe-b)); }
  .hud-top { padding: 4px 6px; gap: 8px; }
  .hud-face { width: 44px; height: 44px; }
  .hud-cast { flex-direction: row; }
  .btn-show { max-width: 110px; }
  .cast__line { display: none; }
  .cast__way { display: none; }
  .tool { min-height: 52px; padding: 2px; }
  .tool img { width: 28px; height: 28px; }
  .hud-info { min-height: 0; order: 2; }
  .btn-show__long { display: none; }
  .btn-show__short { display: inline; }
}
@media (min-aspect-ratio: 9/8) and (max-height: 360px) {
  .hud-field { font-size: 16px; }
  .hud-ears__bar { display: none; }
  .tool__name { display: none; }
  .tool { min-height: 46px; }
  .tool img { width: 32px; height: 32px; }
  /* the 320 point iPhone held sideways (UI-23): the forecast drops its "Tonight:" (the group says it) and draws in so
     its name keeps a few words a line, and the end row draws in to stay inside the panel */
  .cast__name small { display: none; }
  .cast { gap: 6px; padding: 2px 8px 2px 4px; }
  .cast__icon { width: 32px; height: 32px; }
  .btn-show { padding: 6px 10px; gap: 6px; }
  .hud-end { gap: 6px; }
  .acts { gap: 4px; }
  .acts i { width: 18px; height: 18px; }
  .btn-undo { padding: 6px 10px; }
  .btn-end { padding: 8px 12px; }
}
/* held upright on a phone: the forecast in one line beside Show tonight, the foot tight, so the board keeps its room
   (the forecast's longer line is in the field's card and How to play; the line above the tools says the rest) */
@media (max-aspect-ratio: 9/8) and (max-width: 620px) {
  .cast__line, .cast__way { display: none; }
  .cast { padding: 2px 8px 2px 4px; gap: 6px; }
  .cast__icon { width: 40px; height: 40px; }
  .cast__name { font-size: 16px; line-height: 1.2; }
  .btn-show__long { display: none; }
  .btn-show__short { display: inline; }
  .hud-info { min-height: 2.5em; max-height: 3.75em; overflow: hidden; }
  .tool { min-height: 56px; }
  .tool img { width: 30px; height: 30px; }
}
@media (max-aspect-ratio: 9/8) and (max-height: 700px) {
  .hud { gap: 6px; }
  .hud-top { padding: 4px 6px; }
  .hud-foot { padding: 6px; gap: 4px; }
  .tool { min-height: 44px; padding: 2px; }
  .tool img { width: 30px; height: 30px; }
  .tool__name { display: none; }
  .tool.is-new::after { font-size: 16px; padding: 0 4px; }
  .hud-face { width: 44px; height: 44px; }
  .hud-ears__bar { width: 80px; }
  .hud-coach__t { font-size: 16px; }
}
/* a phone held upright: a long field's name takes two lines rather than being cut short */
@media (max-aspect-ratio: 9/8) and (max-width: 520px) {
  .hud-field { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
}
@media (max-aspect-ratio: 9/8) and (max-width: 420px) {
  .hud-field { font-size: 16px; }
  .btn-end { padding: 8px 14px; }
}
@media (max-aspect-ratio: 9/8) and (max-width: 360px) {
  .hud-ears__bar { display: none; }
  .tool__name { font-size: 16px; }
  .btn-undo { padding: 6px 10px; }
  /* the 320 point iPhone (UI-23): the foe's face gives its room to the field's name, a long count takes two lines,
     and the end row's dots and buttons draw in so the end button stays on the screen */
  .hud-face { display: none; }
  .hud-ears__q { white-space: normal; max-width: 86px; line-height: 1.15; }
  .hud-end { gap: 6px; }
  .acts { gap: 4px; }
  .acts i { width: 18px; height: 18px; }
  .btn-end { padding: 8px 12px; }
}

/* ---- the sheets: a field's card, the pause (js/room-ui.js dialog) ------------------------------------------------- */
.bl-sheet__row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bl-intro__lead { margin: 0 0 12px; font-style: italic; }
.bl-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.bl-facts li { padding: 6px 12px; border-radius: 999px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); font-size: var(--rui-min, 16px); font-weight: bold; }
.bl-facts li b { color: var(--rui-gold, #F5C242); }
.bl-rows { display: flex; flex-direction: column; gap: 8px; }
.bl-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border-radius: 14px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.bl-row.is-new { border: 2px solid var(--rui-gold, #F5C242); }
.bl-row img { flex: none; width: 48px; height: 48px; object-fit: contain; }
.bl-row__words { min-width: 0; }
.bl-row__name { margin: 0; font-size: var(--rui-body, 18px); font-weight: bold; color: var(--rui-gold, #F5C242); line-height: 1.2; }
.bl-row__name small { margin-left: 8px; padding: 1px 8px; border-radius: 8px; font-size: var(--rui-min, 16px); background: var(--rui-good, #8EF07A); color: #102008; }
.bl-row__what { margin: 2px 0 0; font-size: var(--rui-min, 16px); line-height: 1.35; }
.bl-h { margin: 16px 0 6px; font: bold var(--rui-h2, 22px)/1.2 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); }
.bl-h:first-child { margin-top: 0; }
.bl-how .bl-h { margin-top: 18px; }
.bl-how .bl-h:first-child { margin-top: 0; }
.bl-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 0; }
.bl-links .rui-btn { text-decoration: none; }
.bl-keys { margin: 0; padding-left: 20px; }
.bl-keys li { font-size: var(--rui-min, 16px); line-height: 1.5; }
.bl-keys kbd { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 6px; border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); font: bold 16px/1.4 var(--font); text-align: center; }

/* ---- THE FIELDS and THE WARDENS (readable rooms: js/room-ui.js) ------------------------------------------------------ */
.rui.bl-room[data-paint] { background: linear-gradient(180deg, rgba(20, 12, 6, 0.84), rgba(20, 12, 6, 0.93)), var(--rui-paint) center / cover no-repeat, #160F0A; }
.rui.bl-room[data-side="horde"][data-paint] { background: linear-gradient(180deg, rgba(10, 7, 20, 0.84), rgba(10, 7, 20, 0.93)), var(--rui-paint) center / cover no-repeat, #0D0913; }
.bl-count { margin: 0 0 8px; }
.bl-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(260px * var(--rui-s, 1)), 100%), 1fr)); gap: 12px; margin: 10px 0; }
.bl-field { appearance: none; display: flex; flex-direction: column; align-items: stretch; padding: 0; border-radius: 16px; overflow: hidden; text-align: left; cursor: pointer;
  background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); min-height: 44px; font: inherit; }
.bl-field:hover { filter: brightness(1.1); }
.bl-field.is-on { border-color: var(--rui-gold, #F5C242); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35), 0 6px 22px rgba(245, 194, 66, 0.25); }
.bl-field__art { position: relative; display: block; aspect-ratio: 16 / 9; background: #20160C; }
.rui[data-side="horde"] .bl-field__art { background: #141019; }
.bl-field__art canvas { display: block; width: 100%; height: 100%; }
.bl-field.is-shut .bl-field__art canvas { filter: grayscale(0.85) brightness(0.45); }
.bl-field__n { position: absolute; left: 10px; top: 8px; min-width: 40px; height: 40px; padding: 0 8px; box-sizing: border-box; display: grid; place-items: center; border-radius: 20px;
  background: rgba(14, 8, 4, 0.84); border: 2px solid var(--rui-gold, #F5C242); color: var(--rui-gold, #F5C242); font: bold 20px/1 var(--rui-title-font, Georgia, serif); }
.bl-field__stars { position: absolute; right: 10px; top: 8px; padding: 4px 10px; border-radius: 14px; background: rgba(14, 8, 4, 0.84); font-size: 18px; letter-spacing: 2px; color: #FFD95A; }
.bl-field__stars .is-off { color: rgba(255, 255, 255, 0.3); }
.bl-field__words { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; }
.bl-field__name { font-size: var(--rui-h2, 22px); font-weight: bold; color: var(--rui-gold, #F5C242); line-height: 1.2; }
.bl-field.is-shut .bl-field__name { color: var(--rui-ink, #FBF3E7); }
.bl-field__facts { font-size: var(--rui-min, 16px); color: var(--rui-soft, #DED4F2); line-height: 1.35; }
.bl-strains { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-strain { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; font-size: var(--rui-min, 16px); font-weight: bold;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.bl-strain img { width: 28px; height: 28px; object-fit: contain; }
.bl-field__state { margin-top: 2px; font-size: var(--rui-min, 16px); font-weight: bold; color: var(--rui-warn, #FFD27A); }
.bl-field__state.is-open { color: var(--rui-ink, #FBF3E7); }
.bl-field__state.is-won { color: var(--rui-good, #8EF07A); }
.bl-next__row { display: flex; align-items: center; gap: 16px; }
.bl-next__art { flex: none; width: calc(104px * var(--rui-s, 1)); height: calc(104px * var(--rui-s, 1)); object-fit: contain; border-radius: 16px;
  background: radial-gradient(circle at 50% 70%, rgba(255, 217, 90, 0.42), rgba(255, 138, 61, 0.1) 70%); }
.bl-next__words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bl-next__name { margin: 0; font-size: var(--rui-h2, 22px); font-weight: bold; color: var(--rui-gold, #F5C242); }
.bl-next__words .rui-p { margin: 0; }
.bl-wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(190px * var(--rui-s, 1)), calc(50% - 6px)), 1fr)); gap: 12px; margin: 10px 0; }
.bl-warden { appearance: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 8px 12px; border-radius: 16px; text-align: left; cursor: pointer;
  background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); min-height: 44px; font: inherit; }
.bl-warden:hover { filter: brightness(1.12); }
.bl-warden.is-on { border-color: var(--rui-gold, #F5C242); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35), 0 6px 22px rgba(245, 194, 66, 0.25); }
.bl-warden__art { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 50% 66%, rgba(255, 217, 90, 0.38), rgba(255, 138, 61, 0.1) 72%); }
.rui[data-side="horde"] .bl-warden__art { background: radial-gradient(circle at 50% 66%, rgba(197, 139, 255, 0.36), rgba(156, 255, 107, 0.1) 72%); }
.bl-warden__art img { width: 96%; height: 96%; object-fit: contain; }
.bl-warden.is-shut .bl-warden__art img { filter: grayscale(1) brightness(0.45); }
.bl-warden__name { font-size: var(--rui-body, 18px); font-weight: bold; color: var(--rui-gold, #F5C242); line-height: 1.2; }
.bl-warden.is-shut .bl-warden__name { color: var(--rui-ink, #FBF3E7); }
.bl-warden__perk { font-size: var(--rui-min, 16px); line-height: 1.3; }
.bl-warden__state { margin-top: 2px; font-size: var(--rui-min, 16px); line-height: 1.3; color: var(--rui-warn, #FFD27A); }
.bl-warden__state.is-open { color: var(--rui-good, #8EF07A); font-weight: bold; }
.bl-warden.is-on .bl-warden__state { color: var(--rui-gold, #F5C242); }
@media (max-width: 380px) { .bl-wgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---- THE TUTORIAL'S WORDS (#say): its own row of the grid, under the forecast, so it covers nothing ----------------- */
html[data-tut] .hud { grid-template-rows: auto auto auto minmax(0, 1fr) auto; grid-template-areas: "top" "cast" "say" "slot" "foot"; }
.say { grid-area: say; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "face head next" "face text text"; align-items: center;
  column-gap: 10px; row-gap: 2px; padding: 8px 10px 10px 8px; border-radius: 18px; box-sizing: border-box; --who: #7FD68E;
  background: linear-gradient(135deg, rgba(36, 54, 30, 0.95), rgba(22, 30, 16, 0.95)); border: 2px solid var(--who); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.say[data-who="mags"] { --who: #79D2F2; background: linear-gradient(135deg, rgba(20, 36, 52, 0.95), rgba(12, 18, 30, 0.95)); }
.say[data-who="lucien"] { --who: #C9A2FF; background: linear-gradient(135deg, rgba(44, 30, 60, 0.95), rgba(24, 16, 34, 0.95)); }
.say.is-new { animation: say-in 0.35s ease both; }
.say.is-nudge { animation: say-nudge 0.4s ease; }
@keyframes say-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes say-nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.say__face { grid-area: face; align-self: start; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--who); background: #1A120C; }
.say__words { display: contents; }
.say__head { grid-area: head; margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.say__name { font: bold 18px/1.2 var(--title-font); color: var(--who); }
.say__step { font-size: 16px; color: var(--muted); }
.say__text { grid-area: text; margin: 0; font-size: 18px; line-height: 1.35; color: var(--text); }
.say__next { grid-area: next; padding: 6px 18px; color: #102008; border: 0; background: linear-gradient(135deg, #D8FFB8, var(--who)); }
.say[data-who="mags"] .say__next { color: #06202C; background: linear-gradient(135deg, #D6F4FF, var(--who)); }
/* the tile and the tool to press glow (the board draws its own ring and arrow on the tile) */
.tool.is-hint, .btn.is-hint { animation: hint-glow 1.3s ease-in-out infinite; border-color: #FFF2C2; }
@keyframes hint-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 242, 194, 0); } 50% { box-shadow: 0 0 0 5px rgba(255, 242, 194, 0.55), 0 0 22px rgba(255, 217, 90, 0.6); } }
@media (min-aspect-ratio: 9/8) {
  html[data-tut] .hud { grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "slot top" "slot cast" "slot say" "slot foot"; }
}
@media (max-aspect-ratio: 9/8) and (max-height: 700px) {
  .say { padding: 6px 8px 8px 6px; }
  .say__face { width: 48px; height: 48px; }
  .say__text { font-size: 16px; }
}
@media (min-aspect-ratio: 9/8) and (max-height: 520px) {
  .say { padding: 4px 8px 6px 4px; }
  .say__face { width: 44px; height: 44px; }
  .say__text { font-size: 16px; line-height: 1.3; }
  html[data-tut] .hud-info { display: none; }
}
/* a host's face in the top bar: Mags in a puzzle, Juniper in the tutorial */
.hud-face.is-host { border-color: #79D2F2; background: #1A120C; }

/* ---- THE CAST'S SCENES (#scene): the speaker standing, and their words in a box at the foot ------------------------- */
.scene { position: fixed; inset: 0; z-index: 62; display: flex; align-items: flex-end; justify-content: center; box-sizing: border-box; overflow: hidden; --who: #7FD68E;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--edge-r)) calc(16px + var(--safe-b)) calc(16px + var(--edge-l));
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(60, 40, 16, 0.6), rgba(10, 6, 2, 0.94) 75%); }
html[data-side="horde"] .scene { background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(46, 28, 74, 0.6), rgba(8, 5, 16, 0.95) 75%); }
.scene[data-who="mags"] { --who: #79D2F2; }
.scene[data-who="lucien"] { --who: #C9A2FF; }
.scene.is-up { animation: scene-in 0.4s ease both; }
@keyframes scene-in { from { opacity: 0; } to { opacity: 1; } }
.scene__figure { position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); height: min(62vh, 640px); width: auto; max-width: 92vw; object-fit: contain; transform: translateX(-50%);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 40px rgba(255, 217, 90, 0.18)); pointer-events: none; }
.scene.is-up .scene__figure { animation: scene-figure 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
@keyframes scene-figure { from { opacity: 0; transform: translate(-50%, 30px) scale(0.96); } to { opacity: 1; transform: translateX(-50%); } }
.scene__box { position: relative; width: min(720px, 100%); box-sizing: border-box; padding: 12px 16px 14px; border-radius: 22px; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, rgba(42, 26, 12, 0.97), rgba(24, 15, 7, 0.98)); border: 2px solid var(--who); box-shadow: 0 -6px 40px rgba(0, 0, 0, 0.55); }
html[data-side="horde"] .scene__box { background: linear-gradient(180deg, rgba(34, 22, 52, 0.97), rgba(18, 11, 30, 0.98)); }
.scene__head { display: flex; align-items: center; gap: 12px; }
.scene__face { flex: none; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--who); background: #1A120C; }
.scene__who { flex: 1 1 auto; min-width: 0; }
.scene__name { margin: 0; font: bold 22px/1.15 var(--title-font); color: var(--who); }
.scene__role { margin: 0; font-size: 16px; line-height: 1.25; color: var(--muted); font-style: italic; }
.scene__count { flex: none; font-size: 16px; color: var(--muted); }
.scene__text { margin: 0; font-size: 20px; line-height: 1.4; color: var(--text); min-height: 2.8em; }
.scene__text.is-new { animation: say-in 0.3s ease both; }
.scene__acts { display: flex; justify-content: flex-end; gap: 10px; }
.scene__next { min-width: 120px; }
/* held sideways: the speaker on the left, the words on the right */
@media (min-aspect-ratio: 9/8) {
  .scene { justify-content: flex-end; align-items: center; }
  .scene__figure { left: max(4vw, calc(16px + var(--edge-l))); bottom: 0; height: min(94vh, 900px); max-width: 44vw; transform: none; }
  .scene.is-up .scene__figure { animation-name: scene-figure-side; }
  @keyframes scene-figure-side { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
  .scene__box { width: min(560px, 54vw); margin-right: 2vw; }
}
@media (min-aspect-ratio: 9/8) and (max-height: 520px) {
  .scene__text { font-size: 18px; min-height: 0; }
  .scene__face { width: 48px; height: 48px; }
  .scene__box { padding: 10px 14px 12px; gap: 6px; }
}
@media (max-aspect-ratio: 9/8) and (max-height: 700px) {
  .scene__figure { height: min(52vh, 520px); bottom: calc(170px + var(--safe-b)); }
  .scene__text { font-size: 18px; }
}

/* ---- THE ALMANAC'S CARD (#card): it flips from its back to its face over the board -------------------------------- */
/* the five backs (a Renown unlock each; the Collection shows them as swatches too) */
.acard--almanac { --back: repeating-linear-gradient(45deg, rgba(245, 194, 66, 0.14) 0 3px, transparent 3px 14px), repeating-linear-gradient(-45deg, rgba(245, 194, 66, 0.14) 0 3px, transparent 3px 14px), radial-gradient(circle at 50% 45%, #6A4520, #2A170A 80%); --back-line: #F5C242; }
.acard--thorn { --back: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0 3px, transparent 3px 13px), repeating-linear-gradient(45deg, rgba(255, 110, 60, 0.4) 0 2px, transparent 2px 17px), linear-gradient(160deg, #7A2414, #2C0A05); --back-line: #FF8A5A; }
.acard--starlit { --back: radial-gradient(#FFF6C8 1.4px, transparent 2px) 0 0 / 24px 24px, radial-gradient(rgba(255, 246, 200, 0.6) 1px, transparent 1.6px) 12px 12px / 24px 24px, linear-gradient(180deg, #24306A, #0A0E26); --back-line: #BFD2FF; }
.acard--midnight { --back: radial-gradient(circle at 50% 30%, #FFF3C4 0 9%, rgba(255, 243, 196, 0.28) 10%, transparent 24%), radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1.6px) 7px 5px / 31px 29px, linear-gradient(180deg, #221440, #07040F); --back-line: #D9C8FF; }
.acard--gilded { --back: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 11px), linear-gradient(135deg, #8A5A10, #F5C242 38%, #FFF0B8 50%, #F5C242 62%, #8A5A10); --back-line: #FFF6D2; }
.acard { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; box-sizing: border-box; overflow-y: auto; perspective: 1400px;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--edge-r)) calc(12px + var(--safe-b)) calc(16px + var(--edge-l)); background: rgba(8, 5, 2, 0.62); --kind: #F5C242; }
html[data-side="horde"] .acard { background: rgba(6, 3, 12, 0.66); }
.acard.is-good { --kind: #8EF07A; }
.acard.is-bad { --kind: #FF7A5A; }
.acard.is-choice { --kind: #F5C242; }
.acard__flip { position: relative; width: min(380px, 100%); transform-style: preserve-3d; }
.acard.is-up .acard__flip { animation: acard-flip 0.9s cubic-bezier(0.3, 0.8, 0.3, 1) both; }
@keyframes acard-flip {
  0% { opacity: 0; transform: translateY(60px) rotateY(180deg) scale(0.82); }
  30% { opacity: 1; transform: translateY(0) rotateY(180deg) scale(1); }
  100% { opacity: 1; transform: rotateY(0) scale(1); }
}
.acard__back, .acard__face { -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: 22px; box-sizing: border-box; }
.acard__back { position: absolute; inset: 0; transform: rotateY(180deg); display: grid; place-items: center; background: var(--back); border: 3px solid var(--back-line);
  box-shadow: inset 0 0 0 8px rgba(0, 0, 0, 0.28), inset 0 0 0 10px var(--back-line), 0 20px 60px rgba(0, 0, 0, 0.6); }
.acard.is-up .acard__back { animation: acard-back-gone 0s linear 0.9s forwards; }
@keyframes acard-back-gone { to { visibility: hidden; } }
.acard__seal { width: 40%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--back-line); box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); }
.acard__seal img { display: block; width: 100%; height: 100%; object-fit: cover; }
.acard__face { position: relative; display: flex; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, #2E1D0D, #1A1007); border: 3px solid var(--kind);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 36px color-mix(in srgb, var(--kind) 45%, transparent), 0 24px 70px rgba(0, 0, 0, 0.65); }
html[data-side="horde"] .acard__face { background: linear-gradient(180deg, #24173A, #120B20); }
.acard__frame { position: relative; flex: none; height: clamp(170px, 38vh, 400px); overflow: hidden; background: #000; }
.acard__art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.acard__art.is-face { object-fit: contain; background: radial-gradient(circle, #3A2A18, #120A04); }
.acard__frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(26, 16, 7, 0.95)); pointer-events: none; }
html[data-side="horde"] .acard__frame::after { background: linear-gradient(180deg, transparent 60%, rgba(18, 11, 32, 0.95)); }
.acard__kind { position: absolute; z-index: 1; left: 12px; top: 12px; padding: 4px 12px; border-radius: 999px; font-size: 16px; font-weight: bold; letter-spacing: 0.04em;
  background: var(--kind); color: #1A0E04; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.acard__body { display: flex; flex-direction: column; gap: 8px; padding: 6px 16px 16px; margin-top: -26px; position: relative; z-index: 1; }
.acard__from { margin: 0; font-size: 16px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.acard__title { margin: 0; font: bold 26px/1.15 var(--title-font); color: var(--gold); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.acard__words { margin: 0; font-size: 18px; line-height: 1.4; color: var(--text); }
.acard__acts { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.acard__opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 2px solid var(--line); }
.acard__opt.is-first { border-color: var(--gold); background: linear-gradient(135deg, rgba(245, 194, 66, 0.32), rgba(245, 194, 66, 0.08)); }
html[data-side="horde"] .acard__opt.is-first { background: linear-gradient(135deg, rgba(156, 255, 107, 0.26), rgba(156, 255, 107, 0.06)); }
.acard__opt-t { font-size: 18px; font-weight: bold; color: var(--gold); }
.acard__opt-s { font-size: 16px; font-weight: normal; line-height: 1.3; color: var(--text); }
.acard__ok { width: 100%; }
/* held sideways: the picture on the left, the words on the right */
@media (min-aspect-ratio: 9/8) {
  .acard__flip { width: min(720px, 100%); }
  .acard__face { flex-direction: row; max-height: calc(100vh - 24px - var(--safe-t) - var(--safe-b)); max-height: calc(100dvh - 24px - var(--safe-t) - var(--safe-b)); }
  .acard__frame { width: 42%; height: auto; min-height: 280px; }
  .acard__frame::after { background: linear-gradient(90deg, transparent 70%, rgba(26, 16, 7, 0.9)); }
  html[data-side="horde"] .acard__frame::after { background: linear-gradient(90deg, transparent 70%, rgba(18, 11, 32, 0.9)); }
  .acard__body { flex: 1 1 0; min-width: 0; margin: 0; padding: 18px 18px 16px; justify-content: center; overflow-y: auto; }
}
@media (min-aspect-ratio: 9/8) and (max-height: 520px) {
  .acard__frame { min-height: 0; }
  .acard__title { font-size: 22px; }
  .acard__words { font-size: 16px; }
  .acard__body { padding: 12px 14px; gap: 6px; }
  .acard__opt { padding: 6px 12px; }
}

/* ---- THE ROOMS' NEW PARTS: hosts, intros, Quick Season's grades, the Puzzles, the Collection, How to play ----------- */
.bl-host { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.bl-host__face { flex: none; width: calc(72px * var(--rui-s, 1)); height: calc(72px * var(--rui-s, 1)); border-radius: 50%; object-fit: cover; border: 2px solid var(--rui-gold, #F5C242); background: #1A120C; }
.bl-host__words { min-width: 0; }
.bl-host__name { margin: 0 0 2px; font: bold var(--rui-body, 18px)/1.2 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); }
.bl-host__line { margin: 0; font-style: italic; }
.bl-intro__host { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; }
.bl-intro__face { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rui-gold, #F5C242); background: #1A120C; }
.bl-intro__host .bl-intro__lead { margin: 0; }
.bl-goal { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; font: bold var(--rui-h2, 22px)/1.25 var(--rui-title-font, Georgia, serif); color: #1A0E04;
  background: linear-gradient(135deg, #FFE9A8, var(--rui-gold, #F5C242)); }
.bl-one { max-width: 520px; }
.bl-field__story { position: absolute; right: 10px; bottom: 8px; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #7FD68E; background: #1A120C; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
/* QUICK SEASON: a card for each grade, a field of it drawn small */
.bl-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(280px * var(--rui-s, 1)), 100%), 1fr)); gap: 12px; margin: 10px 0; }
.bl-grade { appearance: none; display: flex; flex-direction: column; align-items: stretch; padding: 0; border-radius: 16px; overflow: hidden; text-align: left; cursor: pointer; font: inherit;
  background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); min-height: 44px; }
.bl-grade:hover { filter: brightness(1.1); }
.bl-grade:focus-visible, .bl-puzzle:focus-visible, .bl-item:focus-visible, .bl-scene:focus-visible { outline: 3px solid var(--rui-gold, #F5C242); outline-offset: 2px; }
.bl-grade__art { position: relative; display: block; aspect-ratio: 16 / 9; background: #20160C; }
.bl-grade__art canvas { display: block; width: 100%; height: 100%; }
.bl-grade.is-shut .bl-grade__art canvas { filter: grayscale(0.85) brightness(0.45); }
.bl-grade__name { position: absolute; left: 10px; bottom: 8px; padding: 4px 14px; border-radius: 14px; background: rgba(14, 8, 4, 0.86); border: 2px solid var(--rui-gold, #F5C242);
  font: bold var(--rui-h2, 22px)/1.1 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); }
.bl-grade__words { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.bl-grade__what { margin: 0; }
.bl-grade__state { font-size: var(--rui-min, 16px); font-weight: bold; color: var(--rui-warn, #FFD27A); }
.bl-grade__state.is-open { color: var(--rui-soft, #DED4F2); }
.bl-grade__go { align-self: flex-start; pointer-events: none; }
/* THE PUZZLES: a numbered tile each, with its goal and how hard it is */
.bl-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(220px * var(--rui-s, 1)), calc(50% - 6px)), 1fr)); gap: 10px; margin: 10px 0; }
.bl-puzzle { appearance: none; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px 12px 12px; border-radius: 16px; text-align: left; cursor: pointer; font: inherit;
  background: linear-gradient(160deg, #23324A, #141C2A); border: 2px solid rgba(121, 210, 242, 0.45); color: var(--rui-ink, #FBF3E7); min-height: 44px; }
.rui[data-side="horde"] .bl-puzzle { background: linear-gradient(160deg, #2A1E44, #151024); }
.bl-puzzle:hover { filter: brightness(1.12); }
.bl-puzzle.is-solved { border-color: var(--rui-good, #8EF07A); }
.bl-puzzle.is-neat { border-color: var(--rui-gold, #F5C242); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.3), 0 6px 18px rgba(245, 194, 66, 0.2); }
.bl-puzzle.is-shut { filter: grayscale(0.6) brightness(0.7); }
.bl-puzzle__n { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 8px; box-sizing: border-box; border-radius: 20px; background: rgba(0, 0, 0, 0.4);
  border: 2px solid #79D2F2; font: bold 20px/1 var(--rui-title-font, Georgia, serif); color: #BFEFFF; }
.bl-puzzle.is-neat .bl-puzzle__n { border-color: var(--rui-gold, #F5C242); color: var(--rui-gold, #F5C242); }
.bl-puzzle__name { font: bold var(--rui-body, 18px)/1.2 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); overflow-wrap: anywhere; }
.bl-puzzle__goal { font-size: var(--rui-min, 16px); line-height: 1.3; }
.bl-puzzle__diff { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--rui-min, 16px); color: var(--rui-soft, #DED4F2); }
.bl-puzzle__diff i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.bl-puzzle__diff i.is-on { background: #79D2F2; box-shadow: 0 0 6px rgba(121, 210, 242, 0.7); }
.bl-puzzle__diff span { margin-left: 4px; }
.bl-puzzle__state { font-size: var(--rui-min, 16px); font-weight: bold; color: var(--rui-warn, #FFD27A); }
.bl-puzzle__state.is-won { color: var(--rui-good, #8EF07A); }
/* THE COLLECTION: looks, wardrobes, shines, card backs, scenes and titles */
.bl-igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(220px * var(--rui-s, 1)), calc(50% - 6px)), 1fr)); gap: 12px; margin: 10px 0; }
.bl-igrid.is-small { grid-template-columns: repeat(auto-fill, minmax(min(calc(150px * var(--rui-s, 1)), calc(50% - 6px)), 1fr)); }
.bl-item { appearance: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 8px 12px; border-radius: 16px; text-align: left; cursor: pointer; font: inherit;
  background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); min-height: 44px; }
.bl-item:hover { filter: brightness(1.1); }
.bl-item.is-on { border-color: var(--rui-gold, #F5C242); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35), 0 6px 22px rgba(245, 194, 66, 0.25); }
.bl-item__art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #1A120C; }
.bl-item__art img { width: 100%; height: 100%; object-fit: cover; }
.bl-item.is-shut .bl-item__art img { filter: grayscale(0.9) brightness(0.45); }
.bl-item__art.is-gilt img { filter: sepia(1) saturate(2.4) hue-rotate(-8deg) brightness(1.05); }
.bl-item__art.is-figure { aspect-ratio: 3 / 4; background: radial-gradient(circle at 50% 60%, rgba(127, 214, 142, 0.35), rgba(26, 18, 12, 1) 72%); }
.bl-item__art.is-figure img { object-fit: contain; height: 96%; }
.bl-item__art.is-swatch { aspect-ratio: 1; background: radial-gradient(circle at 50% 50%, #FFFFFF 0 6%, rgba(var(--sw), 1) 14%, rgba(var(--sw), 0.35) 40%, transparent 62%), radial-gradient(circle, #2A1C10, #0E0804); }
.bl-item__art.is-prism { background: radial-gradient(circle at 50% 50%, #FFFFFF 0 6%, transparent 50%), conic-gradient(from 0deg, #FF6A6A, #FFD95A, #8EF07A, #6AD8FF, #B48CFF, #FF6AC8, #FF6A6A); }
.bl-item__art.is-back { aspect-ratio: 3 / 4; background: var(--back); border: 2px solid var(--back-line); box-sizing: border-box; }
.bl-item__art.is-back img { width: 46%; height: auto; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--back-line); }
.bl-item__name { font: bold var(--rui-body, 18px)/1.2 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); }
.bl-item.is-shut .bl-item__name { color: var(--rui-ink, #FBF3E7); }
.bl-item__words { font-size: var(--rui-min, 16px); line-height: 1.3; }
.bl-item__state { margin-top: 2px; font-size: var(--rui-min, 16px); font-weight: bold; color: var(--rui-warn, #FFD27A); }
.bl-item__state.is-open { color: var(--rui-soft, #DED4F2); }
.bl-item__state.is-on { color: var(--rui-good, #8EF07A); }
.bl-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(240px * var(--rui-s, 1)), 100%), 1fr)); gap: 10px; margin: 10px 0; }
.bl-scene { appearance: none; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 8px 12px 8px 8px;
  border-radius: 16px; text-align: left; cursor: pointer; font: inherit; background: var(--rui-panel-2, #251C38); border: 2px solid var(--rui-line, rgba(201, 168, 245, 0.4)); color: var(--rui-ink, #FBF3E7); min-height: 64px; }
.bl-scene:hover { filter: brightness(1.1); }
.bl-scene.is-shut { cursor: default; }
.bl-scene.is-shut .bl-scene__face { filter: grayscale(1) brightness(0.5); }
.bl-scene__face { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--rui-gold, #F5C242); }
.bl-scene__name { font-weight: bold; font-size: var(--rui-body, 18px); color: var(--rui-gold, #F5C242); line-height: 1.2; align-self: end; }
.bl-scene.is-shut .bl-scene__name { color: var(--rui-ink, #FBF3E7); }
.bl-scene__state { font-size: var(--rui-min, 16px); line-height: 1.3; color: var(--rui-soft, #DED4F2); align-self: start; }
.bl-titles { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(calc(220px * var(--rui-s, 1)), 100%), 1fr)); gap: 8px; }
.bl-titles li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4));
  font-size: var(--rui-min, 16px); opacity: 0.6; }
.bl-titles li.is-open { opacity: 1; }
.bl-titles li.is-on { border: 2px solid var(--rui-gold, #F5C242); }
.bl-titles li b { color: var(--rui-soft, #DED4F2); }
.bl-titles li span { font: bold var(--rui-body, 18px)/1.2 var(--rui-title-font, Georgia, serif); color: var(--rui-gold, #F5C242); }
/* HOW TO PLAY's pictures */
.bl-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 6px 0 10px; }
.bl-pic { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 14px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.bl-pic img { width: 72px; height: 72px; object-fit: contain; }
.bl-pic figcaption { font-size: var(--rui-min, 16px); line-height: 1.2; text-align: center; font-weight: bold; }
.bl-pic.is-card img { width: 84px; height: 112px; object-fit: cover; border-radius: 10px; border: 2px solid var(--rui-gold, #F5C242); }
.bl-pic.is-face img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 2px solid var(--rui-gold, #F5C242); }

/* ---- small things -------------------------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 80; max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 14px;
  background: var(--glass-2); border: 1px solid var(--line); font-size: 18px; text-align: center; box-sizing: border-box; }
html[data-screen="play"] .toast { bottom: auto; top: calc(120px + var(--safe-t)); }
.boot-error { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center;
  background: var(--ink); font-size: 18px; }
.boot-error__title { font-size: 24px; font-weight: bold; color: var(--gold); margin: 0; }

/* ---- a big screen: the door's column, the corner and the season's words grow with it --------------------------------- */
/* an iPad held upright (or a fold opened tall): the door's column and the season's bars a size up, the board keeps the rest */
/* the shared result board (js/reward-board.js) on the 320 point iPhone (UI-23): its three ways on share 290 points, so
   their words draw in a little and "Campaign" fits its button */
@media (max-width: 360px) { html[data-device="phone"] .rb .rb-foot .rb-btn { padding: 8px 6px; font-size: 16px; } }
@media (max-aspect-ratio: 5/4) and (min-width: 700px) and (min-height: 960px) { .door-col, .corner { zoom: 1.3; } .hud-top, .hud-cast, .hud-foot, .hud-banner, .hud-coach, .say { zoom: 1.2; } }
@media (min-width: 1400px) and (min-height: 820px) { .door-col, .corner, .door-copy { zoom: 1.25; } :root { --panel: 400px; } .hud-top, .hud-cast, .hud-foot, .hud-banner, .hud-coach, .say, .scene__box, .acard__flip { zoom: 1.15; } }
@media (min-width: 2300px) and (min-height: 1250px) { .door-col, .corner, .door-copy { zoom: 1.6; } :root { --panel: 460px; } .hud-top, .hud-cast, .hud-foot, .hud-banner, .hud-coach, .say, .scene__box, .acard__flip { zoom: 1.4; } }

@media (prefers-reduced-motion: reduce) {
  .btn-play::after, .curtain-art, .hud-banner, .hud-coach, .btn-end.is-glow, .hud-face.is-mood, .say.is-new, .say.is-nudge, .tool.is-hint, .btn.is-hint,
  .scene.is-up, .scene.is-up .scene__figure, .scene__text.is-new, .acard.is-up .acard__flip { animation: none; }
  .renown__bar span { transition: none; }
  .acard__back { visibility: hidden; }
}
