/* Family Fun Nite — locked dark adult/parent chrome
   Warm library / campfire: ember charcoal bg + soft gold accents.
   Category box colors and green age tabs stay locked. */

:root {
  --bg: #2c241c;
  --bg-deep: #231c16;
  --bg-glow: #33281e;
  --text: #efe4d4;
  --text-muted: #c4b5a2;
  --text-soft: #a89886;
  --accent: #c9a46c;
  --accent-soft: #b8895a;
  --accent-ember: #a86b52;
  --line: rgba(201, 164, 108, 0.22);
  --line-soft: rgba(201, 164, 108, 0.12);
  --tab: #6b7a62;
  --tab-text: #e8dfd0;
  --underline: #e8dfd0;
  --board: #a86b52;
  --puzzles: #5a6f86;
  --coloring: #9a9590;
  --books: #8a7d6e;
  --screen: #2f3d56;
  --toys: #7a8a72;
  --outdoor: #6a7a5a;
  --cards: #a89058;
  --side-boys: #5a7a96;
  --side-boys-soft: #8fa4b8;
  --side-girls: #a06e7a;
  --side-girls-soft: #c49aa6;
  --serif: "Fraunces", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --max: 520px;
  --max-wide: 1040px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(168, 107, 82, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(201, 164, 108, 0.06), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent); }

.wrap {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
}

/* —— Home chrome —— */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.25rem 0 3rem;
  min-height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover { text-decoration: none; color: inherit; }

.logo-svg {
  width: 64px;
  height: 64px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px rgba(201, 164, 108, 0.25));
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.85rem, 6.5vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  text-align: center;
  text-shadow: 0 0 28px rgba(201, 164, 108, 0.18);
}

/* Age tabs */
.age-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.4rem;
  width: min(100% - 1rem, var(--max));
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.age-tab {
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  border: none;
  border-radius: 8px;
  background: var(--tab);
  color: var(--tab-text);
  font-family: var(--serif);
  font-size: clamp(0.85rem, 3.2vw, 1.05rem);
  font-weight: 500;
  padding: 0.7rem 0.25rem 0.75rem;
  cursor: pointer;
  position: relative;
  line-height: 1;
  transition: filter 0.15s ease;
}

.age-tab:hover { filter: brightness(1.06); }
.age-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.age-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 5px;
  height: 1.5px;
  background: var(--underline);
  border-radius: 1px;
}

/* Boys | Girls side toggle (10-13 / 14-18 only) */
.side-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 1.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(35, 28, 22, 0.55);
  overflow: hidden;
}

.side-toggle.is-visible { display: inline-flex; }

.side-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.55rem 1.35rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.side-btn + .side-btn {
  border-left: 1px solid var(--line-soft);
}

/* Boys = muted blue, Girls = muted pink (calm, not neon) */
.side-btn[data-side="boys"] {
  color: #8fa4b8;
}
.side-btn[data-side="girls"] {
  color: #c49aa6;
}
.side-btn[data-side="boys"]:hover {
  color: #b7c9d8;
}
.side-btn[data-side="girls"]:hover {
  color: #d9b3bd;
}

.side-btn[data-side="boys"][aria-selected="true"] {
  color: #dce6ef;
  background: rgba(90, 122, 150, 0.32);
  box-shadow: inset 0 -1.5px 0 #7a9bb0;
}
.side-btn[data-side="girls"][aria-selected="true"] {
  color: #f0e0e4;
  background: rgba(160, 110, 122, 0.30);
  box-shadow: inset 0 -1.5px 0 #b88896;
}

.side-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Category boxes — color follows CATEGORY (class), never slot position */
.boxes {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.45rem;
  width: min(100% - 1rem, var(--max));
  margin: 0;
  padding: 0;
}

.box {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 0.72;
  max-height: 7.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius);
  padding: 0.55rem 0.3rem;
  font-family: var(--serif);
  font-size: clamp(0.72rem, 2.8vw, 0.95rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.box:hover {
  text-decoration: none;
  color: var(--text);
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.box:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Box colors match the 10-13 row on EVERY age (slot, not category).
   10-13 order: Board terracotta, Puzzles blue, Books taupe, Cards gold, Screen navy */
.boxes .box:nth-child(1) { background: var(--board); }
.boxes .box:nth-child(2) { background: var(--puzzles); }
.boxes .box:nth-child(3) { background: var(--books); }
.boxes .box:nth-child(4) { background: var(--cards); }
.boxes .box:nth-child(5) { background: var(--screen); }

.box-label {
  display: block;
}

.box-label--two {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  border-top: 1px solid transparent;
}

.site-footer a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a:hover { color: var(--accent); }

.disclosure-short {
  max-width: 28rem;
  margin: 0 auto 0.75rem;
  line-height: 1.45;
}

/* —— List pages —— */
.list-page {
  padding: 1.5rem 0 3rem;
}

.list-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.list-back:hover { color: var(--accent); }

.list-header {
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.list-header h1 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.65rem;
  color: var(--text);
  text-shadow: 0 0 20px rgba(201, 164, 108, 0.12);
}

.list-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.item-list .item,
.item-list li.item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.item-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(35, 28, 22, 0.55);
  border: 1px solid var(--line-soft);
}

.item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.item-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
}

