/* ───────────────────────────────────────────────────────────
   Ho Ho Makan — Y2K desktop collage, Christmas edition
   paper window · ink hairlines · stickers · pager LCD
   ─────────────────────────────────────────────────────────── */

:root {
  --ink: #161514;
  --ink-soft: #4b4843;
  --paper: #f4f0e6;
  --paper-2: #ebe5d7;
  --white: #fffdf8;
  --red: #d22a39;
  --red-deep: #a51b28;
  --green: #1d5a3c;
  --pink: #ff9ec0;
  --sun: #ffe36b;
  --sky-1: #5a78a3;
  --lcd: #b9c99c;
  --rule: 1.5px;
  --radius: 16px;

  --f-scrawl: "Rock Salt", "Comic Sans MS", cursive;
  --f-hand: "Reenie Beanie", "Bradley Hand", cursive;
  --f-serif: "Instrument Serif", Georgia, serif;
  --f-sans: "Schibsted Grotesk", system-ui, sans-serif;
  --f-lcd: "VT323", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font: 400 15px/1.5 var(--f-sans);
  color: var(--ink);
  background: var(--sky-1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--pink); color: var(--ink); }

/* ── Sky, snow, grain ─────────────────────────────────────── */
.sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 120%, #f6cbbd 0%, transparent 60%),
    linear-gradient(180deg, #4f6d99 0%, #7891b8 38%, #b8b2c9 66%, #e9c0c0 88%, #f4d0bf 100%);
}
.cloud {
  position: absolute; border-radius: 50%;
  filter: blur(38px); opacity: .85;
  animation: drift 60s ease-in-out infinite alternate;
}
.c1 { width: 60vw; height: 26vh; left: -14vw; bottom: 4vh; background: #f7b9c4; }
.c2 { width: 46vw; height: 22vh; right: -10vw; bottom: 12vh; background: #ffd2bd; animation-duration: 75s; }
.c3 { width: 38vw; height: 14vh; left: 30vw; top: 12vh; background: rgba(255,255,255,.35); animation-duration: 90s; }
.c4 { width: 30vw; height: 16vh; right: 8vw; top: 34vh; background: rgba(250,200,215,.55); animation-duration: 70s; }
@keyframes drift { to { transform: translateX(6vw) translateY(-1vh); } }

#snow, #confetti { position: fixed; inset: 0; pointer-events: none; }
#snow { z-index: 1; }
#confetti { z-index: 60; }
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .14; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Desk + window frame ──────────────────────────────────── */
.desk {
  position: relative; z-index: 3;
  min-height: 100vh;
  padding: clamp(14px, 4.5vw, 64px) clamp(10px, 4vw, 56px) 96px;
  display: grid; justify-items: center; align-content: start;
}
.loading {
  margin-top: 30vh; text-align: center; color: var(--white);
  font: 400 30px/1 var(--f-hand); text-shadow: 0 1px 8px rgba(0,0,0,.25);
}
.loading .flake { display: inline-block; font-size: 42px; animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.frame {
  width: min(1180px, 100%);
  display: grid;
  gap: var(--rule);
  background: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(25, 30, 70, .55), 0 2px 0 rgba(255,255,255,.4) inset;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 1.8fr) minmax(230px, 1fr);
}
.frame.animate { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.frame.home {
  grid-template-areas:
    "logo intro cta"
    "left crew  side"
    "fl   fm    fr";
}
.frame.profile {
  grid-template-areas:
    "logo hello cta"
    "left main  side"
    "fl   fm    fr";
}
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.985); } }

