:root {
  --bg-top: #0b221a;
  --bg-mid: #143628;
  --bg-bot: #310d19;
  --paper: #fffaf0;
  --paper-edge: #e9d7b4;
  --ink: #231b16;
  --ink-muted: #65594f;
  --surface: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 232, 180, 0.22);
  --text: #faf7f2;
  --muted: #cfe0d6;
  --gold: #f5c44e;
  --nice: #1c8c58;
  --nice-bg: #e7f8ef;
  --naughty: #d62f48;
  --naughty-bg: #fdecef;
  --radius: 20px;
  --shadow: 0 22px 54px rgba(4, 12, 10, 0.45);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background: radial-gradient(circle at 80% 0%, rgba(214, 47, 72, 0.2), transparent 44%),
              linear-gradient(160deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-bot) 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

.skip-link { position: absolute; left: -9999px; background: var(--gold); color: #221204; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 12px; top: 12px; }

.snow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 15% 18%, rgba(255,255,255,0.45) 50%, transparent 55%),
    radial-gradient(2px 2px at 82% 24%, rgba(255,255,255,0.4) 50%, transparent 55%),
    radial-gradient(3px 3px at 45% 68%, rgba(255,255,255,0.3) 50%, transparent 55%),
    radial-gradient(2px 2px at 72% 82%, rgba(255,255,255,0.38) 50%, transparent 55%);
}

