@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

/* Night theme: deep indigo, glowing violet and coral, like the game's evening sky. */
:root {
  color-scheme: dark;
  --ink: #f5f3ff;
  --ink-soft: #aaa6d6;
  --line: #2e2a63;
  --page: #0d0a22;
  --card: #18153a;
  --card-glass: rgb(32 27 78 / 62%);
  --panel: #221d52;
  --coral: #ff7a45;
  --coral-deep: #c9481c;
  --violet: #8f7dff;
  --violet-soft: rgb(143 125 255 / 20%);
  --pink: #ff5fa2;
  --gold: #ffcf5a;
  --cyan: #5fd8ff;
  --blurple: #5865f2;
  --blurple-deep: #4450d0;
  --ok: #2fc27a;
  --partial: #f5b333;
  --no: #2b2660;
  --bad: #ff5a62;
  --radius: 20px;
  --shadow: 0 1px 0 rgb(255 255 255 / 5%) inset, 0 14px 40px rgb(0 0 0 / 35%);
  --glow: 0 0 0 1px rgb(143 125 255 / 25%), 0 10px 40px rgb(143 125 255 / 18%);
  --display: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(60rem 36rem at 15% -10%, rgb(143 125 255 / 28%), transparent 60%),
    radial-gradient(50rem 30rem at 95% 5%, rgb(255 95 162 / 18%), transparent 60%),
    radial-gradient(60rem 40rem at 50% 110%, rgb(255 122 69 / 14%), transparent 60%),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
  font: 500 16px/1.5 var(--body);
}
/* A few soft stars, drawn once behind everything. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgb(255 255 255 / 55%), transparent),
    radial-gradient(1px 1px at 78% 12%, rgb(255 255 255 / 45%), transparent),
    radial-gradient(1.5px 1.5px at 62% 68%, rgb(255 255 255 / 35%), transparent),
    radial-gradient(1px 1px at 30% 82%, rgb(255 255 255 / 40%), transparent),
    radial-gradient(1px 1px at 90% 48%, rgb(255 255 255 / 40%), transparent),
    radial-gradient(1.5px 1.5px at 45% 35%, rgb(255 255 255 / 25%), transparent);
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; }
em { font-style: normal; color: var(--coral); }
.brand em, .home h1 em {
  background: linear-gradient(100deg, var(--coral), var(--pink) 55%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
a { color: inherit; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
#app:focus { outline: none; }
.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

/* Top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 20px var(--display);
  text-decoration: none;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-glass);
  backdrop-filter: blur(10px);
  font-weight: 700;
  font-size: 14px;
}
.icon-button .icon { color: var(--partial); }
.lang {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-glass);
}
.lang a {
  display: grid;
  place-items: center;
  height: 34px;
  min-width: 36px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.lang a[aria-current='true'] { background: var(--violet); color: #fff; }

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

/* Buttons */

.cta {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ff9160, var(--coral));
  color: #fff;
  font: 600 21px var(--display);
  box-shadow: 0 5px 0 var(--coral-deep), 0 12px 30px rgb(255 122 69 / 35%);
  transition: transform .08s, box-shadow .08s;
}
.cta:hover { filter: brightness(1.04); }
.cta:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-deep); }
.cta.small { width: auto; min-height: 50px; padding: 0 20px; font-size: 18px; }

.secondary {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card-glass);
  font-weight: 800;
}
.secondary:disabled { opacity: .6; cursor: wait; }
.secondary:hover { border-color: var(--violet); }

.text-button {
  display: block;
  margin: 18px auto 0;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button.armed { color: var(--bad); }

.discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  background: var(--blurple);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s;
}
.discord:hover { background: var(--blurple-deep); }
.discord-card { width: 100%; min-height: 56px; padding: 10px 16px; text-align: center; line-height: 1.25; }
.discord-card .icon { width: 26px; height: 26px; }

/* Home */

