/* comfort.css — the Comfort Dial ("How's today?", js/comfort.js).

   A guest sets the park up for the day they're having, and js/comfort.js puts
   one class per choice on <html> before first paint:

     html.comfort-big     Bigger buttons
     html.comfort-calm    Calm motion
     html.comfort-dim     Dim the lights
     html.comfort-brief   Fewer words
     html.comfort-quiet   Quiet (script only: nothing to style)
     html.comfort-on      any of the above

   EVERY rule in this file is scoped under one of those classes, or styles the
   dial's own .cf- pieces (which exist only while the dial is open). So a guest
   who never opens the dial sees byte-identical styling to before. That is a
   tested guarantee (tests/comfort.test.mjs); keep it when adding rules.

   A game with its own stylesheet adds its own html.comfort-* rules there. The
   rules below cover the park's shared pieces: the top bar, the menu, the doors,
   the hubs' buttons. */

/* =====================================================================
   Bigger buttons
   ===================================================================== */
/* The smallest comfortable tap target, for any page that wants to use it:
     min-height: var(--comfort-tap, 44px); */
html.comfort-big { --comfort-tap: 60px; --comfort-gap: 16px; }

/* ---- top bar ---- */
html.comfort-big .topbar .menu-btn { width: 56px; height: 56px; gap: 6px; }
html.comfort-big .topbar .menu-btn .bar { width: 26px; }
html.comfort-big .topbar .menu-btn.open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
html.comfort-big .topbar .menu-btn.open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
/* The Sterling FM pill: the whole pill grows, and so does its round button. */
html.comfort-big #bgMusic.bg-music,
html.comfort-big .topbar #bgMusic.bg-music { min-height: 56px; padding: 4px 16px 4px 4px; gap: 10px; }
html.comfort-big #bgMusic.bg-music button,
html.comfort-big .topbar #bgMusic.bg-music button { width: 48px; height: 48px; }
/* On a phone the bigger pill and menu button need the room the park's name
   takes, so the name steps behind Sterling's badge, which grows into a full
   tap target for the way home. The words are clipped, not removed: a screen
   reader still reads "Sterling's World". */
@media (max-width: 519px) {
  html.comfort-big .topbar .brand { flex: none; width: 56px; height: 56px; gap: 0; overflow: hidden; white-space: nowrap; }
  html.comfort-big .topbar .brand .pin { flex: none; width: 56px; height: 56px; border-radius: 14px; margin-right: 24px; }
}

/* ---- the menu ---- */
html.comfort-big .side-menu { gap: 12px; }
html.comfort-big .side-menu a { min-height: 68px; padding-top: 12px; padding-bottom: 12px; font-size: 1.2rem; }
html.comfort-big .side-menu .menu-close { width: 60px; height: 60px; font-size: 24px; }
html.comfort-big .side-menu .comfort-open { min-height: 60px; padding: 0 14px; font-size: 1.05rem; }

/* ---- the way back out of a game (partials/back-link.html) ----
   The pill styles itself inline, so growing it takes !important. It gets
   taller, not wider: game pages leave it a fixed space in their top bars. */
html.comfort-big a[aria-label^="Back to "][style*="position:fixed"] { min-height: 56px !important; }

/* ---- the doors: more room between them, so a near miss lands on nothing ---- */
html.comfort-big .sw-doors { gap: 20px; }

/* ---- the lobby ---- */
html.comfort-big .audio-gate { min-height: 60px; }
html.comfort-big .hero-cta-row { gap: 14px; }
html.comfort-big .hero-cta-row .hero-plan,
html.comfort-big .hero-cta-row .hero-ghost,
html.comfort-big .hero-cta-row #tourLaunch { min-height: 64px; font-size: 1.1rem; }
html.comfort-big .lobby-pick,
html.comfort-big .gg-surprise { min-height: 60px; padding-left: 22px; padding-right: 22px; font-size: 1.08rem; }

/* ---- shared dialogs and prompts ---- */
html.comfort-big .guide-btn,
html.comfort-big .guide-link,
html.comfort-big .disclaimer-accept,
html.comfort-big .exit-offer-go,
html.comfort-big .exit-offer-no,
html.comfort-big .sw-pk-btn,
html.comfort-big .fm-prompt .fm-done,
html.comfort-big .fm-prompt label { min-height: 60px; }
html.comfort-big .guide-actions,
html.comfort-big .exit-offer-actions { gap: 14px; }

/* ---- the ticket counter ---- */
html.comfort-big .sw-spoon-chip { padding: 20px 20px; font-size: 1.05rem; }

/* ---- links inside a line of text (the footer's Terms, "Jump back in") ----
   The words stay where they are and the same size; an unseen pad around each
   one catches the tap. Nothing on the page moves. */
