/* Friend Quiz Maker — 100% Original Design System
 * Primary Identity (Variant A): Friendship Receipt & Yearbook Stamp
 * Palettes: Warm Paper Receipt | Neon Nightchat | Pastel Yearbook
 * Prototype Contrast (Variant B): Retro Arcade Chemistry Meter
 */

:root,
[data-theme='warm-paper'] {
  --bg: #f1e9da;
  --bg-tinted: #e7dcc7;
  --surface: #faf5eb;
  --surface-alt: #f3ead9;
  --ink: #1d1b18;
  --muted: #5a5247;
  --border: #1d1b18;
  --accent: #d94126;
  --accent-ink: #ffffff;
  --highlight: #f2b705;
  --highlight-ink: #1d1b18;
  --ok: #177245;
  --bad: #c42727;
  --shadow: 4px 4px 0 #1d1b18;
  --shadow-sm: 2px 2px 0 #1d1b18;
  --font-display: 'Georgia', 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Courier New', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme='neon-nightchat'] {
  --bg: #0a0d16;
  --bg-tinted: #121728;
  --surface: #151b2e;
  --surface-alt: #1d253d;
  --ink: #f4f7ff;
  --muted: #aeb8d9;
  --border: #2af598;
  --accent: #2af598;
  --accent-ink: #07130d;
  --highlight: #ff3e9d;
  --highlight-ink: #ffffff;
  --ok: #2af598;
  --bad: #ff5c77;
  --shadow: 4px 4px 0 #ff3e9d;
  --shadow-sm: 2px 2px 0 #ff3e9d;
}

[data-theme='pastel-yearbook'] {
  --bg: #f8eaf3;
  --bg-tinted: #f1dcf0;
  --surface: #fff9fc;
  --surface-alt: #fceff7;
  --ink: #27193b;
  --muted: #655280;
  --border: #27193b;
  --accent: #e03c68;
  --accent-ink: #ffffff;
  --highlight: #6c63ff;
  --highlight-ink: #ffffff;
  --ok: #1e7f5c;
  --bad: #c8254a;
  --shadow: 4px 4px 0 #6c63ff;
  --shadow-sm: 2px 2px 0 #6c63ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--border) 10%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--surface);
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(1140px, 100% - 2rem);
  margin-inline: auto;
}

/* ==================== HEADER ==================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
}

.brand-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  border: 2px solid var(--accent);
  color: var(--accent);
  transform: rotate(-4deg);
}

.brand-wordmark {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--highlight);
  color: var(--highlight-ink);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.auth-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 999px;
}

/* ==================== BUTTONS & INPUTS ==================== */

.btn-solid,
.btn-outline,
.btn-chip,
.tool-btn,
.nav-step-btn,
.add-quiz-btn,
.pill-btn,
.swatch-btn,
.seg-btn {
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.2rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-solid:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.btn-solid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.05rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.36rem 0.72rem;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1.5px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.btn-chip.is-danger {
  border-color: var(--bad);
  color: var(--bad);
}

.btn-chip.is-dev-mock {
  border-style: dashed;
  background: var(--highlight);
  color: var(--highlight-ink);
}

.btn-sm {
  padding: 0.42rem 0.75rem;
  font-size: 0.84rem;
}

.is-full {
  width: 100%;
}

.text-input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
}

.text-input:focus {
  outline: 3px solid var(--highlight);
  outline-offset: 1px;
}

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.38rem;
}

/* ==================== HERO STAGE & VARIANT A RECEIPT ==================== */

.hero-stage {
  padding: 1.75rem 0 2.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1.75rem;
  align-items: start;
}

.eyebrow-stamp {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.22rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 1.5px solid var(--border);
}

.hero-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.1vw, 2.55rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.maker-controls-card {
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.control-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.segmented-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.seg-btn {
  padding: 0.5rem 0.65rem;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1.5px solid var(--border);
  font-size: 0.84rem;
  font-weight: 700;
}

.seg-btn.is-active {
  background: var(--ink);
  color: var(--surface);
}

.swatch-row,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.swatch-btn,
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.68rem;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
}

.swatch-btn.is-active,
.pill-btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}

.webview-hint {
  margin: 0;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  background: var(--surface-alt);
  border-left: 4px solid var(--highlight);
}

/* Thermal Receipt Card */