.home { text-align: center; }
.hero-art {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 190px;
  margin-bottom: 8px;
}
.hero-art { position: relative; }
.hero-art::before {
  content: '';
  position: absolute;
  inset: 20% 22% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(143 125 255 / 45%), transparent);
  filter: blur(10px);
}
.hero-art img { width: 170px; height: 170px; object-fit: contain; filter: drop-shadow(0 10px 18px rgb(0 0 0 / 45%)); }
.hero-art img:nth-child(1) { transform: translateX(22px) rotate(-5deg); animation: bob 4s ease-in-out infinite; }
.hero-art img:nth-child(2) { position: relative; z-index: 1; width: 190px; height: 190px; animation: bob 4s ease-in-out .5s infinite; }
.hero-art img:nth-child(3) { transform: translateX(-22px) rotate(5deg); animation: bob 4s ease-in-out 1s infinite; }
@keyframes bob { 50% { translate: 0 -6px; } }

.home h1 { font-size: clamp(54px, 15vw, 84px); letter-spacing: -1px; text-shadow: 0 8px 40px rgb(143 125 255 / 35%); }
.tagline { margin-top: 6px; font: 500 clamp(18px, 4.6vw, 22px)/1.25 var(--display); }
.intro { max-width: 460px; margin: 10px auto 0; color: var(--ink-soft); }

.mode-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 22px 0 24px;
}
.mode-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card-glass);
  font-weight: 800;
  font-size: 14px;
  animation: pop .4s ease-out backwards;
  animation-delay: calc(var(--i) * 60ms);
}
.mode-chip .icon { color: var(--violet); width: 18px; height: 18px; }

.home .cta { max-width: 340px; margin: 0 auto; }
.countdown { margin: 22px 0 0; color: var(--ink-soft); font-weight: 700; }
.countdown strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}
.stats span + span::before { content: '·'; margin-right: 8px; }
.home .discord-card { margin-top: 24px; }

/* Play */