html.comfort-big footer a,
html.comfort-big .lobby-welcome a { position: relative; }
html.comfort-big footer a::before,
html.comfort-big .lobby-welcome a::before { content: ""; position: absolute; top: -20px; right: -12px; bottom: -20px; left: -12px; }

/* ---- the hubs' own buttons ----
   Each hub styles its buttons in its own page; their names are gathered here
   so one choice reaches all of them. (An attraction with a player or a board
   of its own, such as the audiobook, the Jukebox or a game, sizes its own
   controls in its own stylesheet when it joins in.) */
html.comfort-big .gd-btn,
html.comfort-big .gd-opt,
html.comfort-big .ho-btn,
html.comfort-big .zd-btn,
html.comfort-big .shop-btn,
html.comfort-big .mb-btn,
html.comfort-big .ts-btn { min-height: 64px; }
html.comfort-big .gd-linkbtn,
html.comfort-big .zd-howbtn,
html.comfort-big .tv-switch a,
html.comfort-big .gg-kids a { min-height: 60px; }
/* Links dressed as buttons: keep their words in the middle as they grow. */
html.comfort-big .zd-howbtn,
html.comfort-big .tv-switch a,
html.comfort-big .gg-kids a,
html.comfort-big .mb-btn,
html.comfort-big .ts-btn { display: inline-flex; align-items: center; justify-content: center; }
html.comfort-big .gd-actions,
html.comfort-big .gd-opts,
html.comfort-big .ho-actions,
html.comfort-big .zd-controls,
html.comfort-big .shop-actions,
html.comfort-big .mb-actions,
html.comfort-big .tv-switch { gap: 14px; }

/* =====================================================================
   Calm motion
   The same quieting the park already does for a device that asks for reduced
   motion. Animations still "finish" (in a blink) rather than being removed,
   so anything waiting on one to end still hears it.
   ===================================================================== */
