/* ==========================================================================
   TAKE THE TROUBLE — premium editorial / hand-drawn cinematic UI
   ========================================================================== */

:root {
  /* Brand palette (sampled from farben.png) */
  --pink: #f6d6ee;
  --pink-deep: #d47bc0;
  --green: #bfd6c2;
  --green-mid: #738f73;
  --green-deep: #516951;
  --orange: #ffc880;
  --orange-deep: #dba360;
  --mauve: #d4a8c8;
  --mauve-deep: #b56fa4;
  --beige: #ded6c6;
  --cream: #ffffff;
  --paper: #ffffff;
  /* Dark "ink" tones are a warm coffee brown — never gray, black, a very
     dark green, or a dark purple/lilac, per house style. */
  --ink: #4a3323;
  --ink-soft: #8a7361;

  --font-display: 'Poppins', 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-lg: 28px;
  --radius-md: 22px;
  --radius-sm: 10px;

  --shadow-soft: 0 18px 40px -18px rgba(181, 111, 164, 0.4);
  --shadow-card: 0 10px 24px -12px rgba(181, 111, 164, 0.3);

  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; }

a { color: inherit; }

/* --------------------------------------------------------------------------
   Header: identical to blancabehrens.com
   -------------------------------------------------------------------------- */

.bbh {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 8px;
  background: rgba(250, 249, 246, 0.85);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgba(73, 76, 80, 0.08);
  font-family: 'Poppins', sans-serif;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.bbh--hidden { transform: translateY(-110%); }
.bbh__inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
@media (min-width: 768px) { .bbh__inner { padding-inline: 48px; } }

.bbh__logo { display: flex; align-items: center; }
.bbh__logo img { height: 78px; width: auto; display: block; }

.bbh__links {
  display: none;
  align-items: center;
  gap: 32px;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bbh__links a {
  position: relative;
  padding-block: 4px;
  color: #494c50;
  text-decoration: none;
}
.bbh__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: currentColor;
  transition: right 0.18s ease;
}
.bbh__links a:hover::after,
.bbh__links a:focus-visible::after,
.bbh__links a[aria-current="page"]::after { right: 0; }
@media (min-width: 900px) { .bbh__links { display: flex; } }

.bbh__actions { display: flex; align-items: center; gap: 16px; }

.bbh__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #adc9b0;
  color: #494c50;
  flex: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.bbh__icon:hover { transform: translateY(-2px) rotate(-6deg); background: #8bab8f; }
.bbh__icon svg { width: 20px; height: 20px; }

.bbh__toggle {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border: 0; padding: 0;
  background: none;
  border-radius: 50%;
  color: #494c50;
  cursor: pointer;
}
.bbh__toggle svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .bbh__toggle { display: none; } }

.bbh-mobile {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #494c50;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateY(-100%);
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Poppins', sans-serif;
}
.bbh-mobile.is-open { transform: translateY(0); }
.bbh-mobile__top { display: flex; justify-content: space-between; align-items: center; }
.bbh-mobile .bbh__icon.bbh-mobile__close { background: rgba(255, 255, 255, 0.12); color: #fff; }
.bbh-mobile ul { list-style: none; margin: 64px 0 0; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.bbh-mobile ul a {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}
.bbh-mobile__actions { margin-top: auto; padding-top: 32px; display: flex; gap: 16px; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */

section {
  position: relative;
  padding: clamp(90px, 12vw, 150px) clamp(20px, 6vw, 64px);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Landing — the very first screen: build a film, or watch the explainer.
   -------------------------------------------------------------------------- */

.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--green);
  padding: 120px 0 72px;
}

/* `display: flex` above and the `hidden` attribute both have 0-1-0
   specificity, so without this the later (author) rule would win and the
   section would stay visible even while `hidden`. */
.landing[hidden] { display: none; }

.landing__scribbles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Against the mint-green landing background, the usual beige doodle tint
   (see .scribble) would nearly disappear — white reads clearly instead. */
.landing__scribbles .scribble {
  background-color: #fff;
}

.landing__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-inline: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.landing__title {
  /* one line at every width: the text is ~9.5em wide */
  white-space: nowrap;
  font-size: clamp(22px, calc((100vw - 40px) / 10), 88px);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 clamp(36px, 6vw, 56px);
  color: #fff;
}

.landing-video {
  position: relative;
  width: min(100%, 980px);
  margin: clamp(36px, 6vw, 60px) 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #2c2e31;
  box-shadow: 0 30px 60px -28px rgba(81, 105, 81, 0.55);
}
.landing-video__player {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.landing-video__sound {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.landing-video__sound:hover { transform: scale(1.08); background: #fff; }
.landing-video__sound svg { width: 20px; height: 20px; }

.landing__about {
  max-width: 62ch;
  margin-top: clamp(28px, 5vw, 44px);
  color: #355235; /* dark green, 5.6:1 on the mint background */
}
.landing__about-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.landing__about p {
  margin: 0 0 12px;
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.65;
}
.landing__about .landing__facts {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.landing-btn {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: clamp(16px, 2.2vw, 22px) clamp(42px, 6vw, 64px);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium);
}

.landing-btn:hover { transform: translateY(-3px) scale(1.03); }
.landing-btn:active { transform: translateY(0) scale(0.97); }

.landing-btn--primary {
  color: #fff;
  background: var(--pink);
}

.landing-btn--secondary {
  color: #fff;
  background: var(--orange);
}
.landing-btn--order {
  display: inline-block;
  color: #fff;
  background: var(--green-deep);
  text-decoration: none;
}
.landing__price {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #355235;
}
.landing__legal-link {
  font-size: 13px;
  font-weight: 600;
  color: #355235;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.landing__legal-link:hover { color: #1f3a1f; }

/* --------------------------------------------------------------------------
   Intro
   -------------------------------------------------------------------------- */

.intro {
  padding-top: clamp(180px, 24vw, 260px);
  padding-bottom: 20px;
}

.intro__grid {
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: start;
  gap: clamp(24px, 5vw, 60px);
  text-align: left;
}

.intro__heading {
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green-mid);
  margin: 0 0 22px;
  line-height: 1.6;
}

.intro__sub {
  font-size: clamp(30px, 5.6vw, 62px);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.08;
  margin: 0;
  color: var(--green-mid);
  min-height: 1.2em;
}

.typing-cursor {
  display: inline-block;
  width: 0.6ch;
  margin-left: 4px;
  border-right: 4px solid var(--mauve-deep);
  animation: blink 0.9s steps(1) infinite;
}

.typing-cursor--done { animation: none; opacity: 0; }

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.intro__scribbles,
.scene-select__scribbles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.intro__scribbles {
  /* keeps top-row doodles clear of the fixed nav, which floats above the
     very start of the page */
  top: 110px;
}

.scribble {
  position: absolute;
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  transition: opacity 0.4s ease;
  /* Every doodle is a solid-color mask (see scribbles.js) so it always
     renders as a flat beige silhouette against the white background,
     regardless of its original ink color. */
  background-color: var(--beige);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-position: center;
  -webkit-mask-position: center;
}

/* --------------------------------------------------------------------------
   Card box — a single box, rotated a full 360° by scroll position so every
   side (front, edge, back, edge, front) is seen as the intro scrolls past.
   -------------------------------------------------------------------------- */

.intro__box {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: clamp(220px, 30vw, 360px);
}

#box-canvas {
  width: clamp(232px, 27vw, 354px);
  height: clamp(340px, 40vw, 520px);
  /* A soft, grounded contact shadow rather than a bright glow — low
     opacity, tight blur, tinted toward the box's own pink instead of a
     generic dark shadow. */
  filter: drop-shadow(0 10px 14px rgba(181, 111, 164, 0.2));
}

/* --------------------------------------------------------------------------
   Scene selection
   -------------------------------------------------------------------------- */

.scene-select {
  padding-top: 20px;
}

.scene-select__header {
  max-width: 1320px;
  margin: 0 auto 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.selection-counter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 56px;
  color: var(--orange-deep);
}

.selection-counter__circle {
  position: absolute;
  left: -34px;
  top: -30px;
  width: calc(100% + 68px);
  height: calc(100% + 60px);
  color: var(--beige);
  pointer-events: none;
}

.selection-counter__text {
  position: relative;
  z-index: 1;
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#selection-count {
  font-weight: 600;
}

.selection-hint {
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--orange-deep);
  margin: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.selection-hint--show {
  opacity: 1;
  transform: translateY(0);
}

.scene-grid {
  position: relative;
  z-index: 2;
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(10px, 1.4vw, 20px);
}

.scene-card {
  --reveal-y: 30px;
  --select-scale: 1;
  position: relative;
  border: none;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--green);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(var(--reveal-y)) scale(var(--select-scale));
  transition:
    opacity 0.5s var(--ease-premium) var(--reveal-delay, 0ms),
    transform 0.45s var(--ease-premium) var(--reveal-delay, 0ms),
    box-shadow 0.35s var(--ease-premium),
    outline-color 0.35s ease;
  outline: 3px solid transparent;
  outline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}

.scene-card.is-revealed {
  --reveal-y: 0px;
  opacity: 1;
}

.scene-card:focus-visible {
  outline-color: var(--mauve-deep);
}

.scene-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-premium), opacity 0.35s ease;
}

.scene-card:hover img {
  transform: scale(1.06);
}

.scene-card:hover {
  box-shadow: 0 16px 30px -14px rgba(79, 111, 88, 0.4);
}

.scene-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(246, 214, 238, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scene-card.is-selected {
  --select-scale: 0.95;
  outline-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(246, 214, 238, 0.6), var(--shadow-soft);
}

.scene-card.is-selected::after { opacity: 1; }

.scene-card.is-disabled {
  cursor: not-allowed;
}

.scene-card.is-disabled img {
  filter: saturate(0.5);
  opacity: 0.55;
}

.scene-card.is-shake {
  animation: shake 0.42s var(--ease-premium);
}

@keyframes shake {
  0%, 100% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-6px) scale(1); }
  40% { transform: translateX(5px) scale(1); }
  60% { transform: translateX(-4px) scale(1); }
  80% { transform: translateX(3px) scale(1); }
}

.scene-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--orange-deep);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.35s var(--ease-premium);
  z-index: 2;
  box-shadow: 0 4px 10px -3px rgba(120, 88, 110, 0.45);
}