.cell { background: var(--paper); padding: 24px; position: relative; min-width: 0; }
.frame.animate .cell > * { animation: fadeUp .6s cubic-bezier(.2,.8,.2,1) both; }
.logo { grid-area: logo; } .intro { grid-area: intro; } .cta { grid-area: cta; }
.left { grid-area: left; } .crew { grid-area: crew; } .side { grid-area: side; }
.hello { grid-area: hello; } .main { grid-area: main; }
.fl { grid-area: fl; } .fm { grid-area: fm; } .fr { grid-area: fr; }
.frame.animate .cell:nth-child(2) > * { animation-delay: .06s; }
.frame.animate .cell:nth-child(3) > * { animation-delay: .12s; }
.frame.animate .cell:nth-child(4) > * { animation-delay: .18s; }
.frame.animate .cell:nth-child(5) > * { animation-delay: .24s; }
.frame.animate .cell:nth-child(6) > * { animation-delay: .3s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

/* ── Type ─────────────────────────────────────────────────── */
.scrawl { font-family: var(--f-scrawl); font-weight: 400; line-height: 1.05; letter-spacing: -.01em; margin: 0; }
.hand { font-family: var(--f-hand); font-size: 26px; line-height: 1; }
.serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.01em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px; }
.small { font-size: 12.5px; color: var(--ink-soft); }
h2.cell-title { font: 800 24px/1 var(--f-sans); letter-spacing: -.035em; margin: 0; }
.cell-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

/* ── Logo cell ────────────────────────────────────────────── */
.logo { display: flex; flex-direction: column; justify-content: center; text-decoration: none; min-height: 200px; padding-right: 30px; }
.logo .scrawl { font-size: clamp(34px, 3.4vw, 46px); transform: rotate(-4deg); transform-origin: left; }
.logo .scrawl span { display: block; }
.logo .scrawl span:nth-child(2) { margin-left: .9em; color: var(--red); }
.logo .sub { margin: 18px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); }
.logo .sticker { position: absolute; }

