/* ============================================================
   JPAR Winter Village: pixel holiday UI
   ============================================================ */
:root {
  --night: #0b1638;
  --night-2: #142a66;
  --ink: #1b2340;
  --ink-2: #2d3a63;
  --paper: #fffdf7;
  --paper-2: #f3efe4;
  --snow: #eef4fb;
  /* JPAR blue/red from the JPAR logo; confirm against the brand kit */
  --blue: #015397;
  --blue-d: #013f73;
  --jpar-red: #b82331;
  --teal: #66cccc;
  --gold: #f5c542;
  --gold-d: #c99a1a;
  --red: #d94a4a;
  --red-d: #a8323a;
  --green: #2f8f5b;
  --muted: #5f6886;
  --px: 'Press Start 2P', ui-monospace, monospace;
  /* Small text (form labels, card details, signs, badges, names). Headlines and buttons keep --px. */
  --label: var(--ui);
  --label-weight: 800;
  --label-scale: 1.45;
  /* Body text: Nunito (legible, rounded). Press Start 2P (--px) is kept for headlines and buttons only. */
  --ui: 'Nunito', ui-rounded, system-ui, sans-serif;
  --frame: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.35;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; z-index: 0;
}

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: none;
  height: 100dvh;
}
.screen.is-active { display: flex; animation: screen-in .5s ease both; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- pixel buttons ---------- */
.btn {
  --bg: var(--blue);
  --fg: #fff;
  font-family: var(--px);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  padding: 13px 18px;
  margin: 4px;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  box-shadow: var(--frame), inset -4px -4px 0 0 rgba(0,0,0,.22), inset 4px 4px 0 0 rgba(255,255,255,.28);
  transition: transform .08s, filter .15s;
  text-align: center;
  touch-action: manipulation;
  user-select: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: var(--frame), inset 4px 4px 0 0 rgba(0,0,0,.22); }
.btn:focus-visible { outline: 3px dashed var(--gold); outline-offset: 7px; }
.btn:disabled { filter: grayscale(.8) brightness(.9); cursor: not-allowed; opacity: .7; }
.btn-gold { --bg: var(--gold); --fg: var(--ink); }
.btn-red { --bg: var(--red); }
.btn-green { --bg: var(--green); }
.btn-ghost { --bg: #fff; --fg: var(--ink); }
.btn-small { font-size: 10px; padding: 9px 12px; }
.btn-xl { font-size: 15px; padding: 18px 26px; }
.btn-icon { padding: 7px 10px; font-size: 14px; }
.btn-block { display: block; width: calc(100% - 8px); }

.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* ---------- panel (classic RPG window) ---------- */
.panel {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px #fff, 0 0 0 12px var(--ink), 0 18px 0 10px rgba(0,0,0,.25);
  padding: 22px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.panel h2, .h2 { font-family: var(--px); font-size: 15px; margin: 0; line-height: 1.5; }
.x { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink); padding: 4px 8px; }
.muted { color: var(--muted); }

/* ============================================================
   PRESENT / INTRO (Connie's red sparkly present)
   ============================================================ */
#screen-gift {
  flex-direction: column; align-items: center; justify-content: flex-start; gap: 18px; /* children use margin:auto to center without clipping the top */
  padding: 24px 16px 22px;
  overflow-y: auto;
}
.gift-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin: auto 0; }
.gift-hello:empty { display: none; }
.gift-hello { margin: 0; font-family: var(--px); font-size: 13px; color: var(--gold); }
.gift-kicker { margin: 0; font-family: var(--px); font-size: 12px; line-height: 1.6; color: var(--gold); letter-spacing: .06em; }
.gift-headline {
  margin: 4px 0 0; max-width: 760px; font-family: var(--px); font-size: clamp(18px, 3.8vw, 30px); line-height: 1.5; color: #fff;
  text-shadow: 3px 3px 0 var(--red-d), 6px 6px 0 rgba(0,0,0,.35);
}
.gift-headline em { font-style: normal; color: var(--gold); }
.gift-sub { margin: 0; font-size: 24px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #0b1638, 0 0 8px #0b1638; }
.brand-plate { display: inline-block; background: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: 0 0 0 4px var(--ink), 4px 6px 0 4px rgba(0,0,0,.3); line-height: 0; }
.brand-plate img { display: block; height: 76px; width: auto; }
.brand-plate.small { padding: 3px 6px; border-radius: 3px; box-shadow: 0 0 0 2px var(--ink); vertical-align: middle; margin-right: 6px; }
.brand-plate.small img { height: 22px; }
.gift-cta { margin: 6px 0 0; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(13px * var(--label-scale)); color: var(--gold); background: rgba(11,22,56,.88); padding: 8px 14px; border-radius: 4px; animation: blink 1.2s steps(2) infinite; }

.present-big {
  --tilt: none;
  position: relative; width: 250px; height: 260px; margin-top: 6px; padding: 0; border: 0; background: none; cursor: pointer;
  transform: var(--tilt); transition: transform .2s ease-out; perspective: 800px;
  animation: present-in .9s cubic-bezier(.2,1.3,.4,1) both;
}
.present-big:focus-visible { outline: 3px dashed var(--gold); outline-offset: 10px; }
@keyframes present-in { from { transform: translateY(40px) scale(.85); opacity: 0; } }
.present-big:not(.opening) .pb-box, .present-big:not(.opening) .pb-lid, .present-big:not(.opening) .pb-bow { animation: present-wiggle 3.2s ease-in-out 1.2s infinite; }
@keyframes present-wiggle { 0%, 82%, 100% { rotate: 0deg; } 86% { rotate: -3deg; } 90% { rotate: 3deg; } 94% { rotate: -2deg; } }
.pb-glitter, .pb-box, .pb-lid {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.95) 1px, transparent 2px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, rgba(255,214,214,.85) 1px, transparent 2px) 0 0 / 31px 27px,
    radial-gradient(circle at 40% 80%, rgba(255,240,180,.8) 1px, transparent 2px) 0 0 / 17px 29px,
    linear-gradient(135deg, #ef3445 0%, #b8101f 52%, #e0263a 100%);
}
.pb-box {
  position: absolute; left: 24px; right: 24px; bottom: 0; height: 150px; transform-origin: 50% 100%;
  box-shadow: 0 0 0 4px var(--ink), inset -14px -14px 0 rgba(0,0,0,.18), 0 18px 30px rgba(0,0,0,.45);
  animation: glitter 2.4s linear infinite;
}
@keyframes glitter { to { background-position: 23px 19px, -31px 27px, 17px -29px, 0 0; } }
.pb-rib-v { position: absolute; left: 50%; top: 0; bottom: 0; width: 30px; margin-left: -15px; background: linear-gradient(90deg, #d9a52a, #fff3a0 45%, #f5c542 60%, #c99a1a); box-shadow: 0 0 0 3px var(--ink); }
.pb-rib-h { position: absolute; left: 0; right: 0; top: 54px; height: 28px; background: linear-gradient(#fff3a0, #f5c542 45%, #c99a1a); box-shadow: 0 0 0 3px var(--ink); }
.pb-lid {
  position: absolute; left: 10px; right: 10px; bottom: 146px; height: 46px; z-index: 2; transform-origin: 50% 100%;
  box-shadow: 0 0 0 4px var(--ink), inset -14px -10px 0 rgba(0,0,0,.16);
  animation: glitter 2.4s linear infinite;
}
.pb-bow { position: absolute; left: 50%; bottom: 188px; width: 130px; height: 66px; margin-left: -65px; z-index: 3; transform-origin: 50% 100%; }
.pb-loop {
  position: absolute; bottom: 6px; width: 60px; height: 48px;
  background: linear-gradient(135deg, #fff3a0, #f5c542 50%, #c99a1a);
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  box-shadow: 0 0 0 4px var(--ink), inset -7px -7px 0 rgba(0,0,0,.16);
}
.pb-loop.l { left: 2px; transform: rotate(-22deg); }
.pb-loop.r { right: 2px; transform: rotate(22deg); }
.pb-knot { position: absolute; left: 50%; bottom: 2px; width: 28px; height: 28px; margin-left: -14px; background: #f5c542; box-shadow: 0 0 0 4px var(--ink), inset -5px -5px 0 rgba(0,0,0,.18); }
.pb-tail { display: none; }
.pb-tag {
  position: absolute; right: -26px; bottom: 98px; z-index: 4; padding: 7px 10px 6px;
  background: var(--paper); color: var(--ink); font-family: var(--px); font-size: 9px; line-height: 1.4; white-space: nowrap;
  box-shadow: 0 0 0 3px var(--ink), 3px 3px 0 3px rgba(0,0,0,.2); transform: rotate(9deg); transform-origin: 0 50%;
}
.pb-tag b { color: var(--red-d); }
.pb-glow { position: absolute; left: 50%; top: 55%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; box-shadow: 0 0 80px 60px rgba(255,216,74,.22); pointer-events: none; }
.pb-sparkles i {
  position: absolute; width: 14px; height: 14px; pointer-events: none;
  background: conic-gradient(from 45deg, transparent 0 20%, #fff8c8 20% 30%, transparent 30% 45%, #fff8c8 45% 55%, transparent 55% 70%, #fff8c8 70% 80%, transparent 80%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  background: #fff8c8; animation: twinkle 2.2s ease-in-out infinite;
}
.pb-sparkles i:nth-child(1) { left: -6px; top: 40%; }
.pb-sparkles i:nth-child(2) { right: 2px; top: 6%; animation-delay: .4s; }
.pb-sparkles i:nth-child(3) { left: 12%; bottom: -12px; animation-delay: .9s; }
.pb-sparkles i:nth-child(4) { right: 14%; bottom: 30%; animation-delay: 1.3s; }
.pb-sparkles i:nth-child(5) { left: 40%; top: -8px; animation-delay: .7s; }
.pb-sparkles i:nth-child(6) { right: -14px; bottom: 6%; animation-delay: 1.7s; }
.pb-sparkles i:nth-child(7) { left: 18%; top: 16%; animation-delay: 1.1s; }
.pb-sparkles i:nth-child(8) { left: 62%; top: 44%; animation-delay: .2s; }
@keyframes twinkle { 0%, 100% { transform: scale(.2) rotate(0); opacity: 0; } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } }

/* unwrap: shake, bow pops, lid flies off, light bursts out, box drops away */
.present-big.opening { cursor: default; animation: unwrap-shake .55s ease-in-out; }
@keyframes unwrap-shake { 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(3deg); } }
.present-big.opening .pb-bow { animation: bow-pop .55s .45s cubic-bezier(.3,1.4,.6,1) forwards; }
@keyframes bow-pop { 40% { transform: translateY(-30px) scale(1.25); } to { transform: translateY(-160px) rotate(-30deg) scale(.7); opacity: 0; } }
.present-big.opening .pb-lid { animation: lid-fly .7s .6s cubic-bezier(.5,-0.3,.7,1) forwards; }
@keyframes lid-fly { to { transform: translate(90px, -220px) rotate(38deg); opacity: 0; } }
.present-big.opening .pb-glow { animation: beam 1s .85s ease-out forwards; }
@keyframes beam { to { box-shadow: 0 0 160px 140px rgba(255,236,150,.95); } }
.present-big.opening .pb-box, .present-big.opening .pb-tag { animation: box-away .6s 1.15s ease-in forwards; }
@keyframes box-away { to { transform: translateY(30px) scale(.85); opacity: 0; } }
.present-big.opening .pb-sparkles i { animation-duration: .7s; }

/* unwrapped: headline + "How was your 2026?" */
.unwrapped { width: min(820px, 100%); margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.unwrapped.reveal > * { animation: rise .6s cubic-bezier(.2,1.2,.4,1) both; }
.unwrapped.reveal > *:nth-child(2) { animation-delay: .35s; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.uw-kicker { font-family: var(--px); font-size: 12px; color: var(--gold); letter-spacing: .06em; margin-bottom: 12px; }
.uw-kicker span { color: #ff8a8a; }
.uw-title {
  margin: 0; font-family: var(--px); font-size: clamp(20px, 4.4vw, 34px); line-height: 1.45; color: #fff;
  text-shadow: 3px 3px 0 var(--red-d), 6px 6px 0 rgba(0,0,0,.35);
}
.uw-copy { margin: 14px auto 0; max-width: 600px; font-size: 20px; color: #dbe8ff; }
.uw-copy b { color: #fff; }
.seg { width: 100%; }
.seg-q { margin: 0 0 14px; font-family: var(--px); font-size: clamp(13px, 2.6vw, 17px); color: #fff; line-height: 1.5; }
.seg-direct { margin: 0 auto 16px; max-width: 620px; font-size: 21px; font-weight: 800; line-height: 1.35; color: var(--gold); text-shadow: 0 1px 2px #0b1638, 0 0 8px #0b1638; }
.seg-direct-box { display: inline-block; margin-right: 4px; color: #fff; }
.seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.seg-card {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border: 0; cursor: pointer;
  background: var(--paper); color: var(--ink); box-shadow: 0 0 0 4px var(--ink), 6px 6px 0 4px rgba(0,0,0,.3);
  transition: transform .12s, background .12s;
}
.seg-card:hover { transform: translateY(-3px); background: #fff; }
.seg-card:focus-visible { outline: 3px dashed var(--gold); outline-offset: 7px; }
.seg-card[aria-checked="true"] { background: #eef4ff; box-shadow: 0 0 0 4px var(--blue), 0 0 0 8px var(--ink), 6px 6px 0 8px rgba(0,0,0,.3); }
.seg-em { font-size: 34px; flex: none; }
.seg-box { flex: none; margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 3px var(--ink); font-size: 22px; font-weight: 800; line-height: 1; color: transparent; }
.seg-card[aria-checked="true"] .seg-box { background: var(--blue); color: #fff; }
.seg-box::after { content: '✓'; }
.seg-txt { font-size: 19px; line-height: 1.3; }
.seg-txt b { display: block; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(11px * var(--label-scale)); line-height: 1.6; margin-bottom: 2px; }
.uw-go { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: rise .45s cubic-bezier(.2,1.2,.4,1) both; scroll-margin-bottom: 20px; }
.pip-says { display: flex; gap: 12px; align-items: flex-start; text-align: left; max-width: 640px; background: var(--paper); color: var(--ink); padding: 12px 14px; box-shadow: 0 0 0 4px var(--ink); }
.pip-face { width: 56px; height: 56px; flex: none; image-rendering: pixelated; background: #dfe9f6; box-shadow: 0 0 0 3px var(--ink); }
.pip-says p { margin: 0; font-size: 18px; }
.pip-says b { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: var(--blue); }
.go-direct { margin: 0; max-width: 620px; font-size: 21px; font-weight: 800; line-height: 1.35; color: var(--gold); text-shadow: 0 1px 2px #0b1638, 0 0 8px #0b1638; }
.uw-meta { margin: 0; font-size: 16px; color: #dbe8ff; text-shadow: 0 1px 2px #0b1638, 0 0 8px #0b1638; }
.uw-meta span { white-space: nowrap; }

.skip-link {
  background: none; border: 0; color: #cfe5ff; font-size: 19px; cursor: pointer;
  text-decoration: underline; text-decoration-color: rgba(207,229,255,.5); text-underline-offset: 4px; padding: 8px;
}
.skip-link:hover { color: #fff; text-decoration-color: #fff; }
.unwrapped .skip-link { color: #fff; text-shadow: 0 1px 2px #0b1638, 0 0 10px #0b1638, 0 0 4px #0b1638; }

@media (max-width: 640px) {
  .present-big { transform: scale(.86); margin-top: 0; }
  .gift-sub { font-size: 21px; }
  .seg-direct, .go-direct { font-size: 19px; }
  .seg-grid { grid-template-columns: 1fr; gap: 12px; }
  .seg-card { padding: 11px 13px; }
  .seg-em { font-size: 28px; }
  .seg-txt { font-size: 17px; }
  .uw-copy { font-size: 18px; }
  .btn-xl { font-size: 13px; padding: 16px 18px; }
}

/* ============================================================
   VILLAGE
   ============================================================ */
#screen-village { flex-direction: column; background: rgba(6,12,34,.5); }
.hud {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(#0b1638, #0b1638ee);
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.hud-title { font-family: var(--px); font-size: 11px; color: #cfe5ff; white-space: nowrap; }
.hud-logo { color: var(--teal); }
.hud-sleigh { display: flex; align-items: center; gap: 8px; }
.sleigh-label { font-family: var(--px); font-size: 10px; color: var(--gold); }
.slot {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px;
  background: rgba(255,255,255,.06);
  outline: 3px dashed rgba(255,255,255,.3); outline-offset: -3px;
}
.slot.filled { background: var(--paper); outline: 0; box-shadow: var(--frame), inset -3px -3px 0 rgba(0,0,0,.12); animation: pop .4s cubic-bezier(.3,1.8,.5,1); cursor: pointer; }
@keyframes pop { from { transform: scale(.3); } }
.hud-actions { display: flex; gap: 6px; }
.hud-sleigh.full .sleigh-label::after { content: ' FULL!'; color: #fff; }

.guide {
  position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--gold); color: var(--ink); border-bottom: 4px solid var(--ink); text-align: center;
  animation: rise .4s cubic-bezier(.2,1.2,.4,1) both;
}
.guide:empty, .guide[hidden] { display: none; }
.guide-step { font-family: var(--px); font-size: 10px; line-height: 1.4; background: var(--ink); color: var(--gold); padding: 6px 8px; white-space: nowrap; }
.guide-text { font-size: 20px; font-weight: 800; line-height: 1.3; }
.stage-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px; position: relative; z-index: 2; }
.stage {
  position: relative;
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px #33407a, 0 0 0 12px var(--ink), 0 20px 50px rgba(0,0,0,.55);
  background: var(--snow);
  container-type: inline-size;
}
#game { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; cursor: pointer; touch-action: manipulation; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.map-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--label); font-weight: var(--label-weight); font-size: calc(clamp(7px, 1.55cqw, 11px) * var(--label-scale)); line-height: 1.3;
  color: #fff; background: var(--ink); border: 0;
  padding: 5px 7px 4px; white-space: nowrap;
  box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 3px 0 2px rgba(0,0,0,.35);
  transition: background .2s;
}
.map-label::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -4px;
  border: 4px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.map-label:hover { background: var(--blue); }
.map-label:hover::after { border-top-color: var(--blue); }
.map-label.picked { background: var(--green); }
.map-label.picked::after { border-top-color: var(--green); }
.map-label.goal { background: var(--gold); color: var(--ink); animation: label-pulse 1s ease-in-out infinite; }
@keyframes label-pulse { 50% { scale: 1.1; } }
.map-label.goal::after { border-top-color: var(--gold); }
.ml-badge:empty, .ep-badge:empty { display: none; }
.ml-badge.new, .ep-badge.new {
  font-size: .8em; background: var(--gold); color: var(--ink); padding: 2px 4px 1px; margin-left: 2px;
  animation: blink 1.1s steps(2) infinite;
}

/* off-screen shop pointers (phones) */
.edge-ptr {
  position: absolute; pointer-events: auto; cursor: pointer; z-index: 3;
  display: inline-flex; align-items: center; gap: 5px;
  transform: translateY(-50%);
  font-family: var(--label); font-weight: var(--label-weight); font-size: calc(8px * var(--label-scale)); line-height: 1.2;
  color: #fff; background: var(--ink); border: 0; padding: 6px 6px 5px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 3px 0 2px rgba(0,0,0,.35);
}
.edge-ptr.left { left: 4px; animation: nudge-left 1.2s ease-in-out infinite; }
.edge-ptr.right { right: 4px; flex-direction: row-reverse; animation: nudge-right 1.2s ease-in-out infinite; }
.edge-ptr .ep-icon { font-size: 13px; }
.edge-ptr .ep-badge { font-size: 0; }
.edge-ptr .ep-badge.new { width: 8px; height: 8px; padding: 0; margin: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--ink); animation: pulse 1s ease-in-out infinite; }
.edge-ptr .ep-badge:not(.new):not(:empty) { font-size: 11px; }
.edge-ptr .ep-arrow { color: var(--gold); }
.edge-ptr.is-new { background: var(--blue); }
.edge-ptr.picked { background: var(--green); }
.edge-ptr.goal { background: var(--gold); color: var(--ink); }
.edge-ptr.goal .ep-arrow { color: var(--ink); }
/* quiet states: Post Office before the sleigh is full, visited shops after (signs stay, edge guides hide) */
.labels .edge-ptr.off { display: none; }
.labels .map-label.plain { background: var(--ink); color: #fff; animation: none; }
.labels .map-label.plain::after { border-top-color: var(--ink); }
.labels .map-label.plain:hover { background: var(--blue); }
@keyframes nudge-left { 50% { translate: -4px 0; } }
@keyframes nudge-right { 50% { translate: 4px 0; } }
.hud-shops { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: #cfe5ff; white-space: nowrap; margin-right: 6px; }

/* dialog box */
.dialog {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 4;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--paper); color: var(--ink);
  padding: 12px 16px 14px 12px;
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #fff, 0 0 0 9px var(--ink), 0 10px 0 6px rgba(0,0,0,.25);
  animation: dialog-in .25s cubic-bezier(.2,1.4,.4,1);
  cursor: pointer;
  max-width: 720px; margin: 0 auto;
}
@keyframes dialog-in { from { transform: translateY(20px); opacity: 0; } }
.dialog-portrait { width: 64px; height: 64px; flex: none; image-rendering: pixelated; background: #dfe9f6; box-shadow: 0 0 0 3px var(--ink); }
.dialog-body { flex: 1; min-width: 0; }
.dialog-name { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: var(--blue); margin-bottom: 6px; }
.dialog-text { font-size: 19px; min-height: 2.6em; }
.dialog-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dialog-choices:empty { display: none; }
.dialog-next { position: absolute; right: 14px; bottom: 8px; font-size: 12px; color: var(--red); animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hint {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 14px 12px; font-size: 16px; color: #b9c6ef; text-align: center; min-height: 52px;
}
.hint b { color: #fff; }
.hint-touch { display: none; }
@media (hover: none) { .hint-touch { display: inline; } .hint-desktop { display: none; } }

@media (max-width: 640px) {
  .hud { padding: 8px 10px; }
  .hud-title { display: none; }
  .stage-wrap { padding: 10px 8px; }
  .dialog-text { font-size: 17px; }
  .dialog-portrait { width: 48px; height: 48px; }
  .guide { padding: 8px 10px; gap: 8px; }
  .guide-text { font-size: 17px; }
  .shop-guide { margin: 24px 12px 0; font-size: 17px; }
}

/* ============================================================
   OVERLAYS
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex;
  padding: 24px 16px;
  background: rgba(5,10,30,.72);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  animation: screen-in .25s ease;
}
.overlay > * { margin: auto; }
.map-panel { width: min(520px, 100%); }
.map-list { display: grid; gap: 10px; margin-top: 14px; }
.map-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 0; padding: 12px 14px; cursor: pointer;
  box-shadow: 0 0 0 3px var(--ink); color: var(--ink); font-size: 18px;
}
.map-item:hover { background: #eef4ff; }
.map-item .mi-icon { font-size: 26px; width: 34px; text-align: center; }
.map-item .mi-name { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(11px * var(--label-scale)); display: block; margin-bottom: 3px; }
.map-item .mi-sub { color: var(--muted); font-size: 16px; }
.map-item .mi-badge { margin-left: auto; font-size: calc(13px * var(--label-scale)); font-family: var(--label); font-weight: var(--label-weight); color: var(--green); }

/* ---------- shop ---------- */
.shop-window {
  --accent: var(--blue);
  --wall: #f6e7cf;
  --wall-2: #efd9b8;
  width: min(1020px, 100%);
  background: var(--wall);
  color: var(--ink);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px #fff, 0 0 0 12px var(--ink), 0 24px 0 10px rgba(0,0,0,.25);
  animation: shop-in .35s cubic-bezier(.2,1.3,.4,1);
  position: relative;
}
@keyframes shop-in { from { transform: scale(.92) translateY(18px); opacity: 0; } }
.shop-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--accent); color: #fff;
  border-bottom: 4px solid var(--ink);
  position: relative;
}
.shop-head::after { /* awning scallops */
  content: ''; position: absolute; left: 0; right: 0; bottom: -16px; height: 12px;
  background: radial-gradient(circle at 10px 0, var(--accent) 9px, transparent 10px) 0 0 / 20px 12px repeat-x;
  filter: drop-shadow(0 3px 0 var(--ink));
  z-index: 1;
}
.shop-head h2 { font-family: var(--px); font-size: 15px; margin: 0; text-shadow: 2px 2px 0 rgba(0,0,0,.3); }
.shop-guide { margin: 26px 22px 0; padding: 10px 14px; background: var(--gold); color: var(--ink); font-size: 20px; font-weight: 800; line-height: 1.3; box-shadow: 0 0 0 3px var(--ink); position: relative; z-index: 2; }
.shop-guide:empty { display: none; }
.shop-guide + .shop-body { padding-top: 20px; }
.shop-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 22px; padding: 28px 22px 18px; }
.shop-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.shop-right { min-width: 0; }
.keeper { display: flex; gap: 12px; align-items: flex-start; }
.keeper-portrait { width: 96px; height: 96px; flex: none; image-rendering: pixelated; background: rgba(255,255,255,.6); box-shadow: 0 0 0 3px var(--ink); animation: idle 1.6s steps(2) infinite; }
@keyframes idle { 50% { transform: translateY(-2px); } }
.speech {
  position: relative; flex: 1; background: #fff; padding: 10px 14px; min-height: 96px;
  box-shadow: 0 0 0 3px var(--ink);
}
.speech::before { content: ''; position: absolute; left: -11px; top: 22px; border: 8px solid transparent; border-right-color: var(--ink); border-left: 0; }
.speech-name { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: var(--accent); margin-bottom: 6px; filter: brightness(.8); }
.speech-text { font-size: 18px; }
.toy {
  position: relative; min-height: 230px; display: grid; place-items: center; align-content: center; overflow: hidden;
  background: rgba(255,255,255,.35); box-shadow: 0 0 0 3px var(--ink), inset 0 -40px 0 rgba(0,0,0,.06);
  padding: 14px;
}

.product { scroll-margin-top: 12px; background: var(--paper); padding: 14px; box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 3px rgba(0,0,0,.15); position: relative; }
.product-lock {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--label); font-weight: var(--label-weight); font-size: calc(11px * var(--label-scale)); line-height: 1.8; color: #fff; text-shadow: 2px 2px 0 var(--ink);
  background: rgba(27,35,64,.35); cursor: pointer;
}
.product:not(.locked) .product-lock { display: none; }
@keyframes reveal { 0% { transform: scale(.96); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
.product h3 { font-family: var(--px); font-size: 13px; line-height: 1.5; margin: 14px 0 6px; }
.product p { margin: 0 0 8px; font-size: 17px; }
.product ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 17px; }
.product li::before { content: '✦ '; color: var(--accent); }
.product.locked h3, .product.locked > p, .product.locked ul { filter: blur(5px); user-select: none; pointer-events: none; }

.shop-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px 16px;
  position: sticky; bottom: 0; z-index: 2;
  background: var(--paper); border-top: 4px solid var(--ink);
}
.shop-actions .note { margin-right: auto; font-size: 16px; color: var(--muted); }

/* building themes */
.theme-hall { --accent: #b23a48; color: #fff;
  background: linear-gradient(transparent 62%, #6e1f2a 62%), repeating-linear-gradient(90deg, #8e2b38 0 18px, #a8323a 18px 36px); }
.theme-fireside { --accent: #8a4b2a;
  background: repeating-linear-gradient(0deg, #f6e3cc 0 22px, #ead2b4 22px 24px), #f6e3cc; }
.theme-workshop { --accent: #d06a22;
  background: radial-gradient(circle at 10px 10px, rgba(90,60,30,.22) 2px, transparent 3px) 0 0 / 20px 20px, #ecdcbc; }
.theme-cinema { --accent: #4a5bb8; color: #fff;
  background: radial-gradient(circle at 50% 0, #3b4f8f, #141a3a 70%); }
.theme-hall .speech, .theme-hall .product, .theme-cinema .speech, .theme-cinema .product { color: var(--ink); }
.theme-hall .toy, .theme-cinema .toy { background: rgba(0,0,0,.25); }
.theme-hall .shop-actions { background: #5b1a24; }
.theme-cinema .shop-actions { background: #1b2340; }
.theme-hall .shop-actions .note, .theme-cinema .shop-actions .note { color: #e6dcff; }

@media (max-width: 760px) {
  .shop-body { grid-template-columns: 1fr; padding: 28px 14px 6px; }
  .toy { min-height: 210px; }
  .keeper-portrait { width: 72px; height: 72px; }
  .shop-actions { padding: 10px 10px 12px; justify-content: stretch; gap: 6px; }
  .shop-actions .btn { flex: 1; font-size: 10px; padding: 11px 8px; }
  .shop-actions .note { width: 100%; text-align: center; font-size: 14px; }
  .overlay { padding: 14px 10px; align-items: start; }
}

/* offer preview card */
.oc-hero {
  position: relative; aspect-ratio: 16 / 8; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 20% 25%, rgba(255,255,255,.35) 2px, transparent 3px) 0 0 / 26px 22px, linear-gradient(135deg, var(--accent), #1b2340 140%);
  box-shadow: 0 0 0 2px var(--ink);
}
.oc-em { font-size: 64px; filter: drop-shadow(4px 4px 0 rgba(0,0,0,.25)); transition: filter .6s, transform .6s; }
.product.revealed .oc-em { animation: reveal .7s ease; }
.product.locked .oc-em { filter: blur(10px); transform: scale(1.1); }
.oc-kicker { position: absolute; left: 10px; top: 10px; background: var(--ink); color: #fff; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); padding: 6px 8px; }
.oc-rec { position: absolute; right: 10px; bottom: 10px; background: var(--gold); color: var(--ink); font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); padding: 6px 8px; box-shadow: 0 0 0 2px var(--ink); z-index: 2; }
.oc-facts { display: grid; gap: 8px; margin: 12px 0 0; padding: 10px 12px; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.oc-facts > div { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: start; }
.oc-facts dt { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); line-height: 1.9; color: var(--muted); }
.oc-facts dd { margin: 0; font-size: 16px; display: flex; flex-direction: column; gap: 4px; }
.product.locked .oc-facts { filter: blur(5px); user-select: none; pointer-events: none; }

/* ---------- toys ---------- */
.toy-btn { position: relative; z-index: 2; order: -1; margin-bottom: 16px; }

/* Village Hall: marquee + wall switch */
.marquee-sign {
  width: 230px; padding: 14px; position: relative;
  background: #3a1d24 radial-gradient(circle, #6b4a2a 3px, transparent 4px) 0 0 / 16px 16px;
  box-shadow: 0 0 0 4px var(--ink), 0 8px 0 rgba(0,0,0,.25);
}
.ms-panel { display: grid; gap: 6px; padding: 14px 8px; text-align: center; background: #22121a; box-shadow: 0 0 0 3px var(--ink); font-family: var(--px); font-size: 11px; color: #6b5a4a; transition: color .3s, text-shadow .3s; }
.ms-panel b { font-size: 13px; }
.marquee-sign.on { background: #3a1d24 radial-gradient(circle, #fff3a0 3px, rgba(255,216,74,.55) 5px, transparent 6px) 0 0 / 16px 16px; animation: chase .45s steps(1) infinite; }
@keyframes chase { 50% { background-position: 8px 8px; } }
.marquee-sign.on .ms-panel { color: #fff; text-shadow: 0 0 10px #ffd84a, 2px 2px 0 #a8323a; }
.marquee-sign.on .ms-panel b { color: var(--gold); }
.wall-switch { margin-top: 16px; width: 46px; height: 66px; display: grid; place-items: center; cursor: pointer; background: #f3efe4; box-shadow: 0 0 0 4px var(--ink), inset -4px -4px 0 rgba(0,0,0,.1); }
.ws-toggle { width: 14px; height: 26px; background: #9aa3b5; box-shadow: 0 0 0 3px var(--ink); transform: translateY(8px); transition: transform .15s, background .15s; }
.wall-switch.on .ws-toggle { transform: translateY(-8px); background: var(--green); }

/* Fireside Office: cocoa mug */
.mug-wrap { padding-top: 40px; }
.mug { position: relative; width: 140px; height: 120px; }
.mug-body { position: absolute; left: 0; top: 0; bottom: 0; width: 104px; background: rgba(255,255,255,.75); border-radius: 0 0 20px 20px; box-shadow: 0 0 0 4px var(--ink); overflow: hidden; }
.mug-body::before { content: ''; position: absolute; left: 10px; top: 12px; width: 8px; height: 80px; background: rgba(255,255,255,.8); border-radius: 4px; z-index: 2; }
.cocoa { position: absolute; left: 0; right: 0; bottom: 0; height: 5%; background: linear-gradient(#a8643a, #6b3e1f); transition: height 1.4s cubic-bezier(.4,0,.2,1); }
.mug.full .cocoa { height: 84%; }
.mallows { position: absolute; left: 0; right: 0; top: 12%; display: flex; justify-content: center; gap: 8px; opacity: 0; transform: translateY(-30px); transition: all .4s 1.2s cubic-bezier(.3,1.6,.5,1); }
.mallows i { width: 16px; height: 14px; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.mug.full .mallows { opacity: 1; transform: none; }
.mug-handle { position: absolute; left: 100px; top: 24px; width: 34px; height: 56px; border: 8px solid #d94a4a; border-left: 0; border-radius: 0 22px 22px 0; box-shadow: 4px 0 0 0 var(--ink); }
.steam { position: absolute; left: 22px; top: -38px; width: 60px; height: 36px; display: flex; justify-content: space-between; opacity: 0; transition: opacity .4s 1.4s; }
.steam i { width: 5px; height: 26px; background: rgba(255,255,255,.9); border-radius: 3px; animation: steam 1.6s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: -.5s; } .steam i:nth-child(3) { animation-delay: -1s; }
@keyframes steam { 50% { transform: translateX(5px) scaleY(1.2); opacity: .5; } }
.mug.full .steam { opacity: 1; }

/* The Workshop: assemble a toy robot */
.bench { position: relative; width: 220px; height: 176px; }
.bench-top { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; background: #8a5a2b; box-shadow: 0 0 0 4px var(--ink), inset 0 4px 0 #a8743d; }
.robot { position: absolute; left: 50%; bottom: 24px; width: 80px; margin-left: -40px; display: flex; flex-direction: column; align-items: center; }
.part { opacity: 0; transform: translateY(-150px); box-shadow: 0 0 0 3px var(--ink); position: relative; }
.robot.built .part { animation: drop .4s cubic-bezier(.3,1.5,.5,1) forwards; }
.robot.built .base { animation-delay: .2s; } .robot.built .body { animation-delay: .55s; } .robot.built .head { animation-delay: .9s; }
@keyframes drop { to { opacity: 1; transform: none; } }
.part.head { width: 46px; height: 32px; background: #9fd3e0; }
.part.head::before { content: ''; position: absolute; left: 50%; top: -14px; width: 4px; height: 12px; margin-left: -2px; background: var(--ink); }
.part.head::after { content: ''; position: absolute; left: 50%; top: -20px; width: 10px; height: 10px; margin-left: -5px; background: var(--red); box-shadow: 0 0 0 2px var(--ink); }
.part.head i { position: absolute; top: 11px; width: 7px; height: 7px; background: var(--ink); }
.part.head i:first-child { left: 10px; } .part.head i:last-child { right: 10px; }
.part.body { width: 62px; height: 40px; margin-top: 3px; background: #d94a4a; }
.part.body b { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--gold); box-shadow: 0 0 0 2px var(--ink); }
.part.base { width: 76px; height: 18px; margin-top: 3px; background: var(--green); }
.part.base i { position: absolute; bottom: -9px; width: 14px; height: 14px; border-radius: 50%; background: #2b2135; }
.part.base i:first-child { left: 8px; } .part.base i:last-child { right: 8px; }
.robot.assembled { animation: wiggle .4s ease 2; }

/* Snow Globe Cinema */
.globe { position: relative; width: 176px; height: 198px; cursor: pointer; transform-origin: 50% 90%; }
.globe:focus-visible { outline: 3px dashed var(--gold); outline-offset: 6px; }
.glass {
  position: absolute; left: 6px; top: 0; width: 164px; height: 164px; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.95), rgba(205,232,255,.6) 38%, rgba(150,190,240,.5));
  box-shadow: 0 0 0 4px var(--ink), inset -12px -14px 0 rgba(0,0,0,.08);
}
.glass::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: -6px; height: 40px; background: #fff; border-radius: 50% 50% 0 0 / 60% 60% 0 0; }
.screen-mini {
  position: absolute; left: 32px; right: 32px; top: 52px; height: 58px; z-index: 1;
  display: grid; place-content: center; text-align: center;
  background: var(--ink); color: var(--gold); font-family: var(--px); font-size: 7px; line-height: 1.9; box-shadow: 0 0 0 3px var(--gold);
}
.screen-mini b { font-size: 9px; color: #fff; }
.flakes { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.flakes i { position: absolute; top: -8px; width: 5px; height: 5px; background: #fff; box-shadow: 0 0 0 1px rgba(27,35,64,.3); animation: globe-snow linear forwards; }
@keyframes globe-snow { 30% { transform: translate(-10px, 50px); } 65% { transform: translate(8px, 110px); } to { transform: translate(-4px, 150px); } }
.globe-base { position: absolute; left: 18px; right: 18px; bottom: 0; height: 42px; z-index: 3; background: linear-gradient(#c8323e, #7a2028); border-radius: 6px 6px 2px 2px; box-shadow: 0 0 0 4px var(--ink), inset 0 6px 0 rgba(255,255,255,.2); }
.globe.shake { animation: globe-shake .55s ease; }
@keyframes globe-shake { 20% { transform: rotate(-14deg); } 40% { transform: rotate(11deg); } 60% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } }
.heart { position: absolute; font-size: 22px; pointer-events: none; animation: heart 1.2s ease-out forwards; z-index: 3; }
@keyframes heart { from { transform: translateY(0) scale(.5); opacity: 1; } to { transform: translateY(-110px) scale(1.2); opacity: 0; } }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* ============================================================
   CHECKOUT / POST OFFICE
   ============================================================ */
#screen-checkout { overflow-y: auto; padding: 22px 14px 40px; display: none; justify-content: center; align-items: flex-start; }
#screen-checkout.is-active { display: flex; }
.checkout { position: relative; width: min(900px, 100%); padding: 14px; margin: auto 0;
  background: repeating-linear-gradient(-45deg, var(--red) 0 22px, #fff 22px 34px, var(--blue) 34px 56px, #fff 56px 68px);
  box-shadow: 0 0 0 4px var(--ink), 0 24px 50px rgba(0,0,0,.5);
  animation: shop-in .4s cubic-bezier(.2,1.3,.4,1);
}
.co-inner { background: var(--paper); color: var(--ink); padding: 18px 22px 26px; box-shadow: 0 0 0 4px var(--ink); }
.co-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.co-brand { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: var(--blue); white-space: nowrap; }
.co-steps { display: flex; gap: 6px; }
.co-steps i { width: 26px; height: 8px; background: #d5dae6; box-shadow: 0 0 0 2px var(--ink); }
.co-steps i.on { background: var(--blue); }
.co-steps i.done { background: var(--green); }
.co-body h2 { font-family: var(--px); font-size: clamp(14px, 2.4vw, 18px); line-height: 1.5; margin: 6px 0 8px; }
.co-body .lede { font-size: 19px; margin: 0 0 18px; color: var(--ink-2); }
.co-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 24px; }
.co-actions .spacer { margin-right: auto; }
.co-actions.sticky { position: sticky; bottom: -26px; z-index: 3; background: var(--paper); margin: 18px -22px -26px; padding: 12px 22px 14px; border-top: 4px solid var(--ink); }
@media (max-width: 640px) { .co-actions.sticky { margin: 14px -14px -20px; padding: 10px 14px 12px; bottom: -20px; } }
.co-counter { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(11px * var(--label-scale)); color: var(--blue); }

.gift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gift-card {
  position: relative; text-align: left; padding: 0; border: 0; cursor: pointer; background: #fff; color: var(--ink);
  box-shadow: 0 0 0 3px var(--ink), 5px 5px 0 3px rgba(0,0,0,.12);
  transition: transform .12s, box-shadow .12s;
  display: flex; flex-direction: column;
}
.gift-card:hover { transform: translateY(-3px); }
.gift-card:focus-visible { outline: 3px dashed var(--blue); outline-offset: 6px; }
.gift-card .gc-img { aspect-ratio: 16 / 10; background: #fff center / cover no-repeat; border-bottom: 3px solid var(--ink); }
.gift-card .gc-img.contain { background-size: contain; }
.gift-card .gc-body { padding: 12px 14px 14px; }
.gift-card .gc-pick { font-size: 19px; font-weight: 600; display: block; }
.gift-card .gc-pick .em { font-size: 22px; margin-right: 4px; }
.gift-card .gc-sub { color: var(--muted); font-size: 16px; }
.gift-card .gc-gift { display: block; margin-top: 6px; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); color: var(--blue); line-height: 1.6; }
.gift-card .gc-check {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  background: #fff; box-shadow: 0 0 0 3px var(--ink); font-size: 18px; color: transparent;
}
.gift-card[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--blue), 0 0 0 8px var(--ink), 6px 6px 0 6px rgba(1,83,151,.2); }
.gift-card[aria-pressed="true"] .gc-check { background: var(--blue); color: #fff; }
.gift-card.declined { opacity: .45; filter: grayscale(1); cursor: not-allowed; }
.gift-card .gc-ribbon { position: absolute; left: -6px; top: 14px; background: var(--red); color: #fff; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); padding: 6px 10px; box-shadow: 0 0 0 2px var(--ink); }

.top-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.top-grid.single { grid-template-columns: minmax(0, 420px); justify-content: center; }
.more-gifts { margin-top: 16px; text-align: center; }
.linkish { background: none; border: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 17px; padding: 6px; }

@media (max-width: 640px) {
  .gift-grid, .top-grid { grid-template-columns: 1fr; gap: 14px; }
  .gift-card .gc-img { aspect-ratio: 16 / 8; }
  .co-inner { padding: 14px 14px 20px; }
  .checkout { padding: 10px; }
  .co-brand { display: none; }
}

/* detail hero */
.detail-hero { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; margin-bottom: 18px; background: #fff; padding: 12px; box-shadow: 0 0 0 3px var(--ink); }
.detail-hero img { width: 150px; height: 120px; object-fit: cover; box-shadow: 0 0 0 2px var(--ink); background: #fff; }
.detail-hero img.contain { object-fit: contain; }
.detail-hero h2 { margin: 0 0 6px; }
.detail-hero p { margin: 0; font-size: 17px; }
@media (max-width: 560px) { .detail-hero { grid-template-columns: 1fr; } .detail-hero img { width: 100%; height: 160px; } }

/* form bits */
.field { margin: 0 0 18px; }
.field > label, .field > .label, fieldset > legend {
  display: block; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); line-height: 1.6; margin-bottom: 8px; color: var(--ink);
}
.field .opt { color: var(--muted); font-family: var(--ui); font-size: 15px; text-transform: none; margin-left: 4px; }
.field .help { font-size: 15px; color: var(--muted); margin-top: 6px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: 18px; padding: 11px 12px; color: var(--ink);
  background: #fff; border: 0; box-shadow: 0 0 0 3px var(--ink); border-radius: 0;
  appearance: none;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; box-shadow: 0 0 0 3px var(--blue), 0 0 0 7px rgba(1,83,151,.2); }
.input.invalid { box-shadow: 0 0 0 3px var(--red), 0 0 0 7px rgba(217,74,74,.18); }
.err { color: var(--red-d); font-size: 15px; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 0; } }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 0; background: #fff; color: var(--ink); cursor: pointer; padding: 9px 13px; font-size: 17px;
  box-shadow: 0 0 0 3px var(--ink); display: inline-flex; align-items: center; gap: 6px;
  transition: transform .08s;
}
.chip:hover { background: #eef4ff; }
.chip:active { transform: translateY(2px); }
.chip[aria-pressed="true"] { background: var(--blue); color: #fff; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip .ic { font-size: 19px; }


.field > label.check { display: flex; gap: 10px; align-items: center; font-family: var(--ui); font-size: 17px; margin-top: 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.gc-cta { display: block; margin-top: 10px; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(10px * var(--label-scale)); color: #fff; background: var(--blue); padding: 9px 10px; text-align: center; box-shadow: inset -3px -3px 0 rgba(0,0,0,.2); }
.gift-card:hover .gc-cta { background: var(--blue-d); }
.top-grid .gc-check { display: none; }

.callout { padding: 14px 16px; background: #eef4ff; box-shadow: 0 0 0 3px var(--ink); font-size: 18px; margin-bottom: 18px; }
.callout.gold { background: #fff7dc; }
.yay { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(11px * var(--label-scale)); color: var(--green); line-height: 1.6; margin-top: 10px; }
.privacy { font-size: 15px; color: var(--muted); margin-top: 14px; }

.wrapping { text-align: center; padding: 40px 10px; }
.wrapping .box { font-size: 60px; display: inline-block; animation: shake .5s ease-in-out infinite; }
@keyframes shake { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ============================================================
   DONE
   ============================================================ */
#screen-done { align-items: center; justify-content: center; padding: 20px 16px; overflow-y: auto; }
.done { width: min(640px, 100%); text-align: center; position: relative; }
.done .panel { padding: 30px 26px 26px; }
.present { width: 120px; height: 110px; margin: 0 auto 20px; position: relative; }
.present .p-box { position: absolute; left: 10px; right: 10px; bottom: 0; height: 74px; background: var(--red); box-shadow: 0 0 0 4px var(--ink), inset -8px -8px 0 rgba(0,0,0,.15); }
.present .p-lid { position: absolute; left: 0; right: 0; top: 18px; height: 24px; background: var(--red); box-shadow: 0 0 0 4px var(--ink), inset -8px -6px 0 rgba(0,0,0,.15); animation: lid 1s .4s cubic-bezier(.3,1.6,.5,1) forwards; }
.present .p-rib-v { position: absolute; left: 50%; margin-left: -9px; width: 18px; top: 18px; bottom: 0; background: var(--gold); }
.present .p-bow { position: absolute; left: 50%; top: 0; margin-left: -26px; width: 52px; height: 22px; background: radial-gradient(circle at 25% 50%, var(--gold) 10px, transparent 11px), radial-gradient(circle at 75% 50%, var(--gold) 10px, transparent 11px); animation: lid 1s .4s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes lid { to { transform: translateY(-36px) rotate(-14deg); } }
.present .p-glow { position: absolute; left: 50%; top: 40px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; box-shadow: 0 0 60px 40px rgba(255,216,74,.8); opacity: 0; animation: glow 1s .6s forwards; }
@keyframes glow { to { opacity: 1; } }
.done h1 { font-family: var(--px); font-size: clamp(16px, 3.6vw, 24px); line-height: 1.5; margin: 0 0 10px; }
.done p { font-size: 19px; margin: 0 0 12px; }
.done .gift-line { font-family: var(--px); font-size: 12px; color: var(--blue); line-height: 1.8; margin: 14px 0; }
.done .sig { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.done .sig img { height: 34px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; font-size: 17px; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink); animation: toast 2.6s ease forwards; max-width: min(90vw, 440px); text-align: center; }
@keyframes toast { 0% { transform: translateY(-14px); opacity: 0; } 10%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   JPAR additions: train, recommendation, placeholders, confirmation
   ============================================================ */
/* the building Pip recommends */
.map-label.rec, .edge-ptr.rec { background: var(--gold); color: var(--ink); animation: label-pulse 1.2s ease-in-out infinite; }
.map-label.rec::after { border-top-color: var(--gold); }
.edge-ptr.rec .ep-arrow { color: var(--ink); }
/* topic train sign (below the tree, arrow points up) */
.labels .train-label { transform: translate(-50%, 0); background: #2b2135; }
.labels .train-label::after { top: -5px; bottom: auto; border: 4px solid transparent; border-bottom-color: #2b2135; border-top: 0; }
.labels .train-label:hover { background: var(--blue); }
.labels .train-label:hover::after { border-bottom-color: var(--blue); }

/* train topic card */
.topic-panel { width: min(500px, 100%); }
.topic-car {
  margin: 14px auto 6px; width: 170px; height: 92px; position: relative; display: grid; place-items: center;
  background: var(--car); box-shadow: 0 0 0 4px var(--ink), inset 0 12px 0 rgba(255,255,255,.28), inset -8px -8px 0 rgba(0,0,0,.15);
}
.topic-car::before, .topic-car::after { content: ''; position: absolute; bottom: -16px; width: 24px; height: 24px; border-radius: 50%; background: #2b2135; box-shadow: inset 0 0 0 6px #6d7488; }
.topic-car::before { left: 22px; } .topic-car::after { right: 22px; }
.tc-em { font-size: 44px; }
.tc-week { position: absolute; left: 8px; top: 8px; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); color: #fff; text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink); }
.topic-name { font-family: var(--px); font-size: 14px; line-height: 1.5; text-align: center; margin: 28px 0 8px; }
.topic-teaser { font-size: 19px; text-align: center; margin: 0 0 10px; }
.topic-more { font-size: 16px; text-align: center; margin: 0; }
.topic-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.topic-dots { display: flex; gap: 6px; }
.topic-dots i { width: 10px; height: 10px; background: #d5dae6; box-shadow: 0 0 0 2px var(--ink); }
.topic-dots i.on { background: var(--blue); }

/* offer tiles (Post Office cards and #1 hero) */
.offer-live { --tile: linear-gradient(135deg, #d0485a, #7a1f2c); }
.offer-consult { --tile: linear-gradient(135deg, #b8774a, #5b2f17); }
.offer-group { --tile: linear-gradient(135deg, #f0a050, #b0561a); }
.offer-recordings { --tile: linear-gradient(135deg, #6f84e0, #24306e); }
.gift-card .gc-tile { position: relative; display: grid; place-items: center; background: radial-gradient(circle at 20% 25%, rgba(255,255,255,.3) 2px, transparent 3px) 0 0 / 26px 22px, var(--tile); }
.gc-em { font-size: 58px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.25)); }
.gc-shop { position: absolute; left: 10px; bottom: 8px; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(9px * var(--label-scale)); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.4); }
.gift-card .gc-pick { font-size: 20px; }
.gc-ribbon.gold { background: var(--gold); color: var(--ink); }
.dh-tile { width: 150px; height: 120px; display: grid; place-items: center; font-size: 56px; background: var(--tile); box-shadow: 0 0 0 2px var(--ink); }
.detail-hero .also { margin-top: 8px; font-size: 16px; color: var(--ink-2); }
@media (max-width: 560px) { .dh-tile { width: 100%; height: 110px; } }

/* placeholders: dashed gold outline + TBD tag, so reviewers see what JPAR still needs to supply */
.ph { outline: 2px dashed #e0a800; outline-offset: 1px; background: rgba(255,216,74,.2); padding: 0 3px; }
.ph-tag { font-style: normal; font-family: var(--label); font-weight: var(--label-weight); font-size: calc(7px * var(--label-scale)); line-height: 1; background: #e0a800; color: #1b2340; padding: 3px 4px; margin-left: 6px; vertical-align: middle; letter-spacing: .05em; }
.is-ph { outline: 2px dashed #e0a800; outline-offset: 3px; }
.chip .ph { background: transparent; outline: 0; padding: 0; }
.chip[aria-pressed="true"] .ph-tag { background: #fff3a0; }

/* about you */
.field.consent > label.check { align-items: flex-start; margin-top: 4px; padding: 12px 14px; background: #f4f7fd; box-shadow: 0 0 0 3px var(--ink); }
.field.consent input { flex: none; margin-top: 2px; }
.fine-print { font-size: 14px; color: var(--muted); margin-top: 8px; }
.fine-print a { color: var(--blue); }

/* confirmation */
.instant { margin: 6px 0 16px; padding: 14px 16px; background: #f4f7fd; box-shadow: 0 0 0 3px var(--ink); text-align: left; }
.instant .muted { font-size: 16px; margin: 10px 0 0; }
.iv-lede { font-size: 19px; margin: 0 0 10px !important; }
.iv-links { display: grid; gap: 8px; }
.iv-link { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; color: var(--ink); text-decoration: none; font-size: 18px; box-shadow: 0 0 0 3px var(--ink); }
.iv-link:hover { background: #eef4ff; }
.iv-dates { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 18px; }
.iv-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 4px; }
.iv-row .btn { text-decoration: none; }
.demo-note { font-size: 16px !important; text-align: left; background: #fff7dc; padding: 10px 12px; box-shadow: 0 0 0 3px var(--ink); }
.done .sig .brand-plate img { height: 64px; }
.referral { margin: 16px 0 4px; padding: 14px; background: #fff; box-shadow: 0 0 0 3px var(--ink); text-align: left; }
.referral h3 { font-family: var(--label); font-weight: var(--label-weight); font-size: calc(12px * var(--label-scale)); margin: 0 0 8px; }
.referral p { font-size: 16px !important; }
.ref-row { display: flex; gap: 8px; }
.ref-row .input { flex: 1; font-size: 15px; }

/* the host (Jonathan) */
.host img { object-fit: cover; flex: none; background: #dfe9f6; box-shadow: 0 0 0 3px var(--ink); }
.host-lg { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.host-lg img { width: 72px; height: 72px; }
.host-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.host-kicker { font-family: var(--label); font-weight: var(--label-weight); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); }
.host-name { font-size: 18px; line-height: 1.2; }
.host-title { font-size: 15px; color: var(--ink-2); }
.host-creds { font-size: 14px; color: var(--muted); }
.host-more summary { cursor: pointer; font-size: 15px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.host-more p { margin: 6px 0 0; font-size: 15px; }
.product.locked .host-lg { filter: blur(5px); user-select: none; pointer-events: none; }
.host-sm { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }
.host-sm img { width: 40px; height: 40px; }
.instant .host-sm { margin: 0 0 12px; }

.field.consent.invalid > label.check { box-shadow: 0 0 0 3px var(--red), 0 0 0 7px rgba(217,74,74,.18); }
