:root {color-scheme: light;}
* {box-sizing: border-box;}
[hidden] {display: none !important;}
body {
  min-height: 100svh;
  margin: 0;
  background: radial-gradient(ellipse at 0 0, #ffebeb, transparent 57%), var(--paper);
}
main {width: min(100%, 1072px); margin: auto; padding: 16px clamp(16px,4vw,48px) 32px;}
.hud,.pad,.direction,.ticket,.power {display: flex; align-items: center;}
.hud,.pad {justify-content: space-between;}
.replay {background: transparent; color: var(--ink); min-height: 42px;}
.replay:hover {color: var(--berry);}
.audio {
  --speaker-bg: #fff4df;
  display: grid; place-items: center; flex: 0 0 auto;
  width: 44px; height: 44px; padding: 0;
  background: var(--speaker-bg); color: #492840;
  border: 1.5px solid currentColor; border-radius: 13px;
  cursor: pointer; touch-action: manipulation;
}
.audio svg {display: block; pointer-events: none;}
.audio .slash, .audio[aria-pressed="false"] .waves {display: none;}
.audio[aria-pressed="false"] .slash {display: inline;}
.audio:active {transform: scale(.95);}
.portrait .audio {position: absolute; bottom: 4px; right: 4px; z-index: 1;}
.poster {display: grid; grid-template-columns: 1.12fr .88fr; gap: clamp(28px,5vw,72px); align-items: center; margin: clamp(14px,4vh,48px) auto;}
.portrait {grid-column: 2; grid-row: 1; position: relative; justify-self: center; width: 92%; max-width: 370px; padding: 6px; border: 2px solid var(--ink); background: #fff6db; border-radius: 12px; box-shadow: 6px 6px 0 #77435c;}
.portrait img {display: block; width: 100%; height: auto; image-rendering: pixelated; border-radius: 4px;}
.portrait::after {content: ""; position: absolute; top: -13px; right: -14px; width: 34px; aspect-ratio: 1; background: #bc3459; clip-path: polygon(50% 0,61% 34%,91% 12%,70% 41%,100% 50%,68% 59%,91% 90%,61% 69%,50% 100%,39% 69%,9% 90%,31% 59%,0 50%,31% 40%,10% 10%,39% 34%);}
.signature {position: absolute; bottom: -11px; left: 8%; padding: 5px 15px; transform: rotate(-4deg); background: #ffd875; border: 2px solid var(--ink); border-radius: 5px; font: 710 1rem/1.2 var(--display);}
.cover-copy {grid-row: 1; grid-column: 1; min-width: 0;}
.cover-copy h1 {margin: 0; font: 850 clamp(44px,6vw,83px)/1.02 var(--display); letter-spacing: -.04em;}
.cover-copy h1 em {display: inline-block; color: var(--berry); font-size: .61em; font-style: normal; font-weight: 650; letter-spacing: -.035em; vertical-align: top; margin-top: .16em;}
.cover-copy > p {font-size: clamp(1rem,1.7vw,1.17rem); max-width: 34ch; margin: 12px 0 24px;}
.cover-goal {display: block; margin-top: .18em; color: var(--berry); font: 720 clamp(1rem, 3.8vw, 1.28rem)/1.4 var(--display);}
.cover-copy .bonus-rule {font-size: .93rem; line-height: 1.45; max-width: 36ch; color: var(--muted); margin: 18px 0 0;}
.bonus-rule span {color: var(--berry);}
#cover-music {display:block; min-height:44px; margin:4px 0 0; padding:6px 0; color:var(--berry); background:transparent; border:0; font-weight:750;}
#cover-music span {margin-inline-end:4px;}
.cta,.pad button {display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 50px; padding: 11px 20px; border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; color: var(--ink); font: 780 1rem/1.3 var(--body); background: var(--rose); box-shadow: 0 3px 0 var(--ink);}
.cta span {font-size: .85em;}
.cta:hover,.pad button:hover {filter:brightness(1.045);}
.cta:active,.pad button[data-held],.pad button:active {transform: translateY(2px); box-shadow: 0 1px 0 var(--ink);}
.hud {margin: 0 0 6px; gap: 8px;}
.hud .clips {margin-left: auto;}
.hud h2,.power h2,.gift-stub h2 {font: 680 clamp(1rem,2.3vw,1.65rem)/1.22 var(--display); letter-spacing: -.028em; margin: 0;}
.clips {display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: .89rem; font-weight: 650;}
.clips b {font-variant-numeric: tabular-nums; background: #f9d8dd; padding: 3px 8px; border-radius: 7px; font-weight: 800;}
.rail {height: 5px; background: #e4d6cd; margin-bottom: 8px; border-radius: 3px; overflow: hidden;}
.rail span {display:block; height:100%; width:0; background:#278d85;}
.glass {padding:3px; border:2px solid var(--ink); border-radius:6px; background:#fff8d7; box-shadow:3px 4px 0 var(--ink);}
#world {width:100%; display:block; aspect-ratio:2.6; image-rendering:pixelated;}
.pad {gap:10px; margin-top:16px;}
.direction {gap:10px;}
.pad button {min-width:64px; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; touch-action:none;}
.direction button {background:var(--mint);}
#jump {min-width:130px;}
#jump.charged {background:#ffd875;}
.help {display:grid; align-content:center; margin:0 0 8px; padding:4px 10px; border-inline-start:3px solid #278d85; background:#e9f4e9; color:#25483e; font:700 1rem/1.35 var(--body);}
.keys {font-size:.9rem; color:var(--muted); margin:4px 0 0;}
dialog {border:2px solid var(--ink); border-radius:16px; padding:clamp(18px,4vw,32px); width:min(415px,92vw); background:var(--paper); color:var(--ink);}
dialog::backdrop {background:#30213988;}
.power {gap:18px; align-items:flex-start;}
.power p {margin:10px 0 17px;}
.dryer-pic{position:relative;width:63px;min-width:63px;height:66px;margin-top:5px;transform:rotate(-14deg)}.dryer-pic i,.dryer-pic b,.dryer-pic:after{position:absolute;display:block;border:3px solid var(--ink)}.dryer-pic i{width:52px;height:29px;background:#fd8188;border-radius:16px 6px 5px 15px;z-index:1}.dryer-pic b{width:13px;height:34px;left:10px;top:23px;border-radius:4px;background:#ffb653}.dryer-pic:after{content:"";top:6px;left:48px;width:14px;height:16px;background:#5bc3bc;z-index:2}

@font-face {
  font-family: "Salon Marquee";
  src: url("fonts/SalonMarquee.woff") format("woff");
  font-display: swap;
}
.paper {
  width: min(100%, 560px);
  margin: 0 auto;
  border: 1px solid #c9acbd;
  border-radius: 18px;
  overflow: hidden;
  background: #fff9ed;
}
.party-stage {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  color: #fff5dc;
  background: linear-gradient(165deg, #4b2b61, #292347 62%, #252452);
}
.party-stage::before,.party-stage::after {
  content: ""; position: absolute; z-index: -1;
  top: 26%; left: 9%; width: 3px; height: 3px;
  background: #ffe8a9; box-shadow: -3px 0 #ffe8a9, 3px 0 #ffe8a9, 0 -3px #ffe8a9, 0 3px #ffe8a9;
}
.party-stage::after {left: auto; right: 12%; top: 35%; transform: scale(.75);}
.ticket {
  position: absolute; inset: 2px 4px auto 12px;
  justify-content: space-between; pointer-events: none; color: #d5c8e3;
  font: 600 .78rem/1.4 var(--display); font-variant-numeric: tabular-nums;
}
.ticket .audio {--speaker-bg: #422c56; color: #ffebd4; border-color: #9f829f; pointer-events: auto;}
.paper h1 {
  margin: 0; padding: 6px 8px 18px;
  text-align: center; line-height: 1.1;
}
#letter-title:focus {outline: none;}
#to {
  display: grid; align-content: center; margin: 0 auto 8px; min-height: 36px; max-width: calc(100% - 110px); overflow-wrap: anywhere;
  font: 650 clamp(1.15rem,5.6cqw,1.8rem)/1.25 var(--display);
  letter-spacing: -.035em; color: #aff4dc;
}
.marquee {
  display: block; font: normal clamp(1.9rem,15.25cqw,5.15rem)/1.04 "Salon Marquee", var(--display);
  letter-spacing: 0; color: #fff0aa;
  text-shadow: 0 .065em #f26e98, .048em .11em #823d70;
}
#party {background: #252452;}
#dance {width:100%; display:block; image-rendering:pixelated;}
@font-face {
  font-family: "Caveat";
  src: url("fonts/Caveat.woff") format("woff");
  font-weight: 400 700;
  font-display: swap;
}
.keepsake {
  position: relative;
  padding: clamp(22px,4.8vw,32px) clamp(20px,5.4vw,39px) 14px;
  color: #522d48;
  background: radial-gradient(ellipse at 96% 0, #ffe4df, transparent 56%), #fff7e9;
}
#words, .gift-action, .gift-stub #codebox {
  font-family: "Caveat", cursive;
  font-synthesis: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#words {
  font-size: clamp(1.55rem, 5.9vw, 1.95rem);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: pretty;
}
#words:has(p) {white-space: normal;}
#words p {margin: 0;}
#words .ink-accent {
  display: table;
  position: relative;
  isolation: isolate;
  margin: .19em 0 .32em;
  color: #a72c55;
  font-weight: 700;
  font-size: 1.17em;
  line-height: 1.15;
}
.ink-accent::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 1% -.015em 5%;
  height: .15em;
  background: #ffcfbf;
  border-radius: 65% 35% 70% 30%;
  transform: rotate(-1.6deg);
}
.ink-heart {display: block; width: 72px; height: 27px; margin: 0 0 0 auto; fill: none; stroke: #ae385c; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;}
.note-signoff {display:flex; align-items:center; gap:12px; margin-top:4px;}
.gift-cue {display:inline-flex; align-items:center; gap:5px; padding:0 6px 0 0; min-height:44px; border:0; background:transparent; color:#95254c; font:650 1.5rem/1.1 Caveat,cursive;}
.gift-cue svg {fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round;}
.gift-cue:hover {color:#61213e;}
#gift-section {scroll-margin-top:12px;}
.gift-stub {
  display: grid; justify-items: start;
  position: relative; isolation: isolate;
  padding: 18px clamp(20px,5.4vw,39px) 22px;
  border-top: 2px dashed #d18491;
  color: #6e2445; background: #ffd7d8;
}
.gift-stub::before,.gift-stub::after {
  content: ""; position: absolute; top: -7px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff7e7; border: 1px solid #d2a5a7;
}
.gift-stub::before {left: -8px;} .gift-stub::after {right: -8px;}
.gift-stub h2 {
  font: 650 .75rem/1.5 var(--display);
  letter-spacing: .075em;
  text-transform: uppercase;
  color: #802d4b;
}
#gift {display:block; width:100%; min-width:0; margin-top:10px; text-decoration:none; border-radius:9px; color:#79233e;}
#gift img {display:block; width:100%; height:auto; border-radius:9px; box-shadow:0 3px 9px #57294533;}
.gift-action {display:none;}
#gift[href] .gift-action {display:block; margin-top:8px; text-align:center; font-size:1.55rem; font-weight:650; line-height:1.15; text-decoration:underline; text-underline-offset:.14em;}
#gift[href]:hover img {box-shadow:0 4px 13px #57294566;}
.gift-stub #codebox {margin-top: 10px; font-size: 1.45rem; line-height: 1.15;}
#code {user-select: all; display: inline-block; margin-top: 5px; color: #492339; font: 750 1.12rem/1.4 var(--body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 100%;}
.replay {border:0; text-decoration:underline; text-underline-offset:4px; display:block; margin:10px auto;}
@media(max-width:650px) {
 main {padding:8px 16px max(20px,env(safe-area-inset-bottom));}
 .poster {display:flex; flex-direction:column; gap:26px; text-align:center; margin:12px auto 10px;}
 .portrait {width:min(58vw,30svh,240px);}
 .signature {font-size:.87rem;}
 .cover-copy h1 {font-size:clamp(2.7rem,12.6vw,4.5rem);}
 .cover-copy > p {margin:8px auto 17px; max-width:31ch;}
 .cover-copy .bonus-rule {margin:16px auto 0; max-width:31ch;}
 #cover-music {margin-inline:auto;}
 .glass {padding:2px;}
 #world {aspect-ratio:1.35;}
 .keys {display:none;}
 .help {min-height:calc(2.7em + 8px);}
 .pad {margin-top:13px;}
}
@media(max-height:500px) and (orientation:landscape) {
 main {max-width:min(100%,125vh); padding:3px 8px;}
 .poster {display:grid; grid-template-columns:1.4fr 1fr; gap:18px; margin:13px 0; text-align:left;}
 .portrait {width:min(100%,175px);}
 .cover-copy h1 {font-size:2.1rem;}
 .cover-copy > p,.cover-copy .bonus-rule {margin:5px 0;}
 .keys {display:none;}
 .hud {margin: 0;}
 .rail {margin:1px 0;} .pad {margin-top:5px;} .pad button,.cta {min-height:36px; padding:5px 12px;}
 .help {min-height:calc(2.7em + 4px); margin:3px 0 4px; padding-block:2px; font-size:.9rem;} #world {aspect-ratio:2.6;}
 .glass {max-width:calc((100dvh - 228px - env(safe-area-inset-bottom)) * 2.6 + 8px); margin-inline:auto;}
}
/* Keep the mobile game and its scrollable letter above the hosting badge. */
@media (max-width:900px), (pointer:coarse) {
 body > main {height:calc(100vh - 68px); height:calc(100dvh - 68px - env(safe-area-inset-bottom)); overflow-y:auto;}
}
