/* casino/css/hush-hunt.css - THE CHAMPION IS MISSING AS PAGE SCREENS (casino/js/hush-hunt-page.js, HUSH.huntPage).
 *
 * The Hidden Puzzle standard (docs/HIDDEN-PUZZLE-STANDARD.md) on the casino's hidden puzzle. Goliath, 2026-10-18: "I
 * think we are going to need to apply this design principle to the Hidden Treasure puzzle in the Casino web version as
 * well"; 21:00: "Go for it for the Hidden Casino game". The reference build is the Tenderfoot Apple app
 * (apps/tenderfoot/css/folly.css): the same screens, sizes and layout rule, in the house's colours (velvet, gilt, the
 * lamps' amber, the house's Palatino).
 *
 *   THE FLOOR: every press 44 CSS px or more (main presses 48 to 56), every word 16 or more, words to read 18 (UI-5).
 *   THE SIDE TABS: FRIENDS and CHALLENGES on the left edge, INVENTORY on the right (js/friends.js, css/hush.css .hd-tab)
 *     stand over these pages; every page keeps 42 px clear of them on both edges, in from the camera (--hh-pad-l/-r).
 *   THE ROUND BACK: the house's gilt arrow disc, bottom right (SPEC 4.3, UI-3).
 *   THE LAYOUT RULE: a window wider than 1.1 times its height (.hh--wide) puts the words and controls down the left and
 *     the pictures on the right; otherwise the pictures sit on top and the controls below.
 *   THE CURRENCIES BAR steps aside while a hunt page is up (html[data-hush-hunt]); the pages show the Clues.
 */

.hh, .hh-sheet, .hh-bar, .hh-note, .hh-toast, .hh-bubble, .hh-fly {
  --hh-ink: #0B0814; --hh-gold: #F5C242; --hh-gilt: #C9A246; --hh-pink: #FF8FC7; --hh-mint: #7FE0D6; --hh-lav: #C9A8F5;
  --hh-parch: #FBF3E7; --hh-lamp: #FFB060; --hh-velvet: #2A1622; --hh-soft: #E3D3F5;
  --hh-title: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --hh-body: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --hh-edge-l: var(--sotc-edge-l, env(safe-area-inset-left, 0px));
  --hh-edge-r: var(--sotc-edge-r, env(safe-area-inset-right, 0px));
  --hh-pad-l: calc(var(--hh-edge-l) + 50px);
  --hh-pad-r: calc(var(--hh-edge-r) + 50px);
  --hh-back: 56px;
}
@media (pointer: coarse) { .hh, .hh-sheet, .hh-bar { --hh-back: 52px; } }
html[data-hush-hunt] #hush-purse { display: none !important; }
/* TURN IT SIDEWAYS (casino/css/hush.css #rotate-prompt, z 60): a phone or tablet held upright sees the curtain alone */
html[data-rotate="1"] :is(.hh, .hh-sheet, .hh-bar, .hh-note, .hh-toast, .hh-bubble, .hh-fly) { visibility: hidden !important; }

/* ---- THE PAGE ------------------------------------------------------------------------------------------------------ */
.hh { position: fixed; inset: 0; z-index: 31; box-sizing: border-box; overflow: hidden; color: var(--hh-parch); font: 16px/1.4 var(--hh-body); background: var(--hh-ink);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  padding: max(12px, env(safe-area-inset-top)) var(--hh-pad-r) max(12px, env(safe-area-inset-bottom)) var(--hh-pad-l); }
.hh *, .hh *::before, .hh *::after, .hh-sheet *, .hh-bar *, .hh-bar *::before, .hh-note, .hh-note * { box-sizing: border-box; }
.hh [hidden], .hh-sheet [hidden], .hh-bar [hidden] { display: none !important; }
.hh button, .hh-sheet button, .hh-bar button, .hh-note button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
.hh-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hh-paint { position: absolute; inset: -2%; background: center / cover no-repeat; }
.hh-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 8, 20, 0.84) 0%, rgba(11, 8, 20, 0.6) 35%, rgba(11, 8, 20, 0.78) 70%, rgba(11, 8, 20, 0.95) 100%); }

/* the round Back: the house's gilt arrow disc on night-black lacquer */
.hh-back { flex: none; display: grid; place-items: center; width: var(--hh-back); height: var(--hh-back); margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--hh-gold);
  background: radial-gradient(circle at 35% 30%, #4A1E2E, #1A0A12 72%); border: 2px solid var(--hh-gilt);
  box-shadow: 0 0 0 3px rgba(26, 10, 18, 0.9), 0 0 14px rgba(245, 194, 66, 0.3), 0 6px 16px rgba(0, 0, 0, 0.55); }
.hh-back svg { width: 28px; height: 28px; }
.hh-back--corner { position: absolute; z-index: 5; right: var(--hh-pad-r); bottom: max(12px, env(safe-area-inset-bottom)); }

/* a picture button: its picture on the left, its words beside it (UI-8) */
.hh-chip { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin: 0; padding: 6px 14px 6px 8px; border-radius: 999px; cursor: pointer; text-align: left;
  font: 700 16px/1.15 var(--hh-body); color: var(--hh-parch); background: rgba(30, 15, 24, 0.9); border: 1px solid rgba(201, 162, 70, 0.55); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }
