/* OpenWithFriends - warm papercraft styles (pure ASCII; emoji via CSS escapes) */
:root {
  --bg: #FFFBF5;
  --card: #FFFFFF;
  --ink: #1F1714;
  --muted: #6B5B53;
  --primary: #C2361E;
  --primary-hover: #A42B16;
  --accent: #9A6608;
  --border: #EFE4D8;
  --radius: 16px;
  --accent-soft: #FBEFD9;
  --shadow: 0 1px 0 rgba(31, 23, 20, .04), 0 8px 24px -12px rgba(31, 23, 20, .18);
  --shadow-lift: 0 2px 0 rgba(31, 23, 20, .05), 0 16px 32px -14px rgba(31, 23, 20, .28);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 56px;
}

.theme-festive { --accent: #1E6B52; --accent-soft: #E3F1EA; }
.theme-rose { --accent: #C83E6B; --accent-soft: #FBE6EE; }
.theme-gold { --accent: #C8901C; --accent-soft: #FBF1D8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: clip; max-width: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; color: #fff; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 251, 245, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; white-space: nowrap; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand span, .brand-text span { color: var(--primary); }
.brand-icon { flex: 0 0 auto; display: block; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.nav-burger { display: none; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: .94rem;
  padding: 8px 12px; border-radius: 999px; transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--ink); }
.site-nav a.nav-boards { border: 1.5px solid var(--border); }

@media (max-width: 900px) {
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 10px; margin-right: -8px; cursor: pointer; border-radius: 10px;
  }
  .nav-burger span { display: block; height: 2px; width: 22px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; box-shadow: var(--shadow);
    display: none;
  }
  .site-nav a { padding: 13px 8px; border-radius: 10px; font-size: 1rem; }
  .site-nav a.nav-boards { border: 0; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked + .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked + .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked + .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  font-weight: 600; font-size: .96rem; line-height: 1.2; text-decoration: none; text-align: center;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-hover); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-lg { min-height: 54px; font-size: 1.05rem; padding: 14px 22px; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); background: var(--card); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding: 8px 10px; min-height: 36px; font-weight: 500; }
.btn-ghost:hover { color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: .9rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; min-width: 0;
}
.card-title { font-size: 1.15rem; margin-bottom: 14px; }

/* ---------- Hero ---------- */
.hero { padding: 24px 0 36px; background: radial-gradient(1200px 380px at 50% -120px, var(--accent-soft), transparent 70%); }
.hero-head { text-align: center; max-width: 860px; margin: 0 auto 22px; }
.hero h1 { font-size: clamp(1.75rem, 6.4vw, 3.1rem); margin-bottom: 12px; }
.hero-subtitle { color: var(--muted); font-size: 1.05rem; margin: 12px auto 0; max-width: 640px; }
.trust-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.trust-badges li {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: .84rem; font-weight: 600; color: var(--ink);
}
.trust-badges li span { color: var(--accent); font-weight: 700; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-weight: 600; font-size: .9rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 12px; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--primary-hover); font-size: .9rem; font-weight: 500; margin: 0 0 10px; }
.form-hint { color: var(--muted); font-size: .84rem; text-align: center; margin: 10px 0 0; }
.char-count { font-size: .8rem; color: var(--muted); text-align: right; }
.char-count.is-near { color: var(--primary-hover); }

/* ---------- Demo / doors ---------- */
.demo-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.demo-head strong { font-family: var(--font-display); font-size: 1.1rem; }
.demo-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.demo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; perspective: 900px; }

