/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio, geometry.
   Put this @layer first; product CSS outside the layer wins ordinary layout rules.
   Native hidden and closed-dialog states take precedence over component display rules. */
@layer od-layout {
  [hidden]:not([hidden="until-found" i]) { display: none !important; }
  dialog:not([open]) { display: none !important; }

  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  .od-icon { display: inline-block; inline-size: var(--od-icon-size, 1em); block-size: var(--od-icon-size, 1em); flex: none; }

  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }
  .od-nowrap  { white-space: nowrap; }
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; }

  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
:root [hidden]:where(:not([hidden="until-found" i])) { display: none; }
/* /OD-LAYOUT-PRIMITIVES v1 */

/* ============================================================
   MIRRA — shared mirror shell, tokens, and base components
   Canvas: 1080 × 1920 (9:16), scaled to the review viewport.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  background:
    radial-gradient(1200px 900px at 50% -10%, #23201c 0%, transparent 62%),
    linear-gradient(180deg, #0d0c0b 0%, #080807 70%, #050505 100%);
  color: #f4efe7;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  position: fixed;
  inset: 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body[data-scene="gym"] {
  background:
    radial-gradient(1100px 860px at 50% -12%, #16211b 0%, transparent 64%),
    linear-gradient(180deg, #0a0c0b 0%, #060807 72%, #040505 100%);
}

button { font: inherit; color: inherit; }

img { max-width: 100%; }

/* ---------- mirror runtime ----------
   The app is a full-screen kiosk surface. A fixed 1080 × 1920 canvas is
   scaled to the physical screen so a 9:16 device renders edge to edge and
   other panels letterbox instead of cropping or stretching. */

.mirror {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1080px;
  height: 1920px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  transform-origin: center center;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* a faint raking sheen so the UI reads as mirror glass, never as a media wall */
.mirror::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 18%, rgba(255,255,255,.045) 34%, transparent 47%),
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 22%);
  mix-blend-mode: screen;
}

#app { position: absolute; inset: 0; }

/* ---------- scene tokens ---------- */

.theme-hotel {
  --bg: #14100b;
  --bg-2: #1d1710;
  --surface: rgba(45, 34, 24, .52);
  --surface-solid: #241c14;
  --line: rgba(216, 185, 130, .20);
  --line-strong: rgba(216, 185, 130, .42);
  --text: #f7f0e5;
  --muted: #b9a892;
  --faint: #96846f;
  --accent: #d8b982;
  --accent-ink: #1b130b;
  --accent-soft: rgba(216, 185, 130, .14);
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r-btn: 999px;
  --r-card: 6px;
  --focus: #ecd3a2;
}

.theme-gym {
  --bg: #080a09;
  --bg-2: #101512;
  --surface: #111613;
  --surface-solid: #141a16;
  --line: #25312a;
  --line-strong: #3b4a41;
  --text: #f1f6f3;
  --muted: #9caaa1;
  --faint: #7f8d85;
  --accent: #7fe3b4;
  --accent-ink: #05130c;
  --accent-soft: rgba(127, 227, 180, .12);
  --font-display: "Avenir Next Condensed", "DIN Condensed", "PingFang SC", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: "DIN Alternate", "Avenir Next Condensed", "SF Mono", Menlo, monospace;
  --r-btn: 8px;
  --r-card: 4px;
  --focus: #a9f3d0;
}

/* ---------- screens ---------- */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 74px 84px 84px;
}

.screen--flush { padding: 0; }

.screen-enter { animation: screenIn .34s cubic-bezier(.4, 0, .2, 1) both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--muted);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.34;
}

.h1 { font-size: 92px; line-height: 1.3; }
.h2 { font-size: 64px; line-height: 1.34; }
.h3 { font-size: 44px; line-height: 1.4; }

.lede {
  margin: 0;
  font-size: 30px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 30ch;
}

.body {
  margin: 0;
  font-size: 28px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 32ch;
}

.caption { font-size: 22px; line-height: 1.5; color: var(--faint); letter-spacing: .02em; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 96px;
  padding: 0 52px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  background: transparent;
  color: var(--text);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.4,0,.2,1), background-color .16s, border-color .16s, color .16s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.975); }

.btn:focus-visible,
.icon-btn:focus-visible,
.chip:focus-visible,
.course-card:focus-visible,
.tile:focus-visible,
.back-btn:focus-visible,
.standby-hit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--focus);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover { background: var(--accent-soft); border-color: var(--line-strong); }

.btn--quiet {
  color: var(--muted);
  min-height: 80px;
  padding: 0 20px;
}

.btn--quiet:hover { color: var(--text); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .32; cursor: not-allowed; }
.btn[disabled]:hover, .btn[aria-disabled="true"]:hover { background: transparent; border-color: var(--line-strong); }

.btn--block { width: 100%; }

.btn--lg { min-height: 116px; font-size: 34px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 9, 7, .35);
  color: var(--text);
  cursor: pointer;
  transition: background-color .16s, transform .16s;
}

.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:active { transform: scale(.94); }

.od-icon { vertical-align: middle; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 26px 0 20px;
  margin-left: -20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  letter-spacing: .04em;
  cursor: pointer;
}

.back-btn:hover { color: var(--text); background: var(--accent-soft); }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 0 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  letter-spacing: .05em;
  cursor: pointer;
  transition: color .16s, border-color .16s, background-color .16s;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* focus ring sits cleanly on chip fill */
.chip[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--focus); }

/* ---------- progress ---------- */

.progress {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .3s cubic-bezier(.4,0,.2,1);
}

/* ---------- media ---------- */

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  background: var(--bg-2);
}

.media-frame img { display: block; width: 100%; height: auto; }

.media-scrim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,6,4,.12) 0%, rgba(8,6,4,0) 38%, rgba(8,6,4,.82) 100%);
  pointer-events: none;
}

/* ---------- overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px;
  background: rgba(6, 5, 4, .78);
  animation: fadeIn .22s ease-out both;
}

body[data-scene="gym"] .overlay { background: rgba(3, 5, 4, .84); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 820px;
  padding: 68px 64px 56px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface-solid);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .45);
  animation: sheetIn .28s cubic-bezier(.4,0,.2,1) both;
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(20px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sheet__title { margin: 0 0 18px; font-family: var(--font-display); font-size: 56px; font-weight: 500; line-height: 1.35; }
.sheet__text { margin: 0 0 44px; font-size: 27px; line-height: 1.75; color: var(--muted); }
.sheet__actions { display: flex; flex-direction: column; gap: 18px; }

/* ---------- toast ---------- */

.toast {
  position: absolute;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%) translateY(10px);
  z-index: 70;
  padding: 24px 40px;
  border-radius: 999px;
  background: rgba(20, 16, 12, .92);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 26px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}

.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- utility ---------- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hr { height: 1px; border: 0; background: var(--line); margin: 0; }

.scroll-fade {
  position: relative;
}

.scroll-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

