:root {
  --bg: #f8f6f0;
  --surface: #ffffff;
  --surface-alt: #eef2fa;
  --text: #14213d;
  --muted: #4a5568;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --accent: #b45309;
  --accent-soft: #fef3c7;
  --win: #15803d;
  --border: #d8e0ee;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 33, 61, 0.08);
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}

.main-nav a:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.main-nav a.is-active,
.main-nav a[aria-current="page"] {
  background: var(--primary);
  color: var(--surface);
}

.main-nav a.is-active:hover,
.main-nav a[aria-current="page"]:hover {
  background: var(--primary-hover);
  color: var(--surface);
}

/* Harmonized Golden Ad Slots (silent when empty, blended with theme variables when active) */
.gfs-ad-slot-wrap {
  margin: 0 auto;
}

.gfs-ad-slot:empty,
.gfs-ad-wrap:empty,
.ad-third-party:empty {
  display: none;
}

.gfs-ad-slot,
.gfs-ad-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px auto 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gfs-ad-slot-top,
.top-banner-wrap {
  padding: 8px 12px;
  margin-top: 12px;
  margin-bottom: 12px;
}

/* Page Headings & Breadcrumbs */
.crumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin: 16px 0 8px;
  flex-wrap: wrap;
}

.crumb-trail a {
  color: var(--muted);
  text-decoration: none;
}

.crumb-trail a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.hero-header {
  padding: 24px 0 16px;
}

.hero-header-compact {
  padding: 16px 0 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}

h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--text);
}

.hero-lead {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

/* Tool Shell & Interactive Simulator */
.sim-quick-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text);
}
.tool-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
}

.tool-shell:fullscreen {
  overflow-y: auto;
  padding: 32px;
  background: var(--bg);
}

.sim-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.mode-pills {
  display: inline-flex;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  flex-wrap: wrap;
}

.mode-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 36px;
}

.mode-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--surface);
}

.sim-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--surface);
  border: 0;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  min-height: 48px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--surface);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--primary);
}

.sim-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 24px;
  align-items: start;
}

.spinner-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dreidel-visual-wrap {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.dreidel-svg {
  width: 196px;
  height: 196px;
  transition: transform 0.18s ease-out;
  transform-origin: 50% 56%;
}

.dreidel-svg.is-spinning {
  animation: dreidelWobble 0.22s linear infinite;
}

@keyframes dreidelWobble {
  0% { transform: rotate(-11deg) scale(1.02) translateX(-4px); }
  25% { transform: rotate(0deg) scale(0.96, 1.03) translateX(0); }
  50% { transform: rotate(11deg) scale(1.02) translateX(4px); }
  75% { transform: rotate(0deg) scale(0.96, 1.03) translateX(0); }
  100% { transform: rotate(-11deg) scale(1.02) translateX(-4px); }
}

.outcome-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  width: 100%;
}

.outcome-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.outcome-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.spin-action-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.spin-action-row .btn-primary {
  flex: 1 1 200px;
}

.sides-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.side-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.side-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.side-heb {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.side-chip.is-active .side-heb {
  color: var(--accent);
}

.side-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.side-rule {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* Multiplayer Pot Panel */
.pot-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pot-bowl {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pot-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.pot-count {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.pot-coins-dots {
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 2px;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.player-row.is-turn {
  background: var(--surface-alt);
  border-color: var(--primary);
}

.player-row.is-out {
  opacity: 0.55;
}

.player-name-input {
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 8px;
  width: 130px;
}

.player-name-input:focus {
  background: var(--surface);
  border-color: var(--primary);
}

.turn-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.gelt-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 8px;
}

.pot-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--muted);
}

.pot-select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
}

.spin-log {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  color: var(--muted);
  max-height: 120px;
  overflow-y: auto;
}

.spin-log p {
  margin: 0 0 4px;
}

.lab-drawer {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.lab-drawer summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.lab-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.lab-stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.lab-stat-val {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.lab-stat-lbl {
  font-size: 12px;
  color: var(--muted);
}

/* Song Player Tool Styles */
.song-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.lyric-sheet {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}

.lyric-line {
  font-size: 18px;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--text);
}

.lyric-line.is-singing {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

/* Engagement Bar */
.engage-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 32px;
}

.engage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.engage-btn {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.engage-btn[data-gf-liked],
.engage-btn[aria-pressed="true"] {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

/* Hub Guide Cards */
.guide-hub-section {
  margin: 48px 0;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 16px;
}

.guide-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
}

.guide-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.guide-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.guide-card-body {
  padding: 16px 24px 24px;
}

.guide-card-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  display: block;
  margin-bottom: 4px;
}

.guide-card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text);
}

.guide-card-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* Article Prose & Featured Images */
.article-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
}

.featured-figure {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.featured-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.featured-figure figcaption {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.prose {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  max-width: 70ch;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  line-height: 1.2;
  margin: 32px 0 12px;
  color: var(--text);
}

.prose h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.2;
  margin: 24px 0 8px;
  color: var(--text);
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.prose th,
.prose td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 700;
}

.callout-box {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 24px;
  margin: 24px 0;
  max-width: 70ch;
}

/* FAQ Section */
.faq-section {
  margin: 48px 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
}

.faq-q {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.faq-a {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

/* Comments Section */
.comments-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  margin: 48px 0;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  max-width: 70ch;
}

.comment-input,
.comment-textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
}

.comment-card {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.comment-card[data-gf-owner] {
  background: var(--surface-alt);
  padding: 16px;
  border-radius: 8px;
}

.comment-meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.owner-pill {
  background: var(--primary);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}

[data-gf-comments][data-gf-empty]::before {
  content: "Share your family's favorite dreidel house rule or longest gelt streak below.";
  display: block;
  font-size: 14px;
  color: var(--muted);
  padding: 12px 0;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 64px;
  font-size: 14px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}

@media print {
  .site-topbar, .engage-strip, .comments-section, .site-footer, .no-print {
    display: none !important;
  }
  body, .article-shell {
    background: #ffffff;
    border: 0;
    box-shadow: none;
  }
}

@media (max-width: 820px) {
  .sim-grid,
  .song-stage,
  .guide-cards-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .lab-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 16px;
  }
  h1 {
    font-size: 28px;
  }
  .prose h2,
  .section-heading {
    font-size: 22px;
  }
  .tool-shell,
  .article-shell,
  .comments-section {
    padding: 16px;
  }
  .sides-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .spin-action-row .btn-primary,
  .spin-action-row .btn-secondary {
    width: 100%;
  }
}