.door {
  position: relative; aspect-ratio: 1 / 1.08; min-width: 0;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--accent-soft);
  padding: 0; overflow: hidden; text-align: left; cursor: default;
  transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease;
}
button.door { cursor: pointer; }
button.door:hover { transform: translateY(-3px) rotateX(4deg); box-shadow: var(--shadow-lift); }
.door-num {
  position: absolute; top: 6px; left: 8px; z-index: 3;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--ink); opacity: .7;
}
.door-front {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: flex-end; justify-content: center; padding: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
    repeating-linear-gradient(45deg, rgba(31,23,20,.025) 0 6px, transparent 6px 12px),
    var(--card);
  border-radius: 10px;
  transform-origin: left center; backface-visibility: hidden;
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .7s;
}
.door-front::after {
  content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.door-inner {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 24px 8px 8px;
}
.door-emoji { font-size: 1.3rem; line-height: 1; }
.door-note { font-size: .72rem; line-height: 1.35; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.door.is-open { background: var(--accent-soft); }

.door.is-open .door-front, .door.flipped .door-front { transform: rotateY(-105deg); opacity: 0; pointer-events: none; }
.door-tag, .lock-tag {
  font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.door-tag { background: var(--primary); color: #fff; }
.lock-tag { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.lock-tag::before { content: "\1F512 "; }
.door.is-final .lock-tag { background: var(--accent); color: #fff; border-color: transparent; }
.door.is-final .lock-tag::before { content: "\1F382 "; }
.door.is-ready { animation: door-glow 1.8s ease-in-out infinite; }
.door.is-ready.flipped { animation: none; }
@keyframes door-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 75, 50, .0); border-color: var(--border); }
  50% { box-shadow: 0 0 0 5px rgba(225, 75, 50, .18), 0 0 22px rgba(225, 75, 50, .35); border-color: var(--primary); }
}

/* ---------- Sections ---------- */
.section { padding: 32px 0; }
.section-title { text-align: center; font-size: clamp(1.4rem, 4.4vw, 2rem); margin-bottom: 20px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
.step h3 { font-size: 1.1rem; margin: 10px 0 6px; }
.step p { margin: 0; color: var(--muted); }
.step-num {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); font-weight: 700;
}
.occasion-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.occasion-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; min-width: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.occasion-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--accent); color: var(--ink); }
.occasion-card strong { font-family: var(--font-display); font-size: 1rem; line-height: 1.25; }
.occasion-card span:last-child { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.occ-emoji { font-size: 1.6rem; }

/* ---------- Prose ---------- */
.prose-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 18px; max-width: 820px; margin: 0 auto;
  overflow-wrap: break-word;
}
.prose-card h2, .page-shell h2 { font-size: 1.45rem; margin-top: 1.6em; }
.prose-card h2:first-child, .page-shell h1:first-child { margin-top: 0; }
.prose-card h3, .page-shell h3 { font-size: 1.12rem; margin-top: 1.3em; }
.prose-card p, .prose-card li, .page-shell p, .page-shell li { color: #3B2F2A; }
.prose-card ul, .prose-card ol, .page-shell ul, .page-shell ol { padding-left: 1.3em; }
.prose-card li, .page-shell li { margin-bottom: .35em; }
.prose-card blockquote { margin: 1em 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.prose-card table, .page-shell table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.prose-card th, .prose-card td, .page-shell th, .page-shell td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.page-shell { padding: 28px 0 48px; }
.page-shell > .container { max-width: 860px; }
.page-shell h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }

/* ---------- Board app ---------- */
.board-app { min-height: 50vh; }
.loading-state, .empty-state { text-align: center; color: var(--muted); padding: 48px 0; }
.board-hero { text-align: center; margin-bottom: 18px; }
.board-occasion { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.board-hero h1 { margin-bottom: 6px; }
.board-sub { color: var(--muted); margin: 0; }
.countdown { display: flex; justify-content: center; gap: 8px; margin: 18px 0; }
.countdown-unit {
  min-width: 68px; padding: 10px 6px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.countdown-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.countdown-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.countdown-done { text-align: center; font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); margin: 18px 0; }
.progress { margin: 0 auto 18px; max-width: 520px; }
.progress-label { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.progress-track { height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--primary)); transition: width .6s ease; }

.share-kit { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px; }
.share-kit .btn { flex: 1 1 200px; max-width: 280px; }
.owner-bar { display: flex; justify-content: center; margin-bottom: 14px; }
.board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; perspective: 1000px; }
.board-grid .door { aspect-ratio: 1 / 1.1; }
.door.is-empty { border-style: dashed; background: var(--bg); }
.door.is-empty .door-inner { align-items: center; justify-content: center; text-align: center; padding: 22px 6px 8px; }
.door-plus { font-size: 1.5rem; color: var(--primary); line-height: 1; font-weight: 600; }
.door-cta { font-size: .74rem; font-weight: 600; color: var(--ink); }
.door-date { font-size: .68rem; color: var(--muted); }
.door.is-filled-locked .door-inner, .door.is-filled-open .door-inner { align-items: center; justify-content: center; text-align: center; }
.door.is-filled-locked { background: var(--card); }
.door.is-filled-open { background: var(--accent-soft); border-color: var(--accent); }
.door-author { font-size: .78rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door-open-tag { font-size: .7rem; font-weight: 700; color: var(--accent); }
.board-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); }
.board-footer p { margin: 0; color: var(--muted); font-size: .88rem; }
.report-link { background: none; border: 0; color: var(--muted); font-size: .82rem; text-decoration: underline; cursor: pointer; padding: 6px; }
.report-link:hover { color: var(--primary-hover); }

