/* hustle/css/hustle.css - HUSHLING HUSTLE's page: the curtain, the door, the corner, the works (the bar along the top,
 * the four rooms with their paintings, crews, machines and switches, the rooms' buttons along the foot on a phone),
 * the pour, the reveal, the cast's scenes and tips, and the Notebook's pages inside the shared room kit's dialogs
 * (../js/room-ui.css). The Herd's colours are candy pink, cream and gold; the Horde's violet and toxic green
 * (html[data-side], set by hustle/js/hustle-main.js).
 *
 * THE TWO LAYOUTS (html[data-layout], hustle-main.js applyLayout):
 *   board  a computer, an iPad held sideways: the four rooms two over two, the bar along the top, Back in the bottom
 *          right corner with the Truck Bay's glass notched round it.
 *   room   a phone, an iPad held upright: one room at a time; held upright the rooms' buttons run along the foot
 *          with Back, held sideways they stand up the left edge.
 * Inside a room: the painting with its people on top (the stage), and the glass under it (the machine's readouts and
 * presses, then the four switches). The stage is a size container, so the people are sized by its height.
 *
 * The series' lessons, kept here from the first draw (docs/LESSONS-LEARNED.md, UI and PH): words never under 16 CSS px;
 * 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-*), and --sotc-edge-l/-r from js/friends.js THE ISLAND'S SIDE). */
