:root {
  --red: #b51f38;
  --deep-red: #78172b;
  --green: #176b47;
  --dark-green: #104c38;
  --cream: #fff3d3;
  --gold: #ffc94b;
  --ink: #291a22;
  --pixel: "Press Start 2P", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #102c27; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 22px;
  background-color: #102c27;
  background-image: radial-gradient(#ffffff20 1px, transparent 1px), linear-gradient(135deg, #133f35, #0d2926);
  background-size: 18px 18px, auto;
  overflow-x: hidden;
}
button { font: inherit; }
.page-shell { width: min(100% - 28px, 790px); margin: 24px auto 18px; position: relative; overflow: visible; border: 4px solid var(--ink); box-shadow: 8px 8px 0 #0007; background: var(--cream); }
.pixel-border { border: 4px solid var(--ink); box-shadow: 8px 8px 0 #0007, inset 0 0 0 4px #fff8; }

.hero { position: relative; width: 100%; margin: 0 auto; overflow: hidden; text-align: center; background: var(--red); color: var(--cream); padding: 14px 22px 0; }
.hero-topline { display: flex; justify-content: space-between; gap: 12px; color: #ffe28b; font: 8px/1.7 var(--pixel); padding: 5px 4px 0; }
.blink { animation: blink 1.2s steps(2, end) infinite; }
.hero-copy { padding: 16px 12px 24px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 14px; color: #ffdb75; font: 9px/1.7 var(--pixel); letter-spacing: .5px; }
h1 { margin: 0; color: #fff7df; font: clamp(15px, 4.4vw, 34px)/1.35 var(--pixel); text-shadow: 3px 3px 0 #691328, 5px 5px 0 #42101d; }
h1 span { white-space: nowrap; }
h1 span { color: #ffe17e; }
.hero-subtitle { margin: 12px 0 0; font-size: 27px; color: #ffe9b8; }
.banner-frame { height: clamp(165px, 28vw, 270px); max-width: 900px; margin: 0 auto 20px; overflow: hidden; border: 5px solid #291a22; box-shadow: 0 0 0 4px var(--gold); background: #fff; }
.banner-frame img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 52%; image-rendering: pixelated; }
.marquee { position: relative; z-index: 3; height: 29px; overflow: hidden; margin: 8px -22px 0; background: var(--dark-green); border-top: 3px solid #291a22; color: #ffe17e; font: 9px/26px var(--pixel); white-space: nowrap; }
.marquee-track { display: flex; width: max-content; animation: marquee 18s linear infinite; }
.marquee-track span { display: block; flex: 0 0 auto; }
.hero-sticker { position: absolute; z-index: 2; top: 70px; font-size: clamp(28px, 5vw, 48px); filter: drop-shadow(3px 4px 0 #641328); animation: bob 2s ease-in-out infinite; }
.sticker-left { left: 5%; } .sticker-right { right: 5%; animation-delay: .4s; }

main { width: 100%; max-width: none; margin: 0 auto; }
.draw-card { position: relative; padding: 30px clamp(16px, 5vw, 44px) 12px; text-align: center; background-color: var(--cream); background-image: radial-gradient(#af6c301c 1px, transparent 1px); background-size: 9px 9px; }
.section-heading { display: flex; justify-content: center; align-items: center; gap: 18px; }
.section-heading .eyebrow { color: var(--red); margin-bottom: 11px; font-size: 8px; }
h2 { margin: 0; color: var(--deep-red); font: clamp(15px, 2.8vw, 21px)/1.65 var(--pixel); }
.heading-sparkle { color: #eeaa1e; font-size: 32px; animation: twinkle 1.2s ease-in-out infinite alternate; }
.instruction { margin: 13px 0 22px; color: #554345; font-size: 24px; }
.people-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.person-button { min-height: 83px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 3px solid var(--ink); border-radius: 0; background: #fffaf0; color: var(--deep-red); box-shadow: 4px 4px 0 #311c23; transition: transform .12s steps(2), box-shadow .12s, background .12s; font: 10px var(--pixel); }
.person-button:hover, .person-button:focus-visible { outline: none; transform: translate(-2px, -3px); box-shadow: 6px 7px 0 #311c23; background: #ffdf8c; }
.person-button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-icon { font: 27px/1 var(--body); filter: drop-shadow(1px 2px 0 #d9a449); }

.dice-stage { display: none; margin: 30px auto 12px; color: var(--deep-red); }
.dice-stage.active { display: block; animation: pop-in .3s ease-out both; }
.dice { position: relative; width: 72px; height: 72px; margin: 0 auto; background: #fff; border: 4px solid var(--ink); border-radius: 12px; box-shadow: 5px 5px 0 #8c2034; animation: roll .65s linear infinite; }
.pip { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--red); display: none; }
.p1 { left: 11px; top: 11px; } .p2 { right: 11px; top: 11px; } .p3 { left: 11px; bottom: 11px; } .p4 { right: 11px; bottom: 11px; } .p5 { left: 27px; top: 27px; } .p6 { left: 11px; top: 27px; } .p7 { right: 11px; top: 27px; }
.dice.face-1 .p5 { display: block; }.dice.face-2 .p1,.dice.face-2 .p4 { display:block; }.dice.face-3 .p1,.dice.face-3 .p5,.dice.face-3 .p4 {display:block;}.dice.face-4 .p1,.dice.face-4 .p2,.dice.face-4 .p3,.dice.face-4 .p4 {display:block;}.dice.face-5 .p1,.dice.face-5 .p2,.dice.face-5 .p3,.dice.face-5 .p4,.dice.face-5 .p5 {display:block;}.dice.face-6 .p1,.dice.face-6 .p2,.dice.face-6 .p3,.dice.face-6 .p4,.dice.face-6 .p6,.dice.face-6 .p7 {display:block;}
#dice-caption { margin: 13px 0 0; font: 9px/1.8 var(--pixel); }
.result { margin: 27px auto 0; max-width: 390px; animation: pop-in .6s cubic-bezier(.2,1.7,.5,1) both; }
.result-ribbon { display: inline-block; padding: 9px 13px; background: var(--green); border: 3px solid var(--ink); box-shadow: 3px 3px 0 #311c23; color: #fff6cf; font: 8px/1.5 var(--pixel); transform: rotate(-2deg); }
.result-intro { margin: 20px 0 10px; color: #503538; font-size: 26px; }
.recipient-card { position: relative; padding: 15px 18px 12px; border: 0; background: transparent; box-shadow: none; }
.avatar-wrap { width: 152px; height: 152px; margin: 0 auto 5px; overflow: hidden; border: 4px solid var(--ink); background: #fff4d7; box-shadow: 3px 3px 0 #9f2838; }
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.recipient-name { color: var(--red); font: 18px/1.6 var(--pixel); text-shadow: 2px 2px 0 #ffdd7b; }
.pixel-hearts { color: #e63a48; font-size: 19px; letter-spacing: 5px; animation: heartbeat 1s steps(2, end) infinite; }
.secret-note { margin: 17px 0 0; color: var(--dark-green); font-size: 23px; }
.error-message { color: #9f142e; font-size: 20px; }
.howto { display: flex; width: min(100% - 32px, 620px); justify-content: center; align-items: center; gap: 15px; margin: 14px auto 22px; padding: 13px 18px; background: #d9edc2; text-align: center; color: #244a31; }
.howto p { margin: 0; font-size: 20px; }.howto strong { color: var(--deep-red); }.howto-icon { flex: 0 0 auto; font-size: 25px; }.bounce { animation: bob 1.5s ease-in-out infinite; }
footer { width: 100%; max-width: none; margin: 0 auto; padding: 18px 12px; text-align: center; color: #c7d4bd; background: var(--dark-green); border-top: 4px solid var(--ink); font: 7px/2 var(--pixel); } footer span { color: #ff6872; font-size: 16px; vertical-align: -3px; margin: 0 3px; }

.snow { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: .65; background-image: radial-gradient(2px 2px at 30px 40px, white 98%, transparent), radial-gradient(1px 1px at 80px 130px, white 98%, transparent), radial-gradient(2px 2px at 150px 90px, white 98%, transparent), radial-gradient(1px 1px at 210px 30px, white 98%, transparent); background-size: 250px 190px; animation: snow 12s linear infinite; }
@keyframes blink { 50% { opacity: .35; } } @keyframes bob { 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes twinkle { to { transform: scale(.72) rotate(20deg); opacity: .55; } } @keyframes marquee { to { transform: translateX(-25%); } }
@keyframes roll { 0% { transform: rotate(0) translateY(0); } 25% { transform: rotate(90deg) translateY(-7px); } 50% { transform: rotate(180deg) translateY(0); } 75% { transform: rotate(270deg) translateY(-7px); } 100% { transform: rotate(360deg) translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.72) translateY(15px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes heartbeat { 50% { transform: scale(1.12); } } @keyframes snow { to { background-position-y: 190px; } }
@media (max-width: 640px) {
  .page-shell { width: min(100% - 18px, 790px); margin-top: 12px; }
  .hero { padding-left: 10px; padding-right: 10px; }.hero-topline { font-size: 6px; gap: 4px; }.hero-copy { padding-top: 22px; }.hero-sticker { top: 88px; }.sticker-left { left: 2%; }.sticker-right { right: 2%; }
  .banner-frame { height: 175px; }.banner-frame img { object-position: center; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }.person-button { min-height: 67px; flex-direction: row; font-size: 9px; }.person-button:last-child { grid-column: span 2; }
  .draw-card { padding-top: 23px; }.section-heading { gap: 10px; }.section-heading .eyebrow { font-size: 7px; }.instruction { font-size: 22px; }
  .howto { gap: 8px; padding: 11px; }.howto-icon { font-size: 20px; }.howto p { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