.receipt-card {
  position: relative;
  background: var(--surface);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
  border-radius: 4px;
}

.receipt-card.is-compact {
  max-width: 620px;
  margin-inline: auto;
}

.receipt-perforation {
  height: 10px;
  margin: -1.5rem -1.25rem 1rem;
  background-image: radial-gradient(circle at 10px 0, var(--bg) 6px, transparent 6.5px);
  background-size: 20px 10px;
  background-repeat: repeat-x;
}

.receipt-perforation.is-bottom {
  margin: 1.1rem -1.25rem -1.5rem;
  background-image: radial-gradient(circle at 10px 10px, var(--bg) 6px, transparent 6.5px);
}

.receipt-top-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.7rem;
  border-bottom: 2px dashed color-mix(in srgb, var(--border) 45%, transparent);
}

.receipt-serial {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
}

.yearbook-stamp {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  transform: rotate(-2.5deg);
}

.yearbook-stamp.is-large {
  font-size: 1rem;
  padding: 0.35rem 0.85rem;
  border-width: 3px;
}

.receipt-owner-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.65rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1.5px dashed color-mix(in srgb, var(--border) 35%, transparent);
}

.receipt-owner-line strong {
  font-size: 0.98rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.progress-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0.85rem 0 0.9rem;
}

.dot-step {
  min-width: 28px;
  height: 26px;
  padding: 0 0.35rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.dot-step.is-answered {
  background: var(--highlight);
  color: var(--highlight-ink);
}

.dot-step.is-current {
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-1px);
}

.question-prompt {
  margin: 0.6rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 700;
  line-height: 1.32;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.option-tile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.85rem;
  background: var(--surface-alt);
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.option-tile:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-sm);
}

.option-tile.is-selected {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 900;
}

.option-emoji {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.receipt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.tool-btn {
  flex: 1 1 140px;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  color: var(--ink);
  border: 1.5px dashed var(--border);
  font-size: 0.84rem;
  font-weight: 700;
}

.tool-btn:hover {
  background: var(--surface-alt);
}

.receipt-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 2px dashed color-mix(in srgb, var(--border) 40%, transparent);
}

.nav-step-btn {
  padding: 0.48rem 0.85rem;
  background: var(--surface-alt);
  color: var(--ink);
  border: 1.5px solid var(--border);
  font-size: 0.86rem;
  font-weight: 800;
}

.nav-step-btn.is-primary {
  background: var(--ink);
  color: var(--surface);
}

.nav-step-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.answered-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

/* Inline Editor Drawer */

.editor-box {
  margin-top: 0.85rem;
  padding: 0.85rem;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: 6px;
}

.editor-options-grid {
  display: grid;
  gap: 0.45rem;
  margin: 0.65rem 0;
}

.editor-opt-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.45rem;
}

.emoji-input {
  text-align: center;
  padding: 0.55rem 0.25rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Publish & Share Result */

.publish-box {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.code-ticket-box {
  margin: 1rem 0;
  padding: 0.9rem;
  text-align: center;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 2.5px dashed var(--border);
  border-radius: 6px;
}

.ticket-label,
.ticket-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
}

.ticket-code {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: 0.12em;
  margin: 0.2rem 0;
}

.share-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.share-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.claim-box {
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 6px;
}

.claim-title {
  margin: 0 0 0.25rem;
  font-weight: 800;
  font-size: 0.9rem;
}

/* ==================== CONTENT BANDS & QUESTION BANK ==================== */

.page-intro-hero {
  padding: 2rem 0 1.25rem;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.content-band {
  padding: 2.25rem 0;
}

.content-band.is-tinted {
  background: var(--bg-tinted);
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}

.content-band h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.2;
}

.band-intro {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

.steps-grid,
.topic-grid,
.faq-grid,
.preview-pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.step-card,
.topic-card,
.faq-item,
.mini-poster-preview {
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  padding: 1rem;
}

.step-card h3,
.faq-item h3,
.mini-poster-preview h3 {
  margin: 0.35rem 0 0.45rem;
  font-size: 1.05rem;
}

.step-card p,
.faq-item p,
.mini-poster-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.step-num,
.preview-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--accent);
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
}

