/* The Holiday Quiz: evergreen night, cream type, gold accents. Shared by the quiz and the results page. */

@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #0e211b;
  --bg-deep: #08150f;
  --panel: rgba(243, 236, 221, 0.045);
  --panel-hi: rgba(243, 236, 221, 0.09);
  --line: rgba(243, 236, 221, 0.14);
  --ink: #f3ecdd;
  --muted: #b5af9c;
  --gold: #e2b866;
  --gold-ink: #1d1708;
  --right: #86d3a0;
  --right-bg: rgba(134, 211, 160, 0.12);
  --wrong: #ef8a93;
  --wrong-bg: rgba(239, 138, 147, 0.12);
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 80% at 50% 0%, #17382d 0%, var(--bg) 55%, var(--bg-deep) 100%) fixed;
  background-color: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
}
html.embedded body { min-height: 0; background-attachment: scroll; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.wrap {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 16px 56px;
}
.wrap.wide { max-width: 1040px; }
html.embedded .wrap { padding-top: 28px; padding-bottom: 28px; }

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.8rem, 11vw, 4.2rem); line-height: 1.02; color: var(--gold); }
h2 { font-size: clamp(1.7rem, 6vw, 2.2rem); line-height: 1.15; }
h3 { font-size: 1.35rem; line-height: 1.2; }
h2:focus, h1:focus { outline: none; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold);
}
.muted { color: var(--muted); font-weight: 400; }
.lede { font-size: 1.15rem; color: var(--ink); margin: 16px 0 28px; max-width: 30em; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 22px 0 0; max-width: 36em; }

/* Start form */
.start { display: grid; gap: 10px; max-width: 420px; }
.start label { font-weight: 600; font-size: 0.95rem; }
input[type='text'], input[type='password'] {
  font: inherit; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; width: 100%;
}
input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-color: transparent; }

.btn {
  font: 700 1rem/1 var(--sans); letter-spacing: 0.01em;
  border-radius: 999px; padding: 16px 26px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.12s ease, background-color 0.2s ease, opacity 0.2s ease;
  min-height: 52px;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn.primary { background: var(--gold); color: var(--gold-ink); }
.btn.primary:hover:not(:disabled) { background: #edc77b; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--panel); }
.start .btn { margin-top: 8px; }

/* Question */
.progress { display: flex; gap: 6px; margin: 0 0 22px; }
.progress i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background-color 0.3s ease; }
.progress i.right { background: var(--right); }
.progress i.wrong { background: var(--wrong); }
.progress i.now { background: var(--gold); }

.lead { color: var(--muted); margin: 0 0 10px; font-size: 1rem; }
.prompt { margin: 0 0 22px; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left;
  font: 500 1rem/1.45 var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; cursor: pointer; min-height: 56px;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.3s ease;
}
.option:hover:not(:disabled) { background: var(--panel-hi); border-color: rgba(226, 184, 102, 0.55); }
.option:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.option:disabled { cursor: default; }
.option .letter {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; margin-top: -1px;
  font-weight: 800; font-size: 0.85rem; color: var(--gold); border: 1px solid rgba(226, 184, 102, 0.5);
}
.option .text { flex: 1; }
.option .mark { flex: none; font-weight: 800; margin-left: 4px; }
.option.pending { border-color: var(--gold); }
.option.pending .letter { animation: pulse 0.9s ease-in-out infinite; }
.option.right { background: var(--right-bg); border-color: var(--right); }
.option.right .letter { background: var(--right); border-color: var(--right); color: #0d2016; }
.option.wrong { background: var(--wrong-bg); border-color: var(--wrong); }
.option.wrong .letter { background: var(--wrong); border-color: var(--wrong); color: #2a0b0f; }
.option.dim { opacity: 0.45; }
@keyframes pulse { 50% { background: rgba(226, 184, 102, 0.35); } }

.reveal {
  margin-top: 22px; padding: 20px 20px 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  animation: rise 0.35s ease both;
}
.verdict { margin: 0 0 8px; font-family: var(--serif); font-size: 1.7rem; line-height: 1.15; }
.verdict.right { color: var(--right); }
.verdict.wrong { color: var(--wrong); }
.story { margin: 0 0 20px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.error { color: var(--wrong); font-weight: 600; margin: 16px 0 0; }

/* Score */
.score { font-family: var(--serif); font-size: clamp(5rem, 26vw, 8rem); line-height: 0.9; margin: 0 0 12px; color: var(--gold); }
.score .of { font-size: 0.4em; color: var(--muted); margin-left: 10px; }
.tier { margin-bottom: 6px; }
.tier-line { margin: 0 0 24px; color: var(--ink); }
.recap { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; }
.recap li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-weight: 500;
}
.recap .tick { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.8rem; }
.recap .tick.right { background: var(--right); color: #0d2016; }
.recap .tick.wrong { background: var(--wrong); color: #2a0b0f; }
.stats { color: var(--muted); margin: 0 0 24px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .btn { flex: 1 1 180px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Results page ---------- */
.head { margin-bottom: 28px; }
.head h1 { font-size: clamp(2.4rem, 8vw, 3.4rem); }
.head .stamp { color: var(--muted); margin: 8px 0 0; font-size: 0.9rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 20px; margin: 0 0 18px;
}
.card h2 { font-size: 1.7rem; margin-bottom: 14px; }
.card .note { color: var(--muted); font-size: 0.9rem; margin: -6px 0 14px; }
.unlock form { display: grid; gap: 10px; max-width: 420px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.tile .big { font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--gold); }
.tile .label { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

#map { height: 360px; border-radius: 12px; overflow: hidden; background: #0b1a15; margin-bottom: 16px; }
.places { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.places li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.places li:last-child { border-bottom: 0; }
.places .n { color: var(--gold); font-weight: 700; white-space: nowrap; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 2.4em 1fr 2.6em; align-items: center; gap: 10px; font-size: 0.92rem; }
.bar { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 6px; }
.bar-row .n { text-align: right; color: var(--muted); }

.qblock { padding: 16px 0; border-top: 1px solid var(--line); }
.qblock:first-of-type { border-top: 0; padding-top: 0; }
.qblock h3 { margin-bottom: 4px; }
.qblock .pct { color: var(--muted); font-size: 0.9rem; margin: 0 0 10px; }
.opt-row { display: grid; grid-template-columns: 1fr 3.2em; gap: 4px 10px; align-items: center; margin: 0 0 10px; font-size: 0.92rem; }
.opt-row .label { grid-column: 1 / -1; }
.opt-row.is-right .label { color: var(--right); font-weight: 600; }
.opt-row.is-right .bar i { background: var(--right); }
.opt-row .n { text-align: right; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 760px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
td.ans { text-align: center; font-weight: 700; }
td.ans.right { color: var(--right); }
td.ans.wrong { color: var(--wrong); }
td.ans.none { color: var(--muted); }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.tag.retake { background: rgba(226, 184, 102, 0.16); color: var(--gold); }
.tag.partial { background: var(--line); color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.empty { color: var(--muted); margin: 0; }

/* Leaflet popups in the evergreen theme */
.leaflet-container { font: 500 0.9rem/1.4 var(--sans); background: #0b1a15; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6); }
.leaflet-control-attribution a { color: #2a5a48; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #f3ecdd; color: #10241d; }
