@layer reset, tokens, base, layout, components, stage, maker, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: none; text-size-adjust: none; }
  body { min-height: 100dvh; line-height: 1.35; -webkit-font-smoothing: antialiased; }
  img, picture, svg, video, canvas { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; }
  p, h1, h2, h3 { overflow-wrap: break-word; }
  h1, h2, h3 { text-wrap: balance; line-height: 1.05; font-weight: 400; }
  p { text-wrap: pretty; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  legend { padding: 0; }
  [hidden] { display: none !important; }
}

@layer tokens {
  :root {
    color-scheme: light dark;
    --font-display: "Lilita One", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
    --font-ui: "Baloo 2", ui-rounded, system-ui, sans-serif;

    --step--1: 0.9375rem;
    --step-0: 1.0625rem;
    --step-1: 1.25rem;
    --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2rem);
    --step-3: clamp(2rem, 1.5rem + 2.6vw, 3rem);
    --step-4: clamp(2.6rem, 1.8rem + 4vw, 4rem);

    --gutter: 16px;
    --tap: 48px;
    --drop: 4px;
    --drop-l: 6px;
    --radius: 18px;
    --radius-l: 28px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    --ink: #2B1B3D;
    --muted: #6B5A7A;
    --paper: #FFFBF2;
    --paper-shade: #D9C6A8;
    --paper-soft: #FFF1D6;
    --paper-line: #EFE3CC;
    --wall: #FFF1D6;
    --sky: #4FB8FF;
    --sky-low: #A6DEFF;
    --tiles: #D27A4B;
    --rosa: #E6007E;
    --rosa-base: #A8005C;
    --rosa-soft: #FFE3F1;
    --sun: #FFD23F;
    --sun-base: #C99A12;
    --sun-soft: #FFE9B3;
    --green: #25D366;
    --green-base: #1A9E4B;
    --danger: #C8102E;
    --focus: #8A5CF6;
    --on-rosa: #FFFFFF;

    --flag-1: #FF2D95; --flag-2: #FFD23F; --flag-3: #37B6F5; --flag-4: #8BD346; --flag-5: #FF8A1F; --flag-6: #8A5CF6;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --wall: #2E1F4F;
      --sky: #1A1238;
      --sky-low: #3A2A6A;
      --tiles: #6A3A2A;
      --paper: #FFF8E8;
      --paper-shade: #B89C72;
      --paper-soft: #F6E8CC;
      --paper-line: #E6D6B4;
      --muted: #5E4E6E;
      --focus: #FFD23F;
    }
  }
}

@layer base {
  body { font-family: var(--font-ui); font-size: var(--step-0); color: var(--ink); background: var(--wall); font-weight: 600; }
  a { color: var(--rosa); text-underline-offset: 0.2em; }
  :focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
  ::selection { background: color-mix(in oklab, var(--rosa) 30%, transparent); }
  @view-transition { navigation: auto; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    @view-transition { navigation: none; }
  }
}

@layer layout {
  .paper-body { background: var(--wall); }
  .masthead { background: linear-gradient(var(--sky), var(--sky-low)); }
  .sky-strip { height: 34px; display: flex; justify-content: space-between; padding: 0 8px; border-top: 2px solid var(--ink); margin-top: 14px; }
  .flag { width: 34px; height: 28px; clip-path: polygon(0 0, 100% 0, 100% 72%, 83% 100%, 67% 72%, 50% 100%, 33% 72%, 17% 100%, 0 72%); }
  .f1 { background: var(--flag-1); } .f2 { background: var(--flag-2); } .f3 { background: var(--flag-3); }
  .f4 { background: var(--flag-4); } .f5 { background: var(--flag-5); } .f6 { background: var(--flag-6); }
  .masthead-row { width: min(100% - 2 * var(--gutter), 44rem); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 16px; }
  .masthead-nav { display: flex; gap: 8px; align-items: center; }
  .paper-main { width: min(100% - 2 * var(--gutter), 44rem); margin: 0 auto; padding: 20px 0 48px; display: grid; gap: 20px; }
  .colophon { width: min(100% - 2 * var(--gutter), 44rem); margin: 0 auto; padding: 20px 0 40px; color: var(--muted); font-size: var(--step--1); }
}