.stepper {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.step {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-glass);
  color: var(--ink-soft);
}
.step.current { border-color: transparent; background: var(--violet); color: #fff; box-shadow: 0 0 20px rgb(143 125 255 / 55%); }
.step.solved { background: var(--ok); color: #fff; }
.step.failed { background: var(--bad); color: #fff; }

.play-head { text-align: center; margin-bottom: 14px; }
.eyebrow {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.play-head h2 { font-size: 30px; }
.help { color: var(--ink-soft); font-size: 15px; line-height: 1.35; }

.image-stage {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border: 3px solid rgb(143 125 255 / 45%);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--glow);
}
.image-stage img { width: 100%; height: 100%; object-fit: cover; }

.clues { display: grid; gap: 8px; }
.clue {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-glass);
}
.clue-label { color: var(--ink-soft); font-size: 13px; font-weight: 800; line-height: 1.2; }
.clue-value { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 700; line-height: 1.35; }
.fresh { animation: pop .3s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.el {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--el, var(--violet));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}
.el-fire { --el: #e8562a; }
.el-water { --el: #2d7fe0; }
.el-grass { --el: #2f9a4f; }
.el-electric { --el: #b98a00; }
.el-ice { --el: #2a9bb5; }
.el-wind { --el: #17a184; }
.el-rock { --el: #8c6d4a; }
.el-dark { --el: #5b4a91; }
.el-holy { --el: #b08326; }

.pips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}
.pip-row { display: flex; gap: 4px; }
.pip-row i { width: 18px; height: 8px; border-radius: 4px; background: var(--ok); transition: background .2s; }
.pip-row i.used { background: var(--bad); }
.just-wrong .pip-row { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.guess-box { position: relative; max-width: 440px; margin: 0 auto; }
.guess-box input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  font-size: 17px;
  font-weight: 700;
}
.guess-box input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.guess-box input::placeholder { color: #8e92b4; font-weight: 600; }

.options {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  max-height: min(290px, 42vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 16px 40px rgb(0 0 0 / 50%);
}
.options li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 10px;
  border-radius: 11px;
  font-weight: 800;
  cursor: pointer;
}
.options li.selected { background: var(--violet-soft); }
.options li small { margin-left: auto; color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.options li.empty { color: var(--ink-soft); cursor: default; font-weight: 600; }
.options .thumb { width: 40px; height: 40px; object-fit: contain; }

.wrong-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.wrong-list li {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 4px;
  border-radius: 99px;
  background: rgb(255 90 98 / 16%);
  color: #ff9ca1;
  font-size: 14px;
  font-weight: 800;
}
.wrong-list .thumb { width: 26px; height: 26px; object-fit: contain; }

/* Classic */

.classic { display: grid; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.tiles-head span { color: var(--ink-soft); font-size: 12px; font-weight: 800; text-align: center; }
.classic-row { display: grid; gap: 4px; }
.classic-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.classic-name .thumb { width: 28px; height: 28px; object-fit: contain; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 5px 3px;
  border-radius: 11px;
  background: var(--no);
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.tile.ok { background: var(--ok); color: #fff; }
.tile.partial { background: var(--partial); color: #33230a; }
.tile-arrow { font-size: 17px; line-height: 1; }
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.legend li { display: flex; align-items: center; gap: 5px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; background: var(--no); }
.legend i.ok { background: var(--ok); }
.legend i.partial { background: var(--partial); }

/* Reveal */

.reveal { text-align: center; animation: pop .3s ease-out; }
.reveal h2 { margin-bottom: 12px; font-size: 30px; }
.reveal.solved h2 { color: var(--ok); }
.reveal.failed h2 { color: var(--bad); }
.reveal .image-stage { max-width: 300px; }
.reveal-name { margin-top: 12px; font: 600 28px/1.1 var(--display); }
.reveal-name small { display: block; color: var(--ink-soft); font: 700 14px var(--body); }
.reveal-elements { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.reveal-desc { max-width: 460px; margin: 10px auto 0; color: var(--ink-soft); }
.reveal-count { margin: 8px 0 18px; font-weight: 800; }
.reveal .classic { margin-bottom: 18px; text-align: left; }
.reveal .cta { max-width: 340px; margin: 0 auto; }

/* Results */

.results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; text-align: center; }
.big-score { font-size: 44px; }
.score-row { display: flex; justify-content: center; gap: 8px; }
.score-tile {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--partial);
  color: #33230a;
  font: 600 21px var(--display);
}
.score-tile.perfect { background: var(--ok); color: #fff; }
.score-tile.good { background: #9ad06c; color: #1e3a0a; }
.score-tile.failed { background: var(--bad); color: #fff; }
.facts { display: flex; justify-content: center; gap: 32px; }
.facts dt { color: var(--ink-soft); font-size: 13px; font-weight: 800; }
.facts dd { font: 600 24px var(--display); font-variant-numeric: tabular-nums; }

.name-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-glass);
  box-shadow: var(--shadow);
}
.name-card h3 { font-size: 21px; }
.name-card p { color: var(--ink-soft); font-size: 15px; }
.name-form { display: flex; gap: 8px; margin-top: 10px; }
.name-form input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-size: 17px;
  font-weight: 700;
}
.name-form input:focus { outline: none; border-color: var(--violet); }
.name-form .cta { box-shadow: 0 4px 0 var(--coral-deep); margin-bottom: 4px; }
.form-error { margin-top: 8px; color: var(--bad) !important; font-weight: 700; }
.results .countdown { margin: 0; }
.board-heading { margin-top: 8px; font-size: 24px; }

/* Leaderboard */

.tabs {
  display: flex;
  gap: 4px;
  max-width: 280px;
  margin: 0 auto 10px;
  padding: 4px;
  border-radius: 13px;
  background: var(--line);
}
.tabs button {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
}
.tabs button.active { background: var(--card); color: var(--ink); }

.board { display: grid; gap: 6px; text-align: left; }
.board-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  grid-template-areas: 'rank name total' 'rank scores time';
  align-items: center;
  gap: 2px 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card-glass);
}
.board-row.me { outline: 2px solid var(--violet); }
.rank { grid-area: rank; font: 600 19px var(--display); text-align: center; color: var(--ink-soft); }
.top1 .rank { color: var(--gold); }
.top2 .rank { color: #c9cbe0; }
.top3 .rank { color: #e0975a; }
.board-name { grid-area: name; min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.board-name small { color: var(--ink-soft); font-weight: 600; }
.board-scores { grid-area: scores; display: flex; gap: 3px; }
.board-scores .score-tile { width: 20px; height: 20px; border-radius: 6px; font-size: 12px; }
.board-total { grid-area: total; font-weight: 800; font-size: 14px; text-align: right; }
.board-time { grid-area: time; color: var(--ink-soft); font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.board-empty { padding: 20px 0; color: var(--ink-soft); text-align: center; font-weight: 700; }
.board-rule { margin-top: 10px; color: var(--ink-soft); font-size: 13px; text-align: center; }

.dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--page);
  color: var(--ink);
  box-shadow: 0 30px 80px rgb(0 0 0 / 60%);
}
.dialog::backdrop { background: rgb(5 3 20 / 70%); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dialog-head h2 { font-size: 24px; }
.close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 24px; line-height: 1; }

/* Footer and toast */

.footer {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer .discord { min-height: 44px; padding: 0 16px; font-size: 15px; }
body:not(.playing) .footer .discord { display: none; }
.footer p { max-width: 520px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.4; }

.toast {
  position: fixed;
  z-index: 20;
  top: 14px;
  left: 50%;
  padding: 9px 18px;
  border-radius: 99px;
  background: var(--violet);
  color: #fff;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--ok); }

noscript { padding: 16px; text-align: center; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 14px; font-weight: 700; }

.presented { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 14px 5px 6px; border: 1px solid var(--line); border-radius: 99px; background: var(--card-glass); color: #c9bfff; font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.presented img { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; }
.streak { font-weight: 800; }
.streak small { color: var(--ink-soft); font-weight: 700; }
.account { color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.home .account { margin-top: 18px; }
.account p { margin-top: 4px; }
.account-who { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; color: var(--ink); }
.account-who .icon { color: var(--blurple); }
.account-member { color: var(--ok); }
.account-member.missing { color: var(--gold); }
.link { padding: 0; border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* Discord sign-in and diamonds */

.discord-login {
  width: 100%;
  min-height: 52px;
  padding: 10px 18px;
  border: 0;
  font-size: 16px;
  line-height: 1.25;
  box-shadow: 0 4px 0 var(--blurple-deep), 0 12px 30px rgb(88 101 242 / 35%);
}
.discord-login .icon { width: 24px; height: 24px; }

.rewards-card {
  position: relative;
  display: grid;
  gap: 12px;
  margin-top: 26px;
  padding: 20px 18px;
  overflow: hidden;
  border: 1px solid rgb(95 216 255 / 30%);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgb(95 216 255 / 12%), rgb(143 125 255 / 12%) 50%, rgb(24 21 58 / 70%));
  box-shadow: var(--shadow);
}
.rewards-card h2 { font-size: 24px; }
.rewards-card > p { color: var(--ink-soft); font-size: 15px; }
.rewards-help { font-size: 13px !important; }

.tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(13 10 34 / 55%);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.tier strong { color: var(--ink); font: 600 22px var(--display); }
.tier-0 { border-color: rgb(95 216 255 / 55%); box-shadow: 0 0 22px rgb(95 216 255 / 20%); }
.tier-0 strong { color: var(--cyan); }
.tier-none { place-content: center; opacity: .7; }

.reward-line {
  padding: 14px 16px;
  border: 1px solid rgb(95 216 255 / 40%);
  border-radius: 16px;
  background: linear-gradient(120deg, rgb(95 216 255 / 16%), rgb(143 125 255 / 16%));
  font: 600 19px/1.3 var(--display);
  animation: pop .4s ease-out;
}
.reward-line.paid { color: var(--cyan); box-shadow: 0 0 30px rgb(95 216 255 / 20%); }
.reward-line.none { border-color: var(--line); background: var(--card-glass); color: #d6d2f5; font: 700 15px var(--body); }

.join-dialog { width: min(440px, calc(100vw - 24px)); padding: 22px 20px 14px; text-align: center; overflow: visible; }
.join-dialog[open] { display: grid; gap: 12px; animation: pop .25s ease-out; }
.join-dialog .close { position: absolute; top: 12px; right: 12px; }
.join-dialog h2 { font-size: 25px; }
.join-dialog p { color: var(--ink-soft); }
.join-art { display: flex; justify-content: center; align-items: flex-end; height: 110px; margin-top: -60px; }
.join-art img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 8px 16px rgb(0 0 0 / 50%)); }
.join-art .join-logo { position: relative; z-index: 1; width: 92px; height: 92px; margin: 0 -14px 6px; border: 3px solid var(--violet); border-radius: 50%; background: var(--card); box-shadow: 0 0 30px rgb(143 125 255 / 50%); }
.join-message:empty { display: none; }
.join-message { color: var(--gold) !important; font-weight: 700; }
.join-dialog .text-button { margin-top: 0; }
.board-name .icon { width: 15px; height: 15px; margin-right: 4px; color: var(--blurple); vertical-align: -2px; }

/* Text pages and the section search engines read */

.about, .prose, .dex { width: 100%; margin: 0 auto; padding: 8px 16px 32px; }
.about, .prose { max-width: 640px; }
.about h2, .prose h1 { margin: 16px 0 8px; font-size: 26px; }
.about h3, .prose h2 { margin: 20px 0 6px; font-size: 20px; }
.about h4 { margin: 12px 0 2px; font: 800 16px var(--body); }
.about ul, .prose ul { display: grid; gap: 4px; padding-left: 20px; list-style: disc; }
.about p, .about li, .prose p, .prose li { color: var(--ink-soft); }
body.playing .about { display: none; }

.dex { max-width: 760px; }
.dex h1 { font-size: 34px; }
.dex-cta { display: grid; place-items: center; max-width: 340px; margin: 14px 0 20px; text-decoration: none; }
.dex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.dex-card { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-glass); }
.dex-card img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.dex-card h2 { font-size: 18px; }
.dex-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; }
.dex-tags .el { font-size: 12px; padding: 1px 8px; }
.dex-role { font-size: 13px; font-weight: 800; }
.dex-habitats { margin-top: 3px; color: var(--ink-soft); font-size: 13px; line-height: 1.3; }

/* Ads stay beside the game, never between the image and the answer box. */

.ad-rail { display: none; }
.ad-label { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 700; text-align: center; }
.ad-unit { display: block; width: 100%; height: 600px; }
.ad-results { margin-top: 10px; }
.ad-results-unit { display: block; }
.rail-promo {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-glass);
  box-shadow: var(--shadow);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.3;
}
.rail-promo strong { font: 600 18px var(--display); }
.rail-button { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; background: var(--blurple); color: #fff; font-weight: 800; }

@media (min-width: 1120px) {
  .ad-rail { display: block; position: fixed; z-index: 1; top: 88px; left: 12px; width: 160px; }
}
@media (min-width: 1460px) {
  .ad-rail { left: calc(50% - 380px - 324px); width: 300px; }
}

@media (max-width: 420px) {
  .icon-button span { display: none; }
  .icon-button { width: 40px; justify-content: center; padding: 0; }
  .clue { grid-template-columns: 1fr; gap: 3px; }
  .hero-art { height: 150px; }
  .hero-art img { width: 130px; height: 130px; }
  .hero-art img:nth-child(2) { width: 150px; height: 150px; }
  .tile { font-size: 11.5px; }
}

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