/* Pokemon collector - kid-friendly, vibrant */
:root {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --accent: #e94560;
  --yellow: #ffc93c;
  --green: #6bcb77;
  --blue: #4d96ff;
  --white: #fff;
  --muted: #a0a0b0;
  --collected-glow: rgba(107, 203, 119, 0.4);
  --font-display: "Fredoka", sans-serif;
  --font-body: "Outfit", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
}

/* Skip link: visible on focus for keyboard/screen reader users */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--blue);
  color: var(--white);
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky top: brand bar + header (game menu) */
.sticky-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin: 0 -1.5rem 0 -1.5rem;
  padding: 0 1.5rem 0.5rem 1.5rem;
  isolation: isolate;
}

/* Brand bar – lead gen hook (top of page) */
.brand-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem 1rem;
  margin: -1rem -1.5rem 1rem -1.5rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-bar-text {
  color: var(--muted);
}

.brand-bar strong {
  color: var(--yellow);
}

.brand-bar-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 0.75rem;
}

.brand-bar-links a {
  color: var(--blue);
  text-decoration: none;
}

.brand-bar-links a:hover {
  text-decoration: underline;
  color: var(--white);
}

/* Header */
.sticky-top .header {
  margin-bottom: 1rem;
}
.header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.header-hero {
  margin-bottom: 1rem;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
  background: linear-gradient(135deg, var(--yellow), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats block: progress + balls/badges */
.header-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.region-select-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}
.region-select-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}
.region-select-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.region-select-btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.region-select-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}
.region-select-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.stats-progress-wrap {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 320px;
}

.stats-balls-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.stats-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}

/* Progress */
.progress-bar {
  height: 22px;
  background: var(--card-bg);
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

/* Poké Balls */
.balls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.balls-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.balls-count {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--yellow);
  min-width: 1.5em;
  text-align: center;
}

/* Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  min-height: 28px;
}

.badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.1);
}

.badge.unlocked {
  background: linear-gradient(135deg, rgba(255,201,60,0.3), rgba(233,69,96,0.3));
  color: var(--yellow);
  border-color: var(--yellow);
}

/* Toolbar: search, sort, filters in one row */
.header-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.header-toolbar .search-input {
  min-width: 140px;
}

.header-toolbar .filters {
  margin: 0;
}

/* Filters */
.filters {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--white);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}


.search-input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(255,255,255,0.2);
  background: var(--card-bg);
  color: var(--white);
  border-radius: 8px;
  min-width: 180px;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.sort-select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid rgba(255,255,255,0.2);
  background: var(--card-bg);
  color: var(--white);
  border-radius: 8px;
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Header actions: primary (Trivia, Math) + secondary (Done, Start over) */
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

.action-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.action-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

/* Mobile: compact header so cards are visible */
@media (max-width: 768px) {
  .sticky-top {
    margin: 0 -1rem 0 -1rem;
    padding: 0 1rem 0.4rem 1rem;
  }
  .brand-bar {
    padding: 0.35rem 0.5rem;
    margin: -0.4rem -1rem 0.4rem -1rem;
    font-size: 0.75rem;
    gap: 0.35rem 0.5rem;
  }
  .brand-bar-text {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-bar-links {
    gap: 0 0.5rem;
  }
  .brand-bar-links a {
    font-size: 0.8rem;
  }

  .header-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0 0.6rem;
    margin-bottom: 0;
  }
  .header-compact-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
  }
  .header-compact-balls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
  }
  .header-compact-balls .balls-label {
    font-size: 0.8rem;
    color: var(--muted);
  }
  .header-compact-balls .balls-count {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--yellow);
    min-width: 1.5em;
  }
  .header-menu-btn {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 8px;
    cursor: pointer;
  }
  .header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  .sticky-top .header-expandable {
    display: none;
    padding-top: 0.5rem;
  }
  .sticky-top.is-expanded .header-expandable {
    display: block;
  }
  .sticky-top.is-expanded .header-compact {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .header-hero {
    margin-bottom: 0.6rem;
  }
  .header-hero .logo {
    font-size: 1.35rem;
  }
  .tagline {
    font-size: 0.8rem;
    margin: 0;
  }
  .header-stats {
    margin-bottom: 0.6rem;
    gap: 0.5rem 1rem;
  }
  .progress-bar {
    height: 18px;
  }
  .progress-text {
    font-size: 0.8rem;
  }
  .header-toolbar {
    margin-bottom: 0.6rem;
    gap: 0.35rem 0.5rem;
  }
  .header-toolbar .search-input {
    min-width: 100%;
    max-width: 100%;
  }
  .filter-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.65rem;
  }
  .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .action-primary,
  .action-secondary {
    padding: 0;
    margin: 0;
    border: none;
  }
  .trivia-btn,
  .math-btn {
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
  }
  .done-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
  }
}

