/* Unwrap: the experience page */
html, body.exp { height: 100%; }
body.exp {
  overflow: hidden; overscroll-behavior: none; touch-action: manipulation;
  background:
    radial-gradient(120% 70% at 50% 48%, color-mix(in srgb, var(--glow) 30%, transparent) 0%, transparent 60%),
    radial-gradient(140% 90% at 50% 0%, var(--bg1) 0%, var(--bg0) 70%);
  background-color: var(--bg0);
  min-height: 100vh; min-height: 100svh;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 35; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 10px) 0 calc(var(--safe-l) + 10px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.spacer { flex: 1; }
.ribbon { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: rgba(255, 207, 90, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 207, 90, 0.4); color: var(--gold-l); font-size: 14px; font-weight: 700; text-decoration: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); color: var(--ink); cursor: pointer; text-decoration: none; font-weight: 800; font-size: 15px; }
.icon-btn svg { width: 22px; height: 22px; }
#btn-sound .ic-off { display: none; }
#btn-sound[aria-pressed='false'] .ic-on { display: none; }
#btn-sound[aria-pressed='false'] .ic-off { display: block; }

.hero { position: fixed; z-index: 2; left: 0; right: 0; top: calc(var(--safe-t) + 50px); text-align: center; pointer-events: none; padding: 0 16px; transition: opacity 0.4s, transform 0.4s; }
.hero.hide { opacity: 0; transform: translateY(-12px); }
.hero-kick { margin: 0; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero-name { font-size: clamp(30px, min(10vw, 6.4svh), 58px); margin: 2px 0 0; overflow-wrap: anywhere; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-name.long { font-size: clamp(24px, min(7vw, 5svh), 40px); }
.hero-sub { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.hero-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 calc(var(--safe-r) + 16px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 16px); pointer-events: none; }
.step { pointer-events: auto; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; animation: stepIn 0.35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } }
.hint { margin: 0; font-size: 16px; color: var(--muted); max-width: 30em; }
.hint b { color: var(--ink); font-weight: 750; display: block; font-size: 19px; font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.count { margin: 0; font-family: var(--mono); font-weight: 700; font-size: clamp(22px, 7vw, 34px); letter-spacing: 0.04em; color: var(--gold-l); font-variant-numeric: tabular-nums; }
.meter { width: min(300px, 76vw); height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-l)); border-radius: inherit; transition: width 0.15s; }
.guess { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.guess-row { flex-wrap: nowrap; width: min(440px, 100%); }
.guess input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.95); color: var(--paper-ink); font-size: 17px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); }
.guess input::placeholder { color: #9a8a7a; }

.bubble { position: fixed; z-index: 3; left: 0; top: 0; max-width: min(78vw, 320px); padding: 10px 16px; border-radius: 18px; background: #fffaf1; color: var(--paper-ink); font-family: var(--display); font-size: 18px; line-height: 1.25; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transform-origin: 50% 100%; pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 3px; }
.bubble.pop { animation: pop 0.45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { opacity: 0; scale: 0.4; } }

.tease { position: fixed; z-index: 3; left: 0; top: 0; max-width: min(58vw, 230px); padding: 12px 16px 14px; background: #ffe680; color: #3a2a00; font-family: var(--display); font-size: 19px; line-height: 1.2; text-align: center; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), inset 0 -8px 12px rgba(0, 0, 0, 0.04); pointer-events: none; rotate: -5deg; transform-origin: 50% 0; }
.tease::before { content: ''; position: absolute; top: -9px; left: 50%; width: 64px; height: 20px; transform: translateX(-50%) rotate(3deg); background: rgba(255, 255, 255, 0.55); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.tease.pop { animation: slap 0.5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes slap { from { opacity: 0; scale: 1.8; } }
.tease.off { opacity: 0; transition: opacity 0.3s; }

.cover { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: calc(var(--safe-t) + 60px) 16px calc(var(--safe-b) + 20px); background: radial-gradient(80% 60% at 50% 45%, rgba(61, 90, 168, 0.35), transparent 70%), rgba(14, 9, 19, 0.55); transition: opacity 0.5s, visibility 0.5s; overflow-y: auto; }
.cover.gone { opacity: 0; visibility: hidden; }
.cover-card { text-align: center; max-width: 420px; width: 100%; }
.cg-body { fill: var(--cg-paper, #172243); } .cg-lid { fill: var(--cg-paper, #172243); } .cg-shade { fill: rgba(0, 0, 0, 0.22); }
.cg-rib { fill: var(--cg-ribbon, #e2b443); } .cg-dot { fill: var(--cg-dot, #e7c46a); }
.cover-gift { width: clamp(96px, 26svh, 150px); height: auto; animation: wobble 2.4s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 82% { transform: rotate(5deg); } 88% { transform: rotate(-3deg); } 94% { transform: rotate(2deg); } }
.cover-kick { margin: 12px 0 0; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cover-name { margin: 4px 0 0; font-family: var(--display); font-size: clamp(40px, min(13vw, 9svh), 68px); line-height: 1.05; overflow-wrap: anywhere; }
.cover-name.long { font-size: clamp(28px, min(8.5vw, 7svh), 48px); }
.cover-from { margin: 6px 0 22px; color: var(--muted); font-size: 16px; }
.cover-note { margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.cover-err { margin: 12px auto 0; max-width: 30em; font-size: 14px; color: #ffd0c4; }

/* reveal overlay */
.rv-ov { position: fixed; inset: 0; z-index: 30; background: radial-gradient(90% 60% at 50% 35%, rgba(255, 214, 120, 0.16), transparent 70%), rgba(12, 7, 16, 0.78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.rv-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.rv-inner { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(var(--safe-t) + 64px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 28px) calc(var(--safe-l) + 16px); max-width: 640px; margin: 0 auto; }
.rv-kick { margin: 0; font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-l); font-weight: 700; }
.rv-slot { width: 100%; display: flex; justify-content: center; }
.rv-slot > .rv { width: 100%; }
.rv-info { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; animation: stepIn 0.5s ease both; width: 100%; }
.rv-sub { margin: 0; font-size: 18px; line-height: 1.4; max-width: 28em; color: var(--ink); }
.rv-date { margin: 0; padding: 6px 14px; border-radius: 99px; background: rgba(255, 207, 90, 0.14); color: var(--gold-l); font-family: var(--mono); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.code { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16); max-width: 100%; }
.code-lbl { width: 100%; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.code-val { font-family: var(--mono); font-weight: 700; font-size: clamp(17px, 5vw, 22px); letter-spacing: 0.08em; user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }

.note { width: 100%; max-width: 480px; background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 22px 22px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45); rotate: -1deg; animation: noteIn 0.6s cubic-bezier(.2, 1.2, .3, 1) both; background-image: repeating-linear-gradient(180deg, transparent 0 29px, rgba(120, 90, 60, 0.12) 29px 30px); background-position: 0 14px; }
@keyframes noteIn { from { opacity: 0; transform: translateY(40px) rotate(4deg); } }
.note-guess { margin: 0 0 10px; display: inline-block; padding: 4px 12px; border-radius: 99px; background: #fff0b8; color: #5a4300; font-size: 14px; font-weight: 700; }
.note-hi { font-size: 24px; margin: 0 0 10px; }
.note-body p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.55; overflow-wrap: anywhere; }
.note-sign { margin: 6px 0 0; font-family: var(--display); font-size: 19px; text-align: right; overflow-wrap: anywhere; }
.rv-end { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; animation: stepIn 0.5s 0.2s ease both; }

.nojs { position: fixed; inset: auto 16px 40px; text-align: center; z-index: 50; }

/* phone landscape: present on the left, controls on the right */
@media (orientation: landscape) and (max-height: 520px) {
  .hero { top: calc(var(--safe-t) + 8px); left: 0; right: auto; width: 58%; }
  .hero-kick { font-size: 12px; }
  .hero-name { font-size: clamp(24px, 9svh, 40px); }
  .hero-sub { font-size: 13px; margin-top: 0; }
  .dock { left: auto; width: 42%; top: 0; align-items: center; padding-top: calc(var(--safe-t) + 56px); }
  .step { max-width: 360px; }
  .hint { font-size: 14px; }
  .hint b { font-size: 17px; }
  .cover { padding-top: calc(var(--safe-t) + 52px); }
  .cover-card { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: center; text-align: left; max-width: 640px; }
  .cover-gift { grid-row: span 5; width: clamp(80px, 34svh, 140px); }
  .cover-kick, .cover-name, .cover-from, .cover-note, .cover-err { margin-left: 0; }
  .cover-from { margin-bottom: 12px; }
  .cover-card .btn { justify-self: start; }
}