.my-boards-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.my-board-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.my-board-meta { min-width: 0; }
.my-board-meta strong { display: block; font-family: var(--font-display); font-size: 1.05rem; overflow-wrap: anywhere; }
.my-board-meta span { color: var(--muted); font-size: .86rem; }
.quick-create { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* Golden Keepsake skin */
.board-app.theme-gold .board-surface {
  position: relative; border-radius: calc(var(--radius) + 4px); padding: 14px;
  background: linear-gradient(135deg, #FFF8E6, #FDF0CF);
}
.board-app.theme-gold .board-surface::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(110deg, #B8860B, #F6D776, #FFF6D5, #D4A42A, #B8860B);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: gold-shimmer 3.5s linear infinite;
}
.board-app.theme-gold .door { border-color: #E9CE85; }
.board-app.theme-gold .door-front { background: linear-gradient(135deg, #FFFDF5, #F9EBC4); }
.board-app.theme-gold .progress-bar { background: linear-gradient(90deg, #B8860B, #F6D776, #D4A42A); }
.board-app.theme-gold .board-hero h1 {
  background: linear-gradient(90deg, #8A5A00, #C8901C, #8A5A00); -webkit-background-clip: text; background-clip: text; color: transparent;
}
@keyframes gold-shimmer { to { background-position: -300% 0; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(31, 23, 20, .5); padding: 0; animation: fade-in .18s ease;
}
.modal {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 22px 18px 20px;
  box-shadow: 0 -8px 40px rgba(31,23,20,.25); animation: slide-up .25s cubic-bezier(.2,.8,.2,1);
}
.modal h2 { font-size: 1.35rem; padding-right: 36px; }
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--bg); font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted);
}
.modal-close:hover { color: var(--ink); }
.modal-text { color: var(--muted); margin: 0 0 14px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; }
.emoji-picker legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.emoji-option {
  width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: #fff;

  font-size: 1.3rem; cursor: pointer; transition: transform .1s, border-color .15s, background .15s;
}
.emoji-option:hover { transform: scale(1.08); }
.emoji-option[aria-pressed="true"] { border-color: var(--primary); background: var(--accent-soft); }
.reveal-card { text-align: center; padding: 8px 0 4px; }
.reveal-emoji { font-size: 3rem; line-height: 1; display: block; margin-bottom: 10px; animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.reveal-note { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.reveal-author { color: var(--muted); font-weight: 600; margin: 0 0 14px; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }

/* ---------- Confetti ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti-piece {
  position: absolute; top: 0; left: 0; width: 9px; height: 14px; border-radius: 2px;
  will-change: transform, opacity;
  animation: confetti-burst var(--dur, 1.2s) cubic-bezier(.15,.6,.35,1) forwards;
}
@keyframes confetti-burst {
  0% { transform: translate(var(--x0), var(--y0)) rotate(0deg) scale(.6); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(var(--x0) + var(--dx)), calc(var(--y0) + var(--dy))) rotate(var(--rot)) scale(1); opacity: 0; }
}

/* ---------- Toast ---------- */
.toast-region { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 500; font-size: .94rem;
  box-shadow: 0 10px 30px rgba(31,23,20,.3); text-align: center; animation: toast-in .25s ease;
}
.toast.is-error { background: var(--primary-hover); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 32px; border-top: 1px solid var(--border); background: #FFF6EA; padding: 32px 0 20px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.footer-col h2 { font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 2px; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: .92rem; }
.footer-col a:hover { color: var(--primary); }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { color: var(--muted); font-size: .9rem; margin: 0; max-width: 340px; }
.brand-footer { font-size: 1.2rem; }
.footer-copy { text-align: center; color: var(--muted); font-size: .84rem; margin: 26px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 380px) {
  .brand { font-size: 1.02rem; }
  .brand-icon { width: 26px; height: 26px; }
  .countdown-unit { min-width: 60px; }
  .countdown-num { font-size: 1.45rem; }
  .trust-badges li { font-size: .78rem; padding: 4px 10px; }
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .header-inner { padding: 0 24px; height: 64px; }
  :root { --header-h: 64px; }
  .hero { padding: 44px 0 56px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
  .card { padding: 26px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .occasion-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .prose-card { padding: 36px 40px; }
  .board-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .door-note { font-size: .8rem; }
  .countdown-unit { min-width: 86px; padding: 14px 8px; }
  .countdown-num { font-size: 2.2rem; }
  .modal-backdrop { align-items: center; padding: 20px; }
  .modal { border-radius: 20px; padding: 28px; }
  .modal-actions { flex-direction: row; justify-content: flex-end; }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding: 0 24px; }
  .footer-brand { grid-column: auto; }
  .section { padding: 48px 0; }
}

@media (min-width: 1280px) {
  .hero h1 { font-size: 3.3rem; }
  .board-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .hero-grid { gap: 28px; }
}

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

/* v2 QA polish: header height <= 54px + WCAG AA contrast >= 4.5:1 */
.site-header .header-inner { min-height: 52px; padding-top: 8px; padding-bottom: 8px; }
.step-num { background: #C2361E !important; color: #FFFFFF !important; }
.door.is-final .lock-tag { background: #1F1714 !important; color: #FFFBF5 !important; }

header.site-header { padding: 0 !important; }
.site-header .header-inner { height: 52px !important; min-height: 52px !important; padding-top: 0 !important; padding-bottom: 0 !important; }

/* ===================== v4: Gold Foil wrap, Guess Who, /code, viral modal ===================== */

/* Header stays locked at 52px on every breakpoint (mobile menu drops right under it) */
:root { --header-h: 52px; }

/* Gold Foil Shimmer note wrap */
.door.wrap-gold {
  border-color: #E2B547;
  background: linear-gradient(135deg, #FFFBEF 0%, #FBEBC0 55%, #F3D27E 100%);
  box-shadow: 0 0 0 1px rgba(212, 164, 42, .28), 0 8px 20px -8px rgba(200, 144, 28, .55);
}
.door.wrap-gold::after {
  content: ""; position: absolute; inset: 0; z-index: 4; border-radius: inherit; padding: 2px; pointer-events: none;
  background: linear-gradient(110deg, #B8860B, #F6D776, #FFF6D5, #D4A42A, #B8860B);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: gold-shimmer 3.5s linear infinite;
}
.door.wrap-gold .door-num { color: #7A4E00; opacity: .9; }
.door.wrap-gold .door-author, .door.wrap-gold .door-open-tag { color: #6E4600; }
.door.wrap-gold.is-filled-open, .door.wrap-gold.is-filled-locked { background: linear-gradient(135deg, #FFFBEF 0%, #FBEBC0 55%, #F3D27E 100%); }
button.door.wrap-gold:hover { box-shadow: 0 0 0 1px rgba(212, 164, 42, .4), 0 14px 28px -10px rgba(200, 144, 28, .65); }
.reveal-card.is-gold { border-radius: 16px; padding: 16px 12px 8px; background: linear-gradient(180deg, #FFF8E6, #FFFFFF 70%); box-shadow: inset 0 0 0 2px #E9CE85; }

/* Guess Who badge + clue pill */
.guess-who-badge {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 2px 8px; border-radius: 999px;
  background: #1F1714; color: #FFFBF5;
  font-size: .68rem; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.guess-who-badge::before { content: "\1F575\FE0F"; }
.clue-pill {
  display: inline-block; max-width: 100%;
  padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink); border: 1px dashed var(--accent);
  font-size: .66rem; font-weight: 500; line-height: 1.5; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clue-pill::before { content: "\1F50E  "; font-style: normal; }
.clue-pill-lg { font-size: .9rem; padding: 6px 14px; white-space: normal; overflow-wrap: anywhere; }
.reveal-who { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 14px; }
.reveal-who .guess-who-badge { font-size: .85rem; padding: 4px 12px; }
.reveal-clue { margin: 0; }
.reveal-banner {
  margin: 0; padding: 10px 18px; border-radius: 14px;
  background: linear-gradient(90deg, #FBEFD9, #FFF6D5); border: 1.5px solid #E9CE85;
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink);
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1);
}
.reveal-banner::before { content: "\1F389  "; }

/* Fill modal: Guess Who checkbox + wrap selector */
.check-row {
  display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg);
  font-weight: 600; font-size: .92rem; cursor: pointer;
}
.check-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--primary); margin: 0; }
.clue-field[hidden] { display: none; }
.wrap-picker { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.wrap-picker legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.wrap-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wrap-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; min-height: 60px;
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--border); background: #fff;
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.wrap-option strong { font-size: .9rem; line-height: 1.25; }
.wrap-option span { font-size: .76rem; color: var(--muted); line-height: 1.3; }
.wrap-option[aria-checked="true"] { border-color: var(--primary); background: var(--accent-soft); }
.wrap-option-gold { background: linear-gradient(135deg, #FFFDF5, #FBF0D2); border-color: #E9CE85; }
.wrap-option-gold strong { color: #7A4E00; }
.wrap-option-gold[aria-checked="true"] { border-color: #C8901C; background: linear-gradient(135deg, #FFF8E6, #F6DC92); box-shadow: 0 0 0 3px rgba(212, 164, 42, .25); }
.wrap-preview-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

.door.wrap-preview { flex: 0 0 76px; width: 76px; aspect-ratio: 1 / 1.08; background: var(--card); }
.door.wrap-preview .door-inner { align-items: center; justify-content: center; text-align: center; padding: 18px 4px 6px; }
.wrap-caption { font-size: .82rem; color: var(--muted); line-height: 1.4; min-width: 0; }

/* Owner delete (subtle, destructive) */
.owner-delete {
  display: block; margin: 14px auto 0; padding: 6px 10px;
  background: none; border: 0; border-radius: 8px;
  color: var(--muted); font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.owner-delete:hover { color: var(--primary-hover); background: #FDECE8; }
.owner-delete:disabled { opacity: .6; cursor: progress; }

/* Post-fill viral modal: one solid CTA + one outline, no external links */
.post-fill-viral { padding-top: 4px; }
.post-fill-viral h2 { padding-right: 0; }
.post-fill-hook { font-weight: 600; color: var(--ink); margin: 0 0 14px; }
.post-fill-actions { display: flex; flex-direction: column; gap: 10px; }
.post-fill-actions .btn { width: 100%; }

/* /code page */
.code-entry-card {
  max-width: 460px; margin: 28px auto 40px; padding: 28px 22px; text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
}
.code-entry-card h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-bottom: 8px; }
.code-entry-card p { color: var(--muted); margin: 0 0 18px; }
.code-entry-card form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.code-entry-card label { font-weight: 600; font-size: .9rem; }
.code-entry-card input {
  width: 100%; min-width: 0; min-height: 64px; padding: 10px 14px;
  background: #fff; border: 2px solid var(--border); border-radius: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 1.75rem; font-weight: 700; letter-spacing: .14em; text-align: center; text-transform: uppercase;
  transition: border-color .15s, box-shadow .15s;
}
.code-entry-card input::placeholder { color: #B5A291; letter-spacing: .14em; }
.code-entry-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.code-entry-card input[aria-invalid="true"] { border-color: var(--primary); }
.code-entry-card .btn-primary { width: 100%; min-height: 54px; font-size: 1.05rem; }
.code-entry-card .form-error { margin: 0; }
.code-entry-card .code-help { font-size: .86rem; margin: 16px 0 0; }

@media (min-width: 768px) {
  .code-entry-card { padding: 36px 34px; margin-top: 44px; }
}
