:root {
  --teal: #1d4e4c;
  --teal-dark: #123332;
  --orange: #ef9b5b;
  --yellow: #f7d565;
  --spicy: #d9622b;
  --bg: #ffffff;
  --ink: #26312f;
  --paper: #fbfaf7;
  --border: #e7e2d8;
  --radius: 18px;
}

* { box-sizing: border-box; }

/* Access gate */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.access-gate.hidden { display: none; }

body.gate-open { overflow: hidden; }

.access-card {
  max-width: 440px;
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(30, 60, 58, 0.18);
  text-align: center;
}

.access-card .sun-logo {
  width: 90px;
  height: auto;
  display: block;
  margin: 0 auto 16px;
}

.access-card h2 {
  color: var(--teal-dark);
  font-size: 1.35rem;
  margin: 0 0 8px;
}

.access-lede {
  color: #55605d;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.access-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.access-form select,
.access-form input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 2px solid var(--border);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.access-form select:focus,
.access-form input:focus {
  outline: none;
  border-color: var(--orange);
}

.access-form .btn {
  margin-top: 6px;
  width: 100%;
}

.access-note {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: #9aa19d;
  line-height: 1.4;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Header */
header.site-header {
  text-align: center;
  padding-top: 12px;
  margin-bottom: 8px;
}

.sun-logo {
  width: 130px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
}

.org-tagline {
  max-width: 380px;
  margin: 6px auto 0;
  color: var(--teal);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0.85;
}

.wordmark {
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--teal);
  letter-spacing: 0.5px;
  margin: 0;
}

.tagline {
  color: var(--teal);
  opacity: 0.65;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Hero */
.hero {
  text-align: center;
  margin: 36px 0 28px;
}

.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 6px;
  color: var(--teal-dark);
  font-weight: 800;
}

.hero p.lede {
  max-width: 560px;
  margin: 0 auto;
  color: #55605d;
  font-size: 1.05rem;
  line-height: 1.55;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid transparent;
}

.pill .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.pill.mild   { background: #eaf4f2; color: var(--teal); border-color: #cfe6e2; }
.pill.medium { background: #fef1e1; color: #b56a26; border-color: #f6d9b4; }
.pill.spicy  { background: #fbe6db; color: var(--spicy); border-color: #f2c3a4; }

.pill.mild .dot   { background: var(--teal); }
.pill.medium .dot { background: var(--orange); }
.pill.spicy .dot  { background: var(--spicy); }

/* Mode tabs */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 36px 0 26px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.mode-tab {
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: #8a938f;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s ease, border-color .15s ease;
}

.mode-tab:hover { color: var(--teal); }

.mode-tab.active {
  color: var(--teal-dark);
  border-bottom-color: var(--orange);
}

.mode-panel { display: none; }
.mode-panel.active { display: block; }

/* Difficulty filter chips */
.filter-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.chip {
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--paper);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  color: #6c7571;
  transition: all .15s ease;
}

.chip:hover { border-color: var(--orange); }

.chip.active[data-diff="all"]    { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.chip.active[data-diff="mild"]   { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.active[data-diff="medium"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip.active[data-diff="spicy"]  { background: var(--spicy); border-color: var(--spicy); color: #fff; }

.chip .check {
  display: none;
  margin-right: 5px;
  font-weight: 800;
}

.chip.active .check { display: inline; }

/* Draw stage */
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.card-slot {
  width: 100%;
  max-width: 440px;
  height: 320px;
  perspective: 1400px;
}

.card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.25,.9,.35,1);
  cursor: pointer;
}

.card.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(30, 60, 58, 0.14);
}

.card-back {
  background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
}

.back-logo-badge {
  background: #fff;
  border-radius: 20px;
  padding: 18px 24px;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.back-logo {
  width: 110px;
  height: auto;
  display: block;
}

.card-back .cta {
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.85;
}

.card-front {
  background: var(--paper);
  border: 2px solid var(--border);
  transform: rotateY(180deg);
  justify-content: space-between;
  overflow: hidden;
}

.card-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.32s ease, opacity 0.32s ease;
}

.card-content.slide-out { transform: translateX(-42px); opacity: 0; }

.card-content.slide-in-prep {
  transition: none;
  transform: translateX(42px);
  opacity: 0;
}

.cat-tag {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.cat-tag.mild   { background: var(--teal); }
.cat-tag.medium { background: var(--orange); }
.cat-tag.spicy  { background: var(--spicy); }

.card-front .question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-front .num {
  align-self: flex-end;
  font-size: 0.8rem;
  color: #a5aca9;
}

.controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  border: none;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 6px 18px rgba(239, 155, 91, 0.4);
}

.btn-primary:hover { background: #e58a44; }

.btn-secondary {
  background: none;
  color: var(--teal);
  border: 2px solid var(--teal);
}

.btn-secondary:hover { background: #eaf4f2; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.hint {
  color: #9aa19d;
  font-size: 0.85rem;
  text-align: center;
}

/* Play the Game — setup / play / summary views */
.game-view { display: none; }
.game-view.active { display: block; }

#gameSetup.active,
#gamePlay.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.setup-lede {
  color: #55605d;
  font-size: 1rem;
  text-align: center;
  margin: 0 0 22px;
  max-width: 480px;
}

.setup-hint {
  color: #9aa19d;
  font-size: 0.85rem;
  text-align: center;
  margin: 16px 0 26px;
}

.play-progress {
  color: #9aa19d;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

.summary-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 22px;
}

.summary-card h2 {
  color: var(--teal-dark);
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.summary-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.summary-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-dark);
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-body .cat-tag { align-self: flex-start; }

.summary-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}

#gameSummary .controls { margin-top: 4px; }

/* Browse view — theater */
.theater {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.theater-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.theater-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--paper);
  color: var(--teal);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: all .15s ease;
}

.theater-nav:hover { border-color: var(--orange); color: var(--orange); }
.theater-nav:disabled { opacity: 0.35; cursor: default; }
.theater-nav:disabled:hover { border-color: var(--border); color: var(--teal); }

.theater-card {
  width: 100%;
  max-width: 460px;
  min-height: 300px;
  background: var(--paper);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  box-shadow: 0 10px 30px rgba(30, 60, 58, 0.12);
}

.theater-card .cat-tag { align-self: flex-start; }

.theater-question {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.4;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 4px;
}

.theater-index {
  align-self: flex-end;
  font-size: 0.8rem;
  color: #a5aca9;
}

.carousel-wrap { width: 100%; }

.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: 6px 4px 16px;
}

.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.carousel-card {
  flex: 0 0 auto;
  width: 128px;
  min-height: 92px;
  background: var(--paper);
  border: 2px solid var(--border);
  border-left: 5px solid var(--teal);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.carousel-card.medium { border-left-color: var(--orange); }
.carousel-card.spicy  { border-left-color: var(--spicy); }

.carousel-card:hover { border-color: var(--orange); }

.carousel-card.active {
  background: #eaf4f2;
  border-color: var(--teal);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 16px rgba(30, 60, 58, 0.16);
}

.carousel-card.active.medium { background: #fef1e1; }
.carousel-card.active.spicy  { background: #fbe6db; }

.carousel-card .mini-num {
  font-size: 0.68rem;
  font-weight: 800;
  color: #b9c0bc;
}

.carousel-card .mini-text {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

@media (max-width: 480px) {
  .theater-card { min-height: 260px; padding: 22px; }
  .theater-question { font-size: 1.05rem; }
  .theater-nav { width: 36px; height: 36px; font-size: 1.3rem; }
}

/* About & How to Play */
.about-groups {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.about-card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
}

.about-card h2 {
  color: var(--teal-dark);
  font-size: 1.25rem;
  margin: 0 0 14px;
}

.about-lede {
  color: #55605d;
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 0 10px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.badge {
  background: #eaf4f2;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 999px;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 2px solid var(--teal);
  color: var(--teal);
  background: #fff;
  transition: all 0.15s ease;
}

.resource-link:hover {
  background: #eaf4f2;
}

.resource-link-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 6px 16px rgba(239, 155, 91, 0.35);
}

.resource-link-primary:hover {
  background: #e58a44;
  border-color: #e58a44;
}

.use-list, .norms-list, .type-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.use-list li, .norms-list li {
  position: relative;
  padding-left: 22px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.use-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--orange);
}

.norms-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

.type-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.type-list .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  transform: translateY(1px);
}

.type-list .dot.mild   { background: var(--teal); }
.type-list .dot.medium { background: var(--orange); }
.type-list .dot.spicy  { background: var(--spicy); }

.instructions-list {
  margin: 14px 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.instructions-list li {
  position: relative;
  padding-left: 38px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
  counter-increment: step;
}

.instructions-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: #9aa19d;
  font-size: 0.85rem;
}

footer .wordmark-mini {
  color: var(--teal);
  font-weight: 800;
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.1rem; }
  .card-slot { height: 360px; }
  .card-front .question { font-size: 1.1rem; }
}
