:root {
  --cream: #fbf7f0;
  --cream-deep: #f2e8d8;
  --paper: #ffffff;
  --cedar: #2a1d15;
  --cedar-mid: #4a3427;
  --cedar-soft: #6c5343;
  --flannel-red: #b83227;
  --flannel-red-dark: #8e2119;
  --pine: #24553a;
  --pine-light: #e5f2ea;
  --gold: #e5a93b;
  --gold-soft: #fdf3dc;
  --navy: #243b55;
  --rust: #c65d28;
  --border: #e5d8c5;
  --shadow: 0 12px 32px rgba(42, 29, 21, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

/* Portal-Subtle Theme Accents */
body[data-portal="kids"] {
  --cream: #fffbf2;
  --cream-deep: #f7ebd2;
}

body[data-portal="adults"] {
  --cream: #f5f1ea;
  --cream-deep: #e8dfd1;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--cedar);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease;
}

h1, h2, h3, h4, .brand-name {
  font-family: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
  line-height: 1.18;
  margin-top: 0;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

/* Subtle 90s Buffalo Plaid Accent Strip */
.flannel-banner {
  background-color: #2c1614;
  background-image:
    repeating-linear-gradient(90deg, rgba(184, 50, 39, 0.34) 0px, rgba(184, 50, 39, 0.34) 38px, transparent 38px, transparent 76px),
    repeating-linear-gradient(0deg, rgba(184, 50, 39, 0.34) 0px, rgba(184, 50, 39, 0.34) 38px, transparent 38px, transparent 76px),
    radial-gradient(circle at 80% 25%, rgba(229, 169, 59, 0.25), transparent 55%);
  color: #fffaf2;
}

body[data-portal="kids"] .flannel-banner {
  background-color: #1f3d2b;
  background-image:
    repeating-linear-gradient(90deg, rgba(229, 169, 59, 0.25) 0px, rgba(229, 169, 59, 0.25) 38px, transparent 38px, transparent 76px),
    repeating-linear-gradient(0deg, rgba(184, 50, 39, 0.28) 0px, rgba(184, 50, 39, 0.28) 38px, transparent 38px, transparent 76px),
    radial-gradient(circle at 80% 25%, rgba(229, 169, 59, 0.34), transparent 55%);
}

body[data-portal="adults"] .flannel-banner {
  background-color: #182332;
  background-image:
    repeating-linear-gradient(90deg, rgba(36, 59, 85, 0.48) 0px, rgba(36, 59, 85, 0.48) 38px, transparent 38px, transparent 76px),
    repeating-linear-gradient(0deg, rgba(184, 50, 39, 0.22) 0px, rgba(184, 50, 39, 0.22) 38px, transparent 38px, transparent 76px),
    radial-gradient(circle at 80% 25%, rgba(229, 169, 59, 0.22), transparent 55%);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 247, 240, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--flannel-red);
}

.brand-name {
  display: block;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--cedar);
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--flannel-red);
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--cedar-mid);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: var(--cream-deep);
}

.nav-btn.active {
  background: var(--cedar);
  color: #fff;
}

.status-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--cedar);
}

.coin-pill {
  background: var(--gold-soft);
  border-color: #ebd08f;
  cursor: pointer;
}

.coin-pill:hover {
  background: #f9e7bc;
}

.streak-pill {
  background: #fff2e8;
  border-color: #f0c3a4;
  color: #a64116;
}

.pass-pill {
  cursor: pointer;
  background: var(--flannel-red);
  border-color: var(--flannel-red);
  color: #fff;
}

.pass-pill.unlocked {
  background: var(--pine);
  border-color: var(--pine);
}

/* Prominent 3-Age Portal Switcher Ribbon */
.portal-ribbon {
  background: var(--cedar);
  color: #fffaf2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-ribbon-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-ribbon-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffd78a;
}

.portal-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.portal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid rgba(255, 250, 242, 0.22);
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.portal-tab strong {
  font-size: 0.86rem;
  display: inline;
}

.portal-tab small {
  font-size: 0.74rem;
  opacity: 0.82;
  margin-left: 4px;
}

.portal-tab:hover {
  background: rgba(255, 250, 242, 0.16);
}

.portal-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--cedar);
}

.portal-tab.active small {
  opacity: 0.9;
  font-weight: 700;
}