.topic-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.topic-card span {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Question Bank List (+ Add to My Quiz) */

.qbank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.qbank-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.qbank-text {
  flex: 1 1 280px;
}

.qbank-prompt {
  margin: 0 0 0.3rem;
  font-weight: 800;
  font-size: 0.98rem;
}

.qbank-preview {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.add-quiz-btn {
  padding: 0.48rem 0.85rem;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 2px solid var(--border);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.add-quiz-btn.is-added {
  background: var(--ok);
  color: #ffffff;
}

.explorer-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.explorer-search {
  max-width: 340px;
}

.explorer-pills {
  margin-bottom: 1rem;
}

/* Sticky Floating Draft Tray */

.draft-tray {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: 720px;
  margin-inline: auto;
  background: var(--ink);
  color: var(--surface);
  border: 2.5px solid var(--highlight);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  padding: 0.7rem 1rem;
}

.draft-tray-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.draft-tray-count {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.draft-tray-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

/* ==================== PLAY, SETTLEMENT & OWNER INSIGHTS ==================== */

.quiz-play-section {
  padding: 1.75rem 0 3rem;
}

.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 1.5rem;
  align-items: start;
}

.play-title {
  margin: 0.75rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.2;
}

.play-sub {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--muted);
}

.play-progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.progress-bar-track,
.miss-bar-track {
  height: 10px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.progress-bar-fill,
.miss-bar-fill {
  height: 100%;
  background: var(--accent);
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-card {
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  padding: 1rem;
}

.side-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.12rem;
}

.side-card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
}

.mini-board-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.mini-board-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.rank-badge,
.score-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.82rem;
}

.score-pill {
  padding: 0.14rem 0.45rem;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 1.5px solid var(--border);
  border-radius: 4px;
}

.settlement-hero {
  text-align: center;
  padding: 0.75rem 0 1.15rem;
  border-bottom: 2px dashed color-mix(in srgb, var(--border) 45%, transparent);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  border: 1.5px solid var(--border);
  background: var(--surface-alt);
}

.score-hero-num {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 4.4rem);
  font-weight: 900;
  line-height: 1.05;
  margin: 0.45rem 0;
}

.stamp-result-row {
  margin: 0.6rem 0;
}

.tier-headline {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.settlement-cta-stack {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.circle-card {
  margin-top: 1.15rem;
  padding: 0.9rem;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: 8px;
}

.circle-card h3 {
  margin: 0 0 0.65rem;
  font-size: 0.98rem;
}

.circle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.55rem;
}

.circle-friend-btn {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
}

.circle-friend-btn span {
  font-size: 0.78rem;
  color: var(--muted);
}

.truth-section {
  margin-top: 1.25rem;
}

.truth-list {
  list-style: none;
  padding: 0;
  margin: 0.65rem 0 0;
  display: grid;
  gap: 0.55rem;
}

.truth-row {
  padding: 0.7rem 0.8rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-left-width: 5px;
  border-radius: 6px;
}

.truth-row.is-right {
  border-left-color: var(--ok);
}

.truth-row.is-wrong {
  border-left-color: var(--bad);
}

.truth-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.truth-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 900;
}