.item-list .item:hover .item-name { color: var(--accent); }

.item-blurb {
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.item-link {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: center;
}

.item-link:hover { color: var(--accent); }

/* —— About / prose —— */
.prose-page {
  padding: 1.75rem 0 3rem;
}

.prose-page h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.85rem;
  margin: 0 0 0.5rem;
  text-shadow: 0 0 20px rgba(201, 164, 108, 0.12);
}

.prose-page h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--accent);
}

.prose-page p,
.prose-page li {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.prose-page ul { padding-left: 1.2rem; }

.page-header-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-header-mini .logo-svg {
  width: 36px;
  height: 36px;
}

.page-header-mini .mini-word {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.page-header-mini .mini-word:hover {
  text-decoration: none;
  color: var(--accent);
}

/* —— Mobile keeps phone column; tablet+ opens up —— */
@media (min-width: 640px) {
  .boxes { gap: 0.6rem; }
  .box {
    max-height: 8.5rem;
    font-size: 1rem;
  }
  .age-tabs { gap: 0.5rem; }
}

/* —— Real desktop site (not a 520px phone in a wide window) —— */
@media (min-width: 900px) {
  :root {
    --max: var(--max-wide);
  }

  .home {
    padding: 3rem 0 3.5rem;
  }

  .brand {
    gap: 1.1rem;
    margin-bottom: 2.25rem;
  }

  .logo-svg {
    width: 88px;
    height: 88px;
  }

  .wordmark {
    font-size: clamp(2.4rem, 3.2vw, 3rem);
  }

  .age-tabs {
    width: min(100% - 2rem, 42rem);
    gap: 0.65rem;
    margin-bottom: 1.5rem;
  }

  .age-tab {
    font-size: 1.1rem;
    padding: 0.85rem 0.4rem 0.9rem;
  }

  .side-toggle {
    margin-bottom: 1.65rem;
  }

  .side-btn {
    font-size: 1.05rem;
    padding: 0.65rem 1.75rem;
  }

  .boxes {
    width: min(100% - 2rem, var(--max-wide));
    gap: 0.85rem;
    flex-wrap: nowrap;
  }

  .box {
    max-height: 11rem;
    font-size: 1.15rem;
    padding: 0.75rem 0.45rem;
    border-radius: 16px;
  }

  .wrap {
    width: min(100% - 2.5rem, var(--max-wide));
  }

  .list-page {
    padding: 2.25rem 0 3.5rem;
  }

  .list-header h1 {
    font-size: 2.1rem;
  }

  /* List stays single column with thumbs — easier to scan */
  .item-list {
    display: block;
  }

  .item-list li {
    padding: 1rem 0;
  }

  .item-name {
    font-size: 1.15rem;
  }

  .prose-page {
    padding: 2.25rem 0 3.5rem;
    max-width: 44rem;
    margin-inline: auto;
  }

  .prose-page h1 { font-size: 2.15rem; }

  .disclosure-short { max-width: 36rem; }
}

@media (min-width: 1100px) {
  .boxes {
    gap: 1rem;
  }
  .box {
    max-height: 12rem;
  }
}


/* —— Screen: Shows / Movies / Playable (8+) —— */
.screen-sections {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.screen-section-title {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.screen-section .item-list {
  border-top: 1px solid var(--line-soft);
}

@media (min-width: 900px) {
  .screen-sections {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.75rem 2rem;
    align-items: start;
  }

  .screen-section .item-list {
    display: block; /* keep single column inside each section */
    grid-template-columns: none;
  }

  .screen-section-title {
    font-size: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.15rem;
  }
}


@media (max-width: 899px) {
  .item-list .item,
  .item-list li.item {
    grid-template-columns: 64px 1fr auto;
    gap: 0.7rem 0.75rem;
  }
  .item-thumb {
    width: 64px;
    height: 64px;
  }
  .item-name { font-size: 1rem; }
  .item-blurb { font-size: 0.82rem; }
}