.scene-card.is-selected .scene-card__badge {
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Music selection
   -------------------------------------------------------------------------- */

.music-select {
  position: relative;
  z-index: 2;
  margin-top: clamp(40px, 6vw, 64px);
  text-align: center;
}

.music-select__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin: 0 0 16px;
}

.music-select__row {
  /* inline-flex (not flex) so this shrink-wraps to the button group's own
     width — centered via the parent's text-align — rather than stretching
     full-width, which would make the arrow's `right: 100%` resolve against
     the whole section instead of the buttons it's meant to sit beside. */
  position: relative;
  display: inline-flex;
}

.sound-arrow {
  /* Absolutely positioned so it never shifts the centered button group —
     it hangs off the group's left edge instead of sharing the flex row. */
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  width: 64px;
  color: var(--beige);
  opacity: 0;
  transform: translateY(-50%) translateX(-8px);
  transition: opacity 0.6s var(--ease-premium), transform 0.6s var(--ease-premium);
  pointer-events: none;
}

.sound-arrow.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sound-arrow__svg {
  width: 100%;
  height: auto;
  display: block;
}

.sound-arrow.is-visible .sound-arrow__svg {
  animation: sound-arrow-nudge 1.5s ease-in-out infinite;
}

@keyframes sound-arrow-nudge {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(5px, 2px) rotate(4deg); }
}