:root {
  --ink: #1E1206;
  --glass: rgba(30, 18, 10, 0.78);
  --glass-2: rgba(52, 32, 20, 0.9);
  --panel: rgba(28, 17, 10, 0.92);
  --line: rgba(255, 233, 190, 0.24);
  --text: #FFF6EC;
  --muted: #F0DEC8;
  --gold: #F5C242;
  --brass: #D9A33E;
  --a: #FF8FC7;
  --b: #FFE3B0;
  --green: #6BE04A;
  --amber: #FFB23E;
  --red: #FF5A4E;
  --t-plain: #B9A58A;
  --t-common: #E9E2D2;
  --t-uncommon: #5FD08A;
  --t-rare: #4FA8FF;
  --t-epic: #C77BFF;
  --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;
  --hud-h: 60px;
}
html[data-side="horde"] { --ink: #0D0818; --glass: rgba(16, 10, 30, 0.8); --glass-2: rgba(36, 24, 60, 0.9); --panel: rgba(16, 11, 30, 0.93);
  --line: rgba(196, 170, 255, 0.26); --muted: #E4D9F5; --a: #A78BFA; --b: #9CFF6B; }
@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; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- 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%, #4A2C14 0%, var(--ink) 72%); transition: opacity 0.5s ease; }
.curtain.is-gone { opacity: 0; }
.curtain-art { width: 140px; height: 140px; object-fit: contain; animation: bob 0.7s ease-in-out infinite alternate; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.5)); }
@keyframes bob { from { transform: translateY(8px) rotate(-6deg); } to { transform: translateY(-10px) rotate(6deg); } }
.curtain-title { margin: 0; font-family: var(--title-font); font-weight: bold; letter-spacing: 0.24em; 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; box-sizing: border-box;
  padding: 10px 18px; font-size: 18px; font-weight: bold; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.2s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, .chip:focus-visible, .round:focus-visible, .hh-go:focus-visible, .hh-lever:focus-visible, .hh-act:focus-visible, .hh-crew:focus-visible,
.hh-fault:focus-visible, .hh-plate--btn:focus-visible, .hh-pace:focus-visible, .hh-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-ghost { background: var(--glass); }
.btn-gold { border: 0; color: #2A1606; background: linear-gradient(135deg, var(--gold), #FFE9A8); }
.btn-gold:disabled { filter: grayscale(0.6) brightness(0.8); cursor: default; }
.btn-play { position: relative; border: 0; min-height: 64px; padding: 14px 40px; font-size: 24px; letter-spacing: 0.12em; text-transform: uppercase; color: #2A1030;
  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(255, 143, 199, 0.4); }
html[data-side="horde"] .btn-play { background: linear-gradient(135deg, #C9F27A, #F5E9A8 40%, var(--a)); 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; }
@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-acct { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-friends { gap: 6px; border-color: rgba(245, 194, 66, 0.55); color: #FFE9A8; }
.chip-friends[aria-expanded="true"] { border-color: var(--gold); background: rgba(245, 194, 66, 0.22); }
.chip-side { padding: 4px 16px 4px 10px; cursor: default; }
.chip-side[role="button"] { cursor: pointer; }
.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 round picture buttons (UI-3, UI-35) and their pictures, drawn as masks so they take the button's colour */
.round { appearance: none; flex: none; position: relative; width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(245, 194, 66, 0.7); cursor: pointer;
  display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #6A4426, #2A180B 75%); color: #FFE9A8; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); padding: 0; box-sizing: border-box; }
html[data-side="horde"] .round { background: radial-gradient(circle at 40% 35%, #4A3170, #1C1230 75%); }
.round:disabled { filter: grayscale(0.8) brightness(0.6); cursor: default; }
.round:not(:disabled):hover { filter: brightness(1.2); }
.round--small { width: 48px; height: 48px; }
.round--back { position: fixed; z-index: 30; right: calc(12px + var(--edge-r)); bottom: calc(8px + var(--safe-b)); }
/* on the board Back is the Truck Bay's own, in the corner of its foot (hustle-main.js placeBack) */
html[data-layout="board"] .hh-room__foot > .round--back { position: absolute; right: 10px; bottom: 10px; }
.round .hh-ic { width: 26px; height: 26px; }
.round__n { position: absolute; right: -4px; top: -4px; min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box; border-radius: 11px; background: var(--gold); color: #2A1606;
  font: bold 16px/22px var(--font); text-align: center; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.ico { width: 26px; height: 26px; display: block; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico--sound { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9zm13.5 3A4.5 4.5 0 0 0 14 8v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E"); }
.ico--back { width: 30px; height: 30px; --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 5 3 12l7 7v-4.2c5 0 8.5 1.6 11 5.2-1-5-4-10-11-11z'/%3E%3C/svg%3E"); }
.ico--whistle { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M9 7h12v5h-5.2A6.5 6.5 0 1 1 9 7zm0 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7zM14 3h2v3h-2zM10.5 2.5l1.8-.9 1.2 2.4-1.8.9zM17.7 2.6l1.8.9-1.2 2.4-1.8-.9z'/%3E%3C/svg%3E"); }
.ico--book { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 3h11a3 3 0 0 1 3 3v15H7a3 3 0 0 1-3-3zm3 13a1 1 0 0 0 0 2h9v-2zm1-10v2h7V6zm0 4v2h5v-2zM19 6h1v16H8v-1h11z'/%3E%3C/svg%3E"); }
.ico--mix { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 8h18v2h-1l-1.5 9a2 2 0 0 1-2 1.7h-9A2 2 0 0 1 5.5 19L4 10H3zm4-6c1.2 1.2 1.2 2.6 0 4h2c1.2-1.4 1.2-2.8 0-4zm4 0c1.2 1.2 1.2 2.6 0 4h2c1.2-1.4 1.2-2.8 0-4z'/%3E%3C/svg%3E"); }
.ico--gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M10.6 2h2.8l.5 2.6 1.7.7 2.2-1.5 2 2-1.5 2.2.7 1.7 2.6.5v2.8l-2.6.5-.7 1.7 1.5 2.2-2 2-2.2-1.5-1.7.7-.5 2.6h-2.8l-.5-2.6-1.7-.7-2.2 1.5-2-2 1.5-2.2-.7-1.7L2 13.4v-2.8l2.6-.5.7-1.7-1.5-2.2 2-2 2.2 1.5 1.7-.7zM12 8.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z'/%3E%3C/svg%3E"); }
.ico--shop { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18l1 5a3 3 0 0 1-5 2 3 3 0 0 1-5 0 3 3 0 0 1-5 0 3 3 0 0 1-5-2zM4 12.5V21h6v-5h4v5h6v-8.5a4.6 4.6 0 0 1-3 .3 4.7 4.7 0 0 1-5 0 4.7 4.7 0 0 1-5 0 4.6 4.6 0 0 1-3-.3z'/%3E%3C/svg%3E"); }
.ico--truck { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M1 5h13v10H1zM15 8h4.5l3.5 4.5V15h-8zM5.5 16a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zm12 0a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z'/%3E%3C/svg%3E"); }
.hh-ic { display: block; width: 24px; height: 24px; flex: none; }

/* ---- the door ---------------------------------------------------------------------------------------------------------- */
.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)); }
/* the painting lies UNDER the dark scrim (.door::before): at the same z-index the later one in the page paints on top,
   and the painting comes after ::before, so at -1 each it covered the scrim and the words washed into the art (UI-20) */
.door-art { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 64% 50%; z-index: -2; }
.door::before { content: ''; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 90% 70% at 50% 50%, rgba(24, 12, 4, 0.8) 0%, rgba(24, 12, 4, 0.6) 55%, rgba(24, 12, 4, 0.32) 100%); }
html[data-side="horde"] .door::before { background: radial-gradient(ellipse 90% 70% at 50% 50%, rgba(13, 8, 24, 0.82) 0%, rgba(13, 8, 24, 0.62) 55%, rgba(13, 8, 24, 0.35) 100%); }
.door-col { position: relative; width: min(480px, 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; display: flex; flex-direction: column; align-items: inherit; font-family: var(--title-font); font-weight: bold; line-height: 0.98; letter-spacing: 0.03em; }
#door-title-a { font-size: clamp(30px, 8vw, 48px); color: #FFF0F6; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.55); letter-spacing: 0.08em; }
#door-title-b { font-size: clamp(52px, 15vw, 96px);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFE6F2 28%, var(--gold) 62%, 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, 143, 199, 0.4)); }
html[data-side="horde"] #door-title-b { background: linear-gradient(180deg, #FFFFFF 0%, #EAFFD9 30%, var(--b) 60%, var(--a) 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 26px rgba(156, 255, 107, 0.35)); }
.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); }
.door-best { margin: 0; font-size: 18px; font-weight: bold; line-height: 1.35; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
.door-next-wrap { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.door-next { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); overflow: hidden; border: 1px solid var(--line); }
.door-next span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--gold)); transition: width 0.5s ease; }
.door-next-text { margin: 0; font-size: 16px; color: var(--muted); line-height: 1.35; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
.door-story { margin: 0; font-size: 16px; font-weight: bold; color: var(--b); line-height: 1.35; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85); }
.door-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.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; }
/* a computer or a phone held sideways: the column on the left, the painting's works on the right */
@media (min-aspect-ratio: 5/4) {
  .door { justify-content: flex-start; padding: calc(70px + var(--safe-t)) calc(24px + var(--edge-r)) calc(24px + var(--safe-b)) calc(max(24px, 5vw) + var(--edge-l)); }
  .door::before { background: linear-gradient(90deg, rgba(24, 12, 4, 0.9) 0%, rgba(24, 12, 4, 0.64) 38%, rgba(24, 12, 4, 0) 62%); }
  html[data-side="horde"] .door::before { background: linear-gradient(90deg, rgba(13, 8, 24, 0.9) 0%, rgba(13, 8, 24, 0.64) 38%, rgba(13, 8, 24, 0) 62%); }
  .door-col { align-items: flex-start; text-align: left; width: min(500px, 44vw); }
  .door-row { justify-content: flex-start; }
  .door-copy { left: auto; right: calc(124px + var(--edge-r)); }
}
/* a phone held sideways: short, so the column is tighter */
@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(520px, 56vw); }
  .door-kicker, .door-sub, .door-next-wrap { display: none; }
  #door-title-a { font-size: 26px; }
  #door-title-b { font-size: clamp(40px, 11vh, 60px); }
  .btn-play { min-height: 56px; font-size: 21px; padding: 10px 30px; }
}
/* a short phone held upright (the smallest iPhones, 320 x 568) */
@media (max-aspect-ratio: 5/4) and (max-height: 640px) {
  .door { padding-top: calc(64px + var(--safe-t)); padding-bottom: calc(112px + var(--safe-b)); }
  .door-col { gap: 8px; }
  .door-kicker, .door-sub, .door-next-wrap { display: none; }
  #door-title-a { font-size: 24px; }
  #door-title-b { font-size: clamp(42px, 13vw, 56px); }
  .btn-play { min-height: 52px; font-size: 19px; letter-spacing: 0.08em; padding: 8px 22px; }
  .door-best { font-size: 16px; }
  .door-row .btn { padding-left: 14px; padding-right: 14px; }
}
@media (max-aspect-ratio: 5/4) and (max-height: 640px) and (max-width: 359px) { .door { padding-top: calc(118px + var(--safe-t)); } }
/* the narrowest phone held sideways: the door's buttons reach right across to where the mark sits beside the World door,
   so the mark sits over the World door instead (UI-1) */
@media (min-aspect-ratio: 5/4) and (max-width: 640px) { .door-copy { right: calc(14px + var(--edge-r)); bottom: calc(84px + var(--safe-b)); } }
/* THE DOOR FITS ITS WINDOW (hustle-main.js fitDoor) */
.door--tight .door-kicker, .door--tight .door-sub { display: none; }
.door--tight .door-col { gap: 8px; }
.door--tighter .door-next-wrap { display: none; }
.door--tighter #door-title-a { font-size: 24px; }
.door--tighter #door-title-b { font-size: clamp(40px, min(13vw, 11vh), 56px); }
.door--tighter .btn-play { min-height: 52px; font-size: 19px; letter-spacing: 0.08em; padding: 8px 22px; }
.door--tighter .door-row .btn { padding-left: 12px; padding-right: 12px; font-size: 16px; }
.door--tighter .door-col { gap: 6px; }
.door--tighter .door-row { gap: 8px; }

/* ---- the corner: top right, in past the island when it is on the 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 11px; } .chip-acct { max-width: 120px; } }
@media (min-aspect-ratio: 5/4) and (max-height: 560px) { .corner { flex-direction: column; align-items: flex-end; flex-wrap: nowrap; } }

/* =========================================================================================================================
   THE WORKS
   ========================================================================================================================= */
.hh-works { position: fixed; inset: 0; z-index: 10; overflow: hidden; touch-action: manipulation;
  background: radial-gradient(ellipse at 50% 30%, #3A2210, var(--ink) 75%); }
html[data-side="horde"] .hh-works { background: radial-gradient(ellipse at 50% 30%, #241640, var(--ink) 75%); }
.hh-fx { position: fixed; left: 0; top: 0; z-index: 25; pointer-events: none; }

/* ---- the bar along the top ------------------------------------------------------------------------------------------------ */
.hh-hud { position: absolute; z-index: 20; top: calc(6px + var(--safe-t)); left: calc(8px + var(--edge-l)); right: calc(8px + var(--edge-r));
  display: flex; align-items: center; gap: 8px; }
.hh-clock { margin: 0; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px 0 6px; box-sizing: border-box; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hh-clock__dial { position: relative; width: 36px; height: 36px; border-radius: 50%; box-sizing: border-box; border: 3px solid var(--brass);
  background: radial-gradient(circle, #FFF8E6 0 58%, #F0DDB2 60%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.15); }
.hh-clock__dial i { position: absolute; left: 50%; bottom: 50%; width: 3px; height: 13px; margin-left: -1.5px; border-radius: 2px; background: #3A1C08; transform-origin: 50% 100%; }
.hh-clock__dial::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #3A1C08; }
#hh-clock-t { font: bold 20px/1 var(--title-font); color: var(--gold); font-variant-numeric: tabular-nums; min-width: 3.1em; }
.hh-renown { position: relative; flex: 1 1 200px; min-width: 150px; max-width: 360px; height: 40px; border-radius: 999px; overflow: hidden; box-sizing: border-box;
  background: rgba(0, 0, 0, 0.5); border: 2px solid rgba(245, 194, 66, 0.6); }
.hh-renown__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--a), var(--gold)); transition: width 0.3s ease; }
.hh-renown.is-met { border-color: var(--gold); box-shadow: 0 0 12px rgba(245, 194, 66, 0.6); }
.hh-renown.is-met .hh-renown__fill { background: linear-gradient(90deg, var(--gold), #FFF2B8); }
.hh-renown__goal { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: linear-gradient(180deg, #FFFFFF 0 26%, transparent 26% 74%, #FFFFFF 74%); }
.hh-renown__t { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: bold 17px/1 var(--font); color: #FFFFFF;
  text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, 0.9); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hh-renown__t::after { content: '\00a0Renown'; }
.hh-renown__t::before { content: '\2605\00a0'; color: var(--gold); }
.hh-order, .hh-call, .hh-reveal { flex: 1 1 220px; min-width: 0; margin: 0; height: 48px; box-sizing: border-box; padding: 4px 12px; border-radius: 14px; display: flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--line); font-size: 16px; font-weight: bold; line-height: 1.2; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hh-order { overflow: hidden; }
.hh-order::before { content: ''; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.hh-order.is-met { border-color: rgba(107, 224, 74, 0.7); }
.hh-order.is-met::before { border: 0; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23123'/%3E%3C/svg%3E") center / 16px no-repeat; }
.hh-call { background: linear-gradient(135deg, rgba(245, 194, 66, 0.95), rgba(255, 233, 168, 0.95)); color: #2A1606; border-color: #FFF2B8; animation: callIn 0.3s ease; overflow: hidden; padding-left: 4px; }
.hh-call[data-tone="bad"] { background: linear-gradient(135deg, rgba(255, 120, 100, 0.96), rgba(255, 200, 170, 0.96)); }
.hh-call[data-tone="good"] { background: linear-gradient(135deg, rgba(140, 230, 110, 0.96), rgba(220, 255, 200, 0.96)); }
.hh-call[data-tone="star"] { background: linear-gradient(135deg, rgba(255, 214, 90, 0.98), rgba(255, 246, 200, 0.98)); }
.hh-call img { flex: none; width: 40px; height: 40px; object-fit: contain; object-position: 50% 20%; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
#hh-call-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes callIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.hh-temper { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; box-sizing: border-box; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); }
.hh-temper__w { font-size: 16px; font-weight: bold; color: var(--muted); }
.hh-temper__face { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; background: rgba(255, 255, 255, 0.12); }
.hh-temper__bar { position: relative; width: 84px; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.55); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.2); }
.hh-temper__bar::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.6); }
.hh-temper__bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width 0.3s ease, background 0.3s ease; }
.hh-temper[data-level="amber"] .hh-temper__bar i { background: var(--amber); }
.hh-temper[data-level="red"] .hh-temper__bar i { background: var(--red); }
.hh-temper[data-level="red"] { border-color: var(--red); animation: temperGlow 0.8s ease-in-out infinite alternate; }
@keyframes temperGlow { to { box-shadow: 0 0 14px rgba(255, 90, 78, 0.8); } }
.hh-hud__btns { flex: none; display: flex; gap: 6px; }
.hh-works.is-tea .hh-room__stage::before { filter: saturate(0.85) sepia(0.25); }

/* ONE ROOM ON THE SCREEN, the bar laid out on a grid so every phone gets the same bar (2026-10-21: a wrapping row put the
   order in a sliver beside the buttons on an Android 412 wide): upright, the clock, Renown and the buttons on top and the
   order (or the call, or the reveal) beside the Temper under them; sideways on a short screen, all of it on one row */
@media (max-width: 899px) {
  .hh-hud { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "clock renown btns" "order order temper"; gap: 6px; }
  .hh-clock { grid-area: clock; }
  .hh-renown { grid-area: renown; max-width: none; min-width: 0; }
  .hh-order, .hh-call, .hh-reveal { grid-area: order; }
  .hh-temper { grid-area: temper; }
  .hh-hud__btns { grid-area: btns; gap: 4px; justify-content: flex-end; }
  .hh-temper { justify-self: end; }
  .hh-hud.is-reveal .hh-reveal { grid-column: 1 / -1; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 559px) {
  .hh-hud { display: grid; grid-template-columns: auto minmax(96px, 1fr) minmax(120px, 2fr) auto auto; grid-template-areas: "clock renown order temper btns"; gap: 6px; }
  .hh-clock { grid-area: clock; padding-right: 10px; }
  .hh-clock__dial { display: none; }
  .hh-renown { grid-area: renown; max-width: none; min-width: 0; }
  .hh-order, .hh-call, .hh-reveal { grid-area: order; }
  .hh-temper { grid-area: temper; }
  .hh-temper__bar { width: 56px; }
  .hh-hud__btns { grid-area: btns; gap: 4px; }
  .hh-hud.is-reveal .hh-reveal { grid-column: 3 / 5; }
}
@media (max-width: 480px) {
  .hh-clock { padding-right: 10px; }
  .hh-clock__dial { display: none; }
  .hh-temper__bar { width: 56px; }
  .hh-renown__t { font-size: 16px; }
}
/* a phone, and a short screen sideways under 700 wide: Dunna's face says "Temper" (its name stays for a reader); on the
   narrowest, Sound waits in the pause (Back) so Renown and the order keep their room */
@media (max-width: 480px), (min-aspect-ratio: 5/4) and (max-height: 559px) {
  .hh-temper__w { display: none; }
  .hh-temper { padding: 0 10px 0 4px; }
}
@media (max-width: 359px), (min-aspect-ratio: 5/4) and (max-height: 559px) and (max-width: 699px) { #hh-sound { display: none; } }
@media (max-width: 359px) { .hh-clock { padding: 0 8px; } #hh-clock-t { min-width: 0; } }
/* Renown's words by the room the bar gives it: the star and the word go first */
.hh-renown { container: renown / inline-size; }
@container renown (max-width: 199px) { .hh-renown__t::after { content: none; } }
@container renown (max-width: 129px) { .hh-renown__t::before { content: none; } }

/* ---- the board ---------------------------------------------------------------------------------------------------------- */
.hh-board { position: absolute; z-index: 5; top: calc(var(--safe-t) + 6px + var(--hud-h) + 8px); left: calc(8px + var(--edge-l)); right: calc(8px + var(--edge-r));
  bottom: calc(8px + var(--safe-b)); display: grid; gap: 8px; }
html[data-layout="board"] .hh-board { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
html[data-layout="room"] .hh-board { grid-template-columns: 1fr; grid-template-rows: 1fr; bottom: calc(8px + var(--safe-b) + 64px); }
html[data-layout="room"] .hh-room { display: none; }
html[data-layout="room"] .hh-board[data-view="mix"] .hh-room--mix, html[data-layout="room"] .hh-board[data-view="works"] .hh-room--works,
html[data-layout="room"] .hh-board[data-view="shop"] .hh-room--shop, html[data-layout="room"] .hh-board[data-view="bay"] .hh-room--bay { display: grid; }
.hh-board.is-shake { animation: shake 0.4s ease; }
@keyframes shake { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(3px, 0); } }

/* ---- a room ------------------------------------------------------------------------------------------------------------- */
.hh-room { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden;
  border-radius: 16px; border: 3px solid rgba(0, 0, 0, 0.55); background: #120A04; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); --lamp: var(--green); }
.hh-room[data-lamp="amber"] { --lamp: var(--amber); }
.hh-room[data-lamp="red"] { --lamp: var(--red); }
.hh-room[data-lamp="off"] { --lamp: #6E6458; }
html[data-layout="board"] .hh-room.is-here { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5); }
html[data-layout="board"] .hh-room[data-lamp="red"]:not(.is-here) { animation: roomRed 0.7s ease-in-out infinite alternate; }
@keyframes roomRed { from { border-color: rgba(0, 0, 0, 0.55); } to { border-color: var(--red); } }
.hh-room__stage::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: var(--art) 50% 70% / cover no-repeat; }
.hh-room--works .hh-room__stage::before { background-position: 40% 70%; }
.hh-room--bay .hh-room__stage::before { background-position: 60% 70%; }
.hh-room__stage { grid-area: 1 / 1; position: relative; min-height: 0; container-type: size; }
/* the room's sign: a brass plate with its lamp; a button that walks there on the board, a sign in one-room view */
.hh-plate { position: absolute; z-index: 6; top: 8px; left: 8px; margin: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: calc(100% - 80px);
  padding: 4px 12px 4px 8px; box-sizing: border-box; border-radius: 12px; border: 2px solid #6B4A1C;
  background: linear-gradient(180deg, #F4D58A, #C9973E 55%, #9C6E26); color: #2A1606; font: bold 16px/1.15 var(--title-font); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
html[data-side="horde"] .hh-plate { background: linear-gradient(180deg, #8F79C9, #5B4596 55%, #3A2A6A); color: #F2EAFF; border-color: #2A1D4D; }
.hh-plate__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-plate--btn { appearance: none; cursor: pointer; min-height: 44px; }
.hh-plate--btn:hover { filter: brightness(1.12); }
.hh-plate__key { flex: none; min-width: 22px; height: 22px; border-radius: 6px; background: rgba(42, 22, 6, 0.85); color: #FFE9A8; font: bold 16px/22px var(--font); text-align: center; }
html[data-layout="board"] .hh-plate--sign { display: none; }
html[data-layout="room"] .hh-plate--btn { display: none; }
.hh-lamp { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 10px var(--green); }
.hh-lamp[data-lamp="amber"] { background: var(--amber); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 12px var(--amber); }
.hh-lamp[data-lamp="red"] { background: var(--red); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 14px var(--red); animation: lampBlink 0.5s steps(2) infinite; }
.hh-lamp[data-lamp="off"] { background: #5A5048; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45); }
@keyframes lampBlink { 50% { opacity: 0.35; } }
.hh-plate::after { content: ''; width: 20px; height: 20px; flex: none; background: currentColor; opacity: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm-3 7h6l1 7h-2l-.5 6h-3L10 16H8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm-3 7h6l1 7h-2l-.5 6h-3L10 16H8z'/%3E%3C/svg%3E") center / contain no-repeat; }
/* the foreman's mark on the room he is in; the sign always keeps its room, so it is one width (hustle-main.js roomGeo).
   In one-room view the room shown is always his, so the sign has no mark, and on a phone it wears the room's short name */
.hh-room.is-here .hh-plate::after { opacity: 1; }
html[data-layout="room"] .hh-plate::after { display: none; }
.hh-plate__name--short { display: none; }
@media (max-width: 480px), (max-height: 400px) {
  html[data-layout="room"] .hh-plate--sign .hh-plate__name { display: none; }
  html[data-layout="room"] .hh-plate--sign .hh-plate__name--short { display: inline; }
}
/* Hurry (from chapter 4): top right of the room */
.hh-pace { position: absolute; z-index: 6; top: 8px; right: 8px; appearance: none; width: 48px; height: 48px; border-radius: 50%; padding: 0; cursor: pointer; display: grid; place-items: center;
  border: 2px solid rgba(255, 211, 78, 0.7); background: radial-gradient(circle at 40% 35%, #6A4426, #2A180B 75%); color: #FFD34E; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
.hh-pace[aria-pressed="true"] { background: linear-gradient(135deg, #FF8FC7, var(--gold)); color: #2A1606; border-color: #FFF2B8; animation: rushGlow 1.2s ease-in-out infinite; }
@keyframes rushGlow { 50% { box-shadow: 0 0 16px rgba(255, 211, 78, 0.9); } }
/* a room not open yet */
.hh-room__shut { display: none; }
/* the room dims and its sign says when it opens, in the middle of its floor: a card that crosses no button (UI-1) */
.hh-room.is-shut .hh-room__stage { filter: grayscale(0.7) brightness(0.5); }
.hh-room.is-shut .hh-room__shut { grid-area: 1 / 1; align-self: center; justify-self: center; z-index: 8; max-width: 80%; margin: 0; padding: 10px 18px; border-radius: 14px; text-align: center;
  display: block; background: rgba(10, 6, 2, 0.85); border: 1px solid var(--line); font: bold 20px/1.3 var(--title-font); color: var(--muted); }
.hh-room.is-shut .hh-room__foot > :not(.round--back) { visibility: hidden; }

/* ---- the people on the stage: sized by the stage's height, so a short room has smaller people, and never taller than
   the floor under the trouble's strip (--floor, hustle-main.js roomGeo), so no head reaches a ring or the sign ------- */
.hh-foreman { position: absolute; z-index: 2; bottom: 2%; width: var(--slot, 20%); width: min(var(--slot, 20%), 64cqh, calc(var(--floor, 100cqh) * 1.08)); height: auto; aspect-ratio: 1.08;
  transform: translateX(-50%); object-fit: contain; object-position: 50% 100%; pointer-events: none; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.5)); }
.hh-foreman.is-in { animation: walkIn 0.45s ease-out; }
@keyframes walkIn { from { opacity: 0; translate: -30px 0; } to { opacity: 1; translate: 0 0; } }
.hh-crew { position: absolute; z-index: 3; bottom: 2%; width: min(var(--slot, 18%), 22%); width: min(calc(var(--slot, 18%) - 8px), 22%, 48cqh, calc(var(--floor, 100cqh) / 1.06)); aspect-ratio: 1; transform: translateX(-50%);
  appearance: none; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; min-width: 44px; transition: left 0.35s ease, opacity 0.3s; }
html[data-layout="room"] .hh-crew { width: min(calc(var(--slot, 18%) - 8px), 34%, 42cqh, calc(var(--floor, 100cqh) / 1.06)); }
.hh-crew__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.5)); pointer-events: none; }
.hh-crew__tag { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); max-width: 110%; padding: 0 6px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(20, 12, 6, 0.78); color: #FFF2DA; font: bold 16px/20px var(--font); pointer-events: none; }
.hh-crew.is-tight .hh-crew__tag { display: none; }
.hh-crew__star { display: none; }
.hh-crew.is-caper .hh-crew__img { animation: wiggle 0.3s ease-in-out infinite alternate; }
.hh-crew.is-caper .hh-crew__star { display: block; position: absolute; left: 50%; top: -6%; width: 34%; aspect-ratio: 1; transform: translateX(-50%); pointer-events: none;
  background: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 220, 90, 0.95));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.5 7L12 17.6 5.7 21l1.5-7L2 9.3l7-.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.5 7 .8-5.2 4.8 1.5 7L12 17.6 5.7 21l1.5-7L2 9.3l7-.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: starPulse 0.6s ease-in-out infinite alternate; }
@keyframes wiggle { from { rotate: -4deg; } to { rotate: 4deg; } }
@keyframes starPulse { to { transform: translateX(-50%) scale(1.2); } }
/* more Hushlings in the room than its floor shows side by side: the last one shown carries the count of the rest */
.hh-crew[data-more]::after { content: attr(data-more); position: absolute; left: 0; top: 0; min-width: 30px; height: 26px; padding: 0 6px; box-sizing: border-box; border-radius: 13px;
  background: var(--glass-2); border: 2px solid var(--line); color: #FFF2DA; font: bold 16px/22px var(--font); text-align: center; pointer-events: none; }
.hh-crew.is-coming { opacity: 0.6; }
.hh-crew.is-picked .hh-crew__img { filter: drop-shadow(0 0 4px var(--gold)) drop-shadow(0 0 10px var(--gold)); }
/* the trouble: the culprit up at the machine, in an amber or red ring, in the strip along the top of the stage (its
   top and its size from hustle-main.js roomGeo, --ftop and --ringw); press and hold to fix it. The red one's culprit
   shakes, never the ring: a turned button's box is wider than the button */
.hh-fault { position: absolute; z-index: 4; top: var(--ftop, 8px); width: var(--ringw, 64px); aspect-ratio: 1; min-width: 48px; transform: translateX(-50%);
  appearance: none; border: 0; padding: 0; margin: 0; background: none; cursor: pointer; touch-action: none; --ring: var(--amber); }
.hh-fault[data-phase="red"] { --ring: var(--red); }
.hh-fault[data-phase="red"] .hh-fault__img { animation: faultShake 0.25s ease-in-out infinite alternate; }
.hh-fault[data-phase="fired"] { --ring: #FF2E6A; }
.hh-fault__ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(#8EF07A calc(var(--k, 0) * 360deg), rgba(0, 0, 0, 0.55) 0); box-shadow: 0 0 0 4px var(--ring), 0 0 18px var(--ring);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); }
.hh-fault::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 240, 210, 0.5), rgba(40, 20, 8, 0.65) 70%); pointer-events: none; }
.hh-fault__img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)); }
.hh-fault__name { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; padding: 1px 8px; border-radius: 8px;
  width: max-content; max-width: var(--slotw, 160px); box-sizing: border-box; text-align: center; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  background: var(--ring); color: #2A0A06; font: bold 16px/20px var(--font); pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.hh-fault.is-held { animation: none; }
.hh-fault.is-held .hh-fault__img { transform: scale(0.92); }
@keyframes faultShake { from { rotate: -3deg; } to { rotate: 3deg; } }
.is-nonames .hh-fault__name { display: none; }
@container (max-height: 150px) { .hh-crew__tag { display: none; } }
/* the shop's customers: the front of the queue at the counter, their patience under them, a wish over their head */
.hh-folk { position: absolute; z-index: 2; bottom: 2%; width: min(var(--slot, 14%), 26%); width: min(var(--slot, 14%), 26%, 44cqh, calc(var(--floor, 100cqh) / 1.06)); aspect-ratio: 1; transform: translateX(-50%); pointer-events: none;
  transition: left 0.5s ease, opacity 0.4s ease; animation: folkIn 0.4s ease-out; }
@keyframes folkIn { from { opacity: 0; translate: -20px 0; } }
.hh-folk__img { position: absolute; inset: 0 0 8% 0; width: 100%; height: 92%; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, 0.5)); }
.hh-folk__wait { position: absolute; left: 15%; bottom: 0; height: 6%; min-height: 5px; max-width: 70%; border-radius: 4px; background: var(--green); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.hh-folk.is-cross .hh-folk__wait { background: var(--red); }
.hh-folk.is-cross .hh-folk__img { filter: drop-shadow(0 0 6px rgba(255, 90, 78, 0.8)); }
.hh-folk__wish { position: absolute; right: -8%; top: -6%; width: 42%; aspect-ratio: 1; box-sizing: border-box; padding: 4%; border-radius: 50%; object-fit: contain;
  background: rgba(255, 255, 255, 0.92); border: 2px solid var(--gold); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45); }
.hh-folk.is-gone { opacity: 0; }
.hh-folk[data-more]::after { content: attr(data-more); position: absolute; left: -10%; top: 0; min-width: 30px; height: 26px; padding: 0 6px; box-sizing: border-box; border-radius: 13px;
  background: var(--glass-2); border: 2px solid var(--line); color: #FFF2DA; font: bold 16px/22px var(--font); text-align: center; }
/* the Truck Bay: the stack of crates, and the truck (the Horde's cart) at the dock */
.hh-stack { position: absolute; z-index: 1; left: 2%; bottom: 3%; width: var(--slot, 19%); width: min(var(--slot, 19%), 26cqh); height: min(74%, var(--floor, 74cqh)); display: flex; flex-direction: column-reverse; gap: 2px; pointer-events: none;
  transform-origin: 50% 100%; transition: rotate 0.4s ease; }
.hh-stack.is-leaning { rotate: 5deg; animation: lean 1.4s ease-in-out infinite alternate; }
.hh-stack.is-down { rotate: 82deg; animation: none; }
@keyframes lean { to { rotate: 8deg; } }
.hh-crate { flex: none; height: min(9cqh, calc(var(--floor, 100cqh) / 7)); min-height: 8px; border-radius: 3px; background: linear-gradient(180deg, #C9924E, #8A5A28); box-shadow: inset 0 0 0 2px #5A3612, 0 2px 3px rgba(0, 0, 0, 0.5); position: relative; }
.hh-crate::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14%; aspect-ratio: 1; min-width: 6px; transform: translate(-50%, -50%) rotate(45deg); background: var(--t, var(--t-plain)); }
.hh-crate--common { --t: var(--t-common); } .hh-crate--uncommon { --t: var(--t-uncommon); } .hh-crate--rare { --t: var(--t-rare); } .hh-crate--epic { --t: var(--t-epic); }
/* the truck and its tag over it (about 36 px) stand on the floor: --ar is its picture's width over its height */
.hh-truck { position: absolute; z-index: 1; right: 0; bottom: 2%; width: var(--slot, 42%); width: min(var(--slot, 42%), 110cqh, calc((var(--floor, 100cqh) - 36px) * var(--ar, 1.55)));
  pointer-events: none; animation: truckIn 0.9s ease-out; }
html[data-side="horde"] .hh-truck { --ar: 2.08; }
@keyframes truckIn { from { translate: 60% 0; opacity: 0; } }
.hh-truck__art { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.5)); }
/* the tag over the truck, right-aligned to it so it never runs past the room's edge; a truck drawn narrower than its
   words keeps the count only */
.hh-truck { container: truck / inline-size; }
.hh-truck__tag { position: absolute; right: 0; top: -4px; transform: translateY(-100%); margin: 0; padding: 2px 10px 6px; border-radius: 10px; white-space: nowrap; max-width: 100%; box-sizing: border-box;
  background: var(--glass-2); border: 2px solid var(--gold); font: bold 16px/1.2 var(--font); color: #FFE9A8; overflow: hidden; }
@container truck (max-width: 139px) { .hh-truck__want { display: none; } }
.hh-truck__tag::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--k, 1) * 100%); background: var(--gold); }
.hh-truck.is-late .hh-truck__tag { border-color: var(--red); animation: lampBlink 0.6s steps(2) infinite; }
.hh-truck.is-late .hh-truck__tag::after { background: var(--red); }
.hh-goo { position: absolute; z-index: 1; left: 50%; bottom: 0; width: min(46cqw, 80cqh); transform: translateX(-50%); pointer-events: none; animation: gooIn 0.6s ease-out; }
@keyframes gooIn { from { transform: translateX(-50%) scaleY(0.2); transform-origin: 50% 100%; } }
.hh-float { position: absolute; z-index: 7; top: 30%; transform: translateX(-50%); font: bold 26px/1 var(--title-font); color: #FFFFFF; pointer-events: none;
  text-shadow: 0 2px 0 #2A1606, 0 0 10px rgba(0, 0, 0, 0.7); animation: floatUp 1.25s ease-out forwards; }
.hh-float--gold { color: var(--gold); font-size: 30px; }
@keyframes floatUp { to { translate: 0 -60px; opacity: 0; } }

/* ---- the glass at a room's foot: the machine, then the four switches ------------------------------------------------------------ */
.hh-room__foot { grid-row: 2; z-index: 5; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 8px; box-sizing: border-box; min-width: 0;
  background: linear-gradient(180deg, rgba(40, 24, 12, 0.94), rgba(20, 12, 6, 0.97)); border-top: 2px solid rgba(217, 163, 62, 0.65); }
html[data-side="horde"] .hh-room__foot { background: linear-gradient(180deg, rgba(30, 20, 52, 0.95), rgba(14, 9, 26, 0.98)); border-top-color: rgba(167, 139, 250, 0.6); }
.hh-mach { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.hh-mach__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hh-mach__row { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.hh-mach__state { margin: 0; font-size: 16px; font-weight: bold; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #FFF2DA; }
.hh-mach__state[data-state="empty"], .hh-mach__state[data-state="dirty"] { color: var(--amber); }
.hh-mach__state[data-state="bad"] { color: #FF8F84; }
.hh-mach__state[data-state="run"] { color: #B8F5A0; }
/* the Works' word and its readouts: a line of their own across the glass; the readouts go under the word when the line is
   short */
.hh-reads { width: 100%; flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.hh-reads .hh-mach__state { flex: 1 1 150px; }
.hh-reads .hh-mach__row { flex: 0 1 auto; gap: 4px; }
.hh-mach--works .hh-mach__info { justify-content: center; }
.hh-mach__sub { margin: 0; font-size: 16px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-read { margin: 0; display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px 0 4px; box-sizing: border-box; border-radius: 15px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); color: var(--brass); white-space: nowrap; }
.hh-read .hh-ic { width: 20px; height: 20px; }
.hh-read__v { font-size: 16px; font-weight: bold; color: #FFF2DA; }
.hh-read.is-on { border-color: var(--gold); box-shadow: 0 0 10px rgba(245, 194, 66, 0.6); color: var(--gold); }
.hh-bar { height: 10px; border-radius: 5px; background: rgba(0, 0, 0, 0.55); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); }
.hh-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--gold)); transition: width 0.25s linear; }
.hh-bar--crate i { background: linear-gradient(90deg, #C9924E, var(--gold)); }
/* the Mixing Room: the Recipe dial (light, balanced, rich, too sweet), where it aims, and what is in the vat */
.hh-dial { position: relative; display: flex; height: 14px; border-radius: 7px; overflow: visible; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.hh-dial__band { height: 100%; }
.hh-dial__band--light { background: #8FD3FF; border-radius: 7px 0 0 7px; }
.hh-dial__band--balanced { background: #8EF07A; }
.hh-dial__band--rich { background: #FFC56B; }
.hh-dial__band--off { background: #FF6A5A; border-radius: 0 7px 7px 0; }
.hh-dial__aim { position: absolute; top: -9px; width: 0; height: 0; margin-left: -6px; border: 6px solid transparent; border-top: 8px solid #FFFFFF; filter: drop-shadow(0 1px 1px #000); }
.hh-dial__needle { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: #FFFFFF; box-shadow: 0 0 0 1px #2A1606, 0 0 6px #FFF; transition: left 0.2s linear; }
.hh-dial.is-off .hh-dial__needle { background: #FF6A5A; animation: lampBlink 0.4s steps(2) infinite; }
.hh-vat__in { display: flex; gap: 2px; }
.hh-vat__in img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
/* the Works: the kettle's gauge, the belt with the sweets riding it */
.hh-gauge { position: relative; flex: none; width: 76px; height: 46px; }
.hh-gauge svg { display: block; width: 100%; height: 100%; }
.hh-gauge__needle { position: absolute; left: 50%; bottom: 4px; width: 4px; height: 34px; margin-left: -2px; border-radius: 2px; background: #FFF2DA; transform-origin: 50% 100%;
  box-shadow: 0 0 0 1px #2A1606; transition: transform 0.2s linear; }
.hh-gauge::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 2px #2A1606; }
.hh-gauge.is-hot .hh-gauge__needle { background: var(--red); }
.hh-gauge.is-hot { animation: faultShake 0.12s ease-in-out infinite alternate; }
.hh-belt { position: relative; height: 26px; border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #3A2A1C 0 14px, #2A1E14 14px 28px); box-shadow: inset 0 0 0 2px #1A120A; }
.hh-belt.is-running { animation: belt 0.6s linear infinite; }
@keyframes belt { to { background-position: 28px 0; } }
.hh-belt__sweet { position: absolute; top: 1px; left: -26px; width: 24px; height: 24px; object-fit: contain; animation: ride 2.1s linear forwards; }
@keyframes ride { to { left: 100%; } }
.hh-belt__sweet--bay { filter: drop-shadow(0 0 3px #C9924E); }
/* the Front Shop: the shelves' newest sweets */
.hh-shelf { display: flex; gap: 2px; min-width: 0; overflow: hidden; }
.hh-shelf img { width: 30px; height: 30px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
/* the presses: big round brass buttons */
.hh-acts { flex: none; display: flex; gap: 6px; align-items: center; }
.hh-act { appearance: none; position: relative; width: 52px; height: 52px; border-radius: 50%; padding: 0; cursor: pointer; display: grid; place-items: center; box-sizing: border-box;
  border: 2px solid #FFE9A8; background: radial-gradient(circle at 40% 35%, #FFE7A0, #D9A33E 55%, #8A5E14); color: #2A1606; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
html[data-side="horde"] .hh-act { border-color: #D9FFB0; background: radial-gradient(circle at 40% 35%, #D9FFB0, #7FCF4A 55%, #3A7A1A); color: #102006; }
.hh-act .hh-ic { width: 28px; height: 28px; }
.hh-act:not(:disabled):hover { filter: brightness(1.1); }
.hh-act:not(:disabled):active { transform: scale(0.94); }
.hh-act:disabled { filter: grayscale(0.85) brightness(0.55); cursor: default; }
.hh-act.is-ready::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--gold); animation: halo 1.4s ease-in-out infinite; pointer-events: none; }
.hh-act.is-bay { background: radial-gradient(circle at 40% 35%, #F2D3A8, #C9924E 55%, #6A4012); }
/* the four switches: a gnome's number and a dwarf's rune on a brass plate, the handle, and its job's picture once known */
.hh-levers { flex: none; display: grid; grid-template-columns: repeat(4, 54px); gap: 6px; }
.hh-lever { appearance: none; position: relative; width: 54px; min-height: 84px; padding: 4px 2px; box-sizing: border-box; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2px;
  border: 2px solid #6B4A1C; background: linear-gradient(180deg, #E7C277, #B3843A 60%, #8A6224); color: #3A2208; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5); }
html[data-side="horde"] .hh-lever { border-color: #2A1D4D; background: linear-gradient(180deg, #8F79C9, #5B4596 60%, #3A2A6A); color: #E8DEFF; }
.hh-lever:hover { filter: brightness(1.1); }
.hh-lever__plates { display: flex; gap: 2px; }
.hh-lever__plates svg { width: 20px; height: 20px; }
.hh-lever__slot { position: relative; width: 10px; height: 26px; border-radius: 5px; background: #1A0F06; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.8); }
.hh-lever__handle { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 22px; margin-left: -2px; background: linear-gradient(90deg, #888, #DDD, #777);
  transform-origin: 50% 100%; transform: rotate(-28deg); transition: transform 0.15s ease; }
.hh-lever__handle::before { content: ''; position: absolute; left: 50%; top: -7px; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FF9A8A, #C0281E 60%, #6A0E08); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hh-lever.is-pulled .hh-lever__handle { transform: rotate(28deg); }
.hh-lever__tag { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(42, 22, 6, 0.75); color: #CBB89A; }
.hh-lever__tag .hh-ic { width: 18px; height: 18px; }
.hh-lever__tag.is-known { background: #FFF6DE; color: #2A1606; box-shadow: 0 0 0 2px var(--gold); }
.hh-lever__key { position: absolute; right: 3px; bottom: 5px; font: bold 16px/1 var(--font); color: rgba(42, 22, 6, 0.85); }
html[data-side="horde"] .hh-lever__key { color: rgba(240, 232, 255, 0.85); }
@media (hover: none) { .hh-lever__key, .hh-plate__key { display: none; } }
/* the Truck Bay's glass, on the board, steps in for Back in the bottom right corner (UI-3) */
html[data-layout="board"] .hh-room--bay .hh-room__foot { padding-right: 76px; }

/* ---- one room at a time ---------------------------------------------------------------------------------------------------- */
/* held upright: the machine over the switches, the switches wide */
html[data-layout="room"] .hh-room__foot { flex-direction: column; flex-wrap: nowrap; gap: 8px; padding: 10px; }
html[data-layout="room"] .hh-levers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html[data-layout="room"] .hh-lever { width: auto; min-height: 92px; }
html[data-layout="room"] .hh-lever__plates svg { width: 24px; height: 24px; }
html[data-layout="room"] .hh-act { width: 56px; height: 56px; }
html[data-layout="room"] .hh-room { border-radius: 14px; }
/* the rooms' buttons along the foot, each with its lamp; Back in the corner */
.hh-nav { display: none; }
html[data-layout="room"] .hh-nav { position: absolute; z-index: 20; display: flex; gap: 8px; left: calc(8px + var(--edge-l)); right: calc(80px + var(--edge-r)); bottom: calc(8px + var(--safe-b));
  justify-content: center; }
.hh-go { appearance: none; position: relative; flex: 0 1 64px; min-width: 52px; height: 56px; border-radius: 16px; padding: 0; cursor: pointer; display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--glass-2); color: #FFE9A8; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45); }
.hh-go.is-here { border-color: var(--gold); background: linear-gradient(180deg, #6A4426, #3A220E); }
html[data-side="horde"] .hh-go.is-here { background: linear-gradient(180deg, #4A3170, #241640); }
.hh-go:disabled { filter: grayscale(0.8) brightness(0.55); cursor: default; }
.hh-go .ico { width: 28px; height: 28px; }
.hh-go__lamp { position: absolute; right: 5px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 8px var(--green); }
.hh-go[data-lamp="amber"] .hh-go__lamp { background: var(--amber); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 10px var(--amber); }
.hh-go[data-lamp="red"] .hh-go__lamp { background: var(--red); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 12px var(--red); animation: lampBlink 0.5s steps(2) infinite; }
.hh-go[data-lamp="red"]:not(.is-here) { border-color: var(--red); }
.hh-go[data-lamp="off"] .hh-go__lamp { background: #5A5048; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5); }
/* a phone held sideways: the rooms' buttons up the left edge, the glass beside the painting */
@media (min-aspect-ratio: 5/4) {
  html[data-layout="room"] .hh-board { left: calc(8px + var(--edge-l) + 60px); bottom: calc(8px + var(--safe-b)); }
  html[data-layout="room"] .hh-nav { flex-direction: column; right: auto; left: calc(6px + var(--edge-l)); top: calc(var(--safe-t) + 6px + var(--hud-h) + 8px); bottom: auto; }
  html[data-layout="room"] .hh-go { flex: none; width: 52px; height: 52px; }
  /* the glass is the right column; Back has the corner under it to itself (UI-3), the glass notched for it, never
     under it (UI-1), and the painting runs down the left */
  html[data-layout="room"] .hh-room { grid-template-rows: minmax(0, 1fr) 60px; grid-template-columns: minmax(0, 1fr) minmax(250px, 34%); }
  html[data-layout="room"] .hh-room__stage, html[data-layout="room"] .hh-room.is-shut .hh-room__shut { grid-area: 1 / 1 / 3 / 2; }
  html[data-layout="room"] .hh-room::after { content: ''; grid-area: 2 / 2; border-left: 2px solid rgba(217, 163, 62, 0.65); background: #140C06; }
  html[data-layout="room"][data-side="horde"] .hh-room::after { border-left-color: rgba(167, 139, 250, 0.6); background: #0E091A; }
  html[data-layout="room"] .hh-room__foot { grid-row: 1; grid-column: 2; border-top: 0; border-left: 2px solid rgba(217, 163, 62, 0.65); justify-content: flex-start; padding: 8px; overflow-y: auto; }
  html[data-layout="room"][data-side="horde"] .hh-room__foot { border-left-color: rgba(167, 139, 250, 0.6); }
  html[data-layout="room"] .hh-mach { flex: none; flex-wrap: wrap; }
  html[data-layout="room"] .hh-lever { min-height: 80px; }
  html[data-layout="room"] .hh-lever__plates svg { width: 20px; height: 20px; }
  html[data-layout="room"] .hh-act { width: 52px; height: 52px; }
}
/* a short phone held sideways: the presses beside the readings, a little smaller, so the switches show without a scroll;
   the readings' words wrap to a second line rather than lose their end */
@media (min-aspect-ratio: 5/4) and (max-height: 400px) {
  html[data-layout="room"] .hh-mach { flex-wrap: nowrap; }
  html[data-layout="room"] .hh-mach__info .hh-mach__state, html[data-layout="room"] .hh-mach__sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  html[data-layout="room"] .hh-act { width: 48px; height: 48px; }
  html[data-layout="room"] .hh-act .hh-ic { width: 26px; height: 26px; }
  html[data-layout="room"] .hh-gauge { width: 60px; height: 38px; }
  html[data-layout="room"] .hh-gauge__needle { height: 28px; }
  html[data-layout="room"] .hh-room__foot { gap: 6px; }
}

/* ---- THE POUR: the drawer at the vat ------------------------------------------------------------------------------------------ */
.hh-pour { position: absolute; z-index: 22; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 18px; overflow: hidden;
  top: calc(var(--safe-t) + 6px + var(--hud-h) + 8px); bottom: calc(8px + var(--safe-b) + 64px); left: calc(8px + var(--edge-l)); right: calc(8px + var(--edge-r));
  background: var(--panel); border: 2px solid rgba(245, 194, 66, 0.6); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); animation: pourIn 0.25s ease-out; }
/* on the board the drawer is the left column's width at most, over the Mixing Room and the Front Shop only */
html[data-layout="board"] .hh-pour { right: auto; width: min(620px, calc((100vw - 24px - var(--edge-l) - var(--edge-r)) / 2)); bottom: calc(8px + var(--safe-b)); }
@media (min-aspect-ratio: 5/4) { html[data-layout="room"] .hh-pour { bottom: calc(8px + var(--safe-b)); left: calc(8px + var(--edge-l) + 60px); right: calc(80px + var(--edge-r)); } }
@keyframes pourIn { from { transform: translateY(16px); opacity: 0; } }
.hh-pour__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.hh-pour__title { margin: 0; font: bold 22px/1.2 var(--title-font); color: var(--gold); }
.hh-pour__close .hh-ic { width: 22px; height: 22px; }
.hh-pour__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 14px 12px; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.hh-pour__sec { margin: 0 0 10px; }
.hh-pour__h { margin: 6px 0 6px; font: bold 18px/1.2 var(--title-font); color: var(--b); }
.hh-pour__row, .hh-pour__book { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-pour__note { margin: 6px 0 0; font-size: 16px; line-height: 1.35; color: var(--muted); }
.hh-tile { appearance: none; position: relative; width: 108px; min-height: 96px; padding: 6px 4px; box-sizing: border-box; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); }
.hh-tile:hover { background: rgba(255, 255, 255, 0.12); }
.hh-tile.is-on { border-color: var(--gold); background: rgba(245, 194, 66, 0.2); box-shadow: 0 0 0 2px rgba(245, 194, 66, 0.35); }
.hh-tile__img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)); }
.hh-tile__ic { width: 40px; height: 40px; margin: 6px; color: var(--brass); }
.hh-tile__w { font-size: 16px; font-weight: bold; line-height: 1.15; text-align: center; overflow-wrap: break-word; hyphens: auto; }
.hh-tile__w small { display: block; font-size: 16px; font-weight: normal; color: var(--muted); }
.hh-pour__book .hh-tile { width: 124px; }
.hh-tile--common { border-color: var(--t-common); }
.hh-tile--uncommon { border-color: var(--t-uncommon); }
.hh-tile--rare { border-color: var(--t-rare); }
.hh-tile--epic { border-color: var(--t-epic); box-shadow: 0 0 10px rgba(199, 123, 255, 0.5); }
.hh-pour__foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.hh-pour__need { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; line-height: 1.3; color: var(--muted); }
.hh-pour__go { flex: none; min-width: 140px; font-size: 20px; }
@media (max-width: 480px) { .hh-tile { width: calc((100% - 16px) / 3); } .hh-pour__book .hh-tile { width: calc((100% - 8px) / 2); } .hh-pour__foot { flex-wrap: wrap; } .hh-pour__go { flex: 1 1 100%; } }

/* ---- sending a Hushling: the rooms as round buttons ---------------------------------------------------------------------------- */
.hh-send { position: absolute; z-index: 26; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px);
  box-sizing: border-box; padding: 10px 14px; border-radius: 18px; background: var(--panel); border: 2px solid rgba(245, 194, 66, 0.6); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
html[data-layout="board"] .hh-send { bottom: auto; top: calc(var(--safe-t) + 6px + var(--hud-h) + 12px); }
.hh-send__t { margin: 0 0 8px; max-width: 420px; font-size: 16px; font-weight: bold; line-height: 1.3; }
.hh-send__row { display: flex; gap: 8px; justify-content: center; }
.hh-send__x { border-color: rgba(255, 255, 255, 0.4); }

/* ---- THE REVEAL: the first sweet off the belt names the batch, in the order's place in the bar for a moment ------------------- */
.hh-reveal { --tc: var(--t-plain); padding: 2px 8px 2px 2px; gap: 6px; overflow: hidden; color: #FFFFFF; border: 2px solid var(--tc);
  background: radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--tc) 35%, transparent), transparent 55%), var(--panel);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 55%, transparent); animation: callIn 0.3s ease; }
.hh-reveal[data-tier="common"] { --tc: var(--t-common); }
.hh-reveal[data-tier="uncommon"] { --tc: var(--t-uncommon); }
.hh-reveal[data-tier="rare"] { --tc: var(--t-rare); }
.hh-reveal[data-tier="epic"] { --tc: var(--t-epic); }
.hh-reveal.is-new { border-color: var(--gold); }
.hh-reveal__art { flex: none; width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.hh-reveal.is-in .hh-reveal__art { animation: spinIn 0.7s ease-out; }
@keyframes spinIn { from { transform: scale(0.3) rotate(-180deg); } }
.hh-reveal__words { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; flex-direction: column; justify-content: center; }
.hh-reveal__kick, .hh-reveal__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-reveal__kick { font: bold 16px/1.15 var(--font); color: var(--tc); }
.hh-reveal.is-new .hh-reveal__kick { color: var(--gold); }
.hh-reveal__name { font: bold 17px/1.15 var(--title-font); }
.hh-reveal__taster { flex: none; width: 40px; height: 40px; object-fit: contain; }
@media (max-width: 479px) { .hh-reveal__taster { display: none; } }
/* one room on the screen: the reveal has the Temper's room in the bar too while it shows */
html[data-layout="room"] .hh-hud.is-reveal .hh-temper { visibility: hidden; }

/* ---- the cast's scenes and tips --------------------------------------------------------------------------------------------------- */
html.is-coach .hh-nav, html.is-coach .round--back { visibility: hidden; }
.coach { position: fixed; z-index: 50; left: calc(10px + var(--edge-l)); right: calc(10px + var(--edge-r)); bottom: calc(8px + var(--safe-b));
  display: flex; align-items: flex-end; gap: 8px; max-width: 900px; margin: 0 auto; pointer-events: auto; }
.coach-face { flex: none; width: clamp(84px, 16vw, 150px); height: clamp(96px, 18vw, 170px); object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.55)); }
.coach-box { flex: 1 1 auto; min-width: 0; box-sizing: border-box; padding: 10px 14px; border-radius: 18px; background: rgba(30, 18, 8, 0.96); border: 2px solid rgba(245, 194, 66, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); }
html[data-side="horde"] .coach-box { background: rgba(22, 13, 38, 0.96); }
.coach-kicker { margin: 0 0 2px; font-size: 16px; font-weight: bold; color: var(--b); }
.coach-who { margin: 0; font: bold 18px/1.2 var(--title-font); color: var(--gold); }
.coach-line { margin: 4px 0 8px; font-size: 18px; line-height: 1.35; }
.coach-row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.coach-skip { min-width: 88px; }
@media (max-height: 520px) {
  .coach-face { width: 78px; height: 92px; }
  .coach-box { padding: 6px 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: end; }
  .coach-line { font-size: 17px; margin: 2px 0 6px; grid-column: 1; }
  .coach-who { grid-column: 1; }
  .coach-row { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
  .coach-row .btn { min-height: 44px; padding: 6px 14px; font-size: 17px; }
}

/* ---- the Notebook, the brief, the Ladder and How to play, inside the room kit's dialogs ---------------------------------------- */
.hh-brief__nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hh-brief__n { margin: 0; font: bold 20px/1.2 var(--title-font); color: var(--rui-gold, #F5C242); text-align: center; flex: 1 1 auto; }
.hh-brief__stars { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.hh-brief__stars li { font-size: 18px; line-height: 1.35; padding: 8px 12px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.hh-brief__stars b { color: var(--rui-gold, #F5C242); }
.hh-brief__h { margin: 12px 0 6px; font: bold 18px/1.2 var(--rui-title-font); color: var(--rui-gold, #F5C242); }
.hh-brief__crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.hh-brief__hand { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.hh-brief__hand img { width: 48px; height: 48px; object-fit: contain; flex: none; }
.hh-brief__hand > span { display: flex; flex-direction: column; font-size: 16px; line-height: 1.25; min-width: 0; }
.hh-brief__hand b { font-size: 17px; }
.hh-brief__go { width: 100%; min-height: 56px; font-size: 20px; }
.hh-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.hh-book__h { margin: 14px 0 6px; font: bold 20px/1.2 var(--rui-title-font); color: var(--rui-gold, #F5C242); }
.hh-book__h--common { color: var(--t-common); } .hh-book__h--uncommon { color: var(--t-uncommon); } .hh-book__h--rare { color: var(--t-rare); } .hh-book__h--epic { color: var(--t-epic); }
.hh-book__score { font-weight: bold; }
.hh-book__list { display: grid; gap: 6px; }
.hh-note { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); }
.hh-note.is-locked { opacity: 0.7; }
.hh-note__plates { flex: none; display: flex; gap: 2px; padding: 4px; border-radius: 8px; background: linear-gradient(180deg, #E7C277, #B3843A); color: #3A2208; }
.hh-note__plates svg { width: 22px; height: 22px; }
.hh-note__ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #FFF6DE; color: #2A1606; }
.hh-note__pic { flex: none; width: 52px; height: 52px; object-fit: contain; }
.hh-note.is-locked .hh-note__pic { filter: brightness(0) opacity(0.5); }
.hh-note__w { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 16px; line-height: 1.3; }
.hh-note__w b { font-size: 17px; }
.hh-book__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.hh-rec { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4));
  border-left: 5px solid var(--tc, var(--t-plain)); }
.hh-rec--common { --tc: var(--t-common); } .hh-rec--uncommon { --tc: var(--t-uncommon); } .hh-rec--rare { --tc: var(--t-rare); } .hh-rec--epic { --tc: var(--t-epic); }
.hh-rec__img { flex: none; width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.5)); }
.hh-rec.is-locked .hh-rec__img { filter: brightness(0) opacity(0.45); }
.hh-rec__w { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 16px; line-height: 1.3; }
.hh-rec__w b { font-size: 17px; }
.hh-rec__rumour { font-style: italic; color: var(--rui-soft, #DED4F2); }
.hh-rec__clue { color: var(--rui-gold, #F5C242); }
.hh-verse { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--rui-panel-2, #251C38); border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4));
  font-size: 17px; line-height: 1.4; }
.hh-verse b { color: var(--rui-gold, #F5C242); font-size: 18px; }
.hh-verse span { font-style: italic; }
.hh-verse.is-locked { opacity: 0.7; }
.hh-ladder { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.hh-ladder li { display: flex; gap: 12px; align-items: baseline; 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: 17px; line-height: 1.35; }
.hh-ladder li b { flex: none; min-width: 64px; color: var(--rui-gold, #F5C242); font-variant-numeric: tabular-nums; }
.hh-ladder li.is-done { border-color: rgba(142, 240, 122, 0.6); }
.hh-ladder li.is-done b::after { content: ' \2713'; color: #8EF07A; }
.hh-how { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 12px; }
.hh-how__pic { flex: none; width: 120px; height: 80px; object-fit: cover; border-radius: 12px; border: 1px solid var(--rui-line, rgba(201, 168, 245, 0.4)); background: var(--rui-panel-2, #251C38); }
img.hh-how__pic[src*="/sweets/"], img.hh-how__pic[src*="/ing/"], img.hh-how__pic[src*="/crew/"], img.hh-how__pic[src*="/cast/"], img.hh-how__pic[src*="/props/"] { object-fit: contain; }
.hh-how__h { margin: 0 0 4px; font: bold 20px/1.2 var(--rui-title-font); color: var(--rui-gold, #F5C242); }
.hh-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; margin: 6px 0 12px; }
.hh-key__row { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.3; }
.hh-key__ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(245, 194, 66, 0.7);
  background: radial-gradient(circle at 40% 35%, #6A4426, #2A180B 75%); color: #FFE9A8; box-sizing: border-box; }
.hh-how__links { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-pause { display: flex; flex-direction: column; gap: 8px; }
.hh-pause .rui-btn { width: 100%; }
@media (max-width: 480px) { .hh-how { flex-direction: column; } .hh-how__pic { width: 100%; height: 120px; } }

/* ---- the toast and the boot error ------------------------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); z-index: 80; width: max-content; max-width: min(640px, calc(100vw - 40px));
  box-sizing: border-box; padding: 12px 18px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line); font-size: 18px; line-height: 1.35; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); pointer-events: none; }
html[data-screen="works"] .toast { bottom: auto; top: calc(var(--safe-t) + var(--hud-h) + 74px); }
.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; }
.boot-error a { color: var(--b); }

@media (prefers-reduced-motion: reduce) {
  .curtain-art, .btn-play::after, .hh-act.is-ready::after, .hh-crew__img, .hh-crew__star, .hh-fault__img, .hh-gauge, .hh-belt, .hh-stack, .hh-lamp, .hh-go__lamp,
  .hh-room, .hh-temper, .hh-pace, .hh-truck__tag, .hh-dial__needle { animation: none !important; }
  .hh-board.is-shake, .hh-reveal, .hh-reveal.is-in .hh-reveal__art, .hh-foreman.is-in, .hh-folk, .hh-truck, .hh-goo, .hh-pour, .hh-call { animation: none !important; }
}
