/* Secret Santa — pixel "cosy room" theme, from the "Gift Exchange Website" design. */

@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/press-start-2p-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/press-start-2p-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/vt323-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/vt323-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #140C1C;
  --cream: #FFF1C9;
  --yellow: #FFEC27;
  --red: #E8432A;
  --accent: #FFEC27;
  --pixel: 'Press Start 2P', monospace;
  --term: 'VT323', monospace;
}

body { margin: 0; background: #5E321D; }
a { color: var(--yellow); }
a:hover { color: var(--cream); }

/* ---- Room: wall, floor, footer ---- */
.wall {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--cream);
  font-family: var(--term);
  background-color: #5E321D;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(20,12,28,.14) 12px 14px, transparent 14px 30px, rgba(255,241,201,.05) 30px 32px, transparent 32px 48px),
    repeating-linear-gradient(90deg, #6B3A22 0 45px, #3A1E10 45px 48px, #5C311C 48px 93px, #3A1E10 93px 96px);
}
.floor {
  border-top: 4px solid var(--ink);
  padding: 20px;
  display: flex;
  justify-content: center;
  background-image: repeating-linear-gradient(0deg, #A0522D 0 20px, #6B3414 20px 24px);
}
.floor span {
  background: var(--ink);
  padding: 10px 14px;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.6;
  color: var(--cream);
  text-align: center;
}

/* Pixel border with a drop shadow. */
.px { box-shadow: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink), 10px 10px 0 0 rgba(20,12,28,.45); }

/* ---- Header (name and gift pages) ---- */
.top {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 24px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand span { font-family: var(--pixel); font-size: 14px; color: var(--yellow); text-transform: uppercase; }
.top a { font-family: var(--pixel); font-size: 12px; min-height: 44px; display: inline-flex; align-items: center; }

/* ---- Type ---- */
.title {
  margin: 0;
  font-family: var(--pixel);
  font-weight: 400;
  line-height: 1.2;
  color: var(--yellow);
  text-align: center;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--ink);
  overflow-wrap: anywhere;
}
.kicker { margin: 0; font-family: var(--pixel); font-size: 14px; line-height: 1.6; color: var(--yellow); text-align: center; text-transform: uppercase; }
.lead { margin: 0; font-size: 30px; line-height: 1.15; }
.note { margin: 0; font-size: 26px; text-align: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 24px;
  box-sizing: border-box;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 16px;
  text-decoration: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: transform .08s steps(1);
}
.btn:hover { color: var(--ink); transform: translate(-2px, -2px); }
.btn:active { transform: translate(2px, 2px); }
.btn.small { font-size: 13px; padding: 0 22px; }
.btn.light { background: var(--cream); }

/* ---- Card (cream panel) ---- */
.panel {
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background-color: var(--cream);
  color: var(--ink);
}
.panel p { margin: 0; font-size: 28px; line-height: 1.2; }

/* ================= 1 · Password ================= */
.login-main { flex: 1; display: flex; justify-content: center; padding: 48px 20px 32px; }
.login-col { width: 100%; max-width: 680px; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.login-col .kicker { font-size: 12px; letter-spacing: 0.08em; }
.login-col .title { font-size: clamp(32px, 6vw, 60px); line-height: 1.15; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field label { font-family: var(--pixel); font-size: 12px; color: #6B3414; }
.pw {
  box-sizing: border-box;
  width: 100%;
  height: 60px;
  padding: 0 16px;
  font-family: var(--term);
  font-size: 34px;
  color: var(--cream);
  background: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 0;
}
.pw:focus { outline: 4px solid var(--red); outline-offset: 2px; }
.panel .error { font-size: 26px; color: #A3123A; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.actions .hint { font-size: 22px; color: #5A4A55; }

/* ================= 2 · Choose your name ================= */
.who-main {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 44px;
}
.who-intro { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; max-width: 720px; }
.who-intro .title { font-size: clamp(24px, 4.5vw, 46px); line-height: 1.25; }
.cards { width: 100%; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px; }
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 96px;
  padding: 20px 22px;
  box-sizing: border-box;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  border-top: 10px solid var(--c, #FF77A8);
  transition: transform .08s steps(1);
}
.card span { font-size: 40px; line-height: 1; overflow-wrap: anywhere; }
.card:hover, .card:focus-visible { color: var(--ink); transform: translateY(-6px); }
.card:focus-visible { outline: 4px solid var(--yellow); outline-offset: 8px; }
.cur { visibility: hidden; flex: none; }
.card:hover .cur, .card:focus-visible .cur { visibility: visible; animation: blink .8s steps(1) infinite; }
/* Top-border colours, cycled across the cards. */
.c0 { --c: #FF77A8; } .c1 { --c: #29ADFF; } .c2 { --c: #FFA300; } .c3 { --c: #7BD84A; } .c4 { --c: #FFEC27; }
.c5 { --c: #83769C; } .c6 { --c: #00E4C6; } .c7 { --c: #FFCCAA; } .c8 { --c: #C2C3C7; } .c9 { --c: #C2477E; }

/* ================= 3 · Open your gift ================= */
.gift-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 20px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}
.stack { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.gift-main .closed .title { font-size: clamp(22px, 4vw, 40px); line-height: 1.3; }
.giftee { font-size: clamp(36px, 8vw, 80px); line-height: 1.1; text-shadow: 5px 5px 0 var(--red), 10px 10px 0 var(--ink); }
.box { display: block; width: 100%; max-width: 380px; cursor: pointer; transition: transform .08s steps(1); }
.box:hover { transform: scale(1.03); }
.tap { margin: 0; font-family: var(--pixel); font-size: 16px; color: var(--yellow); }
.buttons { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.gift-main .panel { padding: 24px 28px; }

/* Reveal without JavaScript: a visually hidden checkbox (#open) toggled by
   the gift box and the "close the box" button, which are <label>s. */
.toggle { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.toggle:focus-visible ~ .box { outline: 4px solid var(--yellow); outline-offset: 8px; }
.toggle:focus-visible ~ .opened .buttons label { outline: 4px solid var(--yellow); outline-offset: 4px; }
.opened { display: none; }
.toggle:checked ~ .closed { display: none; }
.toggle:checked ~ .opened { display: flex; }

/* ---- Animations ---- */
@keyframes flick { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
@keyframes rise { 0% { transform: translateY(0); opacity: 1 } 100% { transform: translateY(-8px); opacity: 0 } }
@keyframes zz { 0% { transform: translate(0, 0); opacity: 0 } 12% { opacity: 1 } 45%, 100% { transform: translate(4px, -8px); opacity: 0 } }
/* Occasional bursts: the room stays calm most of the time, then wakes up. */
@keyframes flare { 0%, 70% { opacity: 1 } 72% { opacity: .45 } 76% { opacity: 1 } 80% { opacity: .45 } 84%, 100% { opacity: 1 } }
/* Bats swoop in a bobbing arc, then sit outside the window until the next pass. */
@keyframes bat-a { 0% { transform: translate(-10px, 6px) } 5% { transform: translate(-1px, 0) } 10% { transform: translate(6px, -5px) } 15% { transform: translate(14px, -1px) } 20%, 100% { transform: translate(30px, -6px) } }
@keyframes bat-b { 0%, 40% { transform: translate(6px, 4px) } 45% { transform: translate(-1px, -1px) } 50% { transform: translate(-8px, 5px) } 55% { transform: translate(-15px, -1px) } 60%, 100% { transform: translate(-28px, 6px) } }
@keyframes flap { 0% { transform: scaleY(1) } 50% { transform: scaleY(.25) } }
@keyframes cat-tail { 0%, 20%, 100% { transform: rotate(0deg) } 4% { transform: rotate(-18deg) } 8% { transform: rotate(14deg) } 12% { transform: rotate(-14deg) } 16% { transform: rotate(10deg) } }
@keyframes dog-head { 0%, 44%, 74%, 100% { transform: translateY(0) } 46%, 72% { transform: translateY(-3px) } }
@keyframes dog-eye { 0%, 45%, 74%, 100% { transform: scaleY(.15) } 46%, 73% { transform: scaleY(1) } }
@keyframes dog-tail { 0%, 46%, 72%, 100% { transform: rotate(0deg) } 48%, 56%, 64% { transform: rotate(-20deg) } 52%, 60%, 68% { transform: rotate(16deg) } }
@keyframes blink { 50% { opacity: 0 } }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes twinkle { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }
@keyframes pop { 0% { transform: scale(.4) } 60% { transform: scale(1.15) } 100% { transform: scale(1) } }
.f1 { animation: flick .6s steps(2) infinite; }
.f2 { animation: flick .5s steps(2) infinite reverse; }
.glow { animation: flick 1.2s steps(3) infinite; }
.steam { transform-box: fill-box; animation: rise 1.8s steps(4) infinite; }
.s2 { animation-delay: .6s; }
.s3 { animation-delay: 1.2s; }
.zz { transform-box: fill-box; animation: zz 12s steps(6) infinite; }
.bat-a { animation: bat-a 10s linear infinite; }
.bat-b { animation: bat-b 10s linear infinite; }
.bat .wing { transform-box: fill-box; transform-origin: center; animation: flap .3s steps(2) infinite; }
.cat-tail { transform-box: fill-box; transform-origin: 0 0; animation: cat-tail 8s linear infinite; }
.dog-head { animation: dog-head 12s step-end infinite; }
.dog-eye { transform-box: fill-box; transform-origin: center; animation: dog-eye 12s step-end infinite; }
.dog-tail { transform-box: fill-box; transform-origin: 100% 50%; animation: dog-tail 12s step-end infinite; }
.bob { animation: bob 1.2s steps(2) infinite; }
.blink { animation: blink 1s steps(1) infinite; }
.tw1 { animation: twinkle .6s steps(2) infinite; }
.tw2 { animation: twinkle .9s steps(2) infinite reverse; }
.pop { display: inline-block; animation: pop .4s steps(4) both; }

/* The name list is a <ul>; each <li> holds one card. */
.cards li { display: flex; }
.cards li .card { flex: 1; }
.stack.opened { gap: 20px; }

/* Keep the brand and the header link on one line on phones. */
.top a { white-space: nowrap; }
@media (max-width: 440px) {
  .top { gap: 8px; }
  .brand { gap: 8px; }
  .brand span { font-size: 11px; }
  .top a { font-size: 10px; }
}