.music-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.music-option {
  border: none;
  background: var(--orange);
  color: #fff;
  padding: 12px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium), background-color 0.3s ease;
}

.music-option:hover {
  transform: translateY(-2px);
}

.music-option.is-selected {
  background: var(--orange-deep);
  color: #fff;
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Create button
   -------------------------------------------------------------------------- */

.create-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: clamp(50px, 8vw, 84px);
}

.create-btn {
  position: relative;
  border: none;
  border-radius: 999px;
  padding: clamp(18px, 2.4vw, 24px) clamp(48px, 7vw, 76px);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--pink);
  cursor: pointer;
  box-shadow: 0 18px 34px -14px rgba(181, 111, 164, 0.55);
  transition: transform 0.3s var(--ease-premium), box-shadow 0.3s var(--ease-premium), opacity 0.3s ease;
}

.create-btn:not(:disabled):hover {
  transform: translateY(-3px) scale(1.035);
  box-shadow: 0 22px 40px -14px rgba(181, 111, 164, 0.65);
}

.create-btn:not(:disabled):active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 10px 20px -12px rgba(181, 111, 164, 0.5);
}

.create-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  background: var(--ink-soft);
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Back button — shared by the film view and the video view, to return to
   the landing screen's two choices.
   -------------------------------------------------------------------------- */