.hh-chip img, .hh-chip svg { width: 30px; height: 30px; flex: none; object-fit: contain; }
.hh-chip--gold span { color: var(--hh-gold); }
.hh-chip--mint { border-color: rgba(127, 224, 214, 0.5); color: var(--hh-mint); }
.hh-chip--mint svg { color: var(--hh-mint); }
.hh-back:active, .hh-chip:active, .hh-turn:active, .hh-more:active, .hh-acts button:active, .hh-row:active, .hh-bar button:active, .hh-tile:active, .hh-room:active, .hh-suspect:active, .hh-board button:active { transform: scale(0.96); }
.hh button:focus-visible, .hh a:focus-visible, .hh-bar button:focus-visible, .hh-sheet button:focus-visible { outline: 3px solid var(--hh-mint); outline-offset: 3px; }
.hh-title { width: fit-content; max-width: 100%; margin: 0; font: 700 clamp(32px, 8vw, 50px)/1.05 var(--hh-title); letter-spacing: 0.04em;
  background: linear-gradient(180deg, #FFF6D2 12%, #F5C242 55%, #B7791F 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #1A0A12) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7)); }

/* ---- THE DOOR -------------------------------------------------------------------------------------------------------
   The painting fills the screen; the lockup and the menu run down the left over a scrim (upright: the menu under the
   painting); Molesworth stands in the painting's clear patch and talks; the sound top right; the round Back bottom right. */
.hh-door { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch;
  background: radial-gradient(120% 60% at 50% 100%, #3A1624 0%, #0B0814 70%); }
.hh-door .hh-art { position: absolute; left: 0; right: 0; top: 0; height: min(64vh, 150vw); }
.hh-door .hh-paint { background-position: 50% 50%; transform-origin: 40% 60%; }
.hh-door .hh-shade { background: linear-gradient(180deg, rgba(11, 8, 20, 0.72) 0%, rgba(11, 8, 20, 0.25) 26%, rgba(11, 8, 20, 0) 42%, rgba(11, 8, 20, 0) 58%, rgba(11, 8, 20, 0.7) 82%, #0B0814 100%); }
.hh-motes { position: absolute; inset: 0; }
.hh-motes i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FFE2A0; box-shadow: 0 0 10px 3px rgba(255, 176, 96, 0.6); opacity: 0; animation: hh-mote 10s linear infinite; }
.hh-motes i:nth-child(3n) { background: #FFF0B8; box-shadow: 0 0 10px 3px rgba(245, 194, 66, 0.65); }
.hh-motes i:nth-child(4n) { width: 4px; height: 4px; }
.hh-col { position: relative; z-index: 2; min-height: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; }
.hh-gap { flex: 1 1 auto; min-height: clamp(36px, 9vh, 320px); }
.hh-kicker { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: calc(100% - 60px); margin: 0; font: 700 16px/1.2 var(--hh-title); letter-spacing: 0.24em; text-transform: uppercase; color: var(--hh-gold); text-shadow: 0 2px 6px #000, 0 0 2px #000; }
.hh-crest { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 2px 4px #000); }
.hh-lock-up { --ts: 44px; width: fit-content; max-width: 100%; margin: 6px 0 4px; font-family: var(--hh-title); font-weight: 700; line-height: 1; letter-spacing: 0.04em; filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.75)); }
.hh-tl { position: relative; display: block; width: max-content; isolation: isolate; font-size: var(--ts); }
.hh-tl + .hh-tl { margin-top: 0.02em; }
.hh-stroke, .hh-fill { display: block; white-space: nowrap; }
.hh-stroke { position: absolute; left: 0; top: 0; z-index: -1; color: #1A0A12; -webkit-text-stroke: 0.13em #1A0A12; }
.hh-fill { background: linear-gradient(180deg, #FFF6D2 12%, #F5C242 52%, #B7791F 92%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hh-hook { margin: 8px 0 2px; max-width: 30em; font: italic 700 clamp(18px, 4.6vw, 23px)/1.25 var(--hh-title); color: var(--hh-lamp); text-shadow: 0 0 2px #0B0814, 0 2px 0 #0B0814, 0 3px 12px #000; }
.hh-tag { margin: 4px 0 0; max-width: 34em; font-size: 16px; line-height: 1.4; color: var(--hh-soft); text-shadow: 0 1px 2px #000, 0 2px 10px #000; }
.hh-door:not(.hh--wide) .hh-tag { display: none; }
.hh-menu { display: flex; flex-direction: column; gap: 10px; padding-bottom: 2px; }
.hh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hh-tile { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 58px; margin: 0; padding: 6px 10px 6px 6px; border-radius: 14px; cursor: pointer; text-align: left;
  font: inherit; color: var(--hh-parch); background: rgba(30, 15, 24, 0.82); border: 1px solid rgba(201, 162, 70, 0.4); box-shadow: inset 4px 0 0 var(--accent, var(--hh-lav)), 0 8px 20px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform 0.12s ease; }
.hh-tile:disabled { cursor: default; }
.hh-tile--gold { --accent: var(--hh-gold); border-color: rgba(245, 194, 66, 0.55); }
.hh-tile--pink { --accent: var(--hh-pink); border-color: rgba(255, 143, 199, 0.45); }
.hh-tile--mint { --accent: var(--hh-mint); border-color: rgba(127, 224, 214, 0.45); }
.hh-tile--lav { --accent: var(--hh-lav); }
.hh-pic { flex: none; display: grid; place-items: center; width: 36px; height: 44px; margin-left: 2px; color: var(--accent, var(--hh-gold)); }
.hh-pic img, .hh-pic svg { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.hh-pic svg { width: 32px; height: 32px; }
.hh-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hh-words b { font: 700 18px/1.15 var(--hh-title); letter-spacing: 0.03em; font-variant-caps: small-caps; color: var(--accent, var(--hh-parch)); }
.hh-words small { font-size: 16px; line-height: 1.3; color: #E8DCF8; }
.hh-chev { flex: none; font: 700 42px/1 var(--hh-title); color: #2A0F1A; margin-left: 2px; }
.hh-play { --accent: #2A0F1A; min-height: 80px; padding: 7px 12px 7px 7px; gap: 12px; border: 2px solid var(--hh-gold); color: #2A0F1A;
  background: linear-gradient(180deg, #FFC6E3 0%, #FF8FC7 48%, #EA6DB0 100%); box-shadow: 0 0 0 4px rgba(245, 194, 66, 0.18), 0 0 26px rgba(255, 143, 199, 0.55), 0 10px 26px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: none; backdrop-filter: none; }
.hh-play::after { content: ''; position: absolute; inset: -7px; border-radius: 20px; box-shadow: 0 0 22px 6px rgba(245, 194, 66, 0.55); opacity: 0; pointer-events: none; }
.hh-play .hh-pic { width: 62px; height: 62px; margin: 0; border-radius: 50%; background: rgba(42, 15, 26, 0.38); overflow: hidden; }
.hh-play .hh-pic img { width: 58px; height: 58px; margin-top: 6px; }
.hh-play .hh-words b { font-size: 34px; letter-spacing: 0.14em; line-height: 1.05; font-variant-caps: normal; text-transform: uppercase; color: #2A0F1A; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45); }
.hh-play .hh-words small { color: #4A1E2E; font-weight: 600; }
.hh-play:disabled { filter: saturate(0.55) brightness(0.9); }
.hh-play:disabled::after { display: none; }
.hh-foot { display: flex; align-items: center; gap: 12px; padding-top: 10px; }
.hh-foot .hh-back { margin-left: auto; }
.hh-fine { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; line-height: 1.35; color: #D9C4FA; text-shadow: 0 1px 2px #000; }
.hh-corner { position: absolute; z-index: 3; top: max(12px, env(safe-area-inset-top)); right: var(--hh-pad-r); display: flex; gap: 10px; }
.hh-disc { display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--hh-gold);
  background: rgba(42, 15, 26, 0.92); border: 2px solid rgba(201, 162, 70, 0.9); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.hh-disc svg { width: 24px; height: 24px; }
.hh-guide { position: absolute; z-index: 3; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.hh-guide img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 18px rgba(255, 176, 96, 0.25)); transform-origin: 50% 100%; animation: hh-sway 4.5s ease-in-out infinite; }
.hh-say { position: absolute; z-index: 4; margin: 0; padding: 10px 14px; border-radius: 16px; background: var(--hh-parch); color: #2A0F1A; font: 600 16px/1.35 var(--hh-body); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--hh-gilt); opacity: 0; transform: translateY(6px) scale(0.96); transform-origin: right bottom; transition: opacity 0.28s ease, transform 0.28s ease; pointer-events: none; }
.hh-say::after { content: ''; position: absolute; right: 22%; bottom: -11px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--hh-gilt); }
.hh-say--on { opacity: 1; transform: none; }
.hh--wide.hh-door .hh-art { position: fixed; height: auto; inset: 0; }
.hh--wide.hh-door .hh-paint { background-position: 58% 50%; transform-origin: 60% 60%; }
.hh--wide.hh-door .hh-shade { background:
  linear-gradient(90deg, rgba(11, 8, 20, 0.94) 0%, rgba(11, 8, 20, 0.84) 30%, rgba(11, 8, 20, 0.35) 52%, rgba(11, 8, 20, 0) 66%),
  linear-gradient(180deg, rgba(11, 8, 20, 0.45) 0%, rgba(11, 8, 20, 0) 18%, rgba(11, 8, 20, 0) 72%, rgba(11, 8, 20, 0.6) 100%); }
.hh--wide.hh-door .hh-col { width: clamp(320px, 42vw, 560px); max-width: none; margin: 0; justify-content: center; gap: 12px; }
.hh--wide.hh-door .hh-gap { display: none; }
.hh--wide.hh-door .hh-hook { font-size: clamp(18px, 2.2vw, 23px); }
.hh--wide.hh-door .hh-menu, .hh--wide.hh-door .hh-grid { gap: 8px; }
.hh--wide.hh-door .hh-kicker { max-width: none; }
.hh--wide.hh-door .hh-foot { padding-top: 0; }
.hh--wide.hh-door .hh-foot .hh-back { position: fixed; z-index: 5; right: var(--hh-pad-r); bottom: max(12px, env(safe-area-inset-bottom)); }

/* ---- THE ROOMS (the standard's Village): every room its own painting; the bottom line carries Clues, How to Play and Back */
.hh-rooms { display: flex; flex-direction: column; gap: 10px; }
.hh-rooms .hh-paint { background-position: 50% 40%; }
.hh-scroll { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding-bottom: 8px; }
.hh-head { position: relative; z-index: 1; padding-top: 4px; }
.hh-night { margin: 4px 0 10px; font: italic 700 18px/1.3 var(--hh-title); color: var(--hh-lamp); text-shadow: 0 2px 6px #000; }
.hh-pips { display: flex; gap: 6px; margin: 0 0 6px; }
.hh-pips i { flex: 1 1 0; max-width: 32px; height: 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(245, 194, 66, 0.35); }
.hh-pips i.on { background: linear-gradient(180deg, #FFE9A8, #F5C242); box-shadow: 0 0 8px rgba(245, 194, 66, 0.7); }
.hh-count { margin: 0; font-size: 16px; color: #E8DCF8; text-shadow: 0 1px 3px #000; }
.hh-main { position: relative; z-index: 1; }
.hh-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.hh-room { position: relative; display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; color: var(--hh-parch);
  background: rgba(30, 15, 24, 0.94); border: 1px solid rgba(201, 162, 70, 0.45); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); transition: transform 0.12s ease; }
.hh-room:disabled { cursor: default; color: var(--hh-parch); }
.hh-plate { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #1A0A12; }
.hh-plate img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hh-num { position: absolute; left: 6px; top: 6px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; font: 700 16px/1 var(--hh-title); color: #2A0F1A; background: var(--hh-gold); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.hh-done { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #12301F; background: var(--hh-mint); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
.hh-done svg { width: 22px; height: 22px; }
.hh-go { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px; padding: 6px 14px 6px 10px; border-radius: 999px; font: 700 16px/1 var(--hh-title); letter-spacing: 0.12em; text-transform: uppercase;
  color: #2A0F1A; background: linear-gradient(180deg, #FFC6E3, #FF8FC7 50%, #EA6DB0); border: 2px solid var(--hh-gold); box-shadow: 0 0 16px rgba(255, 143, 199, 0.7); }
.hh-go svg { width: 16px; height: 16px; }
.hh-padlock { position: absolute; inset: 0; display: grid; place-items: center; color: #E8DCF8; background: rgba(11, 8, 20, 0.5); }
.hh-padlock svg { width: 38px; height: 38px; filter: drop-shadow(0 2px 6px #000); }
.hh-name { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.hh-name b { font: 700 18px/1.15 var(--hh-title); letter-spacing: 0.02em; }
.hh-sub { display: none; font: italic 16px/1.3 var(--hh-title); color: #D9C4FA; }
.hh-state { font-size: 16px; color: #CDBFE6; }
.hh-room--done .hh-state { color: var(--hh-mint); }
.hh-room--next { border: 2px solid var(--hh-pink); box-shadow: 0 0 0 3px rgba(255, 143, 199, 0.25), 0 0 24px rgba(255, 143, 199, 0.5), 0 8px 20px rgba(0, 0, 0, 0.45); }
.hh-room--next .hh-state { color: var(--hh-pink); font-weight: 700; }
.hh-room--locked { border-color: rgba(255, 255, 255, 0.14); background: rgba(30, 15, 24, 0.82); }
.hh-room--locked .hh-plate img { filter: grayscale(0.8) brightness(0.55); }
.hh-room--locked .hh-name b { color: #CDBFE6; }
.hh-line { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: 10px; min-height: calc(var(--hh-back) + 10px); padding-top: 10px; border-top: 1px solid rgba(201, 162, 70, 0.35); }
.hh-line .hh-back { margin-left: auto; }
.hh--wide.hh-rooms { display: grid; grid-template-columns: clamp(220px, 28vw, 360px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px 20px; }
.hh--wide.hh-rooms .hh-shade { background: linear-gradient(90deg, rgba(11, 8, 20, 0.92) 0%, rgba(11, 8, 20, 0.78) 32%, rgba(11, 8, 20, 0.6) 100%); }
.hh--wide.hh-rooms .hh-scroll { display: contents; }
.hh--wide.hh-rooms .hh-head { grid-column: 1; grid-row: 1; align-self: start; }
.hh--wide.hh-rooms .hh-title { font-size: clamp(28px, 4vw, 50px); }
.hh--wide.hh-rooms .hh-main { grid-column: 2; grid-row: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 2px 4px 12px; }
.hh--wide.hh-rooms .hh-cards { margin-top: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.hh--wide.hh-rooms .hh-line { grid-column: 1 / -1; grid-row: 2; }

/* ---- THE LINE-UP: the five suspects as cards; a tap names one ------------------------------------------------------ */
.hh-lineup { display: flex; flex-direction: column; gap: 10px; }
.hh-lineup .hh-paint { background-position: 50% 60%; }
.hh-lineup .hh-head { text-align: center; }
.hh-lineup .hh-title { margin: 0 auto; font-size: clamp(26px, 4.4vw, 46px); }
.hh-lead { margin: 6px auto 0; max-width: 40em; font: 18px/1.4 Georgia, var(--hh-title); color: #E8DCF8; text-shadow: 0 1px 3px #000; }
.hh-suspects { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-content: center; padding: 4px 2px; }
.hh-suspect { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 44px; margin: 0; padding: 8px 6px 10px; border-radius: 14px; cursor: pointer; text-align: center; font: inherit; color: var(--hh-parch);
  background: rgba(30, 15, 24, 0.94); border: 1px solid rgba(201, 162, 70, 0.6); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45); }
.hh-suspect img { display: block; width: 100%; height: clamp(90px, 30vh, 220px); object-fit: contain; object-position: bottom; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); }
.hh-suspect b { font: 700 18px/1.15 var(--hh-title); color: var(--hh-gold); }
.hh-suspect small { font-size: 16px; line-height: 1.3; color: #E8DCF8; }
@media (max-height: 520px) { .hh-suspect small { display: none; } .hh-lead { font-size: 16px; } }

/* ---- THE BOOKS: a picture book, the painting and a character over the words, the arrows and dots under them -------- */
.hh-book { display: flex; align-items: center; justify-content: center; z-index: 47; }
.hh-book .hh-shade { background: rgba(11, 8, 20, 0.76); }
.hh-card { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(640px, 100%); max-height: 100%; overflow: hidden; border-radius: 20px; touch-action: pan-y;
  background: rgba(30, 15, 24, 0.96); border: 1px solid rgba(201, 162, 70, 0.6); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.hh-fig { position: relative; flex: none; margin: 0; aspect-ratio: 4 / 3; max-height: 34vh; overflow: hidden; background: #0B0814; }
.hh-fig::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: linear-gradient(180deg, rgba(30, 15, 24, 0), rgba(30, 15, 24, 0.96)); }
.hh-fig-plate { display: block; width: 100%; height: 100%; object-fit: cover; }
.hh-fig-cast { position: absolute; z-index: 1; right: 4%; bottom: -4%; height: 90%; width: auto; max-width: 46%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7)); }
.hh-book-words { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 20px 16px; -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); }
.hh-book-name { margin: 0; font: 700 16px/1.3 var(--hh-title); letter-spacing: 0.2em; text-transform: uppercase; color: var(--hh-mint); }
.hh-book-h { margin: 4px 0 8px; font: 700 clamp(22px, 6vw, 30px)/1.15 var(--hh-title); color: #FFE29B; }
.hh-book-body { margin: 0; font: 18px/1.5 Georgia, var(--hh-title); color: var(--hh-parch); white-space: pre-line; }
.hh-book-nav { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px 4px; }
.hh-turn { display: grid; place-items: center; width: 52px; height: 52px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--hh-gold); background: rgba(58, 22, 36, 0.95); border: 2px solid rgba(201, 162, 70, 0.9); }
.hh-turn svg { width: 26px; height: 26px; }
.hh-turn:disabled { opacity: 0.3; cursor: default; }
.hh-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hh-n { margin: 0; font-size: 16px; color: #CDBFE6; }
.hh-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 180px; }
.hh-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.hh-dots i.on { background: var(--hh-gold); box-shadow: 0 0 8px var(--hh-gold); }
.hh-dots--long { position: relative; width: min(160px, 36vw); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.hh-dots--long b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--hh-gold); box-shadow: 0 0 8px var(--hh-gold); transition: width 0.3s ease; }
.hh-book-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 4px 16px 14px; }
.hh-card--turn .hh-fig-plate, .hh-card--turn .hh-fig-cast, .hh-card--turn .hh-book-words { animation: hh-in 0.35s ease both; }
.hh--wide .hh-card { width: min(1100px, 100%); height: 100%; max-height: 760px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; }
.hh--wide .hh-fig { grid-column: 1; grid-row: 1 / span 3; aspect-ratio: auto; max-height: none; height: 100%; }
.hh--wide .hh-fig::after { left: auto; top: 0; width: 22%; height: auto; background: linear-gradient(90deg, rgba(30, 15, 24, 0), rgba(30, 15, 24, 0.96)); }
.hh--wide .hh-fig-cast { height: 76%; right: 8%; bottom: -3%; }
.hh--wide .hh-book-words { grid-column: 2; grid-row: 1; padding-top: 16px; }
.hh--wide .hh-book-nav { grid-column: 2; grid-row: 2; }
.hh--wide .hh-book-foot { grid-column: 2; grid-row: 3; }

/* ---- THE STORY: the painting, the speaker's portrait standing on the box, the words; a narration card on parchment -- */
.hh-story { z-index: 48; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(11, 8, 20, 0.55); }
.hh-story .hh-art { opacity: 0; transition: opacity 0.6s ease; }
.hh-story.hh-story--art .hh-art { opacity: 1; }
.hh-story .hh-paint { inset: 0; }
.hh-story .hh-shade { background: linear-gradient(180deg, rgba(11, 8, 20, 0.4) 0%, rgba(11, 8, 20, 0) 25%, rgba(11, 8, 20, 0.1) 50%, rgba(11, 8, 20, 0.9) 100%); }
.hh-skip { position: absolute; z-index: 4; top: max(12px, env(safe-area-inset-top)); right: var(--hh-pad-r); min-height: 44px; margin: 0; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  font: 700 16px/1 var(--hh-body); color: var(--hh-parch); background: rgba(30, 15, 24, 0.82); border: 1px solid rgba(201, 162, 70, 0.6); }
.hh-stage { position: relative; z-index: 2; display: flex; flex-direction: column; width: 100%; max-width: 820px; margin: 0 auto; }
.hh-who { position: relative; z-index: 1; align-self: flex-start; height: min(34vh, 320px); max-width: 60%; margin: 0 0 -22px 6px; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.7)); }
.hh-who--right { align-self: flex-end; margin: 0 6px -22px 0; }
.hh-box { position: relative; z-index: 2; padding: 16px 18px 12px; border-radius: 18px; cursor: pointer; background: rgba(30, 15, 24, 0.96); border: 1px solid rgba(201, 162, 70, 0.7); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6); }
.hh-speaker { margin: 0 0 6px; font: 700 24px/1.15 var(--hh-title); letter-spacing: 0.04em; color: var(--hh-gold); }
.hh-speaker:empty { display: none; }
.hh-role { display: block; margin-top: 2px; font: italic 16px/1.3 var(--hh-title); letter-spacing: 0; color: #CDB8E6; }
.hh-text { margin: 0 0 10px; font: 19px/1.5 Georgia, var(--hh-title); color: var(--hh-parch); white-space: pre-line; }
.hh-more { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; min-height: 48px; padding: 8px 14px 8px 22px; border-radius: 999px; cursor: pointer; font: 700 17px/1 var(--hh-title); letter-spacing: 0.1em; text-transform: uppercase;
  color: #2A0F1A; background: linear-gradient(180deg, #FFF0B8, #F5C242 55%, #D99A2B); border: 1px solid #FFF0B8; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); }
.hh-more svg { width: 20px; height: 20px; }
.hh-story--card .hh-box { text-align: center; color: #3A2140; background: linear-gradient(180deg, #FBF3E7, #EFE0C4); border: 2px solid #B7791F; }
.hh-story--card .hh-text { color: #3A2140; font-style: italic; font-size: 20px; }
.hh-story--card .hh-more { margin: 0 auto; }
.hh-rise { animation: hh-rise-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hh--wide .hh-stage { flex-direction: row; align-items: flex-end; max-width: 1040px; }
.hh--wide .hh-who { order: 0; align-self: flex-end; height: min(76vh, 460px); max-width: 32%; margin: 0 -14px 0 0; }
.hh--wide .hh-who--right { order: 2; margin: 0 0 0 -14px; }
.hh--wide .hh-box { order: 1; flex: 1 1 auto; min-width: 0; }
.hh--wide.hh-story--card .hh-box { max-width: 760px; margin: 0 auto; }

/* ---- THE HUNT'S BAR: the room, its meter and the Clues; the list; the magnifiers, Molesworth's help, Bag, Menu -------- */
.hh-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; touch-action: pan-y; color: var(--hh-parch); font: 16px/1.25 var(--hh-body);
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  padding: 8px var(--hh-pad-r) max(6px, env(safe-area-inset-bottom)) var(--hh-pad-l);
  background: linear-gradient(180deg, rgba(42, 15, 26, 0.98), rgba(14, 8, 14, 0.99)); border-top: 2px solid rgba(201, 162, 70, 0.7); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45); }
.hh-bar[hidden] { display: none; }
.hh-top { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.hh-room-name { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 17px/1.2 var(--hh-title); letter-spacing: 0.04em; color: #FFE29B; }
.hh-found { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #E8DCF8; }
.hh-meter { position: relative; flex: 1 1 auto; min-width: 24px; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.14); }
.hh-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, #F5C242, #FFE9A8); transition: width 0.4s ease; }
.hh-stat { flex: none; display: flex; align-items: center; gap: 4px; white-space: nowrap; color: #D9C4FA; }
.hh-stat svg { width: 18px; height: 18px; color: var(--hh-lamp); }
.hh-stat--open, .hh-stat--open svg { color: var(--hh-mint); }
.hh-clues { flex: none; display: flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 700; color: var(--hh-gold); }
.hh-clues img { width: 22px; height: 22px; }
.hh-list { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(var(--hh-cols, 3), minmax(0, 1fr)); gap: 6px; overflow: auto; }
.hh-item { position: relative; min-width: 44px; min-height: 52px; margin: 0; padding: 6px; border-radius: 12px; cursor: pointer; font: 16px/1.2 var(--hh-body); color: var(--hh-parch); overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(201, 162, 70, 0.4); transition: opacity 0.3s ease; }
.hh-item--gold { font-weight: 700; color: var(--hh-gold); border-color: rgba(245, 194, 66, 0.7); background: rgba(245, 194, 66, 0.08); }
.hh-item--riddle { font-style: italic; color: #E3D0FF; }
.hh-item-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.hh-item[aria-pressed='true'] { border: 2px solid var(--hh-mint); background: rgba(127, 224, 214, 0.16); box-shadow: 0 0 12px rgba(127, 224, 214, 0.35); }
.hh-item::after { content: ''; position: absolute; left: 10%; top: 50%; width: 0; height: 2px; background: var(--hh-gold); transition: width 0.22s ease-out; }
.hh-item--struck::after { width: 80%; }
.hh-item--gone { opacity: 0; }
.hh-item--in { animation: hh-rise-in 0.3s ease-out both; }
.hh-tools { flex: none; display: flex; gap: 6px; }
.hh-tool, .hh-help { flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 48px; margin: 0; padding: 4px 10px; border-radius: 12px; cursor: pointer;
  font: 700 16px/1.1 var(--hh-body); color: var(--hh-parch); background: rgba(58, 22, 36, 0.96); border: 1px solid rgba(201, 162, 70, 0.6); }
.hh-tool svg { flex: none; width: 24px; height: 24px; color: var(--hh-gold); }
.hh-zoom { width: 52px; padding: 4px; }
.hh-zoom svg { width: 28px; height: 28px; }
.hh-zoom:disabled { opacity: 0.45; cursor: default; }
.hh-bag-n { position: absolute; top: -7px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font: 700 16px/20px var(--hh-body); color: #2A0F1A; background: var(--hh-gold); }
.hh-tool { position: relative; }
.hh-help { flex: 1 1 auto; min-width: 0; justify-content: flex-start; padding: 2px 10px 2px 4px; background: linear-gradient(180deg, #5A2238, #36121F); border-color: rgba(245, 194, 66, 0.75); }
.hh-help img { flex: none; width: 44px; height: 44px; object-fit: cover; object-position: 50% 12%; border-radius: 50%; background: #2A0F1A; border: 2px solid var(--hh-gilt); }
.hh-help-words { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; text-align: left; }
.hh-help-words b { color: #FFE29B; }
.hh-cost { display: inline-flex; align-items: center; gap: 3px; color: var(--hh-gold); }
.hh-cost img { width: 20px; height: 20px; }
@media (max-width: 599px) { .hh-label { display: none; } .hh-tool { width: 48px; padding: 4px; } }
.hh-bar--compact { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 6px 8px; padding-top: 6px; }
.hh-bar--compact .hh-top { grid-column: 1; grid-row: 1; flex-wrap: wrap; align-content: center; gap: 2px 10px; }
.hh-bar--compact .hh-room-name { flex: 1 1 100%; }
.hh-bar--compact .hh-found { flex: 1 1 100%; }
.hh-bar--compact .hh-lock-word { display: none; }
.hh-bar--compact .hh-list { grid-column: 2; grid-row: 1; overflow: hidden; }
.hh-bar--compact .hh-item { min-height: 0; padding: 4px 8px; }
.hh-bar--compact .hh-tools { grid-column: 1 / -1; grid-row: 2; }

/* the cut-out flown from the painting to its line (page layer: the bar stands over the canvas) */
.hh-fly { position: fixed; z-index: 40; left: 0; top: 0; pointer-events: none; transform-origin: 50% 50%; filter: drop-shadow(0 0 12px rgba(255, 241, 176, 0.9)); }

/* Molesworth's word, over his help in the bar */
.hh-bubble { position: fixed; z-index: 41; max-width: min(420px, calc(100vw - 32px)); margin: 0; padding: 10px 14px; border-radius: 14px; pointer-events: none; font: 18px/1.35 var(--hh-body); color: #2A0F1A;
  background: var(--hh-parch); border: 2px solid var(--hh-gilt); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(6px); transition: opacity 0.22s ease, transform 0.22s ease; }
.hh-bubble::after { content: ''; position: absolute; left: var(--tail, 30px); bottom: -11px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--hh-gilt); }
.hh-bubble--on { opacity: 1; transform: none; }

/* a line for the player, over the painting */
.hh-toast { position: fixed; z-index: 62; left: 50%; bottom: calc(var(--hh-bar-h, 0px) + 14px); max-width: min(560px, calc(100vw - 32px)); margin: 0; padding: 10px 18px; border-radius: 14px; pointer-events: none; transform: translate(-50%, 8px);
  font: 700 18px/1.35 var(--hh-body); text-align: center; white-space: pre-line; color: var(--hh-parch); background: rgba(14, 8, 14, 0.94); border: 1px solid rgba(201, 162, 70, 0.7); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease; }
.hh-toast--on { opacity: 1; transform: translate(-50%, 0); }

/* ---- THE SHEETS: one card over the dimmed screen; RESUME first, in gold -------------------------------------------- */
.hh-sheet { position: fixed; inset: 0; z-index: 61; display: flex; align-items: center; justify-content: center; overflow-y: auto; touch-action: pan-y;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(7, 4, 8, 0.78); font: 16px/1.4 var(--hh-body); color: var(--hh-parch); -webkit-user-select: none; user-select: none; }
.hh-sheet-card { position: relative; width: min(520px, 100%); max-height: 100%; overflow-y: auto; padding: 16px 16px 18px; border-radius: 18px; background: rgba(30, 15, 24, 0.98); border: 1px solid rgba(201, 162, 70, 0.75); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.hh-sheet-card h2 { margin: 2px 56px 4px 4px; font: 700 24px/1.2 var(--hh-title); letter-spacing: 0.06em; color: #FFE29B; }
.hh-sheet-sub { margin: 0 4px 12px; color: #CDBFE6; }
.hh-sheet-x { position: absolute; top: 8px; right: 8px; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: var(--hh-parch); font: 28px/48px system-ui; cursor: pointer; }
.hh-row { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; margin: 0 0 8px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  font: 700 17px/1.2 var(--hh-body); color: var(--hh-parch); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(201, 162, 70, 0.4); }
.hh-row--gold { color: #2A0F1A; background: linear-gradient(180deg, #FFF0B8, #F5C242 55%, #D99A2B); border-color: #FFF0B8; font-family: var(--hh-title); letter-spacing: 0.12em; text-transform: uppercase; }
.hh-row--gold svg { width: 20px; height: 20px; }
.hh-row--pink { color: #2A0F1A; background: linear-gradient(180deg, #FFC6E3, #FF8FC7 50%, #EA6DB0); border-color: var(--hh-gold); font-family: var(--hh-title); letter-spacing: 0.08em; text-transform: uppercase; }
.hh-sheet-p { margin: 0 0 8px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); color: #E8DCF8; font-size: 18px; line-height: 1.45; }
.hh-sheet-p b { color: var(--hh-gold); }
.hh-sheet-big { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; font: 700 28px/1.1 var(--hh-title); color: var(--hh-gold); }
.hh-sheet-big img { width: 40px; height: 40px; }
@media (max-height: 520px) {
  .hh-menu-sheet .hh-sheet-card { width: min(720px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; align-content: start; }
  .hh-menu-sheet .hh-sheet-card h2, .hh-menu-sheet .hh-sheet-sub, .hh-menu-sheet .hh-row--gold, .hh-menu-sheet .hh-sheet-p { grid-column: 1 / -1; }
}

/* the case book: what was found (a tap reads it), what the clues say, the suspects */
.hh-casebook .hh-sheet-card { width: min(900px, 100%); }
.hh-cb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hh-cb h3 { margin: 0 0 6px; font: 700 16px/1.2 var(--hh-title); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hh-mint); }
.hh-cb-list { display: flex; flex-direction: column; gap: 6px; }
.hh-cb-item { display: block; width: 100%; min-height: 44px; margin: 0; padding: 8px 12px; border-radius: 10px; cursor: pointer; text-align: left; font: 16px/1.3 var(--hh-body); color: var(--hh-parch); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(201, 162, 70, 0.3); }
.hh-cb-item[aria-pressed='true'] { border-color: var(--hh-gold); background: rgba(245, 194, 66, 0.12); color: var(--hh-gold); }
.hh-cb-p { margin: 0 0 6px; color: #E8DCF8; font-size: 16px; line-height: 1.4; }
.hh-cb-read { margin: 0; min-height: 52px; padding: 10px 14px; border-radius: 12px; font: italic 18px/1.45 Georgia, var(--hh-title); color: #3A2140; background: linear-gradient(180deg, #FBF3E7, #EFE0C4); border: 2px solid #B7791F; }
.hh-cb-faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.hh-cb-face { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 44px; margin: 0; padding: 4px; border-radius: 10px; cursor: pointer; font: 700 16px/1.15 var(--hh-title); color: var(--hh-gold); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(201, 162, 70, 0.3); }
.hh-cb-face img { width: 100%; height: 76px; object-fit: contain; object-position: bottom; }
.hh-cb-face span { max-width: 100%; overflow-wrap: anywhere; }
@media (min-width: 600px) { .hh-cb { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .hh-cb-wide { grid-column: 1 / -1; } }
/* a phone on its side: the reading line beside the evidence, under what the clues say, so the card fits the window */
@media (min-width: 600px) and (max-height: 520px) {
  .hh-cb { grid-template-areas: 'ev said' 'ev read' 'who who'; grid-template-rows: auto 1fr auto; }
  .hh-cb-ev { grid-area: ev; } .hh-cb-said { grid-area: said; } .hh-cb-readsec { grid-area: read; align-self: end; } .hh-cb-who { grid-area: who; }
  .hh-cb-face img { height: 52px; }
}

/* ---- A NOTE: a clue's words on a slip of parchment; a tap anywhere puts it away ------------------------------------ */
.hh-note { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(7, 4, 8, 0.55);
  padding: max(14px, env(safe-area-inset-top)) var(--hh-pad-r, 16px) calc(var(--hh-bar-h, 0px) + 10px) var(--hh-pad-l, 16px); }
.hh-paper { position: relative; width: min(640px, 100%); max-height: 100%; overflow-y: auto; padding: 22px 26px 18px; border-radius: 8px; text-align: center; color: #3A2140;
  background: #FBF3E7; box-shadow: inset 0 0 0 10px #FBF3E7, inset 0 0 0 13px #C9A246, inset 0 0 0 19px #FBF3E7, inset 0 0 0 20px rgba(183, 121, 31, 0.5), 6px 8px 0 rgba(0, 0, 0, 0.35); }
.hh-paper-kick { margin: 0 0 6px; font: 700 16px/1.2 var(--hh-title); letter-spacing: 0.2em; text-transform: uppercase; color: #8A5A12; }
.hh-paper-h { margin: 0 0 8px; font: 700 21px/1.2 var(--hh-title); letter-spacing: 0.04em; text-transform: uppercase; color: #6E2A5C; }
.hh-paper-body { margin: 0 0 12px; font: italic 20px/1.5 Georgia, var(--hh-title); color: #3A2140; white-space: pre-line; }
.hh-paper-foot { margin: 0; font-size: 16px; color: #8A5A12; }
.hh-note.hh-rise .hh-paper, .hh-result .hh-paper { animation: hh-rise-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* ---- THE RESULT: ROOM CLEARED and its one CONTINUE ----------------------------------------------------------------- */
.hh-result { cursor: default; background: rgba(7, 4, 8, 0.62); }
.hh-result .hh-paper { padding-bottom: 22px; }
.hh-stamp { display: inline-block; margin: 6px 0 6px; font: 700 clamp(30px, 6vw, 46px)/1.05 var(--hh-title); letter-spacing: 0.06em; transform: rotate(-4deg);
  background: linear-gradient(180deg, #E6B450 10%, #B7791F 60%, #7A5A1C 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hh-result .hh-row { width: auto; min-width: 220px; margin: 6px auto 0; }

/* ---- THE LOCKED PUZZLES: the words, the board and the two ways out; on a wide window the board stands on the left -- */
.hh-lock { z-index: 47; display: flex; background: rgba(11, 8, 20, 0.82); overflow-y: auto; }
.hh-lock-card { position: relative; display: flex; flex-direction: column; gap: 12px; width: min(620px, 100%); margin: auto; padding: 16px 16px 16px; border-radius: 20px;
  background: rgba(30, 15, 24, 0.97); border: 1px solid rgba(201, 162, 70, 0.7); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
.hh-lock-words { display: flex; flex-direction: column; gap: 6px; }
.hh-lock-kick { margin: 0; font: 700 16px/1.2 var(--hh-title); letter-spacing: 0.2em; text-transform: uppercase; color: var(--hh-mint); }
.hh-lock-title { margin: 0; font: 700 clamp(24px, 6vw, 32px)/1.15 var(--hh-title); color: #FFE29B; }
.hh-lock-lead { margin: 0; font: 18px/1.45 Georgia, var(--hh-title); color: var(--hh-parch); }
.hh-lock-clue { margin: 0; font: italic 700 18px/1.4 var(--hh-title); color: var(--hh-gold); }
.hh-lock-clue:empty { display: none; }
.hh-lock-msg { margin: 0; min-height: 1.4em; font: 700 18px/1.35 var(--hh-body); color: var(--hh-pink); }
.hh-lock-msg--gold { color: var(--hh-gold); }
.hh-board { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hh-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-acts button { flex: 1 1 160px; min-height: 52px; margin: 0; padding: 8px 14px; border-radius: 14px; cursor: pointer; font: 700 16px/1.2 var(--hh-body); }
.hh-lock-back { color: #2A0F1A; background: linear-gradient(180deg, #FFF0B8, #F5C242 55%, #D99A2B); border: 1px solid #FFF0B8; }
.hh-lock-skip { color: var(--hh-parch); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(201, 168, 245, 0.45); }
.hh-lock-skip:disabled { opacity: 0.6; cursor: default; }
.hh-try { min-width: 200px; min-height: 52px; margin: 0; padding: 8px 22px; border-radius: 999px; cursor: pointer; font: 700 17px/1.1 var(--hh-title); letter-spacing: 0.1em; text-transform: uppercase;
  color: #2A0F1A; background: linear-gradient(180deg, #FFC6E3, #FF8FC7 50%, #EA6DB0); border: 2px solid var(--hh-gold); box-shadow: 0 0 14px rgba(255, 143, 199, 0.45); }
.hh-opened { position: absolute; left: 50%; top: 42%; z-index: 3; margin: 0; transform: translate(-50%, -50%) rotate(-8deg); font: 700 68px/1 var(--hh-title); letter-spacing: 0.08em; pointer-events: none;
  background: linear-gradient(180deg, #FFF6D2 12%, #F5C242 55%, #B7791F 95%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8)); animation: hh-stamp 0.32s cubic-bezier(0.3, 1.4, 0.6, 1) both; }
.hh--wide .hh-lock-card { width: min(980px, 100%); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 10px 22px; align-items: start; }
.hh--wide .hh-board { grid-column: 1; grid-row: 1 / span 3; align-self: center; min-width: 0; }
.hh--wide .hh-lock-words { grid-column: 2; grid-row: 1; }
.hh--wide .hh-lock-msg { grid-column: 2; grid-row: 2; align-self: end; }
.hh--wide .hh-acts { grid-column: 2; grid-row: 3; align-self: end; }

/* the boards: the casks, the blind clock, the tide dials, the great cog, the plinths, the crate's bolts */
.hh-row5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: min(100%, 520px); }
.hh-cask, .hh-plinth { position: relative; display: grid; place-items: center; min-width: 44px; min-height: 88px; margin: 0; padding: 2px; border-radius: 12px; cursor: pointer; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(201, 162, 70, 0.35); color: var(--hh-gold); }
.hh-cask svg, .hh-plinth svg { display: block; width: 100%; height: auto; }
.hh-cask-n { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; font: 700 20px/30px var(--hh-title); color: #2A0F1A; background: var(--hh-gold); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.hh-cask-n:empty { display: none; }
.hh-plinth b { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font: 700 22px/1 var(--hh-title); color: var(--hh-gold); text-shadow: 0 2px 4px #000; }
.hh-dial-face, .hh-clock-face, .hh-cog-face { display: block; width: min(100%, 300px, 42vh); height: auto; }
.hh-hands-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: min(100%, 420px); }
.hh-hand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hh-hand > span { font: 700 16px/1.2 var(--hh-title); letter-spacing: 0.12em; color: var(--hh-gold); }
.hh-turns { display: flex; gap: 8px; }
.hh-turns button, .hh-step { display: grid; place-items: center; width: 52px; height: 52px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; color: var(--hh-gold); background: rgba(58, 22, 36, 0.95); border: 2px solid rgba(201, 162, 70, 0.9); }
.hh-turns svg, .hh-step svg { width: 26px; height: 26px; }
.hh-dials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 420px); }
.hh-dial { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hh-dial > button:first-child { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; aspect-ratio: 1; min-width: 44px; min-height: 88px; margin: 0; padding: 4px; border-radius: 50%; cursor: pointer;
  color: var(--hh-mint); background: radial-gradient(circle at 40% 35%, #2E4A50, #12222A 70%); border: 3px solid var(--hh-gilt); box-shadow: inset 0 0 0 6px rgba(201, 162, 70, 0.18), 0 8px 18px rgba(0, 0, 0, 0.5); }
.hh-dial > button:first-child svg { width: 52%; height: auto; }
.hh-dial-word { font: 700 16px/1 var(--hh-body); text-transform: capitalize; color: var(--hh-parch); }
.hh-dial .hh-turns button { width: 46px; height: 46px; }
.hh-cog-wrap { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.hh-cog-face .hh-cog-turn { transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: 150px 156px; }
.hh-bolts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(100%, 420px); }
.hh-bolt { display: grid; place-items: center; height: 56px; border-radius: 10px; font: 700 28px/1 var(--hh-title); color: var(--hh-gold); background: linear-gradient(180deg, #4A4A52, #2E2E34); border: 3px solid #8C8C8C; }
.hh-keys { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; width: min(100%, 520px); }
.hh-key { min-width: 44px; min-height: 64px; margin: 0; padding: 0; border-radius: 8px 8px 12px 12px; cursor: pointer; font: 700 24px/1 var(--hh-title); color: #3A2140; background: linear-gradient(180deg, #FFF6DD, #EDE3C8); border: 2px solid var(--hh-gilt); box-shadow: 0 4px 0 #8C6A2A; }
.hh-key:active { transform: translateY(3px); box-shadow: 0 1px 0 #8C6A2A; }
.hh-clear { min-height: 44px; margin: 0; padding: 6px 18px; border-radius: 999px; cursor: pointer; font: 700 16px/1 var(--hh-body); color: var(--hh-lav); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(201, 168, 245, 0.5); }
.hh-shake { animation: hh-shake 0.26s ease; }
.hh-turned { animation: hh-turn 0.3s ease; }

/* ---- short windows (a phone on its side) and big ones (an iPad, a PC): closer set, every press still 44 or more ---- */
@media (max-height: 520px) {
  .hh-crest { width: 26px; height: 26px; }
  .hh-lock-up { margin: 2px 0; }
  .hh-hook { margin: 4px 0 0; font-size: 18px; }
  .hh--wide.hh-door .hh-tag { display: none; }
  .hh--wide.hh-door .hh-col { width: clamp(340px, 44vw, 560px); gap: 7px; }
  .hh-play { min-height: 62px; padding: 4px 12px 4px 6px; }
  .hh-play .hh-pic { width: 52px; height: 52px; } .hh-play .hh-pic img { width: 48px; height: 48px; margin-top: 5px; }
  .hh-play .hh-words b { font-size: 28px; }
  .hh-tile { min-height: 52px; padding-top: 3px; padding-bottom: 3px; }
  .hh-grid .hh-pic { width: 30px; } .hh-words b { font-size: 17px; }
  .hh-fine { display: none; }
  .hh-book-h { font-size: 22px; margin: 2px 0 6px; } .hh-book-body { font-size: 17px; line-height: 1.45; } .hh-book-nav { padding-top: 4px; } .hh-book-foot { padding-bottom: 10px; }
  .hh-lock-card { padding: 12px; gap: 8px; } .hh-lock-lead { font-size: 17px; }
  .hh-dial-face, .hh-clock-face, .hh-cog-face { width: min(100%, 220px, 50vh); }
  .hh--wide .hh-lock-card { gap: 8px 16px; }
}
/* the smallest phones on their side (an iPhone SE, 375 tall): the hook steps aside on the door, the lock's two buttons
   share a row, the clock is a little smaller, and the seven bell notes take two rows when their board is narrow */
@media (max-height: 420px) {
  .hh--wide.hh-door .hh-hook { display: none; }
  .hh-acts button { flex-basis: 110px; padding: 6px 10px; }
  .hh-lock-title { font-size: 26px; }
  .hh-dial-face, .hh-clock-face, .hh-cog-face { width: min(100%, 200px, 44vh); }
  .hh-hand > span { letter-spacing: 0.04em; }
  .hh-key { min-height: 52px; }
}
.hh-board { container-type: inline-size; }
@container (max-width: 352px) { .hh-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 640px) and (min-height: 700px) {
  .hh-play { min-height: 96px; } .hh-play .hh-pic { width: 78px; height: 78px; } .hh-play .hh-pic img { width: 74px; height: 74px; margin-top: 8px; }
  .hh-play .hh-words b { font-size: 40px; } .hh-tile { min-height: 66px; } .hh-words b { font-size: 21px; }
  .hh-words small, .hh-fine, .hh-tag { font-size: 18px; } .hh-kicker { font-size: 19px; } .hh-crest { width: 40px; height: 40px; }
  .hh-pic { width: 48px; height: 52px; } .hh-pic svg { width: 38px; height: 38px; }
  .hh-menu, .hh-grid { gap: 12px; } .hh-disc { width: 56px; height: 56px; } .hh-say { font-size: 18px; }
  .hh-door:not(.hh--wide) .hh-tag { display: block; }
  .hh-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .hh--wide.hh-rooms .hh-cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .hh-sub { display: block; } .hh-name b { font-size: 20px; } .hh-night { font-size: 21px; }
  .hh-book-body { font-size: 20px; } .hh-book-h { font-size: 32px; } .hh-fig { max-height: 40vh; }
  .hh-text { font-size: 22px; } .hh-speaker { font-size: 28px; } .hh-who { height: min(40vh, 420px); }
  .hh-suspect b { font-size: 20px; }
}

/* ---- the motion: the painting breathes, the words arrive, PLAY glows, Molesworth sways; none of it under reduced motion */
.hh-door .hh-paint { animation: hh-drift 26s ease-in-out infinite alternate; }
.hh-play::after { animation: hh-glow 2.4s ease-in-out infinite; }
.hh--in .hh-lock-up, .hh--in .hh-kicker, .hh--in .hh-hook, .hh--in .hh-tag, .hh--in .hh-menu > *, .hh--in .hh-corner { animation: hh-rise-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hh--in .hh-lock-up { animation-delay: 0.08s; } .hh--in .hh-hook { animation-delay: 0.16s; } .hh--in .hh-tag { animation-delay: 0.22s; }
.hh--in .hh-menu > :nth-child(1) { animation-delay: 0.32s; } .hh--in .hh-menu > :nth-child(2) { animation-delay: 0.42s; } .hh--in .hh-menu > :nth-child(3) { animation-delay: 0.52s; }
.hh--in .hh-corner { animation-delay: 0.5s; }
@keyframes hh-drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.09) translate(-1.2%, -0.8%); } }
@keyframes hh-glow { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }
@keyframes hh-rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hh-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes hh-sway { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1.5deg) translateY(-3px); } }
@keyframes hh-mote { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 15% { opacity: 0.9; } 70% { opacity: 0.6; } 100% { opacity: 0; transform: translate(14px, -140px) scale(1.1); } }
@keyframes hh-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2); } to { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); } }
@keyframes hh-shake { 0% { transform: translateX(-10px); } 40% { transform: translateX(8px); } 70% { transform: translateX(-4px); } 100% { transform: none; } }
@keyframes hh-turn { from { opacity: 0.2; transform: rotate(-90deg) scale(0.7); } to { opacity: 1; transform: none; } }
.hh--still *, .hh--still *::after { animation: none !important; transition: none !important; }
.hh--still .hh-motes { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hh *, .hh *::after, .hh-bar *, .hh-bar *::after, .hh-sheet *, .hh-toast, .hh-bubble { animation: none !important; transition: none !important; }
  .hh-motes { display: none; }
}