/* After Hours Bedtime Banner */
.after-hours-banner {
  background: linear-gradient(135deg, #1b2838 0%, #2b1d24 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 20px 26px;
  color: #fffaf2;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

.after-hours-joke {
  font-family: "Fredoka", sans-serif;
  font-size: 1.24rem;
  margin: 0;
  color: #ffe3a8;
  line-height: 1.35;
}

/* Main Container */
.main-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 64px;
}

.view {
  display: none;
  animation: fadeUp 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.18);
  color: #ffd78a;
  margin-bottom: 12px;
}

.eyebrow.dark {
  background: var(--gold-soft);
  color: var(--cedar-mid);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.btn-lg {
  padding: 14px 22px;
  font-size: 0.98rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--flannel-red);
  color: #fff;
  box-shadow: 0 6px 18px rgba(184, 50, 39, 0.26);
}

.btn-primary:hover:not(:disabled) {
  background: var(--flannel-red-dark);
}

.btn-secondary {
  background: var(--pine);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #1b432d;
}

.btn-ghost {
  background: transparent;
  color: var(--cedar);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--cream-deep);
}

/* Hero */
.hero-card {
  border-radius: var(--radius-lg);
  padding: 34px;
  display: grid;
  grid-template-columns: 1.28fr 0.82fr;
  gap: 28px;
  align-items: center;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

.hero-copy h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  margin-bottom: 10px;
  color: #fffaf2;
}

.hero-tagline {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffd78a;
  margin: 0 0 10px;
}

.hero-desc {
  color: rgba(255, 250, 242, 0.92);
  margin: 0 0 18px;
  font-size: 0.98rem;
}

.hero-portal-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.hero-portal-btn {
  border: 1.5px solid rgba(255, 250, 242, 0.35);
  background: rgba(255, 250, 242, 0.12);
  color: #fffaf2;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.hero-portal-btn.active {
  background: #fffaf2;
  color: var(--cedar);
  border-color: #fffaf2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: rgba(255, 250, 242, 0.84);
  font-weight: 600;
}

.montey-spotlight {
  background: rgba(255, 250, 242, 0.1);
  border: 1px solid rgba(255, 250, 242, 0.22);
  border-radius: 20px;
  padding: 14px;
  backdrop-filter: blur(6px);
}

.montey-spotlight img {
  border-radius: 14px;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.spotlight-caption {
  padding: 12px 6px 4px;
  display: flex;
  flex-direction: column;
}

.spotlight-caption strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.08rem;
  color: #fff;
}

.spotlight-caption span {
  font-size: 0.84rem;
  color: #ffd78a;
}

/* Panels */
.panel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.muted {
  color: var(--cedar-soft);
}

.small-note {
  font-size: 0.84rem;
  color: var(--cedar-soft);
}

/* Daily Flannel Money Challenge */
.daily-panel {
  border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffdf8 0%, #fff9ec 100%);
}

.daily-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.daily-host-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.daily-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.daily-streak-box {
  background: var(--cedar);
  color: #ffd78a;
  padding: 10px 16px;
  border-radius: 14px;
  text-align: center;
}

.daily-streak-box span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(255, 250, 242, 0.8);
}

.daily-streak-box strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
}

.daily-question {
  font-size: 1.04rem;
  font-weight: 700;
  margin: 0 0 12px;
}

.daily-solved-box {
  background: var(--pine-light);
  border: 1.5px solid var(--pine);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--cedar);
}

/* Progress & Crew Strip */
.progress-readout {
  min-width: 220px;
}

.progress-track,
.bar-track {
  height: 14px;
  background: var(--cream-deep);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill,
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pine), var(--gold));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.bar-fill.green {
  background: linear-gradient(90deg, var(--pine), #4ba672);
}

.bar-fill.gold {
  background: linear-gradient(90deg, #d49022, var(--gold));
}

.bar-fill.red {
  background: var(--flannel-red);
}

.mini-crew-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.mini-crew-grid.adults-strip {
  grid-template-columns: repeat(4, 1fr);
}

.mini-crew-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--cream);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.mini-crew-card:hover {
  transform: translateY(-3px);
  border-color: var(--flannel-red);
}

.mini-crew-card.completed {
  border-color: var(--pine);
  background: var(--pine-light);
}

.mini-crew-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 8px;
}

.mini-crew-card strong {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 0.96rem;
}

.mini-crew-card span {
  display: block;
  font-size: 0.74rem;
  color: var(--cedar-soft);
}