@media (min-width: 769px) {
  .header-compact {
    display: none;
  }
  .header-compact[aria-hidden="true"] {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  .action-secondary {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.reset-btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
}

.reset-btn:hover {
  color: var(--accent);
  border-color: rgba(233, 69, 96, 0.4);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Trivia button */
.trivia-btn {
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--yellow), #ff6b6b);
  color: var(--bg);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 201, 60, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.trivia-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 201, 60, 0.5);
}

/* Math Challenge button */
.math-btn {
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #6bcb77);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(77, 150, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.math-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(77, 150, 255, 0.5);
}

/* Card detail panel – what's cool about this Pokémon */
.card-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.card-detail-overlay[hidden] {
  display: none;
}

.card-detail-panel {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 3px solid var(--blue);
  box-shadow: 0 0 40px rgba(77, 150, 255, 0.35);
  position: relative;
}

.card-detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.card-detail-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.card-detail-loading {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.card-detail-content {
  padding-top: 0.5rem;
}

.card-detail-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-detail-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.card-detail-meta {
  flex: 1;
  min-width: 0;
}

.card-detail-number {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.card-detail-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
  color: var(--white);
}


.card-detail-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.card-detail-type {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-transform: capitalize;
}

.card-detail-type.type-normal { background: #a8a878; color: #fff; }
.card-detail-type.type-fire { background: #f08030; color: #fff; }
.card-detail-type.type-water { background: #6890f0; color: #fff; }
.card-detail-type.type-electric { background: #f8d030; color: #1a1a2e; }
.card-detail-type.type-grass { background: #78c850; color: #fff; }
.card-detail-type.type-ice { background: #98d8d8; color: #1a1a2e; }
.card-detail-type.type-fighting { background: #c03028; color: #fff; }
.card-detail-type.type-poison { background: #a040a0; color: #fff; }
.card-detail-type.type-ground { background: #e0c068; color: #1a1a2e; }
.card-detail-type.type-flying { background: #a890f0; color: #fff; }
.card-detail-type.type-psychic { background: #f85888; color: #fff; }
.card-detail-type.type-bug { background: #a8b820; color: #fff; }
.card-detail-type.type-rock { background: #b8a038; color: #fff; }
.card-detail-type.type-ghost { background: #705898; color: #fff; }
.card-detail-type.type-dragon { background: #7038f8; color: #fff; }

.card-detail-stats {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.card-detail-cool {
  margin-bottom: 1.25rem;
}

.card-detail-cool-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--yellow);
}

.card-detail-fact {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--white);
  margin: 0;
  opacity: 0.95;
}

.card-detail-evolve {
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.card-detail-evolve-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.card-detail-evolve-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-detail-evolve-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.card-detail-evolve-btn:hover:not(:disabled) {
  border-color: var(--yellow);
  background: rgba(255, 201, 60, 0.15);
}

.card-detail-evolve-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.card-detail-actions {
  margin-top: 1rem;
}

.card-detail-btn {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-detail-btn-primary {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: var(--white);
  box-shadow: 0 4px 14px rgba(107, 203, 119, 0.4);
}

.card-detail-btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(107, 203, 119, 0.5);
}

.card-detail-btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.35);
  margin-bottom: 0.5rem;
}

.card-detail-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--yellow);
}

/* Wild encounter overlay */
.wild-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: var(--yellow);
  text-align: center;
}

.wild-img-wrap {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.wild-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: brightness(1.1);
}

@keyframes wild-run-away {
  0% { transform: translateX(0) scale(1); opacity: 1; }
  60% { transform: translateX(80px) scale(0.9); opacity: 0.7; }
  100% { transform: translateX(160px) scale(0.7); opacity: 0; }
}

.wild-img-wrap.wild-run-away .wild-img {
  animation: wild-run-away 0.6s ease-out forwards;
}

.wild-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-align: center;
  margin: 0 0 1rem;
  color: var(--white);
}

.wild-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.wild-battle-locked-msg {
  font-size: 0.85rem;
  color: var(--muted, rgba(255, 255, 255, 0.75));
  margin: 0.5rem 0 0;
  max-width: 280px;
}

.wild-btn {
  font-family: var(--font-display);
  font-size: 1rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.wild-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

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

.wild-btn-throw {
  background: linear-gradient(135deg, var(--red, #e94560), #ff6b6b);
  color: var(--white);
}

.wild-btn-run {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.wild-btn-battle {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  color: var(--white);
}

.wild-revive-btn {
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: var(--white);
}

/* Battle party order modal */
.battle-party-hint {
  font-size: 0.9rem;
  color: var(--muted, rgba(255, 255, 255, 0.8));
  margin: 0 0 1rem;
  max-width: 320px;
}

.battle-party-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.battle-party-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.battle-party-name {
  font-weight: 600;
}

.battle-party-actions {
  display: flex;
  gap: 0.25rem;
}

.battle-party-move-btn {
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 6px;
  cursor: pointer;
}

.battle-party-move-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.battle-party-remove-btn {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(225, 80, 80, 0.25);
  color: var(--white);
  border-radius: 6px;
  cursor: pointer;
  margin-left: 0.25rem;
}
.battle-party-remove-btn:hover {
  background: rgba(225, 80, 80, 0.4);
}

/* Revive overlay */
.revive-prompt {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.revive-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.revive-options .trivia-option-btn {
  min-width: 3rem;
}

.revive-feedback {
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

.revive-feedback.correct { color: var(--green, #22c55e); }
.revive-feedback.wrong { color: var(--red, #e94560); }

/* Card detail power up */
.card-detail-powerup {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.card-detail-powerup-label {
  font-size: 0.9rem;
  color: var(--muted, rgba(255, 255, 255, 0.8));
  margin: 0 0 0.35rem;
}

/* Battle screen */
.wild-battle {
  margin-top: 0.5rem;
}

.wild-battle-vs {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
  margin: 0 0 0.75rem;
  color: var(--yellow);
}

.wild-battle-sprites {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.wild-battle-yours,
.wild-battle-theirs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.wild-battle-sprite {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 0.1s ease-out;
}

/* Battle move animations: attacker lunges, defender shakes + flash */
@keyframes battle-attack {
  0% { transform: translateX(0) scale(1); }
  40% { transform: translateX(12px) scale(1.08); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes battle-attack-left {
  0% { transform: translateX(0) scale(1); }
  40% { transform: translateX(-12px) scale(1.08); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes battle-hit {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  15% { transform: translateX(-4px); filter: brightness(2); }
  30% { transform: translateX(4px); filter: brightness(2); }
  45% { transform: translateX(-3px); filter: brightness(1.5); }
  60% { transform: translateX(3px); filter: brightness(1.2); }
  75% { transform: translateX(-2px); filter: brightness(1); }
}

.wild-battle-yours.battle-attack .wild-battle-sprite {
  animation: battle-attack 0.4s ease-out;
}

.wild-battle-theirs.battle-attack .wild-battle-sprite {
  animation: battle-attack-left 0.4s ease-out;
}

.wild-battle-yours.battle-hit .wild-battle-sprite,
.wild-battle-theirs.battle-hit .wild-battle-sprite {
  animation: battle-hit 0.45s ease-out;
}

.wild-battle-name {
  font-size: 0.85rem;
  color: var(--white);
}

.wild-battle-vs-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--muted);
}

.wild-hp-bar {
  width: 80px;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  overflow: hidden;
}

.wild-hp-fill {
  height: 100%;
  width: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.wild-battle-yours .wild-hp-fill {
  background: var(--blue);
}

.wild-hp-text {
  font-size: 0.75rem;
  color: var(--muted);
}

.wild-battle-message {
  text-align: center;
  font-size: 0.95rem;
  color: var(--white);
  margin: 0 0 0.75rem;
  min-height: 2.5em;
}

.wild-battle-moves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-width: 320px;
  margin: 0 auto;
}

.wild-battle-move-btn {
  padding: 0.5rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-align: center;
}

.wild-battle-move-btn:hover:not(:disabled) {
  border-color: var(--yellow);
  background: rgba(255, 193, 7, 0.2);
  transform: scale(1.02);
}

.wild-battle-move-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wild-battle-move-btn .move-name {
  display: block;
  font-weight: 600;
}

.wild-battle-move-btn .move-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.wild-math {
  margin-top: 0.5rem;
}

.wild-math-prompt {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--white);
}

.wild-math-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.wild-math-options .trivia-option-btn {
  min-width: 60px;
}

.wild-result {
  text-align: center;
  padding: 0.5rem 0;
}

.wild-result-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
  color: var(--yellow);
}

.wild-result-cta {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.wild-result-cta a {
  color: var(--blue);
  text-decoration: none;
}

.wild-result-cta a:hover {
  text-decoration: underline;
}

/* Math results CTA */
.results-cta {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.results-cta a {
  color: var(--blue);
  text-decoration: none;
}

.results-cta a:hover {
  text-decoration: underline;
}

/* Trivia overlay */
.trivia-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.trivia-overlay[hidden] {
  display: none;
}

.trivia-modal {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  max-width: 420px;
  width: 100%;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 40px rgba(255, 201, 60, 0.3);
  position: relative;
}

.trivia-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--yellow);
  text-align: center;
}

.trivia-score {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.trivia-img-wrap {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.trivia-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: brightness(1.1);
}

.trivia-prompt {
  text-align: center;
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--white);
}

.trivia-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.trivia-option-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: capitalize;
}

.trivia-option-btn:hover:not(:disabled) {
  border-color: var(--yellow);
  background: rgba(255, 201, 60, 0.2);
}

.trivia-option-btn.correct {
  border-color: var(--green);
  background: rgba(107, 203, 119, 0.3);
  color: var(--green);
}

.trivia-option-btn.wrong {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.2);
  color: #ff8a8a;
}

.trivia-option-btn:disabled {
  cursor: default;
  opacity: 0.8;
}

.trivia-feedback {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}

.trivia-feedback.correct {
  background: rgba(107, 203, 119, 0.25);
  color: var(--green);
}

.trivia-feedback.wrong {
  background: rgba(233, 69, 96, 0.2);
  color: #ff8a8a;
}

.trivia-results {
  text-align: center;
  padding: 1.25rem 0 0;
}

.trivia-results h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--yellow);
  margin: 0 0 0.75rem;
}

.trivia-results p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.trivia-results-summary {
  font-size: 1.05rem;
  color: var(--white);
  margin: 0 0 1.25rem;
}

.trivia-again-btn {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--bg);
  cursor: pointer;
  font-weight: 600;
}

.trivia-again-btn:hover {
  filter: brightness(1.1);
}

.trivia-next-btn {
  display: block;
  margin: 1rem auto 0;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.trivia-next-btn:hover {
  border-color: var(--yellow);
  background: rgba(255, 201, 60, 0.2);
}

.trivia-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.trivia-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Evolution celebration overlay */
.evolution-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: evolution-fade-in 0.3s ease;
}

.evolution-overlay[hidden] {
  display: none;
}

@keyframes evolution-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes evolution-burst {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes evolution-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 201, 60, 0.4), 0 0 60px rgba(107, 203, 119, 0.2); }
  50% { box-shadow: 0 0 50px rgba(255, 201, 60, 0.7), 0 0 90px rgba(107, 203, 119, 0.4); }
}

.evolution-celebration {
  text-align: center;
  padding: 2rem;
  animation: evolution-burst 0.5s ease-out;
}

.evolution-label {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--yellow), #6bcb77);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}

.evolution-sprite-wrap {
  display: inline-block;
  padding: 1.5rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 201, 60, 0.15), rgba(107, 203, 119, 0.1));
  border: 3px solid rgba(255, 201, 60, 0.5);
  margin-bottom: 0.75rem;
  animation: evolution-glow 1.2s ease-in-out infinite;
}

.evolution-sprite {
  width: 160px;
  height: 160px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

.evolution-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
  text-transform: capitalize;
}

/* Kanto complete overlay */
.kanto-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.kanto-overlay[hidden] {
  display: none;
}

.kanto-celebration {
  text-align: center;
  padding: 2rem;
  max-width: 400px;
}

.kanto-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--yellow), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.kanto-sub {
  font-size: 1.25rem;
  color: var(--white);
  margin: 0 0 1rem;
}

.kanto-emoji {
  font-size: 3rem;
  margin: 1rem 0;
  letter-spacing: 0.5rem;
}

.kanto-btn {
  font-family: var(--font-display);
  font-size: 1.25rem;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: var(--white);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(107, 203, 119, 0.4);
}

.kanto-btn:hover {
  filter: brightness(1.1);
}

/* Battlefield: clear 2D layout — player left, wild right */
.battlefield {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 auto 1rem;
  max-width: 420px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.12);
}
.battlefield-side {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.battlefield-player { justify-content: flex-end; }
.battlefield-wild { justify-content: flex-start; position: relative; }
.move-effect-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.move-effect-bite,
.move-effect-tackle,
.move-effect-beam,
.move-effect-slash {
  animation-duration: 0.5s;
  animation-fill-mode: both;
}
.move-effect-bite {
  width: 60px;
  height: 40px;
  background: radial-gradient(ellipse 50% 60% at 50% 50%, rgba(0,0,0,0.6), transparent);
  border-radius: 50%;
  animation: move-effect-bite 0.5s ease-out;
}
@keyframes move-effect-bite {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 0.7; }
}
.move-effect-tackle {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  animation: move-effect-tackle 0.45s ease-out;
}
@keyframes move-effect-tackle {
  0% { transform: scale(0.5); opacity: 0; }
  40% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
.move-effect-beam {
  width: 8px;
  height: 60px;
  background: linear-gradient(to top, transparent, var(--yellow));
  border-radius: 4px;
  animation: move-effect-beam 0.4s ease-out;
}
@keyframes move-effect-beam {
  0% { transform: scaleY(0); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scaleY(1); opacity: 0.8; }
}
.move-effect-slash {
  width: 4px;
  height: 50px;
  background: var(--white);
  transform-origin: center;
  animation: move-effect-slash 0.35s ease-out;
}
@keyframes move-effect-slash {
  0% { transform: scaleX(0) rotate(-20deg); opacity: 0; }
  100% { transform: scaleX(1) rotate(-20deg); opacity: 0.9; }
}

/* Wild ball type buttons */
.wild-ball-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.wild-btn-great { border-color: rgba(74, 222, 128, 0.6); background: rgba(34, 197, 94, 0.25); }
.wild-btn-ultra { border-color: rgba(147, 51, 234, 0.6); background: rgba(126, 34, 206, 0.25); }
.balls-label-great { color: #4ade80; }
.balls-label-ultra { color: #a78bfa; }

/* Region select overlay */
.region-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.region-select-overlay[hidden] { display: none; }
.region-select-modal { max-width: 420px; }
.region-select-title { font-family: var(--font-display); margin: 0 0 0.5rem; }
.region-select-sub { color: var(--muted); margin: 0 0 1rem; }
.region-select-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.region-select-card {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.region-select-card:hover {
  border-color: var(--yellow);
  transform: scale(1.05);
}

/* Final completion overlay (all regions done) */
.completion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.completion-overlay[hidden] { display: none; }
.completion-celebration {
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}
.completion-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  margin: 0 0 0.5rem;
  background: linear-gradient(135deg, var(--yellow), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.completion-subtitle { font-size: 1.25rem; margin: 0 0 1rem; }
.completion-stage { margin: 1rem 0; }
.completion-badges { margin: 1rem 0; }
.completion-emoji { font-size: 2.5rem; margin: 1rem 0; letter-spacing: 0.5rem; }
.completion-close-btn { margin-top: 0.5rem; }

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  top: 50%;
  left: 50%;
  animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(720deg) scale(0);
    opacity: 0;
  }
}

/* Main */
.main {
  position: relative;
  flex: 1 1 auto;
}

.site-meta {
  margin: 2rem 0 0;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.site-meta a {
  color: var(--blue);
  text-decoration: none;
}
.site-meta a:hover {
  text-decoration: underline;
}

.legal-disclaimer {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 1rem auto 0;
  max-width: 560px;
  line-height: 1.45;
  text-align: center;
}

.legal-disclaimer-block {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin: 1.5rem auto 0;
  max-width: 520px;
  line-height: 1.5;
}

.footer-disclaimer {
  margin: 0.75rem auto 0;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.9;
  text-align: center;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.loading.hidden {
  display: none;
}

/* Dex grid */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.dex-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 0.75rem;
  text-align: center;
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dex-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.2);
}

.dex-card.collected {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--collected-glow);
}

.dex-card.collected:hover {
  box-shadow: 0 0 28px var(--collected-glow);
}

.dex-card.selected {
  border-color: var(--blue);
  box-shadow: 0 0 24px rgba(77, 150, 255, 0.5);
}

.dex-card .card-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  position: relative;
}

.dex-card img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.dex-card .card-number {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.dex-card .card-hp-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.dex-card .card-hp-bar[hidden] {
  display: none;
}

.dex-card .card-hp-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.dex-card.collected .card-hp-fill {
  background: var(--green);
}

.dex-card .card-hp-fill.card-hp-empty {
  background: var(--muted);
}

.dex-card .card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
  margin: 0;
}

.dex-card.collected .card-name {
  color: var(--green);
}

/* Hidden by filter */
.dex-card.filter-hidden {
  display: none;
}

/* Done for now – positive goodbye */
.done-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.done-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.header-link-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: none;
}
.header-link-btn:hover {
  text-decoration: underline;
  color: var(--white);
}

.done-modal .done-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--yellow);
  text-align: center;
}

.done-modal .done-summary {
  font-size: 1.1rem;
  text-align: center;
  margin: 0 0 0.5rem;
  color: var(--white);
}

.done-modal .done-message {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.25rem;
}

/* Break reminder – screen hygiene */
.break-modal .break-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--yellow);
  text-align: center;
}

.break-modal .break-text {
  font-size: 1.05rem;
  text-align: center;
  margin: 0 0 0.5rem;
  color: var(--white);
}

.break-modal .break-tip {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1.25rem;
}

/* Cooldown – wait before playing again (no close button) */
.cooldown-overlay {
  z-index: 300;
}

.cooldown-modal .cooldown-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  color: var(--yellow);
  text-align: center;
}

.cooldown-modal .cooldown-text {
  font-size: 1rem;
  text-align: center;
  margin: 0 0 0.25rem;
  color: var(--white);
}

.cooldown-modal .cooldown-countdown {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 1rem;
  color: var(--yellow);
}

.cooldown-modal .cooldown-tip {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* Nav in break/cooldown overlays – so user can leave the page */
.overlay-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 1rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.9rem;
}
.overlay-nav a {
  color: var(--blue);
  text-decoration: none;
}
.overlay-nav a:hover {
  text-decoration: underline;
  color: var(--white);
}

/* How I play – mode modal (ability-aware) */
.mode-modal .mode-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--yellow);
  text-align: center;
}

.mode-modal .mode-intro {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.mode-option-btn {
  display: block;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.mode-option-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.mode-option-btn.active {
  border-color: var(--green);
  background: rgba(107, 203, 119, 0.15);
}

.mode-option-label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.mode-option-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.mode-modal .mode-footer {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 0.75rem;
}

.mode-modal .mode-footer a {
  color: var(--blue);
  text-decoration: none;
}

.mode-modal .mode-footer a:hover {
  text-decoration: underline;
}

.mode-close-btn {
  display: block;
  margin: 0 auto;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--blue);
  cursor: pointer;
  text-decoration: none;
}

.footer-link-btn:hover {
  text-decoration: underline;
}

/* Footer – slim sticky nav only (PokeAPI line is in .site-meta and scrolls) */
.footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  z-index: 2;
}

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

.footer a:hover {
  text-decoration: underline;
}

.footer-about-link {
  font-weight: 600;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.6rem;
  margin: 0 0 0.2rem;
}
.footer-nav a {
  color: var(--blue);
  text-decoration: none;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-tagline,
.footer-copyright {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.footer-noncommercial {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ----- Site pages: sticky header + footer (no redundancy) ----- */
.site-sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  margin: 0 -1.5rem 0 -1.5rem;
}

.site-sticky-header .site-nav,
.site-sticky-header .landing-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin: 0;
  font-size: 0.9rem;
}

.site-sticky-header .site-nav a,
.site-sticky-header .landing-nav a {
  color: var(--blue);
  text-decoration: none;
  padding: 0.2em 0;
}

.site-sticky-header .site-nav a:hover,
.site-sticky-header .landing-nav a:hover {
  text-decoration: underline;
  color: #6ba8ff;
}

.site-sticky-header .site-nav .nav-brand { font-weight: 600; }
.site-sticky-header .site-nav a.nav-brand:not([aria-current="page"]) { color: var(--blue); }
.site-sticky-header .landing-nav a { color: var(--blue); }

/* Current page in nav: no underline, slightly emphasized */
.site-sticky-header .site-nav a[aria-current="page"],
.site-sticky-header .landing-nav a[aria-current="page"],
.brand-bar-links a[aria-current="page"] {
  font-weight: 600;
  text-decoration: none;
  color: var(--yellow);
}
.site-sticky-header .site-nav a[aria-current="page"]:hover,
.site-sticky-header .landing-nav a[aria-current="page"]:hover,
.brand-bar-links a[aria-current="page"]:hover {
  text-decoration: none;
  color: var(--yellow);
}

.site-sticky-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 0.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  z-index: 2;
}

.site-sticky-footer .footer-tagline,
.site-sticky-footer .footer-copyright {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Site page main content (nav is in sticky header) */
.app > main.site-page,
.app > main.landing-page { flex: 1; }
.site-page { max-width: 640px; margin: 0 auto; padding: 2rem 1.5rem; }
.site-page h1 { font-family: var(--font-display); font-size: 1.75rem; margin: 0 0 0.5rem; }
.site-page .prose { color: var(--muted); line-height: 1.6; margin: 0 0 1rem; }
.site-page .prose a { color: var(--blue); text-decoration: none; }
.site-page .prose a:hover { text-decoration: underline; color: #6ba8ff; }
.site-page .prose a:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.site-page .tagline { font-size: 1.1rem; color: var(--yellow); margin: 0 0 1rem; }
.site-page h1 { color: var(--white); }
.site-page .pitch { font-size: 1rem; color: var(--white); margin: 0 0 1.5rem; line-height: 1.5; }
.site-page h2 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.5rem 0 0.5rem; color: var(--white); }
.site-page ul { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--muted); line-height: 1.6; }
.site-page .social-links { margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 1rem; }
.site-page .social-links a { color: var(--blue); text-decoration: none; }
.site-page .social-links a:hover { text-decoration: underline; }
.site-page .cta-primary { display: inline-block; margin-top: 0.5rem; padding: 0.6rem 1.25rem; background: var(--blue); color: var(--white); border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 1rem; transition: background 0.2s, transform 0.2s; }
.site-page .cta-primary:hover { background: #6ba8ff; transform: translateY(-1px); }
.site-page .cta-primary:focus { outline: 2px solid var(--white); outline-offset: 2px; }
/* Ensure CTA text stays white when inside .prose (overrides .prose a color) */
.site-page .prose a.cta-primary { color: var(--white); }
.site-page .prose a.cta-primary:hover { color: var(--white); }
.site-page .educator-box a.cta-primary { color: var(--white); }
.site-page .educator-box a.cta-primary:hover { color: var(--white); }
.site-page .hub-cards { display: grid; gap: 1rem; margin: 1.5rem 0; }
.site-page .hub-card { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 1.25rem; text-decoration: none; color: inherit; display: block; transition: background 0.2s, border-color 0.2s; }
.site-page .hub-card:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.25); }
.site-page .hub-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 0.35rem; color: var(--white); }
.site-page .hub-card p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.site-page .educator-box { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 1rem 1.25rem; margin: 0.5rem 0 1rem; }
.site-page .educator-box p { margin: 0 0 0.5rem; }
.site-page .educator-box p:last-child { margin-bottom: 0; }
.site-page .segment-cta { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.site-page .results-cta, .site-page .results-cta a { font-size: 0.95rem; color: var(--blue); text-decoration: none; }
.site-page .results-cta a:hover { text-decoration: underline; }
.site-page .results-cta { margin: 1rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-page .teacher-games { margin: 1.5rem 0; }
.site-page .teacher-game-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.site-page .teacher-game-list a { color: var(--blue); text-decoration: none; font-weight: 600; }
.site-page .teacher-game-list a:hover { text-decoration: underline; }
.site-page .teacher-game-list li { color: var(--muted); font-size: 0.95rem; }

/* ----- Landing page (first touch) ----- */
.landing-page { max-width: 560px; margin: 0 auto; padding: 2rem 1.5rem; text-align: center; }
.landing-hero { margin-bottom: 2rem; }
.landing-hero .landing-title { font-family: var(--font-display); font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 600; margin: 0 0 0.5rem; background: linear-gradient(135deg, var(--yellow), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.landing-hero .landing-subline { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.landing-cta { display: inline-block; font-family: var(--font-display); font-size: 1.25rem; padding: 0.75rem 2rem; background: linear-gradient(135deg, var(--yellow), #ff6b6b); color: var(--bg); text-decoration: none; border-radius: 14px; font-weight: 600; transition: transform 0.2s, box-shadow 0.2s; }
.landing-cta:hover { transform: scale(1.03); box-shadow: 0 8px 24px rgba(255, 201, 60, 0.4); }

/* Games grid: list of cards; each live card is one link */
.landing-games { margin: 2rem 0; }
.landing-games-title { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 1rem; color: var(--white); }
.game-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.game-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 14px; padding: 1rem 1.25rem; text-align: left; display: flex; flex-direction: column; gap: 0.35rem; }
.game-card--live { border-color: rgba(107, 203, 119, 0.4); }
.game-card__link { display: flex; flex-direction: column; gap: 0.35rem; text-decoration: none; color: inherit; transition: background 0.2s, border-color 0.2s; margin: -1rem -1.25rem; padding: 1rem 1.25rem; border-radius: 14px; }
.game-card__link:hover { background: rgba(255,255,255,0.06); }
.game-card__subject { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--yellow); }
.game-card__title { font-family: var(--font-display); font-size: 1.1rem; margin: 0; color: var(--white); }
.game-card__desc { font-size: 0.85rem; color: var(--muted); line-height: 1.45; margin: 0; }
.game-card--coming-soon .game-card__desc { font-size: 0.85rem; color: var(--muted); }

.landing-tagline { color: var(--muted); font-size: 0.95rem; margin: 2rem 0 1rem; }
.landing-audience { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem 1rem; margin: 0 0 2rem; font-size: 0.9rem; }
.landing-audience-label { color: var(--muted); margin-right: 0.25rem; }
.landing-audience a { color: var(--blue); text-decoration: none; }
.landing-audience a:hover { text-decoration: underline; }
.landing-footer { margin-top: 0; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; color: var(--muted); }
.landing-footer .legal-disclaimer { margin: 0.75rem 0 0; font-size: 0.7rem; max-width: none; }
.landing-footer a { color: var(--blue); text-decoration: none; }
.landing-footer a:hover { text-decoration: underline; }
.landing-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; margin-bottom: 2rem; font-size: 0.9rem; }
.landing-nav a { color: var(--blue); text-decoration: none; }
.landing-nav a:hover { text-decoration: underline; }