.back-btn {
  position: fixed;
  top: 96px;
  left: clamp(16px, 4vw, 40px);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s var(--ease-premium);
}

.back-btn:hover {
  color: var(--green-mid);
  transform: translateX(-3px);
}

/* --------------------------------------------------------------------------
   Video view — the rules explainer.
   -------------------------------------------------------------------------- */

.video-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-view[hidden] { display: none; }

.video-view__inner {
  width: 100%;
  max-width: 920px;
  text-align: center;
}

.video-view__title {
  font-size: clamp(22px, 3.2vw, 34px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--green-mid);
  margin: 0 0 clamp(24px, 4vw, 36px);
}

.video-view__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: var(--ink);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

/* Footer: identical to blancabehrens.com */
.bb-footer {
  background: #2c2e31;
  color: rgba(255, 255, 255, 0.7);
  padding: 32px clamp(16px, 4vw, 48px);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
}
.bb-footer__inner {
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.bb-footer p { margin: 0; }
.bb-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: #fff;
  font-family: 'Baloo 2', 'Poppins', sans-serif;
  font-weight: 700;
}
.bb-footer__brand img { height: 22px; width: auto; }
.bb-footer__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.bb-footer__links a { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.bb-footer__links a:hover { color: #adc9b0; }

/* --------------------------------------------------------------------------
   Loading screen
   -------------------------------------------------------------------------- */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease-premium);
}

.loading-screen.is-visible {
  opacity: 1;
  visibility: visible;
}

.loading-screen[hidden] {
  display: none;
}

.loading-screen__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
}

.loading-screen__inner[hidden] {
  display: none;
}

.shrimp-stage {
  width: clamp(200px, 34vw, 340px);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.shrimp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: shrimp-float 3.4s ease-in-out infinite;
}

@keyframes shrimp-float {
  0%   { transform: translateY(0) rotate(0deg); }
  25%  { transform: translateY(-5px) rotate(-1.4deg); }
  50%  { transform: translateY(2px) rotate(0.6deg); }
  75%  { transform: translateY(-3px) rotate(1.2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.loading-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 4px 0 0;
  color: #fff;
}

.loading-percent {
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 800;
  margin: 0;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.loading-stage {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  text-transform: uppercase;
}

.loading-screen__inner--error .loading-error-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  margin: 0 0 8px;
  color: #fff;
}

.loading-error-copy {
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 26px;
  max-width: 46ch;
}

.retry-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 34px;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  transition: transform 0.3s var(--ease-premium);
}

.retry-btn:hover { transform: translateY(-2px) scale(1.03); }
.retry-btn:active { transform: translateY(0) scale(0.97); }

/* --------------------------------------------------------------------------
   Content-hidden state (while loading screen is up)
   -------------------------------------------------------------------------- */

.app-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .scene-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 860px) {
  .intro {
    /* Stacked layout doesn't need the extra top offset added for the
       side-by-side desktop variant — keep the original spacing here. */
    padding-top: clamp(140px, 20vw, 220px);
    padding-bottom: 28px;
  }
  .intro__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .intro__box { order: -1; min-height: clamp(180px, 50vw, 260px); }
  .scene-select {
    /* Extra clearance so the counter's hand-drawn circle (which extends
       30px above its own box) has room to render fully instead of
       crowding the heading right above it. */
    padding-top: 32px;
  }
}

@media (max-width: 640px) {
  .scene-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  section { padding-left: 16px; padding-right: 16px; }
  /* Scribbles stay visible on mobile too — they're behind the content
     (z-index) and non-interactive, so opaque cards/text simply sit on top
     of them rather than being covered. */
  .scribble {
    width: 24vw !important;
  }

  /* ~40% bigger than the desktop floor — the stacked mobile layout gives
     the box its own full-width row, so it can be considerably larger here
     without competing with anything beside it. */
  #box-canvas {
    width: clamp(280px, 70vw, 340px);
    height: clamp(410px, 103vw, 500px);
  }
}

@media (max-width: 420px) {
  .scene-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shrimp-img { animation: none; }
  .scribble { transition: none !important; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