@layer components {
  .skip { position: absolute; left: -999px; }
  .skip:focus { left: var(--gutter); top: var(--gutter); background: var(--paper); padding: 8px 12px; z-index: 50; }

  .logo { font-family: var(--font-display); font-size: 2.25rem; line-height: 1; color: #FFFFFF; text-decoration: none; text-shadow: 3px 3px 0 var(--ink); letter-spacing: 1px; }
  .logo-title { font-size: 1.9rem; }

  .sq {
    width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--paper); color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 var(--drop) 0 var(--paper-shade);
    cursor: pointer; text-decoration: none; flex: none; transition: transform 90ms ease, box-shadow 90ms ease;
  }
  .sq:active { transform: translateY(var(--drop)); box-shadow: 0 0 0 var(--paper-shade); }
  .sq[aria-pressed="true"] { background: var(--rosa); color: #FFFFFF; box-shadow: 0 var(--drop) 0 var(--rosa-base); }
  .sq[aria-pressed="true"]:active { box-shadow: 0 0 0 var(--rosa-base); }
  .sq .when-on, .sq .when-off { display: inline-flex; }
  .sq[aria-pressed="false"] .when-on, .sq[aria-pressed="true"] .when-off { display: none; }
  .sq-text { font-weight: 800; font-size: 0.95rem; text-transform: uppercase; }

  .pill {
    height: var(--tap); padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: var(--step-0); text-decoration: none; color: var(--ink); white-space: nowrap; flex: none;
    transition: transform 90ms ease, box-shadow 90ms ease;
  }
  .pill-sun { background: var(--sun); box-shadow: 0 var(--drop) 0 var(--sun-base); }
  .pill-paper { background: var(--paper); box-shadow: 0 var(--drop) 0 var(--paper-shade); }
  .pill:active { transform: translateY(var(--drop)); box-shadow: 0 0 0 transparent; }

  .btn {
    min-height: 60px; padding: 0 22px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 1px; text-decoration: none; cursor: pointer; width: 100%;
    transition: transform 90ms ease, box-shadow 90ms ease;
  }
  .btn:active { transform: translateY(var(--drop-l)); box-shadow: 0 0 0 transparent !important; }
  .btn-rosa { background: var(--rosa); color: var(--on-rosa); box-shadow: 0 var(--drop-l) 0 var(--rosa-base); }
  .btn-sun { background: var(--sun); color: var(--ink); box-shadow: 0 var(--drop-l) 0 var(--sun-base); font-family: var(--font-ui); font-weight: 800; font-size: 1.25rem; letter-spacing: 0; min-height: 56px; }
  .btn-paper { background: var(--paper-soft); color: var(--ink); box-shadow: 0 var(--drop) 0 var(--paper-shade); font-family: var(--font-ui); font-weight: 800; font-size: 1rem; letter-spacing: 0; }
  .btn-whatsapp { background: var(--green); color: #FFFFFF; box-shadow: 0 var(--drop-l) 0 var(--green-base); font-size: 1.45rem; }
  .btn-text { background: transparent; color: var(--muted); font-family: var(--font-ui); font-weight: 800; font-size: 1.05rem; letter-spacing: 0; min-height: 48px; width: auto; }
  .btn-small { min-height: 44px; padding: 0 14px; font-size: 1rem; width: auto; }
  .btn-big { min-height: 64px; font-size: 1.7rem; }
  .btn:disabled { opacity: 0.6; pointer-events: none; }

  .toast {
    position: absolute; left: 50%; top: calc(74px + var(--safe-top)); translate: -50% 0; z-index: 30;
    background: var(--ink); color: var(--paper); padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: var(--step-0);
    white-space: nowrap; animation: toast-in 240ms ease-out both, toast-out 400ms ease-in 3.2s both; pointer-events: none;
  }
  .toast-inline { position: static; translate: none; justify-self: start; animation: toast-in 240ms ease-out both; }
  @keyframes toast-in { from { opacity: 0; translate: -50% 8px; } }
  @keyframes toast-out { to { opacity: 0; } }

  .page-title { font-family: var(--font-display); font-size: var(--step-3); color: var(--rosa); }
  .eyebrow { color: var(--rosa); font-size: 0.85rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
  .muted { color: var(--muted); font-weight: 600; }
  .error { color: var(--danger); font-weight: 800; font-size: var(--step--1); }

  .paper-page { display: grid; gap: 18px; }
  .cards { display: grid; gap: 14px; }
  .card {
    background: var(--paper); border-radius: 22px; padding: 14px 16px; box-shadow: 0 5px 0 var(--paper-shade);
    display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center;
  }
  .card-mark { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--paper-soft); }
  .card-mark .icon { width: 36px; height: 36px; }
  [data-mark="star"] { color: #FF2D95; } [data-mark="donkey"] { color: #8A5CF6; } [data-mark="heart"] { color: #FF8A1F; } [data-mark="rocket"] { color: #37B6F5; } [data-mark="skull"] { color: #1FA35B; }
  .card-body { display: grid; gap: 2px; min-width: 0; }
  .card-title { font-family: var(--font-display); font-size: 1.4rem; line-height: 1.1; }
  .card-line { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
  .card-breaks { font-weight: 800; font-size: 0.95rem; color: var(--muted); }
  .card-breaks.is-broken { color: var(--rosa); }
  .card-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .card-actions form { display: contents; }

  .empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 28px 8px; }
  .empty-mark { width: 140px; height: 140px; border-radius: 50%; background: var(--paper); box-shadow: 0 6px 0 var(--paper-shade); display: inline-flex; align-items: center; justify-content: center; color: #FF2D95; }
  .empty-mark .icon { width: 72px; height: 72px; opacity: 0.6; }
  .empty-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; margin-top: 8px; }
  .empty .btn { max-width: 24rem; margin-top: 8px; }

  .icon { width: 26px; height: 26px; }
}

@layer stage {
  .stage-body { overflow: hidden; background: var(--sky); }
  .stage { position: fixed; inset: 0; }
  .patio { position: absolute; inset: 0; overflow: hidden; font-family: var(--font-ui); }
  .patio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
  .patio[data-state="idle"] .patio-canvas, .patio[data-state="playing"] .patio-canvas { cursor: pointer; }

  .bar {
    position: absolute; left: 0; right: 0; top: var(--safe-top); z-index: 5;
    padding: 12px var(--gutter) 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  .bar-right { display: flex; gap: 8px; align-items: center; }

  .hits { position: absolute; left: 0; right: 0; top: calc(74px + var(--safe-top)); display: flex; justify-content: center; gap: 10px; z-index: 4; color: var(--ink); pointer-events: none; }
  /* The skill: three round buttons under the candies, pips for the Tier and, when shut, a padlock with dots for how far along. */
  .tiers { position: absolute; left: 0; right: 0; top: calc(108px + var(--safe-top)); display: flex; justify-content: center; gap: 10px; z-index: 5; pointer-events: none; }
  .tier { pointer-events: auto; flex-direction: column; gap: 4px; }
  .pips { display: flex; gap: 3px; }
  .pips i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .lock { display: none; flex-direction: column; align-items: center; gap: 1px; }
  .lock .icon { width: 20px; height: 20px; }
  .lock-dots { display: flex; gap: 3px; }
  .lock-dots i { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; }
  .lock-dots i.is-on { background: currentColor; }
  .sq.is-locked, .sq.is-locked[aria-pressed] { background: var(--paper-soft); color: var(--muted); box-shadow: 0 var(--drop) 0 var(--paper-shade); }
  .sq.is-locked .pips, .sq.is-locked .when-on, .sq.is-locked .when-off { display: none; }
  .sq.is-locked .lock { display: flex; }
  .sq.is-shaking { animation: shake 420ms ease; }
  @keyframes shake { 20% { translate: -5px 0; } 40% { translate: 5px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
  .patio[data-state="burst"] .tiers, .patio[data-state="broken"] .tiers { display: none; }

  .candy .candy-body, .candy .candy-wrap { fill: var(--paper); transition: fill 200ms ease; }
  .candy.is-hit .candy-body, .candy.is-hit .candy-wrap { fill: #FF2D95; }
  .candy.is-hit { animation: candy-pop 420ms cubic-bezier(.3, 1.6, .5, 1); }
  @keyframes candy-pop { 40% { transform: scale(1.35) rotate(-8deg); } }

  .tag {
    position: absolute; right: 10%; top: calc(26% + var(--safe-top)); z-index: 3; margin: 0; padding: 8px 14px; border-radius: 12px;
    background: var(--paper); color: var(--ink); box-shadow: 0 var(--drop) 0 var(--paper-shade); font-weight: 800; font-size: var(--step-0);
    transform: rotate(8deg); pointer-events: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .coach {
    position: absolute; left: 20px; top: calc(172px + var(--safe-top)); width: min(230px, 62%); z-index: 4; padding: 12px 16px; border-radius: var(--radius);
    background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--paper-shade); transform: rotate(-3deg);
    animation: coach-in 400ms cubic-bezier(.3, 1.6, .5, 1) both; pointer-events: none;
  }
  .coach-title { font-size: 1.2rem; font-weight: 800; line-height: 1.15; }
  .coach-line { margin-top: 4px; font-size: var(--step--1); font-weight: 600; color: var(--muted); }
  .coach-blind { width: min(240px, 64%); }
  @keyframes coach-in { from { opacity: 0; transform: rotate(-3deg) scale(0.6); } }

  .karaoke {
    position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(150px + var(--safe-bottom)); z-index: 4;
    padding: 10px 18px 12px; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--paper-shade);
    transform: rotate(-1deg); pointer-events: none;
  }
  .karaoke-now { font-family: var(--font-display); font-size: clamp(1.5rem, 7.2vw, 1.9rem); line-height: 1; color: var(--rosa); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .karaoke-now.is-new { animation: line-in 260ms ease-out; }
  @keyframes line-in { from { opacity: 0; transform: translateY(8px); } }
  .karaoke-next { margin-top: 2px; font-size: var(--step-0); font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
  .karaoke-bar { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--paper-line); overflow: hidden; }
  .karaoke-fill { height: 100%; width: 0; border-radius: 3px; background: var(--rosa); }

  .dale {
    position: absolute; left: 50%; bottom: calc(28px + var(--safe-bottom)); translate: -50% 0; z-index: 6;
    width: 104px; height: 104px; border-radius: 50%; border: 0; background: var(--rosa); color: var(--on-rosa);
    font-family: var(--font-display); font-size: 1.85rem; letter-spacing: 1px; box-shadow: 0 7px 0 var(--rosa-base); cursor: pointer;
    transition: transform 70ms ease, box-shadow 70ms ease; touch-action: manipulation;
  }
  .dale:active, .dale.is-pressed { transform: translateY(6px); box-shadow: 0 1px 0 var(--rosa-base); }
  .patio[data-state="over"] .dale, .patio[data-state="burst"] .dale, .patio[data-state="broken"] .dale, .patio[data-state="sharing"] .dale { display: none; }
  .patio[data-state="over"] .karaoke, .patio[data-state="burst"] .karaoke, .patio[data-state="broken"] .karaoke { display: none; }
  .patio[data-state="burst"] .hits, .patio[data-state="broken"] .hits, .patio[data-state="burst"] .tag, .patio[data-state="broken"] .tag { display: none; }

  .words-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
  .word {
    position: absolute; translate: -50% -50%; font-family: var(--font-display); font-size: 2.6rem; color: var(--sun); text-shadow: 3px 3px 0 var(--ink);
    animation: word-pop 900ms cubic-bezier(.2, 1.4, .4, 1) both; white-space: nowrap;
  }
  .word-miss { color: var(--paper); font-size: 1.8rem; }
  @keyframes word-pop { 0% { opacity: 0; scale: 0.3; } 25% { opacity: 1; scale: 1.15; } 70% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; translate: -50% -90%; } }

  .sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; padding: 22px var(--gutter) calc(28px + var(--safe-bottom));
    background: var(--paper); color: var(--ink); border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: 0 -6px 0 var(--sun);
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: center; animation: sheet-in 360ms cubic-bezier(.2, 1.2, .4, 1) both;
  }
  .sheet .btn { max-width: 26rem; width: 100%; }
  @keyframes sheet-in { from { translate: 0 100%; } }
  .sheet-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1; color: var(--rosa); text-align: center; }
  .sheet-lead { font-size: 1.2rem; font-weight: 700; text-align: center; }
  .sheet-line { font-size: var(--step--1); font-weight: 600; color: var(--muted); text-align: center; }
  .sheet-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .sheet-share { justify-items: stretch; }
  .sheet-share .sheet-title, .sheet-share .sheet-lead { text-align: left; }
  .link-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
  .link-row .btn, .sheet-row .btn { width: auto; flex: none; }
  .sheet-row .sheet-line { flex: 1; text-align: left; }
  .link-box {
    flex: 1; min-width: 0; height: 52px; padding: 0 14px; display: flex; align-items: center; border: 3px solid var(--paper-line); border-radius: 16px;
    background: #FFFFFF; color: var(--muted); font-size: 0.95rem; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  }

  .burst-layer { position: absolute; inset: 0; z-index: 9; pointer-events: none; }
  .burst-title {
    position: absolute; left: 0; right: 0; top: calc(150px + var(--safe-top)); text-align: center; font-family: var(--font-display);
    font-size: clamp(2.6rem, 14vw, 3.8rem); line-height: 1; color: var(--sun); text-shadow: 4px 4px 0 var(--ink); transform: rotate(-6deg);
    animation: word-in 500ms cubic-bezier(.2, 1.5, .4, 1) both;
  }
  .burst-reward {
    position: absolute; left: 50%; top: calc(222px + var(--safe-top)); translate: -50% 0; padding: 6px 18px; border-radius: 999px;
    background: var(--sun); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
    font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; white-space: nowrap; rotate: 3deg;
    animation: word-in 500ms cubic-bezier(.2, 1.5, .4, 1) both;
  }
  .burst-reward[hidden] { display: none; }
  @keyframes word-in { from { opacity: 0; scale: 0.2; } }
  .papelito {
    position: absolute; left: 50%; top: max(36%, calc(272px + var(--safe-top))); width: min(310px, 82%); translate: -50% 0; padding: 22px 22px 24px; border-radius: 6px;
    background: var(--paper); color: var(--ink); box-shadow: 0 8px 0 var(--paper-shade), 0 18px 30px rgb(43 27 61 / 18%); transform: rotate(2deg);
    background-image: repeating-linear-gradient(0deg, transparent 0 30px, rgb(43 27 61 / 8%) 30px 31px);
    display: grid; gap: 8px; animation: papelito-in 700ms cubic-bezier(.2, 1.3, .4, 1) 700ms both; pointer-events: auto;
  }
  @keyframes papelito-in { from { opacity: 0; translate: -50% -140px; transform: rotate(-30deg) scaleY(0.2); } }
  .papelito-eyebrow { font-size: 0.85rem; font-weight: 800; color: var(--rosa); letter-spacing: 2px; text-transform: uppercase; }
  .papelito-for { font-family: var(--font-display); font-size: 1.8rem; line-height: 1.05; }
  .papelito-note { font-size: 1.2rem; font-weight: 600; line-height: 1.35; white-space: pre-line; }
  .sheet-burst { pointer-events: auto; grid-template-columns: 1fr 1fr; justify-items: stretch; }
  .sheet-burst .btn { font-size: 1.3rem; padding-inline: 12px; }

  .needs-3d {
    position: absolute; left: 28px; right: 28px; top: 36%; z-index: 9; padding: 26px 24px; border-radius: 24px; background: var(--paper); color: var(--ink);
    box-shadow: 0 6px 0 var(--paper-shade); transform: rotate(1deg); display: grid; gap: 10px; text-align: center;
  }
  .needs-3d-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.05; }

  @media (min-width: 900px) {
    .bar { padding: 18px 28px 0; }
    .logo { font-size: 2.75rem; }
    .hits { top: calc(84px + var(--safe-top)); }
    .tiers { left: auto; right: 28px; top: calc(84px + var(--safe-top)); }
    .coach { left: 9%; top: 150px; width: 260px; }
    .coach-title { font-size: 1.35rem; }
    .karaoke { left: 50%; right: auto; width: 520px; translate: -50% 0; bottom: 40px; }
    .dale { left: auto; right: 80px; translate: 0; bottom: 36px; width: 124px; height: 124px; font-size: 2.1rem; }
    .sheet { left: 50%; right: auto; width: 560px; translate: -50% 0; border-radius: var(--radius-l); bottom: 24px; box-shadow: 0 8px 0 var(--sun); }
    .papelito { width: 360px; }
    .tag { right: 30%; }
  }

  /* A phone is narrow: the title and four buttons share one row, so the row tightens before it overflows. */
  @media (max-width: 420px) {
    .patio .bar, .patio .bar-right { gap: 6px; }
    .patio .logo { font-size: 1.8rem; }
    .patio .pill { padding: 0 12px; }
  }

  /* A landscape screen is short: the song and the Dale button stand at the sides so the piñata, in the middle,
     is never covered, and the sheets become a card on the right. */
  @media (orientation: landscape) and (max-height: 620px) and (min-width: 900px) {
    .patio .karaoke { left: calc(24px + env(safe-area-inset-left)); translate: none; bottom: 88px; width: min(340px, 34vw); }
    .patio .karaoke-now { font-size: 1.6rem; }
  }
  @media (orientation: landscape) and (max-height: 520px) {
    .patio .bar { padding: 8px 16px 0; }
    .patio .logo { font-size: 1.8rem; }
    .patio .hits { top: calc(64px + var(--safe-top)); }
    .patio .hits .candy { width: 34px; height: auto; }
    .patio .tiers { left: auto; right: calc(16px + env(safe-area-inset-right)); top: calc(70px + var(--safe-top)); }
    .patio .tag { top: calc(136px + var(--safe-top)); right: calc(16px + env(safe-area-inset-right)); }
    .patio .coach { left: 14px; top: calc(66px + var(--safe-top)); width: min(210px, 34vw); padding: 8px 12px; }
    .patio .coach-title { font-size: 1rem; }
    .patio .coach-line { font-size: 0.8rem; margin-top: 2px; }
    .patio .karaoke { left: calc(14px + env(safe-area-inset-left)); right: auto; translate: none; bottom: 76px; width: min(300px, 31vw); padding: 6px 12px 8px; }
    .patio .karaoke-now { font-size: 1.15rem; }
    .patio .karaoke-next { font-size: 0.85rem; min-height: 1.2em; }
    .patio .karaoke-bar { margin-top: 5px; }
    .patio .dale { left: auto; right: calc(20px + env(safe-area-inset-right)); bottom: calc(16px + var(--safe-bottom)); translate: none; width: 92px; height: 92px; font-size: 1.5rem; }
    .patio .word { font-size: 2rem; }
    .patio .word-miss { font-size: 1.4rem; }

    .patio .sheet {
      left: auto; right: calc(12px + env(safe-area-inset-right)); bottom: 12px; width: min(300px, 44vw); translate: none; border-radius: var(--radius-l);
      padding: 14px 14px 16px; gap: 6px; box-shadow: 0 6px 0 var(--sun); max-height: calc(100dvh - 24px); overflow: auto;
    }
    .patio .sheet .btn { min-height: 48px; font-size: 1.2rem; }
    .patio .sheet-title { font-size: 1.4rem; }
    .patio .sheet-lead { font-size: 1rem; }
    .patio .sheet-share { width: min(380px, 60vw); }
    .patio .sheet-share .sheet-lead { display: none; }
    .patio .sheet-share .link-box { height: 44px; }
    .patio .sheet-share .btn-whatsapp { font-size: 1.2rem; }
    .patio .sheet-burst { grid-template-columns: minmax(0, 1fr); width: min(230px, 38vw); }
    .patio .burst-layer { --rest: min(250px, 42vw); }
    .patio .burst-title { top: calc(56px + var(--safe-top)); right: var(--rest); font-size: 2.4rem; }
    .patio .burst-reward { top: calc(112px + var(--safe-top)); left: calc((100% - var(--rest)) / 2); font-size: 1.2rem; padding: 3px 14px; }
    .patio .papelito { top: calc(156px + var(--safe-top)); left: calc((100% - var(--rest)) / 2 + 36px); width: min(330px, calc(100% - var(--rest) - 96px)); padding: 12px 16px 14px; gap: 4px; }
    .patio .papelito-for { font-size: 1.3rem; }
    .patio .papelito-note { font-size: 1rem; line-height: 1.25; }
  }
}

@layer maker {
  .maker { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; background: var(--paper); display: flex; flex-direction: column; }
  .maker-stage { position: relative; flex: none; height: 330px; background: linear-gradient(var(--sky), var(--sky-low) 50%, var(--wall) 51%); overflow: hidden; }
  .maker-stage .patio-canvas { position: absolute; inset: 0; }
  .maker-stage .bar { gap: 12px; justify-content: flex-start; }
  .tag-preview { top: 150px; right: 14%; }
  .maker-form {
    flex: 1; margin-top: -14px; padding: 24px var(--gutter) calc(76px + var(--safe-bottom)); background: var(--paper); border-radius: var(--radius-l) var(--radius-l) 0 0;
    box-shadow: 0 -6px 0 var(--sun); display: grid; gap: 22px; position: relative; z-index: 2;
  }
  .choice { display: grid; gap: 10px; }
  .choice-title { font-family: var(--font-display); font-size: 1.4rem; color: var(--rosa); }
  .chips { display: grid; gap: 10px; }
  .chips-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chips-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .chips-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .chips-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chip { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 84px; border-radius: var(--radius); background: var(--paper-soft); box-shadow: 0 var(--drop) 0 var(--paper-shade); font-weight: 800; font-size: 0.9rem; cursor: pointer; transition: transform 90ms ease; }
  .chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .chip:has(input:checked) { background: var(--rosa-soft); box-shadow: 0 0 0 3px var(--rosa), 0 var(--drop) 0 var(--rosa); }
  .chip:has(input:focus-visible) { outline: 4px solid var(--focus); outline-offset: 3px; }
  .chip:active { transform: translateY(2px); }
  .chip-icon .icon { width: 34px; height: 34px; }
  .chip-shape:nth-child(1) .chip-icon { color: #FF2D95; } .chip-shape:nth-child(2) .chip-icon { color: #8A5CF6; }
  .chip-shape:nth-child(3) .chip-icon { color: #FF8A1F; } .chip-shape:nth-child(4) .chip-icon { color: #37B6F5; }
  .chip-shape:nth-child(5) .chip-icon { color: #1FA35B; }
  .chips-5 .chip { font-size: 0.8rem; padding-inline: 2px; min-width: 0; overflow-wrap: anywhere; text-align: center; }
  .chip-palette { min-height: 52px; padding: 0; overflow: hidden; border-radius: 14px; }
  .swatches { display: flex; width: 100%; height: 52px; }
  .swatch { flex: 1; }
  .chip-pill { min-height: 52px; border-radius: 999px; font-size: 1rem; }

  [data-palette="fiesta"] .swatch:nth-child(1) { background: #FF2D95; } [data-palette="fiesta"] .swatch:nth-child(2) { background: #FF8A1F; }
  [data-palette="fiesta"] .swatch:nth-child(3) { background: #FFD23F; } [data-palette="fiesta"] .swatch:nth-child(4) { background: #8BD346; } [data-palette="fiesta"] .swatch:nth-child(5) { background: #37B6F5; }
  [data-palette="sky"] .swatch:nth-child(1) { background: #1B6FD6; } [data-palette="sky"] .swatch:nth-child(2) { background: #37B6F5; }
  [data-palette="sky"] .swatch:nth-child(3) { background: #8FE3FF; } [data-palette="sky"] .swatch:nth-child(4) { background: #FFFFFF; } [data-palette="sky"] .swatch:nth-child(5) { background: #FFD23F; }
  [data-palette="garden"] .swatch:nth-child(1) { background: #1FA35B; } [data-palette="garden"] .swatch:nth-child(2) { background: #8BD346; }
  [data-palette="garden"] .swatch:nth-child(3) { background: #FFD23F; } [data-palette="garden"] .swatch:nth-child(4) { background: #FF6FAE; } [data-palette="garden"] .swatch:nth-child(5) { background: #FFFFFF; }
  [data-palette="sunset"] .swatch:nth-child(1) { background: #7A1FA2; } [data-palette="sunset"] .swatch:nth-child(2) { background: #E6007E; }
  [data-palette="sunset"] .swatch:nth-child(3) { background: #FF8A1F; } [data-palette="sunset"] .swatch:nth-child(4) { background: #FFD23F; } [data-palette="sunset"] .swatch:nth-child(5) { background: #FFF1D6; }
  [data-palette="sweet"] .swatch:nth-child(1) { background: #FF9EC9; } [data-palette="sweet"] .swatch:nth-child(2) { background: #FFFFFF; }
  [data-palette="sweet"] .swatch:nth-child(3) { background: #B8E8FF; } [data-palette="sweet"] .swatch:nth-child(4) { background: #FFF3A0; } [data-palette="sweet"] .swatch:nth-child(5) { background: #C9B8FF; }

  [data-palette="ocean"] .swatch:nth-child(1) { background: #0B5FA5; } [data-palette="ocean"] .swatch:nth-child(2) { background: #1BB5B8; }
  [data-palette="ocean"] .swatch:nth-child(3) { background: #7DE8D3; } [data-palette="ocean"] .swatch:nth-child(4) { background: #FFFFFF; } [data-palette="ocean"] .swatch:nth-child(5) { background: #FF8A5C; }

  [data-palette="mexico"] .swatch:nth-child(1) { background: #1FA35B; } [data-palette="mexico"] .swatch:nth-child(2) { background: #FFFFFF; }
  [data-palette="mexico"] .swatch:nth-child(3) { background: #E4262F; } [data-palette="mexico"] .swatch:nth-child(4) { background: #1FA35B; } [data-palette="mexico"] .swatch:nth-child(5) { background: #FFFFFF; }
  [data-palette="marigold"] .swatch:nth-child(1) { background: #FF8A1F; } [data-palette="marigold"] .swatch:nth-child(2) { background: #8A5CF6; }
  [data-palette="marigold"] .swatch:nth-child(3) { background: #FFFFFF; } [data-palette="marigold"] .swatch:nth-child(4) { background: #E6007E; } [data-palette="marigold"] .swatch:nth-child(5) { background: #FFD23F; }
  [data-palette="christmas"] .swatch:nth-child(1) { background: #C8102E; } [data-palette="christmas"] .swatch:nth-child(2) { background: #1FA35B; }
  [data-palette="christmas"] .swatch:nth-child(3) { background: #FFD23F; } [data-palette="christmas"] .swatch:nth-child(4) { background: #FFFFFF; } [data-palette="christmas"] .swatch:nth-child(5) { background: #C8102E; }
  [data-palette="love"] .swatch:nth-child(1) { background: #E6007E; } [data-palette="love"] .swatch:nth-child(2) { background: #FF9EC9; }
  [data-palette="love"] .swatch:nth-child(3) { background: #FFFFFF; } [data-palette="love"] .swatch:nth-child(4) { background: #C8102E; } [data-palette="love"] .swatch:nth-child(5) { background: #FFE3F1; }
  [data-palette="kids"] .swatch:nth-child(1) { background: #37B6F5; } [data-palette="kids"] .swatch:nth-child(2) { background: #FFD23F; }
  [data-palette="kids"] .swatch:nth-child(3) { background: #FF2D95; } [data-palette="kids"] .swatch:nth-child(4) { background: #8BD346; } [data-palette="kids"] .swatch:nth-child(5) { background: #FF8A1F; }

  .field { display: grid; gap: 8px; }
  .field input, .field textarea {
    width: 100%; min-height: 54px; padding: 12px 16px; border: 3px solid var(--paper-line); border-radius: 16px; background: #FFFFFF; color: var(--ink);
    font-weight: 700; font-size: 1.15rem; resize: none;
  }
  .field textarea { font-weight: 600; }
  .field [aria-invalid="true"] { border-color: var(--danger); }
  .field .counter { justify-self: end; color: var(--muted); font-size: var(--step--1); font-weight: 700; }
  .counter.is-over { color: var(--danger); }

  .offline-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); background: var(--sun-soft); border: 3px solid var(--sun); }
  .offline-note .icon { flex: none; width: 30px; height: 30px; }
  .offline-title { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
  .offline-line { margin-top: 4px; font-size: var(--step--1); font-weight: 600; color: var(--muted); }

  /* A landscape phone puts the form beside the preview, like a desktop, instead of below a stage as tall as the screen. */
  @media (orientation: landscape) and (max-height: 520px) and (max-width: 899px) {
    .maker { flex-direction: row; }
    .maker-stage { flex: 1; height: auto; background: linear-gradient(var(--sky), var(--sky-low) 32%, var(--wall) 33%, var(--wall) 82%, var(--tiles) 82.5%); }
    .maker-stage .bar { padding: 8px 14px 0; }
    .maker .logo-title { font-size: 1.4rem; }
    .tag-preview { top: 40%; right: 12%; }
    .maker-form { flex: none; width: min(400px, 56vw); margin: 0; border-radius: 0; box-shadow: -6px 0 0 var(--sun); padding: 18px 18px calc(76px + var(--safe-bottom)); overflow: auto; gap: 16px; }
  }

  @media (min-width: 900px) {
    .maker { flex-direction: row; }
    .maker-stage { flex: 1; height: auto; background: linear-gradient(var(--sky), var(--sky-low) 32%, var(--wall) 33%, var(--wall) 82%, var(--tiles) 82.5%); }
    .maker-stage .bar { padding: 18px 28px 0; }
    .tag-preview { top: 34%; right: 24%; }
    .maker-form { flex: none; width: 520px; margin: 0; border-radius: 0; box-shadow: -6px 0 0 var(--sun); padding: 32px 36px; overflow: auto; }
  }
}

@layer utilities {
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