.wrap { width: min(1060px, 92vw); margin: 0 auto; position: relative; z-index: 1; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(10, 29, 22, 0.8);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.brand img { border-radius: 8px; }
.brand-name { font-family: var(--font-display); font-size: 1.12rem; }
.top-nav { display: flex; align-items: center; gap: 16px; font-size: 0.92rem; }
.top-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.top-nav a:hover { color: var(--gold); }
.lang-switch select {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}
.lang-switch select option { color: #111; }

.hero { padding: 26px 0 42px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 196, 78, 0.14);
  border: 1px solid rgba(245, 196, 78, 0.4);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-title {
  margin: 12px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.hero-sub {
  margin: 0 0 22px;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.04rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

/* Official Parchment Verdict Scroll */
.scroll-card {
  background: linear-gradient(180deg, #fffdf7 0%, var(--paper) 65%, #f3e4c6 100%);
  color: var(--ink);
  border: 4px solid var(--gold);
  border-radius: 24px;
  padding: 24px 22px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.scroll-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px dashed var(--paper-edge);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.scroll-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8c2335;
}
.scroll-name {
  margin: 4px 0 2px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.15;
  color: #1c1410;
}
.scroll-sub { font-size: 0.85rem; color: var(--ink-muted); font-weight: 600; }

.stamp {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 10px;
  border: 3px solid currentColor;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  line-height: 1.15;
  text-align: center;
}
.stamp.nice { color: var(--nice); background: rgba(28, 140, 88, 0.08); }
.stamp.naughty { color: var(--naughty); background: rgba(214, 47, 72, 0.08); }
.stamp.pending { color: #9c6510; background: rgba(245, 196, 78, 0.16); }

/* Meter */
.meter-wrap { margin: 14px 0 18px; }
.meter-labels {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.meter-nice { color: var(--nice); }
.meter-naughty { color: var(--naughty); }
.meter-track {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: var(--naughty);
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
}
.meter-track.empty { background: #dfd1b4; }
.meter-fill-nice {
  height: 100%;
  background: linear-gradient(90deg, #1aa364, #34c77b);
  transition: width 0.45s cubic-bezier(.22,1,.36,1);
}

/* Evidence / Friend Votes List */
.votes-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.vote-item {
  background: #ffffff;
  border: 1.5px solid var(--paper-edge);
  border-radius: 14px;
  padding: 12px 14px;
}
.vote-item.nice { border-left: 5px solid var(--nice); }
.vote-item.naughty { border-left: 5px solid var(--naughty); }
.vote-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.vote-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}
.vote-badge.nice { background: var(--nice-bg); color: var(--nice); }
.vote-badge.naughty { background: var(--naughty-bg); color: var(--naughty); }
.vote-from { font-weight: 700; font-size: 0.86rem; color: var(--ink); }
.vote-reason {
  margin: 6px 0 0;
  font-size: 0.94rem;
  color: #362c25;
  white-space: pre-wrap;
  word-break: break-word;
}
.vote-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.link-mini {
  background: transparent;
  border: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.link-mini:hover { color: var(--naughty); }
.empty-votes {
  text-align: center;
  padding: 22px 14px;
  border: 1.5px dashed #d4c09b;
  border-radius: 14px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

/* Mode tabs */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.tab-btn.active {
  background: rgba(245, 196, 78, 0.2);
  border-color: var(--gold);
  color: #fff6d9;
}

/* Forms & Buttons */
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 6px; color: #eef5f1; }
.field input[type="text"], .field textarea {
  width: 100%;
  background: rgba(6, 18, 14, 0.56);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.96rem;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

.verdict-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick-card {
  padding: 14px 10px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pick-card.nice.active { background: rgba(28, 140, 88, 0.32); border-color: #46e095; color: #eafff4; }
.pick-card.naughty.active { background: rgba(214, 47, 72, 0.34); border-color: #ff6b84; color: #fff0f3; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, opacity 0.14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-gold { background: linear-gradient(135deg, #ffe79a, var(--gold)); color: #241304; box-shadow: 0 8px 22px rgba(245,196,78,0.28); }
.btn-red { background: linear-gradient(135deg, #f5516c, var(--naughty)); color: #fff; box-shadow: 0 8px 22px rgba(214,47,72,0.3); }
.btn-green { background: linear-gradient(135deg, #2bbd78, var(--nice)); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.1); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 8px 13px; font-size: 0.83rem; }
.btn-block { width: 100%; }

.code-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(5, 16, 12, 0.6);
  border: 1px dashed rgba(245, 196, 78, 0.6);
  margin: 12px 0;
}
.code-val { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.12rem; font-weight: 800; letter-spacing: 0.08em; color: var(--gold); }

.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.notice-box {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(245, 196, 78, 0.13);
  border: 1px solid rgba(245, 196, 78, 0.35);
  font-size: 0.84rem;
  color: #fff0c4;
}
.my-lists { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.my-lists-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Instant Santa Result Box */
.instant-result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #fffaf0;
  color: var(--ink);
  border: 3px solid var(--gold);
}
.instant-result h3 { margin: 0 0 6px; font-family: var(--font-display); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 14, 11, 0.8);
  backdrop-filter: blur(6px);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: min(460px, 95vw);
  background: #102a20;
  border: 1.5px solid rgba(245, 196, 78, 0.55);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
  text-align: center;
}
.modal-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 1.4rem; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: #102b21;
  color: #fff;
  border: 1px solid var(--gold);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  z-index: 95;
  transition: transform 0.25s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Content & SEO Sections */
.sec { padding: 42px 0; }
.sec-alt { background: rgba(255,255,255,0.03); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.2vw, 2.2rem); margin: 0 0 14px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.step-card h3 { margin: 6px 0; font-size: 1.06rem; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.prose { max-width: 780px; }
.prose h3 { font-family: var(--font-display); margin-top: 24px; }
.prose p, .prose li { color: var(--muted); }
.faq-list details {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.04);
}
.faq-list summary { cursor: pointer; font-weight: 700; color: var(--text); }
.faq-list details p { margin: 10px 0 0; color: var(--muted); font-size: 0.94rem; }

.code-box { max-width: 560px; margin: 40px auto; text-align: center; }
.code-input-big {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem !important;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: lowercase;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 44px;
  margin-top: 28px;
  background: rgba(6, 17, 13, 0.62);
}
.footer-inner { display: grid; gap: 14px; }
.footer-brand p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.footer-langs, .footer-nav { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.88rem; }
.footer-langs a, .footer-nav a { color: var(--muted); text-decoration: none; }
.footer-langs a:hover, .footer-nav a:hover { color: var(--gold); }
.footer-copy { margin: 4px 0 0; color: rgba(207, 224, 214, 0.65); font-size: 0.82rem; }

@media (max-width: 820px) {
  .app-grid, .steps-grid, .share-grid { grid-template-columns: 1fr; }
  .top-nav a[data-i18n="navHow"] { display: none; }
}