/* ── Stickers ─────────────────────────────────────────────── */
.sticker {
  display: inline-block; line-height: 1; user-select: none; -webkit-user-select: none;
  font-size: var(--s, 54px);
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--r, -6deg));
  filter:
    drop-shadow(1.6px 1.6px 0 #fff) drop-shadow(-1.6px -1.6px 0 #fff)
    drop-shadow(1.6px -1.6px 0 #fff) drop-shadow(-1.6px 1.6px 0 #fff)
    drop-shadow(0 9px 10px rgba(30, 25, 50, .28));
  cursor: grab; touch-action: none;
  transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.sticker:hover { --r: 4deg; }
.sticker.dragging { cursor: grabbing; transition: none; z-index: 20; }
.sticker-label { display: block; font-size: 11px; font-weight: 600; margin-top: 10px; text-align: center; color: var(--ink-soft); }
.sticker-board { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 10px; justify-items: center; align-items: center; padding: 6px 0; }
.sticker-board figure { margin: 0; text-align: center; }

/* ── Torn paper note ──────────────────────────────────────── */
.torn-wrap { filter: drop-shadow(0 10px 14px rgba(40,30,30,.18)) drop-shadow(0 1px 1px rgba(0,0,0,.12)); transform: rotate(-1.2deg); max-width: 560px; margin: 0 auto; }
.torn {
  background: var(--white);
  padding: 22px 26px 26px;
  clip-path: polygon(0 7px, 4% 2px, 8% 6px, 12% 1px, 17% 5px, 21% 0, 26% 6px, 31% 2px, 35% 7px, 40% 1px, 45% 5px, 50% 0, 55% 6px, 60% 2px, 64% 7px, 69% 1px, 74% 5px, 79% 0, 84% 6px, 88% 2px, 93% 6px, 97% 1px, 100% 5px,
    100% calc(100% - 4px), 96% 100%, 91% calc(100% - 6px), 86% calc(100% - 1px), 81% calc(100% - 5px), 76% 100%, 71% calc(100% - 7px), 66% calc(100% - 2px), 61% calc(100% - 6px), 56% 100%, 51% calc(100% - 5px), 46% calc(100% - 1px), 41% calc(100% - 7px), 36% calc(100% - 2px), 31% calc(100% - 6px), 26% 100%, 21% calc(100% - 5px), 16% calc(100% - 1px), 11% calc(100% - 6px), 6% calc(100% - 2px), 2% calc(100% - 7px), 0 calc(100% - 3px));
}
.torn h2 { font: 400 clamp(26px, 2.6vw, 34px)/1.05 var(--f-serif); margin: 0 0 12px; letter-spacing: -.015em; }
.torn h2 em { color: var(--red); }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { font-size: 13px; line-height: 1.35; }
.steps b { display: block; font: 400 22px/1 var(--f-lcd); color: var(--red); margin-bottom: 4px; }
.intro { display: flex; align-items: center; justify-content: center; padding: 30px 34px; }
.intro .sticker { position: absolute; }

/* ── Pager countdown ──────────────────────────────────────── */
.cta { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.pager {
  width: 100%; max-width: 230px;
  background: linear-gradient(155deg, #ffc1d8 0%, #ff86ad 48%, #ec5f8e 100%);
  border: var(--rule) solid var(--ink); border-radius: 24px;
  padding: 14px 14px 12px; position: relative;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.65), inset 0 -8px 14px rgba(120, 0, 40, .22), 0 14px 20px -12px rgba(60, 0, 30, .5);
  transform: rotate(2deg);
}
.pager::before { content: ""; position: absolute; left: 18px; right: 40%; top: 6px; height: 7px; border-radius: 6px; background: rgba(255,255,255,.55); }
.lcd {
  background: linear-gradient(180deg, #c8d7aa, var(--lcd));
  border: var(--rule) solid var(--ink); border-radius: 9px;
  padding: 6px 10px 4px; color: #1b2812;
  font-family: var(--f-lcd); text-align: left;
  box-shadow: inset 0 3px 7px rgba(0,0,0,.22);
}
.pager { container-type: inline-size; }
.lcd .lcd-label { font-size: 16px; line-height: 1; opacity: .75; white-space: nowrap; }
.lcd .lcd-time { font-size: min(40px, calc((100cqi - 26px) / 5)); line-height: .9; letter-spacing: .01em; white-space: nowrap; margin-top: 2px; }
.lcd .lcd-time span { display: block; }
.lcd .lcd-time small { font-size: .55em; }
.lcd .lcd-time .colon { display: inline; animation: blink 1s steps(1) infinite; }
.pager-btns { display: flex; justify-content: space-between; align-items: center; padding: 9px 4px 0; }
.pager-btns i { width: 22px; height: 10px; border-radius: 6px; background: var(--ink); opacity: .85; }
.pager-btns span { font: 700 9px/1 var(--f-sans); letter-spacing: .2em; opacity: .7; }
.cta .when { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.cta .when b { color: var(--ink); font-weight: 700; }

/* ── Sticky note ──────────────────────────────────────────── */
.left { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 30px; }
.sticky {
  width: 100%; max-width: 230px; position: relative;
  background: linear-gradient(170deg, #fff08e 0%, var(--sun) 60%, #f7d64f 100%);
  padding: 26px 20px 22px;
  transform: rotate(var(--r, -2.5deg));
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 16px 18px -14px rgba(70, 50, 0, .55);
  border-bottom-right-radius: 30px 8px;
}
.sticky .tape { position: absolute; top: -11px; left: 50%; width: 86px; height: 24px; transform: translateX(-50%) rotate(-4deg); background: rgba(240, 232, 210, .78); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sticky .hand { font-size: 32px; margin: 0 0 8px; }
.sticky ol { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.4; }
.sticky li + li { margin-top: 6px; }
.sticky li::marker { font-family: var(--f-hand); font-size: 20px; }

/* ── Polaroid ─────────────────────────────────────────────── */
.polaroid {
  margin: 0; width: 100%; max-width: 200px; background: var(--white); padding: 11px 11px 0;
  transform: rotate(var(--r, -4deg));
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 24px -16px rgba(30,20,40,.5);
}
.polaroid .photo { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.polaroid .photo .sticker { --s: 80px; --r: 0deg; cursor: default; }
.polaroid figcaption { font: 400 26px/1 var(--f-hand); padding: 12px 2px 14px; }

/* ── Patterns (crew "photos") ─────────────────────────────── */
.pat-0 { background: repeating-linear-gradient(45deg, var(--red) 0 11px, #fff6ef 11px 22px); }
.pat-1 { background: radial-gradient(circle, #fff 1.4px, transparent 2px) 0 0 / 14px 14px, radial-gradient(circle, rgba(255,255,255,.6) 1px, transparent 1.6px) 7px 7px / 14px 14px, var(--green); }
.pat-2 { background: linear-gradient(90deg, rgba(255,255,255,.45) 50%, transparent 0) 0 0 / 18px 18px, linear-gradient(rgba(255,255,255,.45) 50%, transparent 0) 0 0 / 18px 18px, var(--pink); }
.pat-3 { background: radial-gradient(circle, #ffe36b 1.3px, transparent 2px) 0 0 / 22px 22px, radial-gradient(circle, #fff 1px, transparent 1.5px) 11px 11px / 22px 22px, #22325e; }
.pat-4 { background: repeating-conic-gradient(from 0deg at 50% 50%, #ffe36b 0 9deg, #ffcf3d 9deg 18deg); }
.pat-5 { background: conic-gradient(#bfd4f0 25%, #f8fbff 0 50%, #bfd4f0 0 75%, #f8fbff 0) 0 0 / 20px 20px; }

/* ── Crew wall ────────────────────────────────────────────── */
.crew-count { font: 400 22px/1 var(--f-lcd); }
.crew-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 26px 18px; }
.crew-card { text-align: center; transform: translateY(var(--y, 0)) rotate(var(--t, 0deg)); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.crew-card:hover { transform: translateY(calc(var(--y, 0px) - 4px)) rotate(0deg); }
.crew-photo { aspect-ratio: 1; width: 84%; margin: 0 auto; border: var(--rule) solid var(--ink); display: grid; place-items: center; box-shadow: 3px 3px 0 var(--ink); }
.crew-photo .sticker { --s: 38px; --r: 0deg; cursor: default; }
.crew-name { margin: 10px 0 2px; font-size: 13px; font-weight: 700; line-height: 1.15; }
.crew-status { margin: 0; font-size: 11px; line-height: 1.2; color: var(--ink-soft); }
.crew-status.yes { color: var(--green); font-weight: 700; }
.crew-card.me .crew-name::after { content: " (you)"; font-weight: 400; color: var(--red); }

/* ── Progress meter (Y2K segmented) ───────────────────────── */
.meter { width: 100%; }
.meter-bar { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 3px; padding: 3px; border: var(--rule) solid var(--ink); border-radius: 6px; background: var(--white); }
.meter-bar i { height: 12px; border-radius: 2px; background: var(--paper-2); }
.meter-bar i.on { background: linear-gradient(180deg, #3c8a5f, var(--green)); }
.meter-label { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 600; margin-top: 6px; color: var(--ink-soft); }

.side { display: flex; flex-direction: column; gap: 30px; justify-content: flex-start; }

/* ── Party ticket stub ────────────────────────────────────── */
.stub {
  display: grid; grid-template-columns: 1fr 46px; width: 100%;
  border: var(--rule) solid var(--ink); border-radius: 12px; background: var(--white);
  transform: rotate(2deg); box-shadow: 0 14px 18px -14px rgba(30,20,40,.5);
  -webkit-mask: radial-gradient(circle 7px at calc(100% - 46px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 7px at calc(100% - 46px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 7px at calc(100% - 46px) 0, transparent 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle 7px at calc(100% - 46px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.stub-l { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; min-width: 0; }
.stub-l .eyebrow { margin: 0; color: var(--red); }
.stub-l b { font: 400 22px/1.05 var(--f-serif); }
.stub-r { border-left: 2px dashed var(--ink); display: grid; place-items: center; font: 400 18px/1 var(--f-lcd); writing-mode: vertical-rl; letter-spacing: .08em; }

/* ── Footer cells ─────────────────────────────────────────── */
.fl, .fm, .fr { padding: 14px 20px; font-size: 12px; display: flex; align-items: center; }
.fm { justify-content: center; gap: 10px; flex-wrap: wrap; }
.fr { justify-content: flex-end; text-align: right; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: var(--rule) solid var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 600; background: var(--white); text-decoration: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--rule) solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  cursor: pointer; text-decoration: none;
  box-shadow: 3px 3px 0 var(--red);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--red); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--red); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--white); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.btn.red { background: var(--red); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.link-btn { background: none; border: 0; padding: 0; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink-soft); }

/* ── Profile: hello ───────────────────────────────────────── */
.hello { display: flex; flex-direction: column; justify-content: center; padding: 30px 34px; }
.hello h2 { font: 400 clamp(40px, 5vw, 64px)/.95 var(--f-serif); margin: 0; letter-spacing: -.02em; }
.hello h2 em { color: var(--red); }
.hello p { margin: 12px 0 0; max-width: 46ch; color: var(--ink-soft); }
.hello .hand { color: var(--ink); font-size: 28px; margin-top: 10px; display: inline-block; transform: rotate(-2deg); }
.chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 16px; border: var(--rule) solid var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; background: var(--white); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px rgba(210, 42, 57, .18); animation: blink 1.4s ease-in-out infinite; }
.chip.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(29, 90, 60, .18); animation: none; }
@keyframes blink { 50% { opacity: .35; } }

/* ── Wishlist form: tickets ───────────────────────────────── */
.main { padding: 26px 30px 30px; }
.banner { border: var(--rule) dashed var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 18px; background: var(--white); }
.banner.warn { background: #fff4d0; }
.tickets { display: grid; gap: 16px; }
.ticket {
  margin: 0; border: var(--rule) solid var(--ink); border-radius: 14px;
  background: var(--white);
  padding: 16px 18px 16px 64px; position: relative;
  display: grid; grid-template-columns: 1fr 128px; gap: 10px 12px;
  transition: box-shadow .2s, transform .2s;
}
.ticket:focus-within { box-shadow: 5px 5px 0 var(--ink); transform: translate(-2px, -2px); }
.ticket::before { content: ""; position: absolute; left: 48px; top: 10px; bottom: 10px; border-left: 2px dashed var(--paper-2); }
.ticket legend { position: absolute; left: 0; top: 0; bottom: 0; width: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; }
.ticket legend .num { font: 400 30px/1 var(--f-lcd); color: var(--red); }
.ticket legend .tag { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 6px; }
.ticket.optional { background: repeating-linear-gradient(-45deg, var(--white) 0 14px, #fbf7ee 14px 28px); }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f > span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.f > span em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.f-name { grid-column: 1 / -1; }
.f input, .note-field textarea {
  width: 100%; border: var(--rule) solid var(--ink); border-radius: 10px;
  background: var(--paper); padding: 10px 12px; font: 500 15px/1.3 var(--f-sans); color: var(--ink);
  outline: none; transition: background .15s, box-shadow .15s;
}
.f-name input { font: 400 22px/1.15 var(--f-serif); padding: 8px 12px; }
.f input:focus, .note-field textarea:focus { background: #fff; box-shadow: 0 0 0 3px var(--pink); }
.f input::placeholder, .note-field textarea::placeholder { color: #a39d91; }
.rm { position: relative; }
.rm b { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 800; pointer-events: none; }
.rm input { padding-left: 40px; -moz-appearance: textfield; }
.rm input::-webkit-outer-spin-button, .rm input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ticket .err { grid-column: 1 / -1; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--red); min-height: 0; }
.ticket .err:empty { display: none; }
.ticket.bad { border-color: var(--red); box-shadow: 4px 4px 0 var(--red); }
.note-field { display: block; margin-top: 18px; }
.note-field .hand { display: block; margin-bottom: 6px; }
.note-field textarea { min-height: 76px; resize: vertical; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.form-msg { margin: 0; font-size: 13px; font-weight: 600; flex: 1 1 200px; }
.form-msg.bad { color: var(--red); }
.form-msg.good { color: var(--green); }

/* ── Read-only wish items ─────────────────────────────────── */
.wish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wish {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  border: var(--rule) solid var(--ink); border-radius: 14px; background: var(--white); padding: 14px 16px;
}
.wish .num { font: 400 28px/1 var(--f-lcd); color: var(--red); text-align: center; }
.wish .what { font: 400 22px/1.15 var(--f-serif); margin: 0; overflow-wrap: anywhere; }
.wish .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; font-size: 12.5px; }
.wish .price { font: 400 22px/1 var(--f-lcd); background: var(--sun); border: var(--rule) solid var(--ink); border-radius: 8px; padding: 3px 8px 1px; white-space: nowrap; }
.wish a.go { font-weight: 700; text-decoration: none; border-bottom: var(--rule) solid currentColor; }
.wish a.go:hover { color: var(--red); }
.wish-note { margin-top: 14px; font-family: var(--f-hand); font-size: 26px; line-height: 1.05; background: var(--white); border-left: 4px solid var(--red); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.compact .wish { padding: 10px 14px; grid-template-columns: 36px 1fr auto; }
.compact .wish .what { font-size: 18px; }
.empty-note { border: var(--rule) dashed var(--ink); border-radius: 14px; padding: 18px; text-align: center; font-size: 14px; background: var(--white); }

/* ── Mission envelope ─────────────────────────────────────── */
.mission { display: grid; place-items: center; text-align: center; padding: 18px 0 6px; gap: 18px; }
.envelope {
  --w: min(340px, 82vw);
  width: var(--w); aspect-ratio: 1.55; position: relative; cursor: pointer;
  background: linear-gradient(180deg, #f3dcc0, #ead0ae); border: var(--rule) solid var(--ink); border-radius: 8px;
  box-shadow: 0 22px 28px -20px rgba(60, 30, 10, .6);
  transform: rotate(-2deg); transition: transform .3s cubic-bezier(.3,1.6,.5,1);
  border-width: var(--rule); padding: 0;
}
.envelope:hover { transform: rotate(0deg) scale(1.03); }
.envelope::before {
  content: ""; position: absolute; inset: 0; border-radius: 7px;
  background: linear-gradient(160deg, #f6e4cc, #e8cba6);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  border-bottom: var(--rule) solid var(--ink);
}
.envelope::after { content: ""; position: absolute; inset: 0; border-radius: 7px; background: linear-gradient(to top right, transparent calc(50% - 1px), rgba(22,21,20,.35) 50%, transparent calc(50% + 1px)) left bottom / 50% 60% no-repeat, linear-gradient(to top left, transparent calc(50% - 1px), rgba(22,21,20,.35) 50%, transparent calc(50% + 1px)) right bottom / 50% 60% no-repeat; }
.seal {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 2;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ef5a63, var(--red) 55%, var(--red-deep));
  border: var(--rule) solid var(--ink); display: grid; place-items: center;
  font-size: 28px; color: #ffe1e1; box-shadow: 0 4px 0 rgba(0,0,0,.18);
  animation: wobble 2.4s ease-in-out infinite;
}
@keyframes wobble { 0%, 100% { transform: translate(-50%, -50%) rotate(-6deg); } 50% { transform: translate(-50%, -50%) rotate(6deg) scale(1.06); } }
.envelope .to { position: absolute; left: 18px; bottom: 12px; z-index: 2; font: 400 26px/1 var(--f-hand); }

/* ── Giftee panel ─────────────────────────────────────────── */
.giftee-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.giftee-head .scrawl { font-size: clamp(30px, 4vw, 46px); color: var(--red); transform: rotate(-2deg); display: inline-block; }
.bought-toggle { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 14px 16px; border: var(--rule) solid var(--ink); border-radius: 14px; background: var(--white); cursor: pointer; user-select: none; }
.bought-toggle input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border: var(--rule) solid var(--ink); border-radius: 6px; background: var(--paper); display: grid; place-items: center; cursor: pointer; flex: none; margin: 0; }
.bought-toggle input:checked { background: var(--green); }
.bought-toggle input:checked::after { content: "✓"; color: #fff; font-weight: 800; font-size: 16px; }
.bought-toggle b { display: block; font-size: 14px; }
.bought-toggle span { font-size: 12.5px; color: var(--ink-soft); }
.divider { border: 0; border-top: var(--rule) dashed var(--ink); margin: 28px 0 22px; opacity: .5; }

/* ── Retro window (modal) ─────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(28, 32, 58, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 18px; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.window { width: min(520px, 100%); background: var(--paper); border: var(--rule) solid var(--ink); border-radius: 14px; box-shadow: 8px 8px 0 var(--ink); overflow: hidden; animation: pop .35s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes pop { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.titlebar { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px 9px 16px; border-bottom: var(--rule) solid var(--ink); background: repeating-linear-gradient(0deg, var(--paper) 0 3px, var(--paper-2) 3px 4px); font-size: 13px; font-weight: 700; }
.titlebar .x { width: 26px; height: 26px; border: var(--rule) solid var(--ink); border-radius: 50%; background: var(--white); display: grid; place-items: center; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.titlebar .x:hover { background: var(--red); color: #fff; }
.window-body { padding: 30px 28px 28px; text-align: center; }
.slot { margin: 18px auto 10px; border: var(--rule) solid var(--ink); border-radius: 12px; background: var(--white); padding: 20px 10px; min-height: 110px; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 6px 12px -8px rgba(0,0,0,.3); }
.slot .scrawl { font-size: clamp(30px, 8vw, 46px); transition: color .2s; }
.slot.landed .scrawl { color: var(--red); animation: thump .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes thump { from { transform: scale(1.35) rotate(-4deg); } }
.window .after { opacity: 0; transition: opacity .4s; margin: 14px 0 20px; }
.window .after.show { opacity: 1; }

/* ── Taskbar ──────────────────────────────────────────────── */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgba(244, 240, 230, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: var(--rule) solid var(--ink); font-size: 12.5px;
}
.taskbar .start { display: inline-flex; align-items: center; gap: 6px; border: var(--rule) solid var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 800; background: var(--white); text-decoration: none; box-shadow: 2px 2px 0 var(--ink); white-space: nowrap; }
.taskbar .tasks { display: flex; gap: 6px; align-items: center; flex: 1; overflow-x: auto; scrollbar-width: none; }
.taskbar .tasks::-webkit-scrollbar { display: none; }
.taskbar .task { border: var(--rule) solid var(--ink); border-radius: 8px; padding: 3px 10px; background: var(--paper); white-space: nowrap; cursor: pointer; font-size: 12px; font-weight: 600; text-decoration: none; }
.taskbar .task.on { background: var(--ink); color: var(--paper); }
.taskbar .demo-flag { font-weight: 800; color: var(--red); white-space: nowrap; letter-spacing: .06em; }
.taskbar .clock { font: 400 20px/1 var(--f-lcd); white-space: nowrap; }

/* ── Toast ────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: 66px; z-index: 45; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; transition: opacity .25s, transform .25s; box-shadow: 3px 3px 0 var(--red); max-width: calc(100vw - 30px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Error card ───────────────────────────────────────────── */
.solo { width: min(560px, 100%); margin-top: 8vh; }
.solo .window-body { text-align: left; }
.solo h2 { font: 400 34px/1.05 var(--f-serif); margin: 0 0 10px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .frame { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .frame.home { grid-template-areas: "logo cta" "intro intro" "crew crew" "left side" "fl fr" "fm fm"; }
  .frame.profile { grid-template-areas: "logo cta" "hello hello" "main main" "left side" "fl fr" "fm fm"; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .cell { padding: 20px 18px; }
  .frame { grid-template-columns: minmax(0, 1fr); border-radius: 14px; }
  .frame.home { grid-template-areas: "logo" "intro" "cta" "crew" "left" "side" "fm" "fl" "fr"; }
  .frame.profile { grid-template-areas: "logo" "hello" "main" "cta" "left" "side" "fm" "fl" "fr"; }
  .logo { min-height: 0; padding: 26px 22px; }
  .intro { padding: 26px 16px; }
  .steps { grid-template-columns: 1fr; }
  .hello { padding: 24px 20px; }
  .main { padding: 22px 16px 24px; }
  .ticket { grid-template-columns: 1fr; padding: 14px 14px 14px 54px; }
  .ticket::before { left: 40px; }
  .ticket legend { width: 40px; }
  .wish { grid-template-columns: 30px 1fr; }
  .wish .price { grid-column: 2; justify-self: start; }
  .crew-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 10px; }
  .crew-photo .sticker { --s: 30px; }
  .fl, .fr { justify-content: center; text-align: center; }
  .side { flex-direction: column; }
  .taskbar .clock, .taskbar .start .label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