html.comfort-calm { scroll-behavior: auto; }
html.comfort-calm *, html.comfort-calm *::before, html.comfort-calm *::after {
  animation-duration: .001ms !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
/* Things that slide in as you scroll are simply there. */
html.comfort-calm .reveal, html.comfort-calm.js .reveal:not(.in) { opacity: 1; transform: none; }
/* Doors and cards don't lift or shrink under a finger. */
html.comfort-calm .sw-door:hover, html.comfort-calm .sw-door:focus-visible, html.comfort-calm .sw-door:active,
html.comfort-calm .card:hover, html.comfort-calm .card:focus-visible,
html.comfort-calm .side-menu a:hover, html.comfort-calm .side-menu a:focus-visible { transform: none; }

/* =====================================================================
   Dim the lights
   One soft, warm shade over the whole page: pictures, games and all. It never
   takes a tap (pointer-events: none) and sits above everything, so nothing
   bright pokes through. Stretched past the edges so no strip shows while a
   phone's own bars slide away.
   ===================================================================== */
html.comfort-dim::after {
  content: ""; position: fixed; top: -200px; right: -200px; bottom: -200px; left: -200px;
  z-index: 2147483647; pointer-events: none;
  background: rgba(26, 14, 4, .42);
}
/* These are drawn in the browser's own top layer, above the shade, so they
   get the same dimming directly. */
html.comfort-dim dialog,
html.comfort-dim [popover],
html.comfort-dim :fullscreen { filter: brightness(.6); }
/* A guest who has asked their device for its own colours keeps them, and a
   printed page is never shaded. */
@media (forced-colors: active) {
  html.comfort-dim::after { display: none; }
  html.comfort-dim dialog, html.comfort-dim [popover], html.comfort-dim :fullscreen { filter: none; }
}
@media print {
  html.comfort-dim::after { display: none; }
}

/* =====================================================================
   Fewer words
   Pages mark the copy a guest can do without (see js/comfort.js). Warnings,
   instructions and the mission line are never marked.
   ===================================================================== */
html.comfort-brief [data-comfort="extra"],
html.comfort-brief [data-comfort="full"] { display: none !important; }
/* The short twin carries the hidden attribute, so it only ever shows here. */
html.comfort-brief [data-comfort="short"] { display: inline !important; }

/* =====================================================================
   Quiet
   The hushing is done in script (js/comfort.js, js/spoons.js). The one thing
   to style: copy that only makes sense with the sound on, such as "with
   Sterling FM playing along", steps aside.
   ===================================================================== */
html.comfort-quiet [data-comfort="sound"] { display: none !important; }

/* =====================================================================
   The dial itself
   Colours come from the park's tokens where a page has them (so the
   Accessibility Entrance's themes re-colour it too), with the cream palette
   as the fallback on pages that keep their own.
   ===================================================================== */
.cf-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 10010;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 12, 8, .62);
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.cf-sheet {
  box-sizing: border-box; width: 100%; max-width: 440px; max-height: 100%;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--paper, #fffaf0); color: var(--ink, #3a2a18);
  border: 1px solid var(--line, #e3cfa6); border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  font: 400 1rem/1.5 "Atkinson Hyperlegible", system-ui, sans-serif;
  text-align: left;
}
.cf-sheet *, .cf-sheet *::before, .cf-sheet *::after { box-sizing: border-box; }
.cf-sheet:focus { outline: none; }
.cf-title {
  margin: 0; color: var(--ink, #3a2a18);
  font: 800 1.55rem/1.1 "Outfit", system-ui, sans-serif; letter-spacing: -.01em;
}
.cf-sub { margin: 6px 0 0; color: var(--ink-soft, #6d5a42); font-size: .98rem; line-height: 1.45; }
.cf-list { display: grid; gap: 8px; margin-top: 14px; }
.cf-row {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; margin: 0; padding: 10px 14px;
  border-radius: 16px; border: 2px solid var(--line, #e3cfa6);
  background: var(--cream, #f7ecd6); color: var(--ink, #3a2a18);
  font: inherit; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.cf-row .cf-ic {
  width: 28px; height: 28px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.cf-txt { display: grid; gap: 2px; min-width: 0; }
.cf-txt strong { font: 800 1.08rem/1.15 "Outfit", system-ui, sans-serif; color: inherit; }
.cf-txt small { font-size: .88rem; line-height: 1.3; color: var(--ink-soft, #6d5a42); }
/* The switch. Its on/off is told three ways: position, colour and a tick. */
.cf-track {
  position: relative; width: 54px; height: 32px; flex: none; border-radius: 999px;
  background: #8b7a64; transition: background-color .15s ease;
}
.cf-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fffaf0; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .15s ease;
}
/* (The row keeps its own colours when on, so the Accessibility Entrance's
   dark and light themes can never leave pale text on a pale row.) */
.cf-row[aria-checked="true"] { border-color: #1f7a5e; box-shadow: inset 0 0 0 1px #1f7a5e; }
.cf-row[aria-checked="true"] .cf-track { background: #1f7a5e; }
.cf-row[aria-checked="true"] .cf-track::after { transform: translateX(22px); }
.cf-row[aria-checked="true"] .cf-track::before {
  content: ""; position: absolute; top: 9px; left: 11px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
/* Calm motion, held on by the device's own setting. */
.cf-row[aria-disabled="true"] { cursor: default; }
.cf-row[aria-disabled="true"] .cf-track { opacity: .55; }
.cf-row:focus-visible { outline: 3px solid var(--ink, #3a2a18); outline-offset: 3px; }
.cf-note { margin: 12px 2px 14px; color: var(--ink-soft, #6d5a42); font-size: .86rem; line-height: 1.4; }
.cf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cf-reset, .cf-done {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  min-height: 52px; margin: 0; padding: 8px 14px; border-radius: 999px;
  font: 800 1.02rem/1.1 "Outfit", system-ui, sans-serif;
}
.cf-reset { background: transparent; color: var(--ink, #3a2a18); border: 2px solid var(--line, #e3cfa6); }
.cf-done { background: #1f7a5e; color: #fff; border: 2px solid #1f7a5e; }
.cf-reset:focus-visible, .cf-done:focus-visible { outline: 3px solid var(--ink, #3a2a18); outline-offset: 3px; }
.cf-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 600px) {
  .cf-overlay { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-track, .cf-track::after { transition: none; }
}
@media print { .cf-overlay { display: none !important; } }

/* The dial follows its own advice. */
html.comfort-big .cf-row { min-height: 76px; padding: 12px 16px; }
html.comfort-big .cf-list { gap: 12px; }
html.comfort-big .cf-reset, html.comfort-big .cf-done { min-height: 64px; }
html.comfort-big .cf-actions { gap: 14px; }
html.comfort-brief .cf-sub, html.comfort-brief .cf-txt small, html.comfort-brief .cf-note { display: none; }
/* …but a hint that explains a locked switch stays, even with fewer words. */
html.comfort-brief .cf-row[aria-disabled="true"] .cf-txt small { display: block; }

/* Any opener shows that the park is set up for today. */
html.comfort-on [data-comfort-open]::after {
  content: "On"; flex: none; margin-left: 8px; padding: 3px 8px; border-radius: 999px;
  background: #1f7a5e; color: #fff;
  font: 800 .72rem/1.2 "Outfit", system-ui, sans-serif; letter-spacing: .04em;
}
