@font-face {
  font-family: Creepster;
  src: url('halloween-assets/halloween-creepster.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
:root {
  --he-background: #17191b; --he-panel: #23272a;
  --he-text: #f6f7f5; --he-muted: #bdc8cc;
  --he-accent: #f5b85d; --he-success: #8ce0b4;
  --he-error: #ff989c; --he-border: #546067;
  --he-hotspot: #f5b85d; --he-radius: 6px;
  --he-body-font: Arial, sans-serif;
  --he-heading-font: Creepster, Georgia, serif;
  --he-font-size: 16px; --he-heading-size: 30px;
  --he-hotspot-size: 44px;
  --he-room-height: calc(100svh - 132px); --he-room-min: 380px;
}
.he-body { margin: 0; background: var(--he-background); color: var(--he-text); font: var(--he-font-size)/1.5 var(--he-body-font); letter-spacing: 0; }
.he-body *, .he-body *::before, .he-body *::after { box-sizing: border-box; }
.he-body [hidden] { display: none !important; }
.he-body a { color: var(--he-accent); overflow-wrap: anywhere; }
.he-body button, .he-body input, .he-body select, .he-body textarea { font: inherit; }
.he-body button { min-height: 44px; border: 1px solid var(--he-border); border-radius: var(--he-radius); padding: 8px 14px; color: var(--he-text); background: var(--he-panel); cursor: pointer; }
.he-body button:hover { border-color: var(--he-accent); }
.he-body button:disabled { opacity: .6; cursor: default; }
.he-body :focus-visible { outline: 3px solid var(--he-success); outline-offset: 3px; }
.he-body button svg { width: 20px; height: 20px; flex-shrink: 0; pointer-events: none; }
.he-body input:not([type=checkbox]):not([type=radio]), .he-body select, .he-body textarea { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--he-border); border-radius: var(--he-radius); background: var(--he-background); color: var(--he-text); }
.he-header { padding: 10px 22px; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--he-border); }
.he-brand { min-width: 0; }
.he-brand h1 { font: 400 var(--he-heading-size)/1.1 var(--he-heading-font); margin: 0 0 4px; overflow-wrap: anywhere; }
.he-brand span { font-size: 12px; color: var(--he-muted); }
.he-menu { display: flex; gap: 16px; flex-wrap: wrap; }
.he-menu a { text-decoration: none; font-size: 14px; padding: 8px 0; }
.he-menu a:hover { text-decoration: underline; }
.he-room { height: var(--he-room-height); min-height: var(--he-room-min); }
.he-statusbar { min-height: 54px; padding: 5px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--he-border); }
.he-statusbar output { color: var(--he-muted); font-size: 14px; }
.he-actions { display: flex; gap: 6px; align-items: center; }
.he-actions button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 14px; }
.he-room .tour-title { display: none; }
.he-room .tour-toolbar { justify-content: flex-end; }
.he-room .tour-button { width: 44px; height: 44px; color: var(--he-text); border-color: var(--he-border); }
.he-room .tour-hotspot { width: var(--he-hotspot-size); height: var(--he-hotspot-size); display: grid; place-items: center; font-weight: bold; font-size: 14px; color: var(--he-text); border: 2px solid var(--he-hotspot); background: #17191bc9; padding: 0; }
.he-room .tour-hotspot::before { display: none; }
.he-room .tour-hotspot[data-kind=clue] { border-style: dashed; }
.he-room .tour-hotspot[data-solved=true] { border-color: var(--he-success); color: var(--he-success); }
.he-room .tour-hotspot[data-kind=door] { background: #34433ccc; }
.he-room .tour-hotspot svg { width: 21px; height: 21px; }
.he-room .tour-status { background: var(--he-panel); color: var(--he-text); border-color: var(--he-border); }
.he-dialog { color: var(--he-text); background: var(--he-panel); border: 1px solid var(--he-border); border-radius: var(--he-radius); width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 22px; overflow: auto; }
.he-dialog.he-wide { width: min(1100px, calc(100% - 24px)); }
.he-dialog::backdrop { background: #000a; }
.he-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.he-dialog h2 { font: 400 28px/1.2 var(--he-heading-font); margin: 0; overflow-wrap: anywhere; }
.he-dialog-head button { width: 44px; flex-shrink: 0; padding: 0; display: grid; place-items: center; }
.he-dialog p { margin: 0 0 18px; overflow-wrap: anywhere; }
.he-dialog label { display: block; margin-bottom: 14px; }
.he-dialog label > input, .he-dialog label > select { margin-top: 6px; }
.he-choice { display: flex !important; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--he-border); }
.he-choice input { width: 20px; height: 20px; accent-color: var(--he-accent); }
.he-primary { background: var(--he-accent) !important; color: #17191b !important; border-color: transparent !important; }
.he-hint { margin: 18px 0; }
.he-hint summary { cursor: pointer; color: var(--he-accent); }
.he-hint p { margin: 8px 0 !important; color: var(--he-muted); }
.he-success { color: var(--he-success); padding: 16px 0; font-weight: 600; }
.he-error { color: var(--he-error); margin: 12px 0; }
.he-page-error { padding: 18px; }
.he-word-bank, .he-sentence { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.he-sentence { min-height: 62px; padding: 8px; border-bottom: 1px solid var(--he-border); }
.he-sentence button { border-color: var(--he-accent); }
.he-locations { list-style: none; padding: 0; margin: 0; }
.he-locations li { border-bottom: 1px solid var(--he-border); padding: 8px 0; }
.he-locations button { border: 0; width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; }
.he-location-note { color: var(--he-muted); font-size: 14px; }
.he-notebook { padding: 0; list-style: none; }
.he-notebook li { padding: 14px 0; border-bottom: 1px solid var(--he-border); }
.he-notebook strong, .he-notebook span { display: block; }
.he-notebook span { color: var(--he-muted); margin-top: 4px; }
.he-code-parts { font-family: monospace; color: var(--he-success) !important; }
.he-jigsaw-page { padding: 24px; max-width: 1120px; margin: 0 auto; }
.he-jigsaw-page h2 { font: 400 28px/1.2 var(--he-heading-font); margin: 0 0 18px; }
.he-body .picture-jigsaw { color: var(--he-text); background: var(--he-panel); border-radius: var(--he-radius); font: var(--he-font-size)/1.5 var(--he-body-font); }
.he-body .picture-jigsaw .jigsaw-toolbar { background: var(--he-panel); color: var(--he-text); gap: 8px; }
.he-body .picture-jigsaw .jigsaw-toolbar select { width: auto; }
.he-body .picture-jigsaw .jigsaw-toolbar button { color: var(--he-text); background: var(--he-background); border-color: var(--he-border); }
.he-body .picture-jigsaw canvas { border: 1px solid var(--he-border); border-radius: 0; }
.he-body .picture-jigsaw output { font-size: 14px; }
.he-app:fullscreen { background: var(--he-background); overflow: auto; }
@media (max-width: 700px) {
  .he-header { padding: 10px 12px; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 98px; }
  .he-menu { gap: 14px; }
  .he-menu a { font-size: 12px; padding: 4px 0; }
  .he-room { height: var(--he-room-mobile-height, var(--he-room-height)); }
  .he-statusbar { padding: 6px 10px; }
  .he-statusbar output { max-width: 160px; font-size: 12px; }
  .he-actions button span { display: none; }
  .he-actions button { width: 44px; height: 44px; justify-content: center; }
  .he-dialog { padding: 16px; }
  .he-dialog h2 { font-size: 24px; }
  .he-jigsaw-page { padding: 16px 10px; }
  .he-body .picture-jigsaw .jigsaw-toolbar { flex-wrap: wrap; }
  .he-room .tour-controls { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { .he-body * { scroll-behavior: auto !important; } }