.mini-status {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--pine);
}

.inline-rank {
  display: inline-block !important;
  font-size: 0.72rem !important;
  padding: 1px 6px;
  border-radius: 6px;
  color: #fff !important;
  margin-left: 4px;
}

.rank-s {
  background: #d49022;
}

.rank-a {
  background: var(--pine);
}

.rank-b {
  background: var(--navy);
}

/* Banana Coin Locker */
.locker-balance-pill {
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.94rem;
}

.locker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.locker-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.locker-card.owned {
  background: #fff;
  border-color: var(--gold);
}

.locker-card.equipped {
  background: var(--pine-light);
  border-color: var(--pine);
}

.locker-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.locker-cost {
  font-size: 0.78rem;
  color: var(--cedar-mid);
}

/* Features & Offer */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}

.feature-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--flannel-red);
  margin-bottom: 8px;
}

.offer-box {
  background: var(--paper);
  border: 2px solid var(--flannel-red);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 26px;
  align-items: center;
  box-shadow: var(--shadow);
}

.offer-list {
  padding-left: 20px;
  margin: 14px 0 0;
}

.offer-list li {
  margin-bottom: 8px;
  font-weight: 500;
}

.offer-right {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-amount {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--cedar);
}

.price-note {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cedar-soft);
}

/* Section Headers */
.section-header {
  max-width: 760px;
  margin-bottom: 22px;
}

.section-header h1,
.section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  margin-bottom: 8px;
}

/* 3D Flippable Crew Cards (Expanded for Hilarious Origin Backstories!) */
.crew-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.flip-card {
  perspective: 1200px;
  height: 610px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}

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

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #fffdf9 0%, #f5ecdc 100%);
}

.crew-photo-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.crew-photo-wrap img {
  width: 100%;
  aspect-ratio: 1 / 0.72;
  object-fit: cover;
  object-position: center 22%;
}

.flannel-chip {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: rgba(42, 29, 21, 0.86);
}

.crew-meta {
  flex: 1;
}

.crew-meta h2 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.crew-species {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--flannel-red);
  margin-bottom: 6px;
}

.crew-catchphrase {
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 700;
  color: var(--pine);
  margin: 0 0 8px;
}

.origin-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--cedar-mid);
}

.origin-box strong {
  display: block;
  color: var(--cedar);
  margin-bottom: 3px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.origin-box p {
  margin: 0;
}

.crew-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.crew-card-actions .btn {
  flex: 1;
  padding: 9px 10px;
  font-size: 0.82rem;
}

.wildlife-facts {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  flex: 1;
}

.wildlife-facts li {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 9px;
}

.wildlife-facts strong {
  color: var(--pine);
}

/* Mission Selector & Stage */
.mission-selector-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.mission-selector-grid.adults-lab-grid {
  grid-template-columns: repeat(2, 1fr);
}

.mission-tile {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}

.mission-tile.completed {
  border-color: var(--pine);
}

.mission-tile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mission-tile-head img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
}

.mission-badge-tag {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--cedar-mid);
}

.mission-badge-tag.done {
  background: var(--pine-light);
  color: var(--pine);
}

.mission-badge-tag.locked {
  background: #f3e4e2;
  color: var(--flannel-red);
}

.mission-stage {
  background: var(--paper);
  border: 2px solid var(--cedar);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}

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

.stage-host {
  display: flex;
  align-items: center;
  gap: 14px;
}

.stage-host img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--flannel-red);
}

/* Interactive Mission & Arcade Controls */
.statement-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.statement-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  flex-wrap: wrap;
}

.statement-row.canceled {
  background: var(--pine-light);
  border-color: var(--pine);
}

.statement-row.wrong {
  background: #fdeceb;
  border-color: var(--flannel-red);
}

.meter-bar-grid,
.arcade-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.meter-bar-grid.meter-4,
.arcade-hud {
  grid-template-columns: repeat(4, 1fr);
}

.stat-box {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.stat-box span {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cedar-soft);
  text-transform: uppercase;
}

.stat-box strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.42rem;
  color: var(--cedar);
}

