@font-face {
  font-family: "Google Sans";
  src: url("./media/GoogleSans-VariableFont_GRAD,opsz,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
}

.google-sans {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  font-variation-settings: "GRAD" 0;
}

/* ── CSS Variables ── */
:root {
  --color-text:    #222222;
  --color-gold:    #9f6e20;
  --color-bg:      #fffdf7;
  --color-surface: #fff9ee;
  --font-base:     1rem;
  --font-title:    2rem;
  --cat-height:    2rem;
  --radius:        10px;
  --transition:    0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: var(--font-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Page system ── */
.page {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}
.page.active {
  display: flex;
}

/* ── HOME ── */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

.title-brand {
  font-family: "Skyline Vintage", "Google Sans", sans-serif;
  font-size: var(--font-title);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.18em;
  line-height: 0.7;
}

@font-face {
  font-family: "Skyline Vintage";
  src: url("./media/Skyline-Vintage.otf") format("opentype");
}

.subtitle {
  font-size: 0.95rem;
  color: #555;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.cat-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-img {
  height: var(--cat-height);
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

/* ── Buttons ── */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 280px;
  margin-top: 0.5rem;
}

.btn-main {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  background: #fbf9f5;
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  width: 100%;
}

.btn-main:active,
.btn-main.active {
  background: var(--color-gold);
  color: #ffffff;
}

.link-about {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: 0.7rem;
  font-weight: 400;
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: color var(--transition);
}

.link-about:hover {
  color: #555;
}

/* desktop: hover also triggers fill */
@media (hover: hover) {
  .btn-main:hover {
    background: var(--color-gold);
    color: #ffffff;
  }
}

/* ── Inner pages ── */
.page-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8dcc8;
  background: var(--color-surface);
}

.btn-back {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-gold);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0;
  transition: opacity var(--transition);
}
.btn-back:hover { opacity: 0.7; }
.btn-back .arrow { font-size: 1.1rem; line-height: 1; }

.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  gap: 1rem;
  text-align: center;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-placeholder {
  font-size: 0.95rem;
  color: #888;
}

/* ── Responsive scaling ── */
@media (min-width: 480px) {
  :root {
    --font-base:  1.1rem;
    --font-title: 2.2rem;
    --cat-height: 2.2rem;
  }
}

@media (min-width: 768px) {
  :root {
    --font-base:  1.2rem;
    --font-title: 2.4rem;
    --cat-height: 2.4rem;
  }
  .btn-group { max-width: 320px; }
}

@media (min-width: 1024px) {
  :root {
    --font-base:  1.25rem;
    --font-title: 2.5rem;
    --cat-height: 2.5rem;
  }
}

/* ══════════════════════════════════════
   MINI GAME
══════════════════════════════════════ */

.game-body {
  justify-content: flex-start;
  padding-top: 1.5rem;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.game-subtitle {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
  text-align: center;
}

/* ── Day toggle ── */
.day-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
}

.toggle-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.toggle-label.active-label { color: var(--color-text); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--color-gold);
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-track { background: var(--color-gold); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }

/* ── Line dropdown ── */
.line-select {
  font-family: "Google Sans", sans-serif;
  font-size: 0.9rem;
  color: var(--color-text);
  background: #fff;
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239f6e20' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

/* ── Game action buttons ── */
.game-actions {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.btn-game {
  font-family: "Google Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex: 1;
  letter-spacing: 0.03em;
}

.btn-start {
  background: var(--color-gold);
  color: #fff;
  border: 2px solid var(--color-gold);
}
.btn-start:hover { background: #7e5519; border-color: #7e5519; }

.btn-reset {
  background: #fff;
  color: #888;
  border: 2px solid #ccc;
}
.btn-reset:hover { background: #f2f2f2; }

.btn-next {
  background: #fff;
  color: var(--color-gold);
  border: 2px solid var(--color-gold);
  width: 100%;
  margin-top: 0.5rem;
  flex: unset;
}
.btn-next:hover { background: var(--color-gold); color: #fff; }

/* ── Scoreboard ── */
.scoreboard {
  display: flex;
  gap: 1rem;
  justify-content: center;
  width: 100%;
}

.score-item {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}
.score-item.correct { background: #e8f5e9; color: #2e7d32; }
.score-item.wrong   { background: #fdecea; color: #c62828; }

/* ── Question area ── */
.question-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.question-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-prompt {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
  text-align: center;
}

/* ── Station buttons ── */
.station-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.station-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
  padding: 0;
  min-height: 0px;
}

.station-btn.selected {
  border-color: #222;
  border-width: 3px;
}

.station-btn.correct-pick { border-color: #2e7d32; border-width: 3px; }
.station-btn.wrong-pick   { border-color: #c62828; border-width: 3px; }
.station-btn:disabled { cursor: default; }

.line-band {
  width: 100%;
  height: 10px;
  flex-shrink: 0;
}

.station-name {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 0.75rem 0.5rem;
  text-align: center;
  line-height: 1.3;
}

/* ── Result feedback ── */
.result-feedback {
  width: 100%;
  background: #fffbf0;
  border: 1.5px solid #e8dcc8;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text);
  text-align: center;
}

.result-feedback .result-verdict {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.result-feedback .result-verdict.correct { color: #2e7d32; }
.result-feedback .result-verdict.wrong   { color: #c62828; }

/* ── About / link ── */
.link-about {
  font-family: "Google Sans", sans-serif;
  font-optical-sizing: auto;
  font-variation-settings: "GRAD" 0;
  font-size: 0.7rem;
  font-weight: 400;
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: color var(--transition);
}
.link-about:hover { color: #555; }

/* ── About page ── */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.88rem;
  color: #555;
  line-height: 1.6;
  max-width: 340px;
}

.about-content a {
  color: var(--color-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.about-content a:hover { color: #7e5519; }

/* ══════════════════════════════════════
   BROWSE BY STATION
══════════════════════════════════════ */

.browse-body {
  justify-content: flex-start;
  padding-top: 1.5rem;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.search-wrapper { position: relative; width: 100%; }

.browse-search {
  font-family: "Google Sans", sans-serif;
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
  border: 2px solid var(--color-gold);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.browse-search:focus { box-shadow: 0 0 0 3px rgba(159,110,32,0.15); }
.browse-search::placeholder { color: #bbb; }

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid #e8dcc8;
  border-radius: var(--radius);
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  display: none;
}
.search-suggestions.open { display: block; }
.search-suggestions li {
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--color-text);
  border-bottom: 1px solid #f5efe3;
  transition: background 0.12s;
}
.search-suggestions li:last-child { border-bottom: none; }
.search-suggestions li:hover { background: #fff8ec; }

.station-card {
  width: 100%;
  border: 1.5px solid #e8dcc8;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.station-card-band { width: 100%; height: 12px; }
.station-card-body { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; }
.station-card-name { font-size: 1.15rem; font-weight: 700; color: var(--color-text); text-transform: capitalize; }
.station-card-desc { font-size: 0.8rem; color: #888; }

.station-card-stats { display: flex; gap: 0.5rem; width: 100%; }
.stat-item {
  flex: 1;
  background: #fffbf0;
  border: 1px solid #f0e4cc;
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.stat-item.stat-total { background: #fff8ec; border-color: var(--color-gold); }
.stat-label { font-size: 0.68rem; font-weight: 600; color: #aaa; letter-spacing: 0.05em; text-transform: uppercase; }
.stat-value { font-size: 1rem; font-weight: 700; color: var(--color-text); }

.station-card-lines { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; }
.line-pill {
  font-size: 0.7rem; font-weight: 700; color: #fff;
  padding: 0.2rem 0.6rem; border-radius: 999px; letter-spacing: 0.03em;
}