@font-face {
  font-family: 'PokemonSolid';
  src: url('../fonts/Pokemon Solid.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'PressStart2P';
  src: url('../fonts/PressStart2P-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Flexo';
  src: url('../fonts/flexo-medium.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Roboto';
  src: url('../fonts/Roboto-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

html {
  scrollbar-gutter: stable;
}

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

body {
  background: #FFCB05;
  font-family: 'Flexo', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 16px;
  overflow-x: hidden;
  touch-action: manipulation;
  padding-top: max(16px, env(safe-area-inset-top));
}

small {
  font-family: 'Flexo', sans-serif;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: clamp(12px, 3vw, 20px) clamp(12px, 3vw, 22px);
  max-width: 520px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  text-align: center;
  overflow: visible;
  margin-left: auto;
  margin-right: auto;
  margin-top: auto;
  margin-bottom: auto;
}

/* ── LANDING ── */
#landing-screen h1 {
  font-family: 'PokemonSolid', cursive; font-size: clamp(28px,7vw,52px);
  color: #3D7DCA; margin-bottom: 4px; line-height: 1.2;
  -webkit-text-stroke: 2px #003A70; paint-order: stroke fill; letter-spacing: 1px;
}
#landing-screen .landing-subtitle {
  font-family: 'Roboto', sans-serif; font-size: clamp(9px,2.2vw,13px);
  color: #003A70; margin-bottom: 6px; letter-spacing: 1px; line-height: 1.6; font-weight: 700;
}
.landing-logo {
  width: 100%;
  max-width: min(420px, 100%);
  height: auto;
  display: block;
  margin: 0 auto 8px;
  object-fit: contain;
  padding: 0 12px;
}

.gen-selector {
  display: flex; justify-content: center; gap: 10px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.gen-badge {
  font-family: 'Roboto', sans-serif; font-size: 13px;
  padding: 5px 14px; border-radius: 99px; border: 2px solid #ddd;
  background: #f9f9f9; color: #888;
}
.gen-badge.gen-active {
  border-color: #3D7DCA; background: #eef4fc; color: #003A70; font-weight: 700;
}
.gen-badge.gen-inactive { opacity: 0.5; }

.quiz-type-grid { display: flex; flex-direction: column; gap: 14px; }
.quiz-type-btn {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  border: 2px solid #ddd; border-radius: 14px; background: #f9f9f9;
  cursor: pointer; text-align: left; transition: all .2s; width: 100%;
}
.quiz-type-btn:hover { border-color: #3D7DCA; background: #eef4fc; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(61,125,202,0.15); }
.qt-icon  { font-size: 36px; flex-shrink: 0; }
.qt-text  { flex: 1; }
.qt-title {
  font-family: 'Flexo', sans-serif; font-size: clamp(16px,4vw,22px);
  color: #003A70; display: block; margin-bottom: 5px; line-height: 1.3; font-weight: 700;
}
.qt-desc  { font-size: 13px; color: #666; line-height: 1.5; font-family: 'Roboto', sans-serif; }
.qt-arrow { font-size: 20px; color: #ccc; flex-shrink: 0; }
.quiz-type-btn:hover .qt-arrow { color: #3D7DCA; }

/* ── WELCOME ── */
#welcome-screen { display: none; }
#welcome-screen h1 {
  font-family: 'Flexo', sans-serif; font-size: clamp(22px,5.5vw,40px);
  color: #003A70; margin-bottom: 18px; line-height: 1.3; font-weight: 700;
}
.back-link {
  background: none; border: none; color: #aaa; font-size: 12px; cursor: pointer;
  margin-bottom: 18px; display: block; text-align: left; padding: 0;
  font-family: 'Roboto', sans-serif;
}
.back-link:hover { color: #3D7DCA; }
label { display: block; font-weight: 700; margin-bottom: 6px; text-align: left; font-size: 14px; color: #333; font-family: 'Flexo', sans-serif; }
input[type="text"] {
  width: 100%; padding: 10px 14px; border: 2px solid #ddd; border-radius: 8px;
  font-size: 15px; margin-bottom: 20px; outline: none; transition: border-color .2s;
  font-family: 'Roboto', sans-serif;
}
#learn-search {
  margin-bottom: 8px;
}
input[type="text"]:focus { border-color: #3D7DCA; }
.toggle-row { display: flex; background: #f0f0f0; border-radius: 10px; padding: 4px; margin-bottom: 20px; gap: 4px; }
.toggle-btn {
  flex: 1; padding: 10px 6px; border: none; border-radius: 8px; background: transparent;
  cursor: pointer; font-size: 13px; font-weight: 700; color: #666; transition: all .2s; line-height: 1.5;
  font-family: 'Roboto', sans-serif;
}
.toggle-btn.active { background: #3D7DCA; color: #fff; box-shadow: 0 2px 6px rgba(61,125,202,0.3); }
.difficulty-row { display: flex; gap: 12px; margin-bottom: 24px; }
.diff-btn {
  flex: 1; padding: 14px 8px; border: 2px solid #ddd; border-radius: 10px;
  background: #f9f9f9; cursor: pointer; font-size: 13px; font-weight: 700; transition: all .2s;
  font-family: 'Roboto', sans-serif;
}
.diff-btn:hover { border-color: #3D7DCA; background: #eef4fc; }
.diff-btn.selected { border-color: #3D7DCA; background: #3D7DCA; color: #fff; }
.diff-btn .icon { font-size: 28px; display: block; margin-bottom: 6px; }
.start-btn {
  background: #3D7DCA; color: #fff; border: none; border-radius: 10px;
  padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  transition: background .2s; font-family: 'Flexo', sans-serif;
}
.start-btn:hover { background: #003A70; }
.start-btn:disabled { background: #ccc; cursor: not-allowed; }



/* ── SETTINGS GEAR ICON ── */

.gear-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 999;
  background: rgba(0,58,112,0.18); border: 2px solid rgba(255,255,255,0.6);
  border-radius: 10px; padding: 6px 10px; cursor: pointer;
  font-size: 18px; backdrop-filter: blur(4px); transition: background .2s; line-height: 1;
}
.gear-toggle:hover { background: rgba(0,58,112,0.28); }

.qt-svg-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  /* white SVG → #003A70 navy */
  filter: brightness(0) saturate(100%) invert(13%) sepia(68%)
          saturate(2072%) hue-rotate(199deg) brightness(87%) contrast(102%);
  transition: filter .2s;
}


body.night-mode .qt-svg-img {
  /* white SVG → #7eb3f7 light blue */
  filter: brightness(0) saturate(100%) invert(72%) sepia(40%)
          saturate(500%) hue-rotate(185deg) brightness(105%) contrast(95%);
}



/* ── GAME ── */
#game-screen { display: none; }
.top-bar {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; font-weight: 700; color: #555; margin-bottom: 8px;
  font-family: 'Roboto', sans-serif;
}
.top-row-1 {
  display: flex; align-items: center; justify-content: space-between;
}
.top-row-2 {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  background: #f5f6fa; border-radius: 8px; padding: 5px 8px;
}
.top-trainer {
  display: flex; align-items: center; gap: 5px; min-width: 0;
  flex: 1.5; overflow: hidden;
}
.top-row-2 .q-counter,
.top-row-2 .acc-inline,
.top-row-2 .timer-display {
  flex: 1; text-align: center; white-space: nowrap;
}
@media (max-width: 548px) {
  .top-row-1 { padding-right: 44px; }
}
.trainer {
color: #3D7DCA; font-size: 12px; font-weight: 700;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
font-family: 'Roboto', sans-serif;
}
.q-counter {
font-family: 'Roboto', sans-serif; font-size: 12px; color: #555; font-weight: 700;
}
.acc-inline {
font-family: 'Roboto', sans-serif; font-size: 12px; font-weight: 700; color: #3D7DCA;
}
.timer-display {
font-family: 'Roboto', sans-serif; font-size: 12px; color: #3D7DCA;
font-weight: 700; white-space: nowrap;
}
.reset-btn {
  background: transparent; border: 2px solid #ddd; border-radius: 8px;
  padding: 5px 11px; font-size: 12px; font-weight: 700; color: #888; cursor: pointer; transition: all .2s;
  font-family: 'Roboto', sans-serif;
  flex-shrink: 0;
}
.reset-btn:hover { border-color: #3D7DCA; color: #3D7DCA; background: #eef4fc; }
.progress-wrap { background: #f0f0f0; border-radius: 99px; height: 8px; margin-bottom: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,#3D7DCA,#FFCB05); border-radius: 99px; transition: width .4s ease; }

.topbar-back-btn {
  background: transparent;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 15px;
  color: #888;
  cursor: pointer;
  transition: all .2s;
  font-family: Roboto, sans-serif;
  flex-shrink: 0;
  line-height: 1;
}
.topbar-back-btn:hover {
  border-color: #3D7DCA;
  color: #3D7DCA;
  background: #eef4fc;
}




#pokemon-img {
  will-change: filter, opacity;
}



body.night-mode .top-row-2 {
  background: #1e2d4a !important;
}

/* ── WHO'S THAT ── */
.pokemon-img-wrap {
width: 170px; height: 170px; margin: 0 auto 8px; display: flex;
align-items: center; justify-content: center; background: #f7f7f7;
border-radius: 50%; position: relative; overflow: hidden;
}
#pokemon-img { max-width: 130px; max-height: 130px; object-fit: contain; image-rendering: pixelated; transition: opacity .3s; }
#pokemon-img.silhouette { filter: brightness(0); }
.spinner {
  display: none; width: 36px; height: 36px; border: 4px solid #eee;
  border-top-color: #3D7DCA; border-radius: 50%; animation: spin .7s linear infinite; position: absolute;
}
@keyframes spin { to { transform: rotate(360deg); } }
.question-label { font-family: 'Flexo', sans-serif; font-size: 13px; color: #444; margin-bottom: 8px; font-weight: 700; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.opt-btn {
  padding: 11px 12px; border: 2px solid #ddd; border-radius: 10px; background: #f9f9f9; min-height: 44px;
  cursor: pointer; font-size: 13px; font-weight: 700; transition: all .2s; line-height: 1.3;
  font-family: 'Flexo', sans-serif;
}
.opt-btn:hover:not(:disabled) { border-color: #3D7DCA; background: #eef4fc; }
.opt-btn.correct { background: #d4edda; border-color: #28a745; color: #155724; }
.opt-btn.wrong   { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.opt-btn:disabled { cursor: default; }

/* ── IDENTIFY ── */
#identify-section { display: none; }
.identify-name {
font-family: 'Flexo', sans-serif; font-size: clamp(22px,5.5vw,38px);
color: #003A70; margin-bottom: 10px; line-height: 1.2; font-weight: 700;
}
.img-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.img-opt-btn {
  border: 3px solid #ddd; border-radius: 14px; background: #f9f9f9;
  cursor: pointer; padding: 10px; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
  height: clamp(105px, 24vw, 150px); position: relative; overflow: hidden;
}
.img-opt-btn:hover:not(:disabled) { border-color: #3D7DCA; background: #eef4fc; transform: scale(1.02); }
.img-opt-btn.correct { border-color: #28a745; background: #d4edda; }
.img-opt-btn.wrong   { border-color: #dc3545; background: #f8d7da; }
.img-opt-btn:disabled { cursor: default; }
.img-opt-btn img { max-width: 100%; max-height: 100%; object-fit: contain; image-rendering: pixelated; transition: filter .3s, opacity .3s; }
.img-opt-btn img.silhouette { filter: brightness(0); }
.img-opt-spinner {
  position: absolute; width: 28px; height: 28px; border: 3px solid #eee;
  border-top-color: #3D7DCA; border-radius: 50%; animation: spin .7s linear infinite;
}

/* ── EVOLUTION QUIZ ── */
#evo-section { display: none; }
.evo-visual-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 16px; overflow: hidden;
}
.evo-question-img-wrap {
  width: 120px; height: 120px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f7f7f7; border-radius: 50%; position: relative;
  border: 3px solid #eee; overflow: hidden;
}
#evo-pokemon-img { max-width: 100px; max-height: 100px; object-fit: contain; image-rendering: pixelated; transition: opacity .3s; }
.evo-spinner {
  display: none; width: 32px; height: 32px; border: 3px solid #eee;
  border-top-color: #3D7DCA; border-radius: 50%; animation: spin .7s linear infinite; position: absolute;
}
.evo-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.evo-arrow-line  { font-size: 28px; color: #3D7DCA; line-height: 1; font-weight: 900; }
.evo-arrow-label { font-family: 'Flexo', sans-serif; font-size: 11px; color: #aaa; text-align: center; line-height: 1.5; }
.evo-qmark-wrap {
  width: 120px; height: 120px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f7f7f7; border-radius: 50%; border: 3px solid #eee; overflow: hidden;
}
.evo-qmark { font-family: 'Flexo', sans-serif; font-size: 48px; color: #3D7DCA; line-height: 1; user-select: none; font-weight: 700; }
.evo-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.evo-opt-btn {
  border: 3px solid #ddd; border-radius: 14px; background: #f9f9f9;
  cursor: pointer; padding: 10px 8px 8px; transition: all .2s;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; height: clamp(90px, 22vw, 120px);
}
.evo-opt-btn:hover:not(:disabled) { border-color: #3D7DCA; background: #eef4fc; transform: scale(1.02); }
.evo-opt-btn.correct { border-color: #28a745; background: #d4edda; }
.evo-opt-btn.wrong   { border-color: #dc3545; background: #f8d7da; }
.evo-opt-btn:disabled { cursor: default; }
.evo-opt-btn img { width: auto; max-width: calc(100% - 16px); height: auto; max-height: calc(clamp(90px, 22vw, 120px) - 36px); object-fit: contain; image-rendering: pixelated; transition: filter .3s, opacity .3s; }
.evo-opt-btn img.silhouette { filter: brightness(0); }
.evo-opt-btn .evo-caption { font-size: 11px; font-weight: 700; margin-top: 5px; line-height: 1.3; color: #444; text-align: center; font-family: 'Flexo', sans-serif; }
.evo-opt-btn.correct .evo-caption { color: #155724; }
.evo-opt-btn.wrong   .evo-caption { color: #721c24; }
.evo-opt-spinner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 24px; height: 24px; border: 3px solid #eee;
  border-top-color: #3D7DCA; border-radius: 50%; animation: spin .7s linear infinite;
}
.evo-opt-btn.none-tile { justify-content: center; }
.evo-opt-btn.none-tile .none-icon  { font-size: 28px; margin-bottom: 4px; }
.evo-opt-btn.none-tile .none-label { font-family: 'Flexo', sans-serif; font-size: 11px; color: #888; line-height: 1.6; text-align: center; }
.evo-opt-btn.none-tile.correct .none-label { color: #155724; }
.evo-opt-btn.none-tile.wrong   .none-label { color: #721c24; }

.feedback-msg { font-size: 14px; font-weight: 700; min-height: 22px; margin-bottom: 10px; font-family: 'Roboto', sans-serif; }

/* ── HINTS ── */
.hint-section { margin-bottom: 12px; }
.hint-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.hint-btn {
  flex: 1; max-width: 150px; padding: 7px 6px; border: 2px solid #FFCB05;
  border-radius: 8px; background: #fffbe6; cursor: pointer; font-size: 11px;
  font-weight: 700; color: #7a5c00; transition: all .2s; font-family: 'Roboto', sans-serif;
}
.hint-btn:hover:not(:disabled) { background: #fff3b0; border-color: #e0a800; }
.hint-btn:disabled { opacity: .45; cursor: default; }
.hint-btn.used { background: #fff3b0; border-color: #e0a800; color: #5a4000; }
.hint-btn .hint-icon { font-size: 14px; display: block; margin-bottom: 2px; }
.hint-cards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.hint-card {
  background: #fffbe6; border: 2px solid #FFCB05; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; text-align: left; animation: fadeIn .3s ease;
  font-family: 'Roboto', sans-serif;
}
.hint-card strong { color: #7a5c00; font-size: 12px; display: block; margin-bottom: 2px; font-family: 'Flexo', sans-serif; font-weight: 700; }
.hint-card .entry-text { color: #444; line-height: 1.5; font-size: 13px; font-family: 'Roboto', sans-serif; }
.next-btn {
  background: #3D7DCA; color: #fff; border: none; border-radius: 10px;
  padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  transition: background .2s; font-family: 'Flexo', sans-serif;
}
.next-btn:hover { background: #003A70; }

/* ── RESULTS ── */
#result-screen { display: none; }

#result-screen.active-screen {
  display: block;
}

body:has(#result-screen[style*="block"]) {
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 32px;
}

.result-name  { font-family: 'Flexo', sans-serif; font-size: 16px; font-weight: 700; color: #3D7DCA; margin-bottom: 10px; }
.result-pct   {
  font-family: 'Flexo', sans-serif; font-size: clamp(56px,14vw,88px);
  color: #3D7DCA; margin-bottom: 4px; line-height: 1.1; font-weight: 700;
}
.result-sub  { font-size: 14px; color: #888; margin-bottom: 4px; font-family: 'Roboto', sans-serif; }
.result-time { font-family: 'Roboto', sans-serif; font-size: 12px; color: #aaa; margin-bottom: 6px; font-weight: 700; }
.result-msg  { font-size: 14px; color: #444; margin-bottom: 24px; font-weight: 700; font-family: 'Roboto', sans-serif; }
.result-emoji { font-size: 48px; margin-bottom: 10px; }
.restart-btn {
  background: #3D7DCA; color: #fff; border: none; border-radius: 10px;
  padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  transition: background .2s; margin-bottom: 12px; font-family: 'Flexo', sans-serif;
}
.restart-btn:hover { background: #003A70; }
.leaderboard-btn {
  background: #fff; color: #3D7DCA; border: 2px solid #3D7DCA; border-radius: 10px;
  padding: 13px 28px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
  transition: all .2s; margin-bottom: 12px; font-family: 'Flexo', sans-serif;
}
.leaderboard-btn:hover { background: #eef4fc; }
.home-btn {
  background: transparent; border: 2px solid #ddd; border-radius: 10px;
  padding: 11px 28px; font-size: 13px; font-weight: 700; cursor: pointer; width: 100%;
  color: #888; transition: all .2s; font-family: 'Roboto', sans-serif;
}
.home-btn:hover { border-color: #3D7DCA; color: #3D7DCA; background: #eef4fc; }

@keyframes result-pct-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  70%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.result-pct--pop {
  animation: result-pct-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  display: inline-block; /* required for transform to apply to text */
}


/* ── LEADERBOARD ── */
.lb-title {
  font-family: 'Flexo', sans-serif; font-size: clamp(24px,6vw,36px);
  color: #003A70; font-weight: 700; margin-bottom: 16px;
}
.lb-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; justify-content: center; }
.lb-tab {
  padding: 7px 14px; border: 2px solid #ddd; border-radius: 99px;
  background: #f9f9f9; cursor: pointer; font-size: 12px; font-weight: 700;
  font-family: 'Roboto', sans-serif; transition: all .2s; color: #666;
}
.lb-tab.active { background: #3D7DCA; border-color: #3D7DCA; color: #fff; }
.lb-tab:hover:not(.active) { border-color: #3D7DCA; color: #3D7DCA; background: #eef4fc; }
.lb-filters { display: flex; gap: 6px; margin-bottom: 14px; justify-content: center; }
.lb-filter {
  padding: 5px 12px; border: 2px solid #ddd; border-radius: 99px;
  background: #f9f9f9; cursor: pointer; font-size: 11px; font-weight: 700;
  font-family: 'Roboto', sans-serif; transition: all .2s; color: #666;
}
.lb-filter.active { background: #3D7DCA; border-color: #3D7DCA; color: #fff; }
.lb-filter:hover:not(.active) { border-color: #3D7DCA; color: #3D7DCA; background: #eef4fc; }
.lb-table-wrap {
  max-height: 55vh;
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
}
.lb-table-wrap::-webkit-scrollbar { width: 6px; }
.lb-table-wrap::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 99px; }
.lb-table-wrap::-webkit-scrollbar-thumb { background: #3D7DCA; border-radius: 99px; }
.lb-table { width: 100%; border-collapse: collapse; font-family: 'Roboto', sans-serif; font-size: 12px; }
.lb-table th {
  font-family: 'Roboto', sans-serif; font-size: 10px; font-weight: 700; color: #aaa;
  padding: 6px 8px; text-align: left; border-bottom: 2px solid #eee;
  position: sticky; top: 0; background: #fff; letter-spacing: 0.5px;
}
.lb-table td { padding: 8px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.lb-table tr:hover td { background: #eef4fc; }
.lb-rank { font-family: 'Roboto', sans-serif; font-size: 11px; font-weight: 700; color: #3D7DCA; }
.lb-rank-1 { color: #FFD700; }
.lb-rank-2 { color: #C0C0C0; }
.lb-rank-3 { color: #CD7F32; }
.lb-loading { text-align: center; padding: 32px; color: #aaa; font-family: 'Roboto', sans-serif; font-size: 12px; }
.lb-empty   { text-align: center; padding: 32px; color: #aaa; font-family: 'Roboto', sans-serif; font-size: 14px; }
.lb-you { background: #ddeeff !important; font-weight: 700; border-left: 3px solid #3D7DCA; }
.lb-you td { color: #003A70 !important; }
.lb-submit-status {
  font-family: 'Roboto', sans-serif; font-size: 11px; font-weight: 700; text-align: center;
  margin-bottom: 10px; min-height: 32px; color: #aaa;
}

/* ── Pokeball preloader shared animation ─────────────────────── */
@keyframes pokeball-elastic-spin {
  0%   { transform: rotate(0deg)   scale(1);    }
  45%  { transform: rotate(210deg) scale(1.07); }
  65%  { transform: rotate(390deg) scale(0.91); }
  78%  { transform: rotate(342deg) scale(1.05); }
  88%  { transform: rotate(368deg) scale(0.97); }
  94%  { transform: rotate(354deg) scale(1.02); }
  98%  { transform: rotate(362deg) scale(0.99); }
  100% { transform: rotate(360deg) scale(1);    }
}

.pokeball-spinner {
  width: 48px;
  height: 48px;
  display: block;
  animation: pokeball-elastic-spin 1.7s linear infinite;
  filter: drop-shadow(0 3px 10px rgba(61, 125, 202, 0.35));
}

/* Submit score preloader */
.lb-submit-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
}

.lb-submit-inner {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lb-submit-inner .pokeball-spinner {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

@keyframes lb-msg-pulse {
  0%, 100% { opacity: 1;   }
  50%       { opacity: 0.5; }
}

.lb-submit-msg {
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #3D7DCA;
  animation: lb-msg-pulse 1.7s ease-in-out infinite;
}

/* Leaderboard fetch preloader */
.lb-fetch-loading {
  display: flex;
  justify-content: center;
  padding: 22px 0 6px;
}

.lb-fetch-loading .pokeball-spinner {
  width: 48px;
  height: 48px;
}



/* ── TYPE BADGES ── */
.type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; font-family: 'Roboto', sans-serif;
  margin-right: 4px; margin-top: 2px;
}
.t-fire     { background-color:#fd7d24; color:#fff; }
.t-water    { background-color:#4592c4; color:#fff; }
.t-fighting { background-color:#d56723; color:#fff; }
.t-poison   { background-color:#b97fc9; color:#fff; }
.t-psychic  { background-color:#f366b9; color:#fff; }
.t-bug      { background-color:#729f3f; color:#fff; }
.t-rock     { background-color:#a38c21; color:#fff; }
.t-ghost    { background-color:#7b62a3; color:#fff; }
.t-dragon   { background-color:#53a4cf; color:#fff; }
.t-dark     { background-color:#707070; color:#fff; }
.t-normal   { background-color:#a4acaf; color:#212121; }
.t-electric { background-color:#eed535; color:#212121; }
.t-grass    { background-color:#9bcc50; color:#212121; }
.t-ice      { background-color:#51c4e7; color:#212121; }
.t-ground   { background-color:#f7de3f; color:#212121; }
.t-flying   { background-color:#3dc7ef; color:#212121; }
.t-steel    { background-color:#9eb7b8; color:#212121; }
.t-fairy    { background-color:#fdb9e9; color:#212121; }

/* ══════════ POKÉDEX ══════════ */
.qt-title {
  font-family: 'Flexo', sans-serif !important;
}
.learn-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px;
  max-height: 480px; overflow-y: auto; padding-right: 4px; margin-top: 6px;
}
.learn-grid::-webkit-scrollbar { width: 6px; }
.learn-grid::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 99px; }
.learn-grid::-webkit-scrollbar-thumb { background: #3D7DCA; border-radius: 99px; }
.learn-card {
  border: 2px solid #eee; border-radius: 12px; background: #f9f9f9;
  cursor: pointer; padding: 10px 6px 8px; transition: all .2s; margin-top: 5px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.learn-card:hover { border-color: #3D7DCA; background: #eef4fc; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(61,125,202,0.15); }
.learn-card img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.learn-card .lc-num  { font-family: 'Roboto', sans-serif; font-size: 9px; color: #bbb; }
.learn-card .lc-name { font-size: 12px; font-weight: 700; color: #333; text-align: center; line-height: 1.3; font-family: 'Flexo', sans-serif; }
#learn-detail-screen { overflow-y: auto; }
.learn-detail-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.learn-detail-num { font-family: 'Roboto', sans-serif; font-size: 12px; color: #bbb; font-weight: 700; }
.learn-sprite-wrap {
  width: 230px; height: 230px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: #f7f7f7; border-radius: 50%; position: relative;
  border: 3px solid #eee; overflow: hidden;
}
#learn-sprite { max-width: 215px; max-height: 179px; object-fit: contain; image-rendering: pixelated; transition: opacity .3s; }
.learn-name-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.learn-detail-name {
  font-family: 'Flexo', sans-serif; font-size: clamp(24px,6vw,38px);
  color: #003A70; font-weight: 700; line-height: 1.2;
}
.learn-speaker-btn {
  background: #eef4fc; border: 2px solid #3D7DCA; border-radius: 50%;
  width: 38px; height: 38px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s; flex-shrink: 0;
}
.learn-speaker-btn:hover  { background: #3D7DCA; }
.learn-speaker-btn.playing { animation: pulse .6s ease infinite alternate; background: #3D7DCA; }
@keyframes pulse { from{transform:scale(1)} to{transform:scale(1.15)} }
.learn-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.learn-info-card { background: #f9f9f9; border: 2px solid #eee; border-radius: 12px; padding: 10px 12px; text-align: left; }
.learn-info-label { font-family: 'Roboto', sans-serif; font-size: 10px; font-weight: 700; color: #aaa; margin-bottom: 6px; letter-spacing: 0.5px; }
.learn-info-value { font-size: 13px; font-weight: 700; color: #333; line-height: 1.5; font-family: 'Roboto', sans-serif; }
.learn-dex-entry {
  background: #fffbe6; border: 2px solid #FFCB05; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; color: #444; line-height: 1.7;
  text-align: left; margin-bottom: 18px; font-family: 'Roboto', sans-serif;
}
.learn-evo-section { margin-bottom: 8px; }
.learn-section-label {
  font-family: 'Flexo', sans-serif; font-size: 15px; font-weight: 700;
  color: #333; margin-bottom: 12px; text-align: center;
}
.learn-evo-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.learn-evo-member {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; padding: 8px; border-radius: 12px; border: 2px solid #eee;
  background: #f9f9f9; transition: all .2s; min-width: 72px;
}
.learn-evo-member:hover { border-color: #3D7DCA; background: #eef4fc; transform: translateY(-2px); }
.learn-evo-member.current { border-color: #3D7DCA; background: #eef4fc; }
.learn-evo-member img { width: 60px; height: 60px; object-fit: contain; image-rendering: pixelated; }
.learn-evo-member .evo-mem-name { font-size: 11px; font-weight: 700; color: #333; text-align: center; font-family: 'Flexo', sans-serif; }
.learn-evo-member .evo-mem-num  { font-family: 'Roboto', sans-serif; font-size: 9px; color: #bbb; }
.learn-evo-arrow { font-size: 20px; color: #3D7DCA; font-weight: 900; padding: 0 2px; }
.learn-evo-branch { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.learn-nav-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.learn-nav-btn {
  flex: 1; padding: 8px 12px; border: 2px solid #eee; border-radius: 10px;
  background: #f9f9f9; cursor: pointer; font-family: 'Roboto', sans-serif;
  font-size: 12px; font-weight: 700; color: #888; transition: all .2s;
}
.learn-nav-btn:hover:not(:disabled) { border-color: #3D7DCA; color: #3D7DCA; background: #eef4fc; }
.learn-nav-btn:disabled { opacity: .35; cursor: default; }
.swipe-hint {
  text-align: center; font-family: 'Roboto', sans-serif; font-size: 11px;
  color: #bbb; margin-bottom: 14px; letter-spacing: 1px; transition: opacity .4s ease;
}
.swipe-hint.hidden { opacity: 0; pointer-events: none; }

/* ── FOOTER ── */
.page-footer {
  max-width: 520px;
  width: 100%;
  margin-top: 20px;
  margin-left: auto;   /* ← ADD */
  margin-right: auto;  /* ← ADD */
  text-align: center;
  color: rgba(0,58,112,0.6);
  font-size: 11px;
  line-height: 1.9;
  padding: 0 4px 24px;
  font-family: Roboto, sans-serif;
}
.page-footer a { color: rgba(0,58,112,0.8); text-decoration: underline; }
.footer-dedication-badge {
  --ded-height: 48px;
  --ded-ball: 54px;
  --ded-border: 3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--ded-height);
  max-width: min(100%, 500px);
  padding: 0 16px 0 0;
  margin: 0 auto 10px;
  border: var(--ded-border) solid #111;
  border-radius: 999px;
  background: #fffdf5;
  box-shadow: 3px 3px 0 #111;
  overflow: visible;
  text-align: left;
  transition: box-shadow .15s ease, transform .15s ease;
}
.footer-dedication-badge:hover {
  box-shadow: 1px 1px 0 #111;
  transform: translate(2px, 2px);
}
.footer-dedication-ball {
  flex: 0 0 var(--ded-ball);
  width: var(--ded-ball);
  height: var(--ded-ball);
  border-radius: 50%;
  border: var(--ded-border) solid #111;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-left: calc(-1 * var(--ded-border) - 2px);
  position: relative;
  z-index: 1;
  transition: transform .6s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.footer-dedication-badge:hover .footer-dedication-ball {
  transform: rotate(360deg);
}
.footer-dedication-badge.is-spinning .footer-dedication-ball {
  animation: footerDedicationSpin .6s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.footer-dedication-ball svg {
  width: 84%;
  height: 84%;
  --pokeball-outline: #ffffff;
}
.footer-dedication-text {
  font-family: 'Flexo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
  padding: 7px 0;
}
.page-footer .disclaimer { font-size: 10px; color: rgba(99,99,99,1); margin-top: 8px; line-height: 1.7; }

@media (max-width: 560px) {
  .footer-dedication-badge {
    --ded-height: 44px;
    --ded-ball: 50px;
    gap: 8px;
    padding-right: 12px;
  }

  .footer-dedication-text {
    font-size: 11px;
    line-height: 1.3;
    padding: 8px 0;
  }
}

@media (hover: none) {
  .footer-dedication-badge:hover {
    box-shadow: 3px 3px 0 #111;
    transform: none;
  }

  .footer-dedication-badge:hover .footer-dedication-ball {
    transform: none;
  }
}

@keyframes footerDedicationSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.screen { animation: fadeIn .35s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* ══════════ MAULISHMASTER — THE CHOSEN ONE ══════════ */
#maulish-cosmic {
  display:none; position:fixed; inset:0; z-index:9985; pointer-events:none;
  background:radial-gradient(ellipse at 50% 50%, #12002e 0%, #000010 60%, #000 100%);
  opacity:0; transition:opacity .7s ease;
}
#maulish-star-canvas {
  position:fixed; inset:0; z-index:9986; pointer-events:none;
  opacity:0; transition:opacity 1s ease;
}
#maulish-edge-aura {
  display:none; position:fixed; inset:0; z-index:9987; pointer-events:none;
}
#maulish-edge-aura.pulse {
  animation:maulishEdgePulse 2s ease-in-out infinite alternate;
}
@keyframes maulishEdgePulse {
  from { box-shadow:inset 0 0 80px rgba(160,80,255,0.25), inset 0 0 200px rgba(255,215,0,0.08); }
  to   { box-shadow:inset 0 0 140px rgba(200,100,255,0.5), inset 0 0 300px rgba(255,215,0,0.15); }
}
#maulish-light-pillar {
  display:none; position:fixed; left:50%; bottom:0;
  transform:translateX(-50%); z-index:9989; pointer-events:none;
  width:200px; height:0;
  background:linear-gradient(to top, rgba(255,215,0,0.6) 0%, rgba(255,215,0,0.15) 50%, transparent 100%);
  transition:height 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
  filter:blur(12px);
}
.maulish-energy-ring {
  position:fixed; border-radius:50%; pointer-events:none; z-index:9988;
  top:50%; left:50%; transform:translate(-50%,-50%) scale(0);
  animation:maulishRingExpand 1.1s cubic-bezier(0.2,0.6,0.4,1) forwards;
}
@keyframes maulishRingExpand {
  0%   { transform:translate(-50%,-50%) scale(0); opacity:1; }
  100% { transform:translate(-50%,-50%) scale(4.5); opacity:0; }
}
.maulish-energy-particle {
  position:fixed; border-radius:50%; pointer-events:none; z-index:9994;
  animation:maulishParticleRise linear forwards;
}
@keyframes maulishParticleRise {
  0%   { opacity:1; transform:translateY(0) translateX(0) scale(1); }
  100% { opacity:0; transform:translateY(-260px) translateX(var(--drift)) scale(0.15); }
}
#easter-overlay.maulish-active { background:transparent !important; }
#easter-card.maulish-active {
  background:linear-gradient(160deg, #1a0035 0%, #0d001a 50%, #1a0035 100%) !important;
  border:1.5px solid rgba(255,215,0,0.4) !important;
  border-radius:20px; padding:28px 24px;
  animation:maulishCardRise 0.8s cubic-bezier(0.175,0.885,0.32,1.1) forwards,
            maulishCardAura 3s ease-in-out 0.8s infinite alternate !important;
}
@keyframes maulishCardRise {
  0%   { transform:translateY(80px) scale(0.85); opacity:0; }
  60%  { transform:translateY(-12px) scale(1.03); opacity:1; }
  80%  { transform:translateY(5px) scale(0.99); opacity:1; }
  100% { transform:translateY(0) scale(1); opacity:1; }
}
@keyframes maulishCardAura {
  from { box-shadow:0 0 24px rgba(155,48,255,0.3), 0 0 50px rgba(255,215,0,0.12), 0 20px 60px rgba(0,0,0,0.85); }
  to   { box-shadow:0 0 55px rgba(155,48,255,0.55), 0 0 110px rgba(255,215,0,0.28), 0 20px 60px rgba(0,0,0,0.85); border-color:rgba(255,215,0,0.85) !important; }
}
#easter-card.maulish-active #easter-title {
  color:#FFD700 !important;
  text-shadow:0 0 25px rgba(255,215,0,.9), 0 0 50px rgba(160,80,255,.6);
}
#easter-card.maulish-active #easter-body  { color:rgba(255,255,255,.75) !important; }
#easter-card.maulish-active #easter-close {
  background:linear-gradient(135deg, #7b20e0, #4a0a9e) !important;
  background-size:100% 100% !important;
  border:1.5px solid rgba(255,215,0,0.55) !important;
  color:#fff !important;
  box-shadow:0 4px 20px rgba(155,48,255,0.5) !important;
  animation:maulishBtnPulse 2.8s ease-in-out infinite !important;
}
@keyframes maulishBtnPulse {
  from { box-shadow:0 4px 14px rgba(155,48,255,0.4), 0 0 0 rgba(255,215,0,0); }
  to   { box-shadow:0 4px 28px rgba(155,48,255,0.75), 0 0 16px rgba(255,215,0,0.18); }
}
.maulish-halo-ring {
  position:absolute; inset:-14px; border-radius:28px; pointer-events:none; z-index:0;
  animation:maulishHaloSpin 4s ease-in-out infinite;
}
@keyframes maulishHaloSpin {
  0%   { box-shadow:0 0 0 1.5px rgba(255,215,0,0.5), 0 0 18px rgba(255,215,0,0.25), 0 0 50px rgba(155,48,255,0.1); }
  50%  { box-shadow:0 0 0 2px rgba(255,215,0,0.95), 0 0 32px rgba(255,215,0,0.55), 0 0 80px rgba(155,48,255,0.25); }
  100% { box-shadow:0 0 0 1.5px rgba(255,215,0,0.5), 0 0 18px rgba(255,215,0,0.25), 0 0 50px rgba(155,48,255,0.1); }
}
.maulish-nebula {
  position:absolute; inset:0; border-radius:20px; pointer-events:none; z-index:0; opacity:.35;
  background:radial-gradient(ellipse at 30% 40%, rgba(120,0,255,0.4) 0%, transparent 60%),
             radial-gradient(ellipse at 75% 65%, rgba(255,100,0,0.25) 0%, transparent 55%),
             radial-gradient(ellipse at 55% 20%, rgba(0,180,255,0.2) 0%, transparent 50%);
  animation:maulishNebulaDrift 5s ease-in-out infinite alternate;
}
@keyframes maulishNebulaDrift {
  from { opacity:.3; transform:scale(1) rotate(0deg); }
  to   { opacity:.45; transform:scale(1.05) rotate(3deg); }
}
.maulish-chosen-banner {
  font-size:9px; font-weight:900; letter-spacing:4px; text-transform:uppercase;
  color:rgba(255,215,0,0.6); margin-bottom:6px; display:block;
  animation:maulishBannerFade 0.6s ease 1.2s both;
}
@keyframes maulishBannerFade {
  from { opacity:0; letter-spacing:8px; }
  to   { opacity:1; letter-spacing:4px; }
}
#easter-card.maulish-active #easter-emoji {
  position:relative; z-index:1;
  animation:maulishEmojiAura 2s ease-in-out infinite alternate;
}
@keyframes maulishEmojiAura {
  from { filter:drop-shadow(0 0 16px rgba(255,215,0,.9)) drop-shadow(0 0 30px rgba(160,80,255,.6)); transform:scale(1); }
  to   { filter:drop-shadow(0 0 28px rgba(255,215,0,1)) drop-shadow(0 0 60px rgba(180,100,255,.9)); transform:scale(1.06); }
}
/* ══════════ END CHOSEN ONE ══════════ */

/* ══════════════ SETTINGS ══════════════ */
#settings-overlay {
  display: none; position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(3px);
  align-items: flex-end; justify-content: center;
}
#settings-overlay.open { display: flex; }

.s-sheet {
  background: #fff;
  border-radius: 22px 22px 0 0;
  width: 100%; max-width: 480px;
  max-height: min(88vh, 760px);
  padding: 14px 18px 20px;
  box-shadow: 0 -6px 32px rgba(0,0,0,0.18);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(0.32,0.72,0,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#settings-overlay.open .s-sheet { transform: translateY(0); }

.s-handle {
  width: 40px; height: 4px;
  background: #ddd; border-radius: 99px;
  margin: 0 auto 14px; flex-shrink: 0;
}
.s-title {
  font-size: 18px; font-weight: 700; color: #003A70;
  text-align: center; margin-bottom: 10px;
  font-family: 'Flexo', sans-serif; flex-shrink: 0;
}
.s-label {
  font-size: 10px; font-weight: 700; color: #aaa;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 6px; margin-top: 12px;
  font-family: 'Roboto', sans-serif; flex-shrink: 0;
}
.s-label:first-of-type { margin-top: 0; }

/* Gen chips */
.s-gen-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.s-gen-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 99px;
  border: 2px solid #ddd; background: #f9f9f9;
  font-size: 12px; font-weight: 700; color: #888;
  font-family: 'Roboto', sans-serif; user-select: none;
}
.s-gen-chip.s-mandatory { border-color: #3D7DCA; background: #eef4fc; color: #003A70; cursor: pointer; }
.s-gen-chip.s-locked    { opacity: 0.45; cursor: pointer; }
.s-chip-check {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #ccc;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; flex-shrink: 0;
}
.s-gen-chip.s-mandatory .s-chip-check { background: #3D7DCA; border-color: #3D7DCA; color: #fff; }
.s-gen-note { font-size: 11px; color: #bbb; margin-top: 6px; font-family: 'Roboto', sans-serif; flex-shrink: 0; }

/* Sound */
.s-sound-row { display: flex; gap: 8px; flex-shrink: 0; }
.s-sound-card { flex: 1; background: #f9f9f9; border: 2px solid #eee; border-radius: 12px; padding: 10px 12px; transition: opacity .3s; }
.s-sound-card.s-muted { opacity: 0.45; }
.s-sound-lbl {
  font-size: 11px; font-weight: 700; color: #888;
  margin-bottom: 8px; display: flex;
  align-items: center; justify-content: space-between;
  font-family: 'Roboto', sans-serif;
}
.s-sound-val { color: #3D7DCA; }
.s-sound-card input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(to right, #3D7DCA 0%, #FFCB05 var(--pct, 70%), #e0e0e0 var(--pct, 70%), #e0e0e0 100%);
}
.s-sound-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #3D7DCA; cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,0.25); transition: transform .1s;
}
.s-sound-card input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
.s-sound-card.s-muted input[type="range"] {
  background: linear-gradient(to right, #bbb 0%, #bbb var(--pct,0%), #e0e0e0 var(--pct,0%), #e0e0e0 100%) !important;
}
.s-sound-card.s-muted input[type="range"]::-webkit-slider-thumb { background: #bbb; }

/* Auto-duck toggle */
.s-duck-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; background: #f9f9f9; border: 2px solid #eee;
  border-radius: 12px; padding: 9px 12px; flex-shrink: 0;
}
.s-duck-label { font-size: 12px; font-weight: 700; color: #555; font-family: 'Roboto', sans-serif; }
.s-toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.s-toggle-switch input { display: none; }
.s-toggle-track {
  position: absolute; inset: 0; background: #ddd;
  border-radius: 99px; cursor: pointer; transition: background .2s;
}
.s-toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.s-toggle-switch input:checked + .s-toggle-track { background: #3D7DCA; }
.s-toggle-switch input:checked + .s-toggle-track::after { transform: translateX(18px); }

/* Sprite tiles */
.s-sprite-grid { display: flex; gap: 8px; flex-shrink: 0; }
.s-sprite-btn {
  flex: 1; border: 2px solid #eee; border-radius: 12px;
  background: #f9f9f9; padding: 9px 6px 8px;
  cursor: pointer; text-align: center; transition: all .2s;
}
.s-sprite-btn:hover { border-color: #3D7DCA; background: #eef4fc; }
.s-sprite-btn.selected { border-color: #3D7DCA; background: #eef4fc; }
.s-sprite-icon { font-size: 22px; display: block; margin-bottom: 4px; }
.s-sprite-name { font-size: 11px; font-weight: 700; color: #003A70; display: block; margin-bottom: 3px; line-height: 1.3; font-family: 'Flexo', sans-serif; }
.s-sprite-desc { font-size: 10px; color: #aaa; line-height: 1.4; display: block; font-family: 'Roboto', sans-serif; }
.s-sprite-tick { display: none !important; }

.s-animation-grid {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 1px;
}
.s-animation-btn {
  flex: 1;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #f9f9f9;
  padding: 10px 9px 9px;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
}
.s-animation-btn:hover { border-color: #3D7DCA; background: #eef4fc; }
.s-animation-btn.selected { border-color: #3D7DCA; background: #eef4fc; }
.s-animation-name {
  font-size: 12px;
  font-weight: 700;
  color: #003A70;
  display: block;
  margin-bottom: 4px;
  line-height: 1.3;
  font-family: 'Flexo', sans-serif;
}
.s-animation-desc {
  font-size: 10px;
  color: #888;
  line-height: 1.45;
  display: block;
  font-family: 'Roboto', sans-serif;
}
.s-animation-tick { display: none !important; }
body.night-mode .s-animation-btn {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .s-animation-btn:hover,
body.night-mode .s-animation-btn.selected {
  background: #243858 !important;
  border-color: #3D7DCA !important;
}
body.night-mode .s-animation-name { color: #7eb3f7 !important; }
body.night-mode .s-animation-desc { color: #aab4c8 !important; }
body.night-mode .s-animation-tick { color: #7eb3f7 !important; }

/* Save button */
.s-save-btn {
  width: 100%; margin-top: 14px; background: #3D7DCA; color: #fff;
  border: none; border-radius: 12px; padding: 13px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: 'Flexo', sans-serif; transition: background .2s;
  flex-shrink: 0;
}
.s-save-btn:hover { background: #003A70; }

body.fast-animations .screen,
body.fast-animations .progress-fill,
body.fast-animations #pokemon-img,
body.fast-animations .img-opt-btn img,
body.fast-animations #evo-pokemon-img,
body.fast-animations .evo-opt-btn img,
body.fast-animations #learn-sprite,
body.fast-animations .img-skeleton {
  transition: none !important;
  animation: none !important;
}

body.fast-animations .spinner,
body.fast-animations .img-opt-spinner,
body.fast-animations .evo-spinner,
body.fast-animations .evo-opt-spinner {
  animation: none !important;
}

/* ══════════════ SETTINGS ENDS ══════════════ */

/* ══════════ WIFEY — THE ETERNAL BLOOM ══════════ */
#wifey-cosmic {
  display:none; position:fixed; inset:0; z-index:9985; pointer-events:none;
  background:radial-gradient(ellipse at 50% 55%,#3b0024 0%,#1e000e 58%,#0a0005 100%);
  opacity:0; transition:opacity .7s ease;
}
#wifey-star-canvas {
  position:fixed; inset:0; z-index:9986; pointer-events:none;
  opacity:0; transition:opacity 1s ease;
}
#wifey-edge { display:none; position:fixed; inset:0; z-index:9987; pointer-events:none; }
#wifey-edge.pulse { animation:wifeyEdgePulse 2.8s ease-in-out infinite alternate; }
@keyframes wifeyEdgePulse {
  from { box-shadow:inset 0 0 70px rgba(255,100,150,.18),inset 0 0 180px rgba(255,215,0,.05); }
  to   { box-shadow:inset 0 0 130px rgba(255,140,175,.42),inset 0 0 280px rgba(255,215,0,.12); }
}
#wifey-pillar {
  display:none; position:fixed; left:50%; bottom:0; transform:translateX(-50%);
  z-index:9989; pointer-events:none; width:200px; height:0;
  background:linear-gradient(to top,rgba(255,120,165,.65) 0%,rgba(255,180,205,.15) 50%,transparent 100%);
  transition:height .7s cubic-bezier(.25,.46,.45,.94); filter:blur(14px);
}
.wifey-ring {
  position:fixed; border-radius:50%; pointer-events:none; z-index:9988;
  top:50%; left:50%; transform:translate(-50%,-50%) scale(0);
  animation:wifeyRingExpand 1.3s cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes wifeyRingExpand {
  0%   { transform:translate(-50%,-50%) scale(0); opacity:1; }
  100% { transform:translate(-50%,-50%) scale(5.5); opacity:0; }
}
.wifey-petal {
  position:fixed; pointer-events:none; z-index:9994; font-size:20px; user-select:none;
  animation:wifeyPetalRise linear forwards;
}
@keyframes wifeyPetalRise {
  0%   { opacity:1; transform:translateY(0) translateX(0) rotate(0deg) scale(1); }
  100% { opacity:0; transform:translateY(-300px) translateX(var(--drift)) rotate(var(--spin)) scale(.25); }
}
#easter-overlay.wifey-active { background:transparent !important; }
#easter-card.wifey-active {
  background:linear-gradient(165deg,#2e0020 0%,#18000c 55%,#2e0020 100%) !important;
  border:1.5px solid rgba(255,160,190,.35) !important;
  border-radius:22px;
  padding:28px 24px !important;
  animation:wifeyCardRise .85s cubic-bezier(.175,.885,.32,1.1) forwards,
            wifeyCardAura 3.8s ease-in-out .85s infinite alternate !important;
}
@keyframes wifeyCardRise {
  0%   { transform:translateY(70px) scale(.88); opacity:0; }
  58%  { transform:translateY(-12px) scale(1.03); opacity:1; }
  78%  { transform:translateY(5px) scale(.99); opacity:1; }
  100% { transform:translateY(0) scale(1); opacity:1; }
}
@keyframes wifeyCardAura {
  from { box-shadow:0 0 22px rgba(255,100,150,.3),0 0 45px rgba(255,215,0,.09),0 22px 65px rgba(0,0,0,.88); }
  to   { box-shadow:0 0 52px rgba(255,140,175,.62),0 0 105px rgba(255,215,0,.22),0 22px 65px rgba(0,0,0,.88); border-color:rgba(255,190,210,.75) !important; }
}
.wifey-halo {
  position:absolute; inset:-15px; border-radius:30px; pointer-events:none; z-index:0;
  animation:wifeyHaloPulse 4.2s ease-in-out infinite;
}
@keyframes wifeyHaloPulse {
  0%   { box-shadow:0 0 0 1.5px rgba(255,180,200,.4),0 0 16px rgba(255,130,165,.18); }
  50%  { box-shadow:0 0 0 2px rgba(255,205,218,.92),0 0 30px rgba(255,165,190,.55); }
  100% { box-shadow:0 0 0 1.5px rgba(255,180,200,.4),0 0 16px rgba(255,130,165,.18); }
}
.wifey-nebula {
  position:absolute; inset:0; border-radius:22px; pointer-events:none; z-index:0; opacity:.32;
  background:radial-gradient(ellipse at 28% 38%,rgba(255,70,130,.3) 0%,transparent 58%),
             radial-gradient(ellipse at 72% 68%,rgba(255,210,0,.12) 0%,transparent 52%),
             radial-gradient(ellipse at 55% 18%,rgba(255,140,185,.18) 0%,transparent 48%);
  animation:wifeyNebulaDrift 5.5s ease-in-out infinite alternate;
}
@keyframes wifeyNebulaDrift {
  from { opacity:.26; transform:scale(1) rotate(0deg); }
  to   { opacity:.42; transform:scale(1.06) rotate(3.5deg); }
}
.wifey-banner {
  font-size:8.5px; font-weight:900; letter-spacing:4px; text-transform:uppercase;
  color:rgba(255,185,205,.65); margin-bottom:8px; display:block;
  animation:wifeyBannerFade .6s ease 1.3s both; position:relative; z-index:1;
}
@keyframes wifeyBannerFade { from{opacity:0;letter-spacing:9px;} to{opacity:1;letter-spacing:4px;} }
#easter-card.wifey-active #easter-emoji {
  position:relative; z-index:1;
  animation:wifeyEmojiAura 2.8s ease-in-out infinite alternate;
}
@keyframes wifeyEmojiAura {
  from { filter:drop-shadow(0 0 14px rgba(255,140,175,.9)) drop-shadow(0 0 28px rgba(255,90,130,.5)); transform:scale(1); }
  to   { filter:drop-shadow(0 0 26px rgba(255,175,198,1)) drop-shadow(0 0 55px rgba(255,120,160,.85)); transform:scale(1.07); }
}
#easter-card.wifey-active #easter-title {
  color:#FFB7C5 !important;
  text-shadow:0 0 18px rgba(255,140,175,.9),0 0 42px rgba(255,75,125,.45);
  position:relative; z-index:1;
}
#easter-card.wifey-active #easter-body { color:rgba(255,235,242,.78) !important; position:relative; z-index:1; }
#easter-card.wifey-active #easter-close {
  background:linear-gradient(135deg,#b52e61,#7f1338) !important;
  border:1.5px solid rgba(255,185,205,.5) !important;
  color:#fff !important; position:relative; z-index:1;
  animation:wifeyBtnPulse 3s ease-in-out infinite;
}
@keyframes wifeyBtnPulse {
  from { box-shadow:0 4px 12px rgba(185,46,97,.4); }
  to   { box-shadow:0 4px 26px rgba(210,55,110,.78),0 0 18px rgba(255,185,205,.18); }
}
/* ══════════ END WIFEY ══════════ */

/* DEDICATION Button EGG */
easter-card.dedication-active {
  background: linear-gradient(160deg, #2e0018 0%, #1a000d 55%, #2e0018 100%) !important;
  border: 1.5px solid rgba(255, 182, 193, 0.45) !important;
  border-radius: 20px;
  padding: 28px 24px;
  animation: dedicationCardRise 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards,
             dedicationCardAura 4s ease-in-out 0.8s infinite alternate !important;
}
@keyframes dedicationCardRise {
  0%   { transform: translateY(70px) scale(0.88); opacity: 0; }
  60%  { transform: translateY(-10px) scale(1.02); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes dedicationCardAura {
  from { box-shadow: 0 0 22px rgba(255,105,180,0.25), 0 0 45px rgba(255,215,0,0.08), 0 20px 60px rgba(0,0,0,0.85); }
  to   { box-shadow: 0 0 50px rgba(255,105,180,0.5),  0 0 90px rgba(255,215,0,0.18), 0 20px 60px rgba(0,0,0,0.85); }
}
easter-card.dedication-active #easter-title {
  color: #ffb6c1 !important;
  text-shadow: 0 0 20px rgba(255,182,193,0.8), 0 0 40px rgba(255,105,180,0.4);
}
easter-card.dedication-active #easter-body {
  color: rgba(255, 240, 245, 0.88) !important;
  line-height: 1.8 !important;
  font-size: 13.5px !important;
}
easter-card.dedication-active #easter-close {
  background: linear-gradient(135deg, #c2185b, #880e4f) !important;
  border: 1.5px solid rgba(255, 182, 193, 0.5) !important;
  color: #fff !important;
}
easter-overlay.dedication-active {
  background: transparent !important;
}




/* ══════════ HELU — GAMEBOY ══════════ */
#helu-edge { display:none; position:fixed; inset:0; z-index:9987; pointer-events:none; }
#helu-edge.pulse { animation:heluEdgePulse 1.8s ease-in-out infinite alternate; }
@keyframes heluEdgePulse {
  from { box-shadow:inset 0 0 55px rgba(139,172,15,.14); }
  to   { box-shadow:inset 0 0 95px rgba(155,187,15,.32),inset 0 0 250px rgba(48,98,48,.18); }
}
#helu-pillar {
  display:none; position:fixed; left:50%; bottom:0; transform:translateX(-50%);
  z-index:9989; pointer-events:none; width:200px; height:0;
  background:linear-gradient(to top,rgba(139,172,15,.72) 0%,rgba(155,187,15,.22) 50%,transparent 100%);
  transition:height .6s cubic-bezier(.25,.46,.45,.94); filter:blur(10px);
}
.helu-ring {
  position:fixed; border-radius:3px; pointer-events:none; z-index:9988;
  top:50%; left:50%; transform:translate(-50%,-50%) scale(0);
  animation:heluRingExpand .95s cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes heluRingExpand {
  0%   { transform:translate(-50%,-50%) scale(0) rotate(0deg); opacity:1; }
  100% { transform:translate(-50%,-50%) scale(6.5) rotate(6deg); opacity:0; }
}
.helu-glitch-line {
  position:fixed; left:0; right:0; pointer-events:none; z-index:9996;
  animation:heluGlitchSweep linear forwards;
}
@keyframes heluGlitchSweep { from{top:105vh;opacity:.7;} to{top:-5px;opacity:0;} }
#easter-overlay.helu-active { background:transparent !important; }
#easter-card.helu-active {
  background:#0F380F !important;
  border:3px solid #306230 !important;
  border-radius:3px !important;
  padding:28px 24px !important;
  animation:heluCardRise .72s cubic-bezier(.175,.885,.32,1.1) forwards,
            heluCardGlow 2.2s ease-in-out .72s infinite alternate !important;
}
#easter-card.helu-active::before {
  content:''; position:absolute; inset:0; border-radius:3px; pointer-events:none; z-index:2;
  background:repeating-linear-gradient(0deg,rgba(0,0,0,.07) 0px,rgba(0,0,0,.07) 1px,transparent 1px,transparent 3px);
}
@keyframes heluCardRise {
  0%   { transform:translateY(70px) scale(.88); opacity:0; }
  55%  { transform:translateY(-8px) scale(1.02); opacity:1; }
  78%  { transform:translateY(3px) scale(.99); opacity:1; }
  100% { transform:translateY(0) scale(1); opacity:1; }
}
@keyframes heluCardGlow {
  from { box-shadow:0 0 18px rgba(155,187,15,.38),0 0 45px rgba(48,98,48,.28),0 22px 65px rgba(0,0,0,.92); }
  to   { box-shadow:0 0 44px rgba(155,187,15,.72),0 0 95px rgba(48,98,48,.48),0 22px 65px rgba(0,0,0,.92); border-color:#9BBB0F; }
}
.helu-halo {
  position:absolute; inset:-11px; border-radius:5px; pointer-events:none; z-index:0;
  animation:heluHaloPulse 3.2s ease-in-out infinite;
}
@keyframes heluHaloPulse {
  0%   { box-shadow:0 0 0 2px rgba(155,187,15,.38),0 0 12px rgba(155,187,15,.14); }
  50%  { box-shadow:0 0 0 3px rgba(155,187,15,.88),0 0 26px rgba(155,187,15,.44); }
  100% { box-shadow:0 0 0 2px rgba(155,187,15,.38),0 0 12px rgba(155,187,15,.14); }
}
.helu-noise {
  position:absolute; inset:0; border-radius:3px; pointer-events:none; z-index:0; opacity:.05;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.helu-banner {
  font-size:8px; font-weight:900; letter-spacing:3px; text-transform:uppercase;
  color:rgba(155,187,15,.6); margin-bottom:9px; display:block;
  font-family:'Courier New',monospace;
  animation:heluBannerFade .5s ease 1s both; position:relative; z-index:1;
}
@keyframes heluBannerFade { from{opacity:0;letter-spacing:7px;} to{opacity:1;letter-spacing:3px;} }
#easter-card.helu-active #easter-emoji {
  position:relative; z-index:1; image-rendering:pixelated;
  animation:heluEmojiGlow 2.2s ease-in-out infinite alternate;
}
@keyframes heluEmojiGlow {
  from { filter:drop-shadow(0 0 10px rgba(155,187,15,.8)) brightness(.95); transform:scale(1); }
  to   { filter:drop-shadow(0 0 22px rgba(155,187,15,1)) brightness(1.06); transform:scale(1.04); }
}
#easter-card.helu-active #easter-title {
  color:#9BBB0F !important; font-family:'Courier New',monospace !important; letter-spacing:1px;
  text-shadow:0 0 14px rgba(155,187,15,.9),0 0 30px rgba(48,98,48,.6);
  position:relative; z-index:1; animation:heluGlitch 7s ease-in-out infinite;
}
@keyframes heluGlitch {
  0%,90%,100% { transform:translateX(0) skewX(0); filter:none; }
  91% { transform:translateX(-3px) skewX(-3deg); filter:hue-rotate(80deg); }
  92% { transform:translateX(3px) skewX(2deg); filter:hue-rotate(-80deg); }
  93% { transform:translateX(-1px); filter:none; }
  94% { transform:translateX(0); }
}
#easter-card.helu-active #easter-body {
  color:rgba(155,187,15,.72) !important; font-family:'Courier New',monospace !important;
  letter-spacing:.2px; position:relative; z-index:1;
}
#easter-card.helu-active #easter-close {
  background:#1a5218 !important; border:2px solid #9BBB0F !important;
  color:#9BBB0F !important; font-family:'Courier New',monospace !important;
  letter-spacing:2px; position:relative; z-index:1;
  animation:heluBtnBlink 1.6s step-end infinite;
}
@keyframes heluBtnBlink {
  0%,100% { box-shadow:0 0 10px rgba(155,187,15,.45); }
  50%     { box-shadow:0 0 22px rgba(155,187,15,.88),inset 0 0 5px rgba(155,187,15,.25); }
}

#helu-pixel-canvas {
  position:fixed; inset:0; z-index:9986; pointer-events:none;
  opacity:0; transition:opacity 0.8s ease;
}

/* ── QUIZ SECTION DIVIDER ─────────────────────────────────────── */
.quiz-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  color: #ccc;
  font-size: 10px;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.quiz-section-divider::before,
.quiz-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #ebebeb;
}

/* ── COMING SOON CARD ─────────────────────────────────────────── */
.quiz-type-btn--coming-soon {
  opacity: 0.5;
  cursor: not-allowed !important;
  filter: grayscale(0.5);
  pointer-events: auto; /* keeps the title tooltip working */
}
.quiz-type-btn--coming-soon:hover {
  border-color: #ddd !important;
  background: #f9f9f9 !important;
  transform: none !important;
  box-shadow: none !important;
}
.quiz-type-btn--coming-soon .qt-arrow {
  color: #ddd !important;
}
.qt-coming-soon-badge {
  display: inline-block;
  font-size: 9px;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  background: #f0f0f0;
  color: #aaa;
  border: 1px solid #ddd;
  border-radius: 99px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

body.night-mode .quiz-section-divider { color: #444; }
body.night-mode .quiz-section-divider::before,
body.night-mode .quiz-section-divider::after { background: #2a3a5a; }
body.night-mode .qt-coming-soon-badge {
  background: #1e2d4a;
  color: #556a8a;
  border-color: #2e4a7a;
}

/* ══════════ END HELU ══════════ */


/* ── QUESTION TRANSITION ──────────────────────────────────────── */
@keyframes q-fade-slide {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0);    }
}
.q-entering {
  animation: q-fade-slide 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes q-fade-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
.q-leaving {
  animation: q-fade-slide-out 0.18s cubic-bezier(0.4, 0, 0.6, 1) both;
  pointer-events: none; /* block double-tap during exit */
}

/* ── SETTINGS CLOSE BUTTON ───────────────────────────────────── */
.s-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: sticky;
  top: -14px;
  z-index: 2;
  background: #fff;
  padding-top: 6px;
  padding-bottom: 6px;
}
.s-title-row .s-title {
  margin-bottom: 0;
}
.s-close-btn {
  background: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.s-close-btn:hover {
  background: #e0e0e0;
  color: #222;
}
body.night-mode .s-close-btn {
  background: #2e4a7a;
  color: #aab4c8;
}
body.night-mode .s-close-btn:hover {
  background: #3d5f99;
  color: #fff;
}
body.night-mode .s-title-row {
  background: #16213e;
}

@media (max-width: 520px) {
  .s-sheet {
    max-height: 90vh;
    padding: 12px 14px 16px;
  }

  .s-sound-row,
  .s-sprite-grid,
  .s-animation-grid {
    gap: 6px;
  }

  .s-sprite-name,
  .s-animation-name {
    font-size: 11px;
  }

  .s-sprite-desc,
  .s-animation-desc {
    font-size: 9px;
  }
}


/* Night mode overrides */
body.night-mode .review-card {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .review-title { color: #7eb3f7 !important; }
body.night-mode .review-question { color: #aab4c8 !important; }
body.night-mode .review-correct { color: #6fcf97 !important; }
body.night-mode .review-wrong   { color: #eb9898 !important; }
body.night-mode .review-img-wrap { background: #2e4a7a !important; }
body.night-mode #review-section { border-top-color: #2e4a7a !important; }

/* ============================================================
   SETTINGS PANEL — FULL DARK MODE FIX
   ============================================================ */

/* Sheet background + handle */
body.night-mode .s-sheet {
  background: #16213e !important;
}
body.night-mode .s-handle {
  background: #2e4a7a !important;
}

/* Section labels (GENERATION, SOUND, etc.) */
body.night-mode .s-label {
  color: #556a8a !important;
}

/* Gen chips — unselected */
body.night-mode .s-gen-chip {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
  color: #aab4c8 !important;
}
/* Gen chips — selected/active */
body.night-mode .s-gen-chip.s-mandatory {
  background: #1a3a5a !important;
  border-color: #3D7DCA !important;
  color: #7eb3f7 !important;
}
body.night-mode .s-chip-check {
  border-color: #2e4a7a !important;
}
body.night-mode .s-gen-chip.s-mandatory .s-chip-check {
  background: #3D7DCA !important;
  border-color: #3D7DCA !important;
  color: #fff !important;
}
body.night-mode .s-gen-note {
  color: #556a8a !important;
}

/* Sound cards */
body.night-mode .s-sound-card {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .s-sound-lbl {
  color: #aab4c8 !important;
}
body.night-mode .s-sound-val {
  color: #7eb3f7 !important;
}
body.night-mode .s-sound-card input[type="range"] {
  background: linear-gradient(to right, #3D7DCA 0%, #FFCB05 var(--pct, 70%), #2e4a7a var(--pct, 70%), #2e4a7a 100%) !important;
}
body.night-mode .s-sound-card.s-muted input[type="range"] {
  background: linear-gradient(to right, #556a8a 0%, #556a8a var(--pct, 0%), #2e4a7a var(--pct, 0%), #2e4a7a 100%) !important;
}

/* Auto-duck toggle row */
body.night-mode .s-duck-row {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .s-toggle-track {
  background: #2e4a7a !important;
}
body.night-mode .s-toggle-switch input:checked ~ .s-toggle-track {
  background: #3D7DCA !important;
}

/* Visual Style (Sprite) buttons — unselected */
body.night-mode .s-sprite-btn {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .s-sprite-btn:hover {
  background: #243858 !important;
  border-color: #3D7DCA !important;
}
/* Visual Style — SELECTED */
body.night-mode .s-sprite-btn.selected {
  background: #1a3a5a !important;
  border-color: #3D7DCA !important;
  box-shadow: 0 0 0 2px rgba(61,125,202,0.35) !important;
}
body.night-mode .s-sprite-name {
  color: #7eb3f7 !important;
}
body.night-mode .s-sprite-desc {
  color: #aab4c8 !important;
}

/* Animation buttons — unselected */
body.night-mode .s-animation-btn {
  background: #1e2d4a !important;
  border-color: #2e4a7a !important;
}
body.night-mode .s-animation-btn:hover {
  background: #243858 !important;
  border-color: #3D7DCA !important;
}
/* Animation buttons — SELECTED (the fix for "which is active" being unclear) */
body.night-mode .s-animation-btn.selected {
  background: #1a3a5a !important;
  border-color: #3D7DCA !important;
  box-shadow: 0 0 0 2px rgba(61,125,202,0.35) !important;
}
body.night-mode .s-animation-name {
  color: #7eb3f7 !important;
}
body.night-mode .s-animation-desc {
  color: #aab4c8 !important;
}

/* Save & Close button */
body.night-mode .s-save-btn {
  background: #3D7DCA !important;
  color: #fff !important;
}
body.night-mode .s-save-btn:hover {
  background: #003A70 !important;
}

/* Sticky title row */
body.night-mode .s-title-row {
  background: #16213e !important;
}
body.night-mode .s-title {
  color: #7eb3f7 !important;
}


/* Dedication badge — night mode */
body.night-mode .footer-dedication-badge {
  background: #1e2d4a !important;
  border-color: #7eb3f7 !important;
  box-shadow: 3px 3px 0 #7eb3f7 !important;
}
body.night-mode .footer-dedication-badge:hover {
  box-shadow: 1px 1px 0 #7eb3f7 !important;
}
body.night-mode .footer-dedication-ball {
  background: #16213e !important;
  border-color: #7eb3f7 !important;
}
body.night-mode .footer-dedication-text {
  color: #e8f0fe !important;
}
body.night-mode .page-footer {
  color: rgba(174, 196, 230, 0.7) !important;
}
body.night-mode .page-footer a {
  color: rgba(174, 196, 230, 0.9) !important;
}
body.night-mode .page-footer .disclaimer {
  color: rgba(150, 170, 200, 0.8) !important;
}




/* ── LOADING SKELETON ──────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.img-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #e8eef6 25%, #d0d8ea 50%, #e8eef6 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  pointer-events: none;
  transition: opacity 0.25s;
}
body.night-mode .img-skeleton {
  background: linear-gradient(90deg, #1e2d4a 25%, #2a3f6a 50%, #1e2d4a 75%);
  background-size: 800px 100%;
}
/* Wrappers must be position:relative for skeleton to anchor */
.pokemon-img-wrap,
.evo-question-img-wrap {
  position: relative;
}

/* ── SHARE BUTTON ──────────────────────────────────────────────── */
.share-btn {
  background: #fff;
  color: #3D7DCA;
  border: 2px solid #3D7DCA;
  border-radius: 10px;
  padding: 13px 28px;
  width: 100%;
  font-size: 15px;
  font-weight: 700;
  font-family: Flexo, sans-serif;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.share-btn:hover  { background: #eef4fc; }
.share-btn:active { transform: scale(0.97); }
body.night-mode .share-btn          { color: #7eb3f7; border-color: #7eb3f7; }
body.night-mode .share-btn:hover    { background: #1e2d4a; }

/* ── Night Mode ─────────────────────────────────── */
body.night-mode {
  --night-text: #e8e8e8;
  --night-sub: #aab4c8;
  --night-blue: #7eb3f7;
}
body.night-mode #landing-screen h1,
body.night-mode #welcome-screen h1,
body.night-mode .qt-title,
body.night-mode .learn-detail-name,
body.night-mode .lb-title { color: #7eb3f7 !important; -webkit-text-stroke: 0 !important; }

body.night-mode .qt-desc,
body.night-mode .landing-subtitle,
body.night-mode label,
body.night-mode .learn-info-label,
body.night-mode .learn-dex-entry,
body.night-mode .lb-table td,
body.night-mode .lb-table th,
body.night-mode .result-msg,
body.night-mode .result-score-sub,
body.night-mode .result-time { color: #aab4c8 !important; }

body.night-mode .opt-btn,
body.night-mode .img-opt-btn,
body.night-mode .evo-opt-btn,
body.night-mode .diff-btn,
body.night-mode .toggle-btn,
body.night-mode .learn-nav-btn,
body.night-mode .learn-card,
body.night-mode .hint-card,
body.night-mode .learn-info-card { background: #1e2d4a !important; border-color: #2e4a7a !important; color: #aab4c8 !important; }

body.night-mode .diff-btn.selected,
body.night-mode .toggle-btn.active { background: #3D7DCA !important; color: #fff !important; }

body.night-mode input[type="text"] { background: #1e2d4a !important; border-color: #2e4a7a !important; color: #e8e8e8 !important; }
body.night-mode input[type="text"]::placeholder { color: #556a8a !important; }

body.night-mode .opt-btn.correct,
body.night-mode .img-opt-btn.correct,
body.night-mode .evo-opt-btn.correct { background: #1a4a2a !important; border-color: #28a745 !important; }

body.night-mode .opt-btn.wrong,
body.night-mode .img-opt-btn.wrong,
body.night-mode .evo-opt-btn.wrong { background: #4a1a1a !important; border-color: #dc3545 !important; }

body.night-mode .lb-table tr { background: #1e2d4a !important; }
body.night-mode .lb-table tr.lb-you { background: #2a3f6a !important; }
body.night-mode .lb-table th { background: #16213e !important; color: #7eb3f7 !important; }

/* ── Night Mode: missing text-colour overrides ───────────────── */

/* Pokédex grid — Pokémon names */
body.night-mode .learn-card .lc-name          { color: #c8d4e8 !important; }

/* Pokédex detail — info values (Height, Weight, Category, Abilities) */
body.night-mode .learn-info-value             { color: #e8e8e8 !important; }

/* Pokédex detail — "Evolution Chain" section label */
body.night-mode .learn-section-label          { color: #7eb3f7 !important; }

/* Pokédex detail — evolution chain member names + card background */
body.night-mode .learn-evo-member             { background: #1e2d4a !important; border-color: #2e4a7a !important; }
body.night-mode .learn-evo-member:hover,
body.night-mode .learn-evo-member.current     { background: #1e3a5a !important; border-color: #3D7DCA !important; }
body.night-mode .learn-evo-member .evo-mem-name { color: #c8d4e8 !important; }

/* Pokédex detail — dex entry yellow background */
body.night-mode .learn-dex-entry              { background: #1e2a14 !important; border-color: #4a6a2a !important; }

/* Game — question sub-label */
body.night-mode .question-label               { color: #aab4c8 !important; }

/* Evolution quiz — option button captions */
body.night-mode .evo-opt-btn .evo-caption     { color: #aab4c8 !important; }

/* Hints — card body text and label heading */
body.night-mode .hint-card .entry-text        { color: #aab4c8 !important; }
body.night-mode .hint-card strong             { color: #e8c050 !important; }

/* Hints — hint buttons */
body.night-mode .hint-btn                     { background: #1e2d1a !important; border-color: #4a6a2a !important; color: #e8c050 !important; }
body.night-mode .hint-btn.used                { background: #2a3a1a !important; border-color: #6a8a3a !important; color: #c8a840 !important; }

/* Settings — auto-duck label */
body.night-mode .s-duck-label                 { color: #aab4c8 !important; }

/* Leaderboard — "you" row text (was dark navy on dark blue) */
body.night-mode .lb-you td                    { color: #7eb3f7 !important; }

/* quiz-type-btn: dark background + border, matching other dark cards */
body.night-mode .quiz-type-btn {
    background: #1e2d4a !important;
    border-color: #2e4a7a !important;
}

body.night-mode .quiz-type-btn:hover {
    background: #243858 !important;
    border-color: #3D7DCA !important;
    box-shadow: 0 4px 12px rgba(61, 125, 202, 0.25) !important;
}

body.night-mode .quiz-type-btn:hover .qt-arrow {
    color: #7eb3f7 !important;
}

/* coming-soon variant: keep it clearly disabled in dark mode */
body.night-mode .quiz-type-btn--coming-soon:hover {
    background: #1e2d4a !important;
    border-color: #2e4a7a !important;
    box-shadow: none !important;
}

.learn-browse-title {
    font-family: 'Flexo', sans-serif;
    font-size: clamp(26px, 6vw, 42px);
    color: #003A70;
    margin-bottom: 16px;
}

body.night-mode .learn-browse-title { color: #7eb3f7 !important; }


/* ── REVIEW MISTAKES ───────────────────────────────────────── */
#review-section {
  margin-top: 24px;
  width: 100%;
  text-align: left;
}

#review-section[style*="block"] {
  animation: fadeIn 0.4s ease both;
}

.review-title {
  font-family: Flexo, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #003A70;
  margin-bottom: 12px;
  text-align: center;
  padding-bottom: 10px;
  border-top: 2px solid #eee;
  padding-top: 18px;
}

.review-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff5f5;
  border: 2px solid #f0d0d0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  text-align: left;
}

.review-img-wrap {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #eee;
  overflow: hidden;
}

.review-sprite {
  width: 52px;
  height: 52px;
  object-fit: contain;
  image-rendering: pixelated;
}

.review-info { flex: 1; min-width: 0; }

.review-question {
  font-family: Flexo, sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 5px;
  line-height: 1.4;
}

.review-correct {
  font-family: Roboto, sans-serif;
  font-size: 12px;
  color: #155724;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.4;
}

.review-wrong {
  font-family: Roboto, sans-serif;
  font-size: 12px;
  color: #721c24;
  font-weight: 700;
  line-height: 1.4;
}

/* Dark mode */
body.night-mode .review-title {
    color: #7eb3f7;
    border-top-color: #2e4a7a;
}

body.night-mode .review-card {
    background: #1e2d4a;
    border-color: #5a2a2a;
}

body.night-mode .review-img-wrap {
    background: #162238;
    border-color: #2e4a7a;
}

body.night-mode .review-question { color: #aab4c8; }
body.night-mode .review-correct  { color: #6daa45; }
body.night-mode .review-wrong    { color: #dd6974; }
/* ── REVIEW MISTAKES END ────────────────────────────────────── */


/* ── Keyboard shortcut badges on answer buttons ──────────────── */
#options-grid .opt-btn,
#img-options-grid .img-opt-btn,
#evo-options-grid .evo-opt-btn {
  position: relative; /* needed for ::before positioning */
}

#options-grid .opt-btn::before,
#img-options-grid .img-opt-btn::before,
#evo-options-grid .evo-opt-btn::before {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.15);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border-radius: 4px;
  opacity: 0.65;
  pointer-events: none;
}

#options-grid .opt-btn:nth-child(1)::before,
#img-options-grid .img-opt-btn:nth-child(1)::before,
#evo-options-grid .evo-opt-btn:nth-child(1)::before { content: '1'; }

#options-grid .opt-btn:nth-child(2)::before,
#img-options-grid .img-opt-btn:nth-child(2)::before,
#evo-options-grid .evo-opt-btn:nth-child(2)::before { content: '2'; }

#options-grid .opt-btn:nth-child(3)::before,
#img-options-grid .img-opt-btn:nth-child(3)::before,
#evo-options-grid .evo-opt-btn:nth-child(3)::before { content: '3'; }

#options-grid .opt-btn:nth-child(4)::before,
#img-options-grid .img-opt-btn:nth-child(4)::before,
#evo-options-grid .evo-opt-btn:nth-child(4)::before { content: '4'; }

/* Hide badges after the question is answered */
#options-grid .opt-btn.correct::before,
#options-grid .opt-btn.wrong::before,
#img-options-grid .img-opt-btn.correct::before,
#img-options-grid .img-opt-btn.wrong::before,
#evo-options-grid .evo-opt-btn.correct::before,
#evo-options-grid .evo-opt-btn.wrong::before {
  display: none;
}
/* ── Keyboard shortcut badges on answer buttons ends ──────────────── */
