:root {
  --commercial-safe-bottom: 76px;
}

.scene {
  box-sizing: border-box;
  max-width: 100vw;
  overflow: hidden;
  padding-bottom: max(var(--commercial-safe-bottom), 9vh) !important;
}

.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scene .bigline {
  font-size: clamp(1.9rem, min(3.1vw, 5vh), 3.8rem) !important;
}

.scene[data-title="Kick-Ass Challenge"] .bigline {
  margin-top: 0 !important;
  font-size: clamp(1.65rem, min(1.6vw, 2.8vh), 2rem) !important;
  line-height: 1 !important;
}

.scene[data-title="Save the Recipe"] .prompt {
  margin-top: 0 !important;
  padding: .65rem .85rem !important;
  font-size: clamp(.85rem, min(1.35vw, 2.15vh), 1.35rem) !important;
  line-height: 1.3 !important;
}

.scene[data-title="Try to Trip It Up"] .wheel {
  width: min(400px, 32vw, 62vh) !important;
}

.presenter-strip {
  display: flex !important;
  align-items: center;
  gap: .55rem;
  min-height: 56px;
}

.presenter-strip .presenter-status {
  margin-right: auto;
  white-space: nowrap;
}

.presenter-strip .tiny-btn {
  white-space: nowrap;
}

.progress {
  bottom: max(58px, 6.3vh) !important;
}

.presenter-strip .commercial-control {
  flex: 0 0 auto;
}

.commercial-version {
  position: fixed;
  z-index: 91;
  top: max(8px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  padding: .3rem .55rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(9,14,20,.78);
  color: rgba(255,255,255,.65);
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: .08em;
  pointer-events: none;
}

.commercial-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  overflow: auto;
  padding: clamp(18px, 4vw, 48px);
  background: rgba(7, 11, 16, .985);
  color: #f7fbff;
  font: 16px/1.45 system-ui, sans-serif;
}

.commercial-overlay.open {
  display: block;
}

.commercial-overlay__panel {
  width: min(980px, 100%);
  margin: 0 auto;
}

.commercial-overlay__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.commercial-overlay h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.commercial-overlay h3 {
  margin: 0 0 .5rem;
  font-size: 1.15rem;
}

.commercial-overlay p {
  margin: .45rem 0;
  color: #b7c4d0;
}

.commercial-overlay button,
.commercial-dock button {
  min-height: 44px;
  padding: .7rem 1rem;
  border: 1px solid rgba(83, 215, 255, .45);
  border-radius: 10px;
  background: #16212d;
  color: #fff;
  font: 800 14px/1 system-ui, sans-serif;
  cursor: pointer;
}

.commercial-overlay button:focus-visible,
.commercial-dock button:focus-visible {
  outline: 4px solid #53d7ff;
  outline-offset: 3px;
}

.commercial-results {
  display: grid;
  gap: .75rem;
  margin: 1rem 0 1.5rem;
}

.commercial-result {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}

