/* Shared base for the Questvow RPG wedding worlds. Each page sets its own palette tokens on :root. */
@font-face { font-family: 'Press Start 2P'; src: url('fonts/press-start-2p.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('fonts/cormorant-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('fonts/cormorant-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('fonts/cormorant-500i.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --bg: #fbf6ea; --ink: #2b2230; --muted: #6d6170; --panel: #fffdf7; --panel-ink: var(--ink);
  --line: #2b2230; --accent: #b0894a; --accent-ink: #1b1410; --accent2: #7a1f2b;
  --px: 'Press Start 2P', ui-monospace, monospace;
  --serif: 'Cormorant', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--sans); overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
svg.px-art, .px-art svg { shape-rendering: crispEdges; image-rendering: pixelated; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.px { font-family: var(--px); letter-spacing: .02em; line-height: 1.6; }
.serif { font-family: var(--serif); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 9vw, 104px) 0; position: relative; }
.eyebrow { font-family: var(--px); font-size: 10px; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.title { font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 5.5vw, 52px); line-height: 1.1; margin: 0 0 14px; }
.lead { color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.center { text-align: center; } .center .lead { margin-inline: auto; }

/* Pixel frame: hard border plus offset drop shadow, no radius */
.frame { background: var(--panel); color: var(--panel-ink); border: 3px solid var(--line); box-shadow: 6px 6px 0 rgba(0,0,0,.28); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px;
  font-family: var(--px); font-size: 11px; line-height: 1.4; text-transform: uppercase; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line);
  transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.btn.alt { background: var(--panel); color: var(--panel-ink); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }
.row { display: flex; flex-wrap: wrap; gap: 14px; }
.center .row { justify-content: center; }

.demo-badge { position: fixed; top: 12px; left: 12px; z-index: 50; font-family: var(--px); font-size: 9px; padding: 8px 10px;
  background: #ffe36b; color: #1b1410; border: 2px solid #1b1410; text-decoration: none; }
.audio-btn { position: fixed; top: 12px; right: 12px; z-index: 50; width: 48px; height: 48px; cursor: pointer; font-size: 20px;
  background: var(--panel); color: var(--panel-ink); border: 3px solid var(--line); box-shadow: 3px 3px 0 var(--line); }

/* RPG dialog box */
.dlg { position: fixed; inset: auto 0 0 0; z-index: 60; padding: 16px; display: none; }
.dlg.open { display: block; animation: dlgUp .25s ease-out; }
.dlg-box { width: min(760px, 100%); margin-inline: auto; background: #14122a; color: #f5efe0; border: 4px solid #f5efe0;
  outline: 4px solid #14122a; box-shadow: 0 10px 40px rgba(0,0,0,.5); padding: 18px 20px 14px; display: flex; gap: 16px; cursor: pointer; }
.dlg-face { flex: none; width: 72px; height: 72px; background: #262248; border: 3px solid #f5efe0; display: grid; place-items: center; }
.dlg-face:empty { display: none; }
.dlg-who { font-family: var(--px); font-size: 10px; color: #ffd36b; margin: 0 0 8px; }
.dlg-text { margin: 0; min-height: 3.3em; font-size: 16px; }
.dlg-next { font-family: var(--px); font-size: 9px; color: #ffd36b; text-align: right; margin-top: 6px; animation: blink 1s steps(2) infinite; }
@keyframes dlgUp { from { transform: translateY(30px); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* Countdown */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 460px; }
.center .cd { margin-inline: auto; }
.cd div { text-align: center; padding: 12px 4px; }
.cd b { display: block; font-family: var(--px); font-size: clamp(16px, 4vw, 22px); }
.cd span { font-size: 12px; color: var(--muted); }

/* Event cards */
.events { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin: 28px 0; }
.event { padding: 24px; }
.event h3 { font-family: var(--px); font-size: 12px; margin: 0 0 14px; color: var(--accent2); }
.event dl { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.event dt { font-size: 13px; color: var(--muted); }
.event dd { margin: 0; font-weight: 600; }

/* Forms */
.field { display: block; margin-bottom: 16px; }
.field > span, legend { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px; min-height: 48px; background: #fff; color: #1b1410;
  border: 3px solid var(--line); border-radius: 0; }
.field textarea { min-height: 110px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.choice { display: inline-flex; align-items: center; gap: 8px; margin: 0 16px 6px 0; min-height: 40px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent2); }
.err { color: #b3261e; font-size: 13px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
[aria-invalid="true"] { border-color: #b3261e !important; }
.status { margin: 14px 0 0; padding: 12px; font-size: 14px; border: 2px dashed currentColor; }
.status:empty { display: none; }
.status.ok { color: #1f6b3a; } .status.bad { color: #b3261e; } .status.wait { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-height: 460px; overflow: auto; }
.board li { padding: 14px 16px; }
.board b { display: block; font-size: 14px; margin-bottom: 4px; }
.board p { margin: 0; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 150%); transition: transform .3s;
  font-family: var(--px); font-size: 10px; padding: 12px 16px; background: #14122a; color: #fff; border: 3px solid #fff; }
.toast.show { transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }

.foot { padding: 32px 0 48px; font-size: 13px; color: var(--muted); text-align: center; }

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