/* Images used only from CSS live in assets/ too: overwrite the file to swap it.
   Background/LatiosLatias.webp, fonts/PokemonClassic.ttf, InGame/TextInputBackground*.png,
   Silhouette/SilhouetteBackground.png. Everything else is listed in js/assets.js. */
@font-face {
  font-family: PokemonClassic;
  src: url(../assets/fonts/PokemonClassic.ttf) format('truetype');
}

:root {
  --sky-top: #5fb4f0;
  --sky-bottom: #c9ecff;
  --grass: #5aa845;
  --grass-dark: #3d7d2f;
  --panel: #1f3550;
  --panel-border: #f2c94c;
  --paper: #fffbe8;
  --ink: #ffffff;
  --ink-dim: #b8c7d9;
  --correct: #45f395;
  --partial: #f3db45;
  --wrong: #f36445;
  /* pokedle.net's hard purple-grey drop shadow under white text */
  --text-outline: 2px 2px 0 #493f52;
  /* lighter tile colors under the cursor */
  --correct-hover: #9dffcb;
  --partial-hover: #ffef89;
  --wrong-hover: #fe9077;
  --radius: 14px;
  --font: PokemonClassic, Helvetica, Arial, sans-serif;
}
body.colorblind {
  --correct: #0072b2;
  --partial: #f0e442;
  --wrong: #d55e00;
  --correct-hover: #0c8ad3;
  --partial-hover: #fff45f;
  --wrong-hover: #eb7419;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: -1px;
  background: #f5b97b url(../assets/Background/LatiosLatias.webp) center bottom / cover fixed no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

a { color: inherit; }
button { font-family: var(--font); }

/* ---------- header ---------- */
.top { width: 100%; max-width: 560px; padding: 18px 0 10px; }
/* Back button on the left, settings and language on the right; equal sides keep the logo centered */
.top-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.top-side { display: flex; align-items: center; gap: 4px; }
.top-right { justify-content: flex-end; }
.back-btn { display: inline-flex; align-items: center; justify-content: center; }
.back-btn img { width: 30px; height: 30px; }
.back-btn:hover img { transform: translateX(-3px); }
/* The header icons (assets/Icons) are white; where they sit on a light background, draw them in the panel's dark blue */
#win-stats .ico, .stats h2 .ico { filter: brightness(0) invert(17%) sepia(30%) saturate(1100%) hue-rotate(178deg); }
.logo img { display: block; width: min(300px, 62vw); filter: drop-shadow(0 4px 6px #0005); }
.icon-btn { width: 42px; height: 42px; padding: 0; border: none; background: none; cursor: pointer; }
.icon-btn img { width: 32px; filter: drop-shadow(0 2px 2px #0008); }
.ico { width: 1.2em; height: 1.2em; object-fit: contain; vertical-align: -0.2em; }

.toolbar { display: flex; justify-content: center; gap: 14px; margin-top: 8px; }
.tool {
  height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: none; background: none;
  color: #fff;
  cursor: pointer;
}
.tool img { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 2px 2px #0008); }
.streak { position: relative; cursor: default; }
.streak img { width: 34px; height: 36px; }
.streak b { position: absolute; bottom: 0; right: -6px; font-size: .75rem; text-shadow: 0 0 3px #000, 0 0 3px #000; }

main { width: 100%; max-width: 760px; flex: 1; }

/* ---------- game page ---------- */
/* A soft, blurred dark circle behind the panel, guess box and "yesterday" line,
   so the white text stands out from the bright background */
.game { position: relative; isolation: isolate; }
.game::before {
  content: '';
  position: absolute; z-index: -1;
  /* Length of the shape: how far it reaches above and below the section
     (more than 60px below makes short pages scroll past the footer) */
  top: -150px; bottom: -200px; left: 50%;
  width: min(760px, 100vw);
  transform: translateX(-50%);
  /* the gradient's long fade gives the blurred edge (a blur filter on this layer doesn't render everywhere) */
  background: radial-gradient(closest-side, #000 50%, rgba(0, 0, 0, .64) 72%, rgba(0, 0, 0, .22) 88%, transparent);
  /* Darkness of the shape: 0 = invisible, 1 = solid black in the middle */
  opacity: .25;
  pointer-events: none;
}

/* ---------- panels ---------- */
.panel {
  background: var(--panel);
  border: 4px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 #0003;
  padding: 16px 18px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.3rem; text-align: left; }
.gen-label { margin: 0 0 6px; font-size: .85rem; color: var(--ink-dim); text-align: left; }
/* The game's clue panel, styled like pokedle.net's: gold frame, pale pink inner line,
   big top-left corner and a purple-grey shadow under the text */
.prompt-panel {
  max-width: 462px;
  padding: 20px;
  background: #294e68;
  border: 6px solid #caa746;
  border-radius: 28px 10px 10px;
  box-shadow: inset 0 0 0 4px #ecd9ef;
  text-shadow: 2px 2px 0 #60526c;
}
.prompt-panel .gen-label { font-size: .8rem; color: rgba(255, 255, 255, .5); }
.prompt-panel h2 { font-size: 1rem; }
.prompt-panel .clue > .muted { color: #94a6b3; font-size: 1rem; text-shadow: 0 4px 4px rgba(0, 0, 0, .25); }
.muted { color: var(--ink-dim); }
.loading { text-align: center; font-size: 1.3rem; text-shadow: 0 2px 0 #0004; }

/* ---------- home ---------- */
.tagline { text-align: center; font-size: 1.5rem; text-shadow: var(--text-outline); margin: 12px 0 18px; }
.mode-list { display: grid; gap: 12px; justify-items: center; }
/* Button artwork is 458×135; the title and description sit on its blank areas */
.mode-btn {
  position: relative; display: block;
  width: min(320px, 86vw); aspect-ratio: 458 / 135;
  background: center / 100% 100% no-repeat;
  color: #000; text-decoration: none; text-align: left;
  /* drop-shadow follows the button art's shape, lifting it off the background */
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .35));
  transition: transform .1s;
}
.mode-btn:active { transform: scale(.98); }
.mode-btn.mini { width: min(280px, 80vw); margin: 4px auto 16px; }
.button-title { position: absolute; top: 12%; left: 7%; font-size: 1.15rem; text-transform: uppercase; }
.button-description { position: absolute; bottom: 20%; left: 21%; font-size: .62rem; }
.mode-btn .check { position: absolute; top: 8%; right: 6%; }
.check { color: var(--correct); font-size: 1.6rem; }

/* Home page sizes, the same as pokedle.net's. Its page is the window minus an 8px margin
   on each side, hence the (100vw - 16px); the button text moves and scales at its breakpoints. */
body.is-home .top { padding: 8px 0 0; }
body.is-home .logo img { width: min(334px, calc((100vw - 16px) * .8)); }
.home .tagline { font-size: 19.2px; font-weight: 500; margin: 16px 0; }
.home .mode-list { gap: 12.8px; }
.home .mode-btn { width: min(370px, calc((100vw - 16px) * .23)); }
.home .button-title { top: 14px; left: 32px; font-size: 20px; }
.home .button-description { bottom: 25px; left: 84px; font-size: 11px; }
@media (max-width: 1608px) {
  .home .button-title { top: .9vw; left: 1.8vw; font-size: 1.3vw; }
  .home .button-description { bottom: 1.5vw; left: 4.8vw; font-size: .76vw; }
}
@media (max-width: 1000px) {
  .home .mode-btn { width: min(370px, calc((100vw - 16px) * .95)); }
  .home .button-title { top: 19px; left: 31.8px; font-size: 22.9px; }
  .home .button-description { bottom: 24.9px; left: 82.6px; font-size: 13.9px; }
}
@media (max-width: 440px) {
  .top .icon-btn img, .top .flag-btn img, .top .back-btn img { width: 8vw; height: auto; }
  /* Both icons sit on the right, so on phones the logo shrinks to stay clear of them
     (pokedle.net instead lets its two corner icons overlap the logo) */
  .top-row { grid-template-columns: 1fr minmax(0, auto) 1fr; }
  .top-side { min-width: calc(16vw + 8px); }
  .icon-btn { width: auto; }
  .logo, .logo img { max-width: 100%; }
}
@media (max-width: 400px) {
  .home .mode-btn { width: calc((100vw - 16px) * .85); }
  .home .button-title { top: 4vw; left: 7.5vw; font-size: 4.4vw; }
  .home .button-description { bottom: 5.5vw; left: 18.6vw; font-size: 3.15vw; }
}

/* ---------- classic clues ---------- */
.clues { display: flex; justify-content: space-around; gap: 6px; margin: 4px 0 8px; }
.clue-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  background: none; border: 2px solid transparent; border-radius: 10px;
  color: var(--ink-dim); font-size: .85rem;
}
.clue-btn small { font-size: .75rem; }
.clue-icon { width: 40px; height: 40px; object-fit: contain; }
.clue-btn.unlocked { color: #fff; cursor: pointer; }
.clue-btn.unlocked .clue-icon { filter: drop-shadow(0 0 6px var(--panel-border)); }
.clue-btn.unlocked:hover, .clue-btn.active { border-color: var(--panel-border); }
.clue-box {
  background: var(--paper); color: var(--panel); text-shadow: none;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 10px;
}
.clue-box p { margin: 4px 0 0; }

.switch-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: .9rem; margin-top: 6px;
}
.settings .switch-row, .settings .btn { justify-content: space-between; width: 100%; font-size: 1.05rem; margin: 10px 0; }
.info { width: 16px; height: 16px; cursor: help; }
.switch {
  appearance: none;
  width: 40px; height: 22px; border-radius: 11px;
  background: #222; border: 2px solid #fff;
  position: relative; cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .2s;
}
.switch:checked { background: #8bd17c; }
.switch:checked::after { left: 20px; }

.eye { background: none; border: none; cursor: pointer; margin-top: 8px; }
.eye .ico { width: 30px; height: 30px; }
.eye.off { opacity: .4; }
.note { margin: 2px 0 0; }

/* ---------- mode visuals ---------- */
.tcg-card { width: min(240px, 66vw); margin: 0 auto; border-radius: 10px; overflow: hidden; }
.tcg-card.small { width: 150px; }
.tcg-card img { display: block; width: 100%; transition: filter .8s; user-select: none; }

.silhouette {
  width: min(300px, 76vw); aspect-ratio: 1; margin: 0 auto;
  overflow: hidden; border-radius: 6px;
  background: url(../assets/Silhouette/SilhouetteBackground.png) center / cover;
}
.silhouette img { width: 100%; height: 100%; object-fit: contain; filter: brightness(0); transition: transform .8s, filter .8s; user-select: none; }
.silhouette.revealed img { filter: none; }

.dex {
  margin: 0;
  padding: 14px;
  background: var(--paper);
  color: var(--panel);
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1.45;
  text-shadow: none;
}

/* ---------- guess input ---------- */
.guess-form {
  display: flex; align-items: center;
  /* Same size as pokedle.net's: 80% of the page, at most 360px, 70px tall */
  width: min(360px, calc((100vw - 16px) * .8));
  margin: 0 auto 19.2px;
}
.combo { position: relative; flex: 1; min-width: 0; }
#guess-input {
  display: block;
  width: 100%; height: 70px;
  padding: 0 23px 7px;
  border: none;
  background: url(../assets/InGame/TextInputBackgroundLeft.png) left center / 100% 100% no-repeat;
  color: #000;
  font: 16px/20px var(--font); letter-spacing: -1px;
  outline: none;
}
#guess-input::placeholder { color: #a1a1a1; font-size: 12px; }
.go {
  width: 102px; height: 70px; margin-left: -1px; flex-shrink: 0;
  border: none; font-size: 0; cursor: pointer;
  background: url(../assets/InGame/TextInputBackgroundRight.png) center / 100% 100% no-repeat;
}
.go:hover { background-image: url(../assets/InGame/TextInputBackgroundRightHover.png); }
.suggestions {
  position: absolute; z-index: 10;
  top: calc(100% + 6px); left: 0; right: 0;
  max-height: 300px; overflow-y: auto;
  margin: 0; padding: 4px;
  list-style: none;
  background: #fff; color: var(--panel);
  border-radius: 12px;
  box-shadow: 0 8px 20px #0005;
}
.suggestions li {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  font-size: 1.05rem;
}
.suggestions li.active, .suggestions li[data-id]:hover { background: #ffe9a6; }
.suggestions li.empty { color: #888; cursor: default; justify-content: center; }
.suggestions img { image-rendering: pixelated; }

/* ---------- classic grid ---------- */
.classic-scroll { overflow-x: auto; padding-bottom: 6px; }
.classic-grid {
  display: grid;
  grid-template-columns: repeat(8, 76px);
  gap: 6px;
  justify-content: center;
  min-width: max-content;
  margin: 0 auto;
}
.col-head {
  font-size: .55rem; text-align: center;
  align-self: end;
  padding-bottom: 4px;
  border-bottom: 3px solid #fff;
  font-weight: 700;
  text-shadow: var(--text-outline);
}
.cell {
  height: 76px;
  display: grid; place-items: center;
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px #000;
  color: #000;
  text-align: center;
  font-size: .62rem;
  padding: 6px;
  position: relative;
  overflow: hidden;
  word-break: break-word;
}
body.colorblind .cell.correct { color: #fff; }
.cell span { position: relative; z-index: 1; }
.cell.correct, .chip.correct { background: var(--correct); }
.cell.partial, .chip.partial { background: var(--partial); }
.cell.wrong, .chip.wrong { background: var(--wrong); }
.cell.pic { background: #fff; padding: 2px; }
.cell img { image-rendering: pixelated; }
.arrow-up::before, .arrow-down::before {
  content: '';
  position: absolute; inset: 0;
  background: #0006;
  clip-path: polygon(97% 40%, 80% 40%, 80% 95%, 20% 95%, 20% 40%, 3% 40%, 50% 5%);
}
.arrow-down::before { clip-path: polygon(97% 60%, 80% 60%, 80% 5%, 20% 5%, 20% 60%, 3% 60%, 50% 95%); }

.legend {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  margin: 10px auto; font-size: .9rem;
}
.chip { width: 22px; height: 22px; border-radius: 5px; box-shadow: inset 0 0 0 2px #000; display: inline-block; position: relative; overflow: hidden; }
.chip.arrow-up::before, .chip.arrow-down::before { inset: 0; }
.legend-panel { max-width: 380px; margin-top: 14px; }
.legend-panel summary { cursor: pointer; font-size: 1.1rem; }

/* ---------- list of guesses (other modes) ---------- */
.guess-list { list-style: none; padding: 0; margin: 0 auto; max-width: 300px; display: grid; gap: 8px; }
.guess-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 14px 4px 4px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 4px #000;
  color: #000;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.guess-list li.correct { background: var(--correct); }
.guess-list li.wrong { background: var(--wrong); }
.guess-list img { image-rendering: pixelated; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 3px #000; }

/* ---------- win ---------- */
.win-panel { border-color: var(--correct); margin-top: 18px; }
.win-panel p { margin: 6px 0; }
.win-title { font-size: 2rem; color: #ffcb05; }
.win-mon { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.4rem; }
.win-mon img { width: 96px; height: 96px; object-fit: contain; }
.next-day { margin: 14px 0; }
.countdown { font-size: 2rem; font-weight: 700; color: #ffcb05; letter-spacing: 2px; }
.next-day small { color: var(--ink-dim); }
.share-box { background: #0003; border-radius: 10px; padding: 10px; }
.share-box pre { white-space: pre-wrap; font: .95rem var(--font); margin: 0 0 10px; text-align: left; }
.share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 10px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px;
  border: none; border-radius: 30px;
  background: var(--panel-border); color: var(--panel);
  font: 700 1rem var(--font);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 #a8862a;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a8862a; }
.btn.small { padding: 6px 14px; font-size: .9rem; }
.btn.ghost { background: #fff; box-shadow: 0 4px 0 #9fb3c8; }
.btn.danger { background: var(--wrong); color: #fff; box-shadow: 0 4px 0 #8f2f27; }

/* Same sizes and colors as pokedle.net's "Yesterday's pokémon was" line */
.yesterday { text-align: center; text-shadow: var(--text-outline); margin-top: 3rem; font-size: 1rem; }
.yesterday .num { color: #fff; font-size: .8rem; }
.yesterday strong { display: inline-block; margin-top: .8rem; color: #71d68a; font-size: 1.35rem; font-weight: 400; }

/* ---------- modal ---------- */
dialog {
  border: 4px solid var(--panel);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--panel);
  font-family: var(--font);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 22px;
}
dialog::backdrop { background: #0009; }
dialog h2 { margin-top: 0; border-bottom: 2px solid var(--panel); padding-bottom: 6px; }
dialog li { margin-bottom: 6px; }
dialog hr { border: none; border-top: 2px solid #0002; }
dialog .col-head { color: var(--panel); text-shadow: none; border-bottom-color: var(--panel); }
dialog .cell { color: #fff; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--panel); font-size: 1.3rem; cursor: pointer;
}

.stats-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stats-tabs button {
  border: 2px solid var(--panel); background: none; color: var(--panel);
  border-radius: 20px; padding: 4px 10px; cursor: pointer;
}
.stats-tabs button.active { background: var(--panel); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; text-align: center; }
.stat-grid b { display: block; font-size: 1.7rem; }
.stat-grid small { text-transform: uppercase; font-size: .75rem; }
.histogram { display: grid; gap: 4px; }
.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row span { width: 26px; text-align: right; }
.bar { background: var(--panel); color: #fff; border-radius: 4px; padding: 2px 6px; text-align: right; font-size: .85rem; min-width: 24px; }
.transfer textarea { width: 100%; font: .85rem monospace; border-radius: 8px; padding: 8px; }

/* ---------- footer ---------- */
.foot {
  text-align: center; font-size: .55rem; line-height: 1.6;
  max-width: 560px; padding: 30px 0 20px;
  text-shadow: var(--text-outline);
}
.foot p { margin: 4px 0; }

@media (max-width: 480px) {
  .classic-grid { grid-template-columns: repeat(8, 64px); }
  .cell { height: 64px; font-size: .75rem; }
  .cell img { width: 52px; height: 52px; }
  .countdown { font-size: 1.6rem; }
}

/* ---------- languages ---------- */
.flag-btn img { width: 32px; height: auto; border-radius: 3px; box-shadow: 0 0 0 2px #fff, 0 2px 4px #0006; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.lang {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  border: 2px solid transparent; background: #0000000d; color: var(--panel);
  font: .7rem var(--font); cursor: pointer; text-align: start;
}
.lang img { width: 28px; border-radius: 2px; box-shadow: 0 0 0 1px #0003; }
.lang:hover { border-color: var(--panel); }
.lang.active { border-color: var(--panel); background: var(--panel-border); }

/* help */
.help dt { font-weight: 700; margin-top: 8px; }
.help dd { margin: 2px 0 0; }
.help .tag { padding: 0 4px; border-radius: 4px; color: #000; box-shadow: inset 0 0 0 2px #000; }
.help .tag.correct { background: var(--correct); }
.help .tag.partial { background: var(--partial); }
.help .tag.wrong { background: var(--wrong); }
.transfer h3 { display: flex; align-items: center; gap: 6px; }

/* right-to-left languages (Arabic, Hebrew, Farsi) */
[dir='rtl'] .panel h2, [dir='rtl'] .gen-label { text-align: right; }
[dir='rtl'] .button-title { left: auto; right: 7%; }
[dir='rtl'] .button-description { left: auto; right: 9%; }
[dir='rtl'] .classic-grid, [dir='rtl'] .guess-form { direction: ltr; }

/* ---------- animations (same as pokedle.net, which uses animate.css) ---------- */
/* Add .anim plus one effect class; --delay staggers them (Classic tiles flip in 0.55s apart). */
.anim { animation-duration: 1s; animation-fill-mode: both; animation-delay: var(--delay, 0s); }
.fade-in { animation-name: fadeIn; }
.fade-in-up { animation-name: fadeInUp; }
.flip-in-y { animation-name: flipInY; backface-visibility: visible !important; }
.tada { animation-name: tada; }
.head-shake { animation-name: headShake; animation-timing-function: ease-in-out; }
.heart-beat { animation-name: heartBeat; animation-duration: 1.3s; animation-timing-function: ease-in-out; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 100%, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes flipInY {
  0% { transform: perspective(400px) rotateY(90deg); animation-timing-function: ease-in; opacity: 0; }
  40% { transform: perspective(400px) rotateY(-20deg); animation-timing-function: ease-in; }
  60% { transform: perspective(400px) rotateY(10deg); opacity: 1; }
  80% { transform: perspective(400px) rotateY(-5deg); }
  100% { transform: perspective(400px); }
}
@keyframes tada {
  0% { transform: scale(1); }
  10%, 20% { transform: scale(.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}
@keyframes headShake {
  0% { transform: translateX(0); }
  6.5% { transform: translateX(-6px) rotateY(-9deg); }
  18.5% { transform: translateX(5px) rotateY(7deg); }
  31.5% { transform: translateX(-3px) rotateY(-5deg); }
  43.5% { transform: translateX(2px) rotateY(3deg); }
  50% { transform: translateX(0); }
}
@keyframes heartBeat {
  0% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.3); }
  70% { transform: scale(1); }
}
/* "Next mode" button on the win screen gently pulses until hovered */
@keyframes loopGrow { from { transform: scale(1); } to { transform: scale(1.03); } }
.win-panel .mode-btn { animation: loopGrow .5s ease infinite alternate; }
.win-panel .mode-btn:hover { animation: none; transform: scale(1.02); }

/* Header: buttons fade in, the logo grows and the settings cog turns on hover, icons light up */
.top .icon-btn, .top .logo, .toolbar .tool { animation: fadeIn 1s both; }
.logo { transition: transform .2s ease-in-out; }
.logo:hover { transform: scale(1.05); }
.icon-btn img, .tool img { transition: transform .1s, opacity .2s; }
#btn-settings:hover img { transform: rotate(25deg); }
.toolbar .tool img { opacity: .7; }
.toolbar .tool:hover img { opacity: 1; transform: none; }

/* Each page fades in; modals slide up */
#app > * { animation: fadeIn 1s both; }
dialog[open] { animation: fadeInUp 1s both; }
.modal-close { transition: transform .1s; }
.modal-close:hover { transform: scale(1.1); }

/* Small grow on hover, like the original buttons */
.mode-btn:hover { transform: scale(1.02); }
.guess-list li { transition: transform .2s ease-in-out; }
.guess-list li:hover { transform: scale(1.02); }
.btn { transition: transform .1s; }
.btn:hover:not(:active) { transform: scale(1.02); }
.clue-btn .clue-icon { transition: width .2s, height .2s; }
.clue-btn.unlocked:hover .clue-icon { width: 43px; height: 43px; }
.cell { transition: background-color .3s; }

/* More hover effects from the original */
.cell.correct:not(.pic):hover { background: var(--correct-hover); }
.cell.partial:not(.pic):hover { background: var(--partial-hover); }
.cell.wrong:not(.pic):hover { background: var(--wrong-hover); }
.cell.arrow-up:hover::before, .cell.arrow-down:hover::before { background: #0008; }
.tcg-card, .dex { transform: scale(.98); transition: transform .2s; }
.tcg-card:hover, .dex:hover { transform: scale(1); }
.silhouette { transition: transform .2s; }
.silhouette:hover { transform: scale(1.03); }
.win-panel { transition: background-color .1s; }
.win-panel:hover { background: #27446a; }
.share-box { transition: background-color .2s ease-in; }
.share-box:hover { background: #0005; }
#win-stats:hover:not(:active) { transform: scale(1.04); }
.flag-btn img { opacity: .7; transition: opacity .2s; }
.flag-btn:hover img { opacity: 1; }
.stats-tabs button { transition: background-color .2s, color .2s; }
.stats-tabs button:not(.active):hover { background: #35485a; color: #fff; }
.lang { transition: transform .1s; }
.lang:hover { transform: scale(1.02); }
.foot a:hover { text-decoration: underline; }
.eye { transition: transform .1s; }
.eye:hover { transform: scale(1.1); }
button:disabled, button:disabled:hover, [aria-disabled="true"], [aria-disabled="true"]:hover { cursor: default; transform: none; }

/* "Share on X" in the stats window: black button, X logo on the left behind a divider, label on the right */
.x-btn {
  display: flex; align-items: stretch;
  width: min(258px, 100%); height: 64px;
  margin: 14px auto 4px;
  background: #000; color: #fff;
  border: 2px solid #fff; border-radius: 12px;
  box-shadow: 0 4px 0 #0004;
  text-decoration: none;
  transition: transform .1s ease-in-out;
}
.x-btn img { width: 30px; padding: 0 22px; border-right: 3px solid #333; box-sizing: content-box; }
.x-btn span { flex: 1; align-self: center; text-align: center; font-size: 1.15rem; }
.x-btn:hover { transform: scale(1.07); }

/* ---------- how to play, FAQ and answers archive ---------- */
.guide { max-width: 620px; margin: 28px auto 16px; text-align: left; line-height: 1.5; letter-spacing: 0; }
.guide h1 { font-size: 1.3rem; margin: 0 0 12px; }
.guide h2 { font-size: 1.15rem; margin: 18px 0 8px; text-align: left; }
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 1rem; margin: 14px 0 4px; color: #ffcb05; }
.guide p { margin: 4px 0 10px; color: var(--ink); font-size: .95rem; }
.guide a { color: #ffcb05; }
details.guide summary { cursor: pointer; font-size: 1rem; }
details.guide[open] summary { margin-bottom: 10px; }
.archive-link { color: #fff; font-size: .85rem; }
.archive-days { list-style: none; padding: 0; margin: 0; columns: 2 220px; }
.archive-days li { margin: 4px 0; }
.archive-answers { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.archive-answers li {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
  background: #0003; border-radius: 10px; padding: 6px 12px 6px 6px;
}
.archive-answers img { image-rendering: pixelated; background: #fff; border-radius: 8px; }
.archive-answers a { font-size: .8rem; }
.archive-nav { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.not-found .guide { text-align: center; max-width: 440px; }
.not-found h1 { font-size: 1.5rem; margin: 0 0 10px; }
.guide .not-found-text { font-size: 1.05rem; margin-bottom: 18px; }
.not-found .btn { margin-bottom: 6px; color: var(--panel); text-decoration: none; }
.guide .not-found-code { font-size: 4rem; line-height: 1; color: #ffcb05; margin: 8px 0 12px !important; text-shadow: var(--text-outline); }

/* Tooltips, styled like pokedle.net's: cream box, thick black border, pink inner line, black arrow */
.tooltip {
  position: fixed; z-index: 10000;
  width: 200px;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, visibility .15s;
}
.tooltip.show { opacity: 1; visibility: visible; transition: opacity .15s; }
.tooltip-inner {
  padding: 10px 5px;
  background: #f8f7d8;
  color: #000;
  border: 8px solid #000;
  border-radius: 10px;
  box-shadow: inset 0 0 0 4px #ecd9ef;
  font: 1rem/1.35 var(--font);
  text-align: center;
  text-transform: none; letter-spacing: normal; text-shadow: none;
}
.tooltip-arrow {
  position: absolute; left: calc(var(--arrow-x, 50%) - 7px);
  width: 0; height: 0;
  border: 7px solid transparent;
}
.tooltip[data-pos="bottom"] .tooltip-arrow { top: -7px; border-bottom-color: #000; border-top-width: 0; }
.tooltip[data-pos="top"] .tooltip-arrow { bottom: -7px; border-top-color: #000; border-bottom-width: 0; }
.col-head[data-tip] { cursor: help; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