.commercial-result__status {
  align-self: start;
  padding: .35rem .45rem;
  border-radius: 999px;
  text-align: center;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.commercial-result.pass .commercial-result__status { background: #163a2e; color: #86f2bd; }
.commercial-result.warning .commercial-result__status { background: #473719; color: #ffd57b; }
.commercial-result.fail .commercial-result__status { background: #4a1c28; color: #ff9fba; }

.commercial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.commercial-actions .primary {
  border-color: rgba(255, 102, 184, .65);
  background: #3b1730;
}

.commercial-dock {
  position: fixed;
  z-index: 1200;
  top: 0;
  right: 0;
  display: none;
  width: min(440px, 94vw);
  height: 100vh;
  overflow: auto;
  padding: 20px;
  border-left: 1px solid rgba(83,215,255,.35);
  background: #0d1117;
  color: #f7fbff;
  box-shadow: -20px 0 50px rgba(0,0,0,.5);
  font: 16px/1.4 system-ui, sans-serif;
}

.commercial-dock.open { display: block; }
.commercial-dock__status { color: #53d7ff; font-weight: 900; letter-spacing: .08em; }
.commercial-dock__time { color: #ff9bd0; font-weight: 800; }
.commercial-dock__title { margin: .35rem 0 1rem; font-size: 2rem; line-height: 1.05; }
.commercial-dock__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.commercial-note { margin-top: .9rem; padding: .9rem; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.045); }
.commercial-note b { color: #53d7ff; }
.commercial-note.watch b { color: #ff9bd0; }
.commercial-private-warning { margin: .8rem 0; color: #ffd57b; font-weight: 800; }

.commercial-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1.25rem;
}

.commercial-recovery-grid button {
  min-height: 72px;
  text-align: left;
}

[contenteditable="true"] {
  min-width: 3ch;
}

@media (max-height: 900px) {
  .scene {
    padding-top: max(62px, 8vh) !important;
    padding-bottom: max(70px, 9vh) !important;
  }

  .scene h2 {
    font-size: clamp(2rem, min(4.8vw, 7vh), 4.6rem) !important;
  }

  .scene p {
    font-size: clamp(.95rem, min(1.65vw, 2.75vh), 1.5rem) !important;
  }

  .scene .eyebrow {
    margin-bottom: .45rem !important;
    font-size: clamp(.72rem, min(1.05vw, 1.9vh), 1.05rem) !important;
  }

  .scene .lede {
    margin-top: .6rem !important;
  }

  .scene .cards {
    gap: .6rem !important;
  }

  .scene .card {
    min-height: clamp(92px, 21vh, 178px) !important;
    padding: .8rem !important;
  }

  .scene .card h3 {
    font-size: clamp(1.15rem, min(2vw, 3.2vh), 2.1rem) !important;
  }

  .scene .card p {
    font-size: clamp(.76rem, min(1.35vw, 2.15vh), 1.18rem) !important;
  }

  .scene .card .num {
    margin-bottom: .35rem !important;
    font-size: clamp(1.7rem, min(3.8vw, 5.6vh), 3.5rem) !important;
  }

  .scene .prompt,
  .scene .plain-prompt {
    padding: .75rem .9rem !important;
    font-size: clamp(.9rem, min(1.55vw, 2.35vh), 1.3rem) !important;
  }
}

@media (min-width: 901px) and (max-aspect-ratio: 4/3) {
  .scene .hero-grid,
  .scene .two-col,
  .scene .split,
  .scene .wheel-wrap {
    grid-template-columns: 1.05fr .95fr !important;
    gap: 2.5vw !important;
  }

  .scene .cards.four {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .scene .wheel {
    width: min(340px, 34vw) !important;
  }
}

@media (max-width: 1200px), (max-height: 720px) {
  :root { --commercial-safe-bottom: 68px; }
  .presenter-strip { padding-left: 10px !important; padding-right: 10px !important; }
  .presenter-strip .presenter-help { display: none !important; }
  .presenter-strip .tiny-btn { padding: .5rem .65rem !important; font-size: .72rem !important; }
  .scene { padding-top: max(68px, 8vh) !important; }
  .scene h1, .scene .display { max-width: 100%; }
}

@media (max-height: 620px) {
  :root { --commercial-safe-bottom: 60px; }
  .scene { padding-top: 58px !important; padding-bottom: 66px !important; }
  .scene h2 { font-size: clamp(1.7rem, 5.5vh, 3.1rem) !important; }
  .scene .lede, .scene p, .scene .prompt, .scene .plain-prompt { font-size: clamp(.82rem, 2.25vh, 1.1rem) !important; }
  .scene .cards { gap: .65rem !important; }
  .scene .card, .scene .panel { min-height: 0 !important; padding: .8rem !important; }
  .presenter-strip { min-height: 52px; }
}

@media (max-aspect-ratio: 4/3) {
  .scene { padding-left: clamp(24px, 5vw, 64px) !important; padding-right: clamp(24px, 5vw, 64px) !important; }
}

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

@media print {
  .commercial-version,
  .commercial-overlay,
  .commercial-dock { display: none !important; }
}