.truth-detail {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.hardest-callout {
  padding: 0.75rem;
  background: var(--highlight);
  color: var(--highlight-ink);
  border: 2px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.85rem;
}

.owner-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.friend-breakdown-list,
.miss-stat-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.friend-breakdown-details {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  background: var(--surface-alt);
}

.friend-breakdown-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.friend-answer-list {
  list-style: none;
  padding: 0.5rem 0 0;
  margin: 0;
  font-size: 0.82rem;
  display: grid;
  gap: 0.3rem;
}

.miss-stat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.outbox-banner,
.claim-banner {
  padding: 0.75rem 0;
  background: var(--highlight);
  color: var(--highlight-ink);
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

.claim-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.claim-banner-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

/* ==================== CODE ENTRY & LEGAL PAGES ==================== */

.code-form {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.code-input {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
}

.legal-article {
  padding: 2rem 0 3rem;
}

.legal-container {
  max-width: 780px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 1.75rem;
}

.legal-container h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.legal-container h2 {
  margin: 1.4rem 0 0.45rem;
  font-size: 1.18rem;
}

.legal-updated {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

/* ==================== MODAL ==================== */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.65);
}

.modal-card {
  position: relative;
  width: min(600px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--surface);
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 1.25rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-head h2 {
  margin: 0;
}

.owned-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.owned-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-radius: 6px;
}

.owned-actions {
  display: flex;
  gap: 0.4rem;
}

/* ==================== /_proto VARIANT B: RETRO ARCADE CHEMISTRY METER ==================== */

.proto-toolbar-band {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 1rem 0;
}

.proto-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.proto-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}

.proto-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.arcade-stage {
  padding: 2rem 0 3rem;
  background: linear-gradient(160deg, #171228 0%, #0b1020 100%);
  color: #f6f2ff;
}

.arcade-kicker {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.25rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 900;
  background: #ff4757;
  color: #ffffff;
  border: 2px solid #fff3d6;
}

.arcade-title {
  margin: 0 0 0.65rem;
  font-family: var(--font-mono);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  color: #ffd166;
  text-shadow: 3px 3px 0 #ff4757;
}

.arcade-lead {
  color: #cbd3f5;
  margin: 0 0 1.25rem;
}

.arcade-console-box,
.arcade-cabinet {
  background: #1f1b38;
  border: 3px solid #ffd166;
  box-shadow: 6px 6px 0 #ff4757;
  border-radius: 12px;
  padding: 1.2rem;
}

.arcade-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: #7bed9f;
  margin-bottom: 0.35rem;
}

.arcade-input {
  width: 100%;
  padding: 0.68rem 0.85rem;
  background: #0d1221;
  color: #7bed9f;
  border: 2px solid #7bed9f;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 800;
}

.arcade-gauge-wrap {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #0d1221;
  border: 2px solid #485696;
  border-radius: 10px;
  text-align: center;
}

.arcade-gauge-svg {
  width: min(260px, 100%);
  height: auto;
}

.arcade-readout {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: #ffd166;
}

.arcade-marquee {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffd166;
  margin-bottom: 0.8rem;
}

.arcade-crt {
  background: #091815;
  border: 3px solid #2ed573;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.9rem;
}

.arcade-prompt {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 700;
  color: #9effc4;
}

.arcade-pad-grid {
  display: grid;
  gap: 0.55rem;
}

.arcade-pad {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.72rem 0.85rem;
  background: #2b264e;
  color: #ffffff;
  border: 2px solid #7bed9f;
  box-shadow: 0 3px 0 #1e9e56;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.arcade-pad:hover {
  background: #3a3269;
  transform: translateY(-1px);
}

.arcade-pad-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ff4757;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 900;
  flex-shrink: 0;
}

.arcade-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.arcade-ctrl-btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: #ffd166;
  color: #171228;
  border: 2px solid #fff3d6;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 900;
  cursor: pointer;
}

/* ==================== FOOTER & HELPERS ==================== */

.site-footer {
  margin-top: 2.5rem;
  background: var(--surface);
  border-top: 2px solid var(--border);
  padding: 2rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-col-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.32rem;
  font-size: 0.88rem;
}

.footer-list a {
  color: var(--ink);
  text-decoration: none;
}

.footer-list a:hover {
  text-decoration: underline;
  color: var(--accent);
}

.footer-bottom {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1.5px dashed color-mix(in srgb, var(--border) 35%, transparent);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}

.tiny-meta,
.muted-note,
.band-note {
  font-size: 0.84rem;
  color: var(--muted);
}

.error-note {
  color: var(--bad);
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0;
}

.cross-promo-strip {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1.5px dashed color-mix(in srgb, var(--border) 35%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

/* ==================== RESPONSIVE (390px MOBILE & TABLET) ==================== */

@media (max-width: 900px) {
  .hero-grid,
  .play-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    width: calc(100% - 1.25rem);
  }
  .header-inner {
    gap: 0.5rem;
  }
  .site-nav {
    order: 3;
    width: 100%;
    padding-top: 0.35rem;
    border-top: 1px dashed color-mix(in srgb, var(--border) 30%, transparent);
  }
  .receipt-card {
    padding: 1.25rem 0.9rem;
  }
  .receipt-perforation {
    margin: -1.25rem -0.9rem 0.9rem;
  }
  .receipt-perforation.is-bottom {
    margin: 0.9rem -0.9rem -1.25rem;
  }
  .share-url-row {
    grid-template-columns: 1fr;
  }
  .legal-container {
    padding: 1.15rem;
  }
}