.coin-jar-wrap {
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.weather-banner {
  background: var(--pine-light);
  border: 1.5px solid var(--pine);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Kids 3-Jar Visuals & Banana Grove */
.jars-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.jar-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.jar-glass {
  width: 84px;
  height: 112px;
  border: 3px solid var(--cedar);
  border-radius: 14px 14px 20px 20px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  margin-bottom: 6px;
}

.jar-fill {
  width: 100%;
  transition: height 0.25s ease;
}

.jar-spend { background: linear-gradient(180deg, #f3a63b, #c65d28); }
.jar-save { background: linear-gradient(180deg, #43a36d, #24553a); }
.jar-give { background: linear-gradient(180deg, #5278a8, #243b55); }

.grove-icons {
  font-size: 1.45rem;
  line-height: 1.4;
  min-height: 68px;
  margin: 8px 0;
}

.slider-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.slider-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.slider-card input[type="range"] {
  width: 100%;
  accent-color: var(--flannel-red);
  margin-top: 6px;
}

.chart-box {
  background: #fffdf9;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin: 16px 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.choice-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--flannel-red);
  background: #fff;
}

.choice-btn.selected {
  border-color: var(--pine);
  background: var(--pine-light);
}

/* Reward & Rank Medal */
.mission-reward-box {
  margin-top: 18px;
  padding: 22px;
  border-radius: 16px;
  background: var(--pine-light);
  border: 2px solid var(--pine);
}

.reward-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.rank-medal {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(42, 29, 21, 0.18);
  flex-shrink: 0;
}

.rank-medal .rank-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rank-medal strong {
  font-family: "Fredoka", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.reward-metrics {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.dinner-prompt-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #b9dac7;
}

/* Adults After Hours Labs UI */
.adult-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.leak-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.leak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  flex-wrap: wrap;
}

.leak-row.active {
  background: #fff9f6;
  border-color: var(--flannel-red);
}

.leak-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.leak-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--flannel-red);
}

.leak-amt-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.leak-amt-wrap input {
  width: 78px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-weight: 700;
}

.custom-add-bar {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 10px;
  margin: 14px 0 20px;
}

.custom-add-bar input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
}

.hitlist-panel {
  background: var(--cream);
  border: 2px dashed var(--cedar);
  border-radius: 16px;
  padding: 18px;
}

.hitlist-items {
  margin: 0;
  padding-left: 20px;
}

.hitlist-items li {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.debt-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debt-head,
.debt-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr 1fr;
  gap: 8px;
  align-items: center;
}

.debt-head {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--cedar-soft);
  padding: 0 4px;
}

.debt-row input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: #fff;
}

.playbook-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.playbook-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.playbook-card {
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.script-quote {
  background: #fff;
  border-left: 4px solid var(--pine);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  font-size: 0.9rem;
}

/* Certificate Studio */
.cert-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.25fr;
  gap: 24px;
  align-items: start;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cedar-mid);
}

.field input, .field select, .field textarea {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: var(--cedar);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cert-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.cert-canvas-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 26px rgba(42, 29, 21, 0.12);
}

#cert-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Parents Grid */
.parent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.parent-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 16, 11, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  padding: 30px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  background: var(--cream-deep);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.modal-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-box.highlight {
  border-color: var(--flannel-red);
  background: #fff9f8;
}

.modal-box input {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.code-feedback {
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0;
  min-height: 1.2em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--cream-deep);
  padding: 24px 20px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--cedar-soft);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--flannel-red);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

/* Print Only Certificate */
.print-only {
  display: none;
}

@media print {
  @page {
    size: letter landscape;
    margin: 0.25in;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  #print-certificate-img {
    width: 100%;
    height: auto;
    page-break-inside: avoid;
  }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-card,
  .offer-box,
  .cert-layout,
  .adult-two-col,
  .playbook-grid {
    grid-template-columns: 1fr;
  }
  .crew-grid,
  .mission-selector-grid,
  .locker-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mini-crew-grid,
  .mini-crew-grid.adults-strip {
    grid-template-columns: repeat(3, 1fr);
  }
  .feature-grid,
  .meter-bar-grid,
  .meter-bar-grid.meter-4,
  .arcade-hud,
  .slider-grid,
  .jars-visual-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .crew-grid,
  .mission-selector-grid,
  .mission-selector-grid.adults-lab-grid,
  .locker-grid,
  .parent-grid,
  .modal-split,
  .field-row,
  .custom-add-bar,
  .debt-head,
  .debt-row {
    grid-template-columns: 1fr;
  }
  .mini-crew-grid,
  .mini-crew-grid.adults-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero-card {
    padding: 22px;
  }
  .portal-tabs {
    justify-content: flex-start;
  }
}
