:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --bg: #111315;
  --panel: #1c2024;
  --panel-soft: #262c31;
  --line: #384149;
  --text: #f7fafc;
  --muted: #a8b3bd;
  --accent: #f5d547;
  --accent-2: #57c7ff;
  --good: #59d993;
  --danger: #ff7474;
  --profile-a: rgba(87, 199, 255, 0.36);
  --profile-b: rgba(245, 213, 71, 0.22);
  --grid-min: clamp(18px, 1.75vw, 38px);
  --suggestion-image: 48px;
  --main-input-height: 78px;
  --main-input-font: 3.4rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, var(--profile-a), transparent 48%),
    linear-gradient(315deg, var(--profile-b), transparent 46%),
    var(--bg);
  color: var(--text);
}

body.popover-open::before {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.app-shell {
  width: min(1920px, calc(100vw - 16px));
  margin: 0 auto;
  padding: 8px 0 18px;
}

.quiz-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(28, 32, 36, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.masthead,
.playbar,
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.masthead-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.masthead-icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 950;
}

.info-icon-button {
  border-radius: 50%;
  font-family: Georgia, serif;
  font-style: italic;
}

.profile-panel {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 19, 22, 0.72);
}

.profile-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
}

.profile-slot {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--slot-color), transparent 42%), rgba(28, 32, 36, 0.84)),
    rgba(28, 32, 36, 0.9);
}

.profile-slot.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 213, 71, 0.12);
}

.profile-name-row {
  display: grid;
  grid-template-columns: 1fr 42px 42px;
  gap: 6px;
}

.profile-name,
.profile-stats,
.profile-settings,
.profile-name-input {
  width: 100%;
  height: 34px;
}

.profile-name,
.profile-stats,
.profile-settings {
  min-height: 34px;
  padding: 0 10px;
  background: var(--slot-color);
  color: #081016;
  font-weight: 900;
}

.profile-stats,
.profile-settings {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0.72rem;
}

.profile-name-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #0e1012;
  color: var(--text);
  outline: none;
}

.profile-name-input[hidden] {
  display: none;
}

.profile-name-input:focus {
  border-color: var(--accent);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.stats-panel {
  position: fixed;
  z-index: 35;
  top: 10px;
  left: 10px;
  display: grid;
  gap: 10px;
  width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 19, 22, 0.9);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.stats-panel[hidden] {
  display: none;
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-header span,
.stats-charts article > span {
  display: block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-header strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.stat-pill {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181b;
}

.stat-pill span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-pill strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 8px;
}

.stats-charts article {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181b;
}

.line-chart {
  min-height: 120px;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #0e1012;
  background-size: 100% 25%, 20% 100%, auto;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: 120px;
}

.chart-path {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: chart-draw 700ms ease-out forwards;
}

@keyframes chart-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 120px;
  color: var(--muted);
  font-size: 0.82rem;
}

.masthead {
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.score-card,
.points-card,
.achievement-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181b;
}

.token-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-width: 0;
}

.token-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
}

.token-item img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  image-rendering: pixelated;
}

.token-item span {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-item strong {
  display: inline;
  color: var(--text);
  font-size: inherit;
}

.token-item small {
  position: absolute;
  right: -4px;
  bottom: -10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 950;
  animation: token-plus 1.5s ease-out;
}

.token-item.is-earned {
  color: var(--accent);
  filter: drop-shadow(0 0 5px rgba(245, 213, 71, 0.75));
}

@keyframes token-plus {
  0% { opacity: 0; transform: translateY(5px) scale(0.8); }
  25% { opacity: 1; transform: translateY(0) scale(1.15); }
  100% { opacity: 0; transform: translateY(-8px) scale(1); }
}

.score-card {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 112px;
  padding: 10px 14px;
}

.score-card span {
  font-size: 2rem;
  font-weight: 900;
}

.points-card {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 9px 14px;
}

.points-float {
  position: absolute;
  right: 10px;
  bottom: -6px;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 950;
  pointer-events: none;
  animation: points-float 950ms ease-out forwards;
}

@keyframes points-float {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1.15);
  }

  100% {
    opacity: 0;
    transform: translateY(-42px) scale(1);
  }
}

.points-card span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.points-card strong {
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.points-card.is-pulsing strong {
  animation: total-pulse 620ms ease-out;
}

.points-card small,
.last-success small {
  color: var(--accent);
  font-weight: 900;
}

.latest-points.is-animating {
  animation: points-pop 900ms ease-out;
}

@keyframes points-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }

  22% {
    opacity: 1;
    transform: translateY(-7px) scale(1.2);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes total-pulse {
  0% {
    transform: scale(1);
  }

  28% {
    color: var(--accent);
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.achievement-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding: 10px 12px;
}

.achievement-card > div:nth-child(2) {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.achievement-card span,
.tier-popover > span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tier-badge {
  width: 48px;
  height: 48px;
  object-fit: contain;
  image-rendering: pixelated;
}

.achievement-card strong {
  color: var(--text);
  font-size: 0.92rem;
}

.achievement-card.is-unlocked {
  animation: tier-unlock 900ms ease-out;
}

.tier-progress {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #0e1012;
}

.tier-popover {
  position: fixed;
  z-index: 14;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(430px, calc(100vw - 28px));
  padding: 28px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #15181b;
  box-shadow: 0 0 50px rgba(245, 213, 71, 0.32), 0 32px 100px rgba(0, 0, 0, 0.72);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: tier-popover-in 560ms ease-out;
}

.tier-popover[hidden] {
  display: none;
}

.tier-popover img {
  width: 128px;
  height: 128px;
  margin: 10px 0;
  object-fit: contain;
  image-rendering: pixelated;
  animation: badge-spin-in 740ms ease-out;
}

.tier-popover strong {
  font-size: 2rem;
}

.tier-popover p {
  margin: 8px 0 0;
  color: var(--muted);
}

.reward-popover {
  z-index: 16;
  top: min(72vh, calc(100vh - 14px));
  place-items: stretch;
  width: min(560px, calc(100vw - 28px));
  max-height: min(54vh, calc(100vh - 28px));
  overflow: auto;
  text-align: left;
}

.reward-popover > span,
.reward-popover > strong {
  text-align: center;
}

.reward-popover-list {
  display: grid;
  gap: 8px;
  width: 100%;
}

.reward-summary-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #101316;
}

.reward-summary-item img {
  width: 72px;
  height: 72px;
  margin: 0;
  object-fit: contain;
  image-rendering: pixelated;
  animation: badge-spin-in 500ms ease-out;
}

.reward-summary-item span {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-summary-item strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
}

.reward-summary-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.tier-popover-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

@keyframes tier-popover-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.78);
  }

  55% {
    opacity: 1;
    transform: translate(-50%, -51%) scale(1.04);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes badge-spin-in {
  from {
    opacity: 0;
    transform: rotate(-35deg) scale(0.45);
  }

  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.tier-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 320ms ease;
}

@keyframes tier-unlock {
  0% {
    box-shadow: 0 0 0 rgba(245, 213, 71, 0);
    transform: scale(1);
  }

  32% {
    box-shadow: 0 0 34px rgba(245, 213, 71, 0.35);
    transform: scale(1.015);
  }

  100% {
    box-shadow: 0 0 0 rgba(245, 213, 71, 0);
    transform: scale(1);
  }
}

.score-card small,
.suggestion small,
.tile-number {
  color: var(--muted);
}

.playbar {
  align-items: flex-end;
}

.input-wrap {
  flex: 1;
  min-width: 220px;
}

body.popover-open .input-wrap {
  position: fixed;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
  transform: translate(-50%, -50%);
}

.input-wrap label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

body.popover-open .input-wrap label {
  font-size: 1rem;
}

.dismiss-popover {
  display: none;
}

body.popover-open .dismiss-popover {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.combo-box {
  position: relative;
}

#guess-input {
  width: 100%;
  height: 58px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #0e1012;
  color: var(--text);
  font-size: 1.25rem;
  outline: none;
}

body.popover-open #guess-input {
  height: var(--main-input-height);
  padding: 0 18px;
  font-size: clamp(1.8rem, 5vw, var(--main-input-font));
  font-weight: 900;
}

#guess-input.is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 5px rgba(255, 116, 116, 0.2), 0 0 26px rgba(255, 116, 116, 0.24);
  animation: input-shake 320ms ease-in-out;
}

@keyframes input-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-8px);
  }

  40%,
  80% {
    transform: translateX(8px);
  }
}

#guess-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 213, 71, 0.12);
}

.suggestions {
  position: absolute;
  z-index: 5;
  inset: calc(100% + 8px) 0 auto;
  display: none;
  max-height: 310px;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101316;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  list-style: none;
}

body.popover-open .suggestions {
  max-height: min(360px, 40vh);
}

.suggestions.is-open {
  display: grid;
  gap: 6px;
}

.suggestion {
  display: grid;
  grid-template-columns: calc(var(--suggestion-image) + 4px) 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 4px 10px 4px 4px;
  border-radius: 7px;
  cursor: default;
  pointer-events: none;
}

.suggestion img {
  width: var(--suggestion-image);
  height: var(--suggestion-image);
}

.suggestion:hover,
.suggestion.is-active {
  background: transparent;
}

.suggestion img,
.pokemon-sprite {
  image-rendering: pixelated;
}

.suggestion-name {
  font-weight: 850;
}

.last-success {
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(89, 217, 147, 0.48);
  border-radius: 8px;
  background: rgba(29, 58, 44, 0.82);
}

.last-success.is-scoring {
  animation: success-pop 520ms ease-out;
}

@keyframes success-pop {
  0% {
    transform: scale(0.98);
  }

  35% {
    transform: scale(1.025);
  }

  100% {
    transform: scale(1);
  }
}

.last-success:not([hidden]) {
  display: flex;
}

.last-success img {
  image-rendering: pixelated;
}

.pokemon-sprite,
#last-success-sprite,
.duplicate-feedback img,
#pokemon-popover-sprite,
.sprite-variant img {
  cursor: zoom-in;
}

.success-sprite-zoom {
  position: fixed;
  z-index: 30;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sprite-zoom-backdrop {
  position: fixed;
  z-index: 29;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.held-sprite-name {
  position: fixed;
  z-index: 31;
  max-width: calc(100vw - 28px);
  color: var(--text);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 950;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
}

.held-sprite-name[hidden] {
  display: none;
}

.last-success span {
  display: block;
  color: var(--good);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.last-success strong {
  display: block;
  font-size: 1.25rem;
}

.last-success small {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}

.score-breakdown {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.mistake-feedback {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 116, 116, 0.48);
  border-radius: 8px;
  background: rgba(70, 24, 28, 0.86);
}

.mistake-feedback span {
  display: block;
  margin-bottom: 7px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mistake-feedback.is-duplicate {
  border-color: rgba(87, 199, 255, 0.52);
  background: rgba(24, 53, 70, 0.9);
}

.mistake-feedback.is-duplicate > span {
  color: var(--accent-2);
}

.duplicate-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.duplicate-feedback img {
  image-rendering: pixelated;
}

.duplicate-feedback strong {
  font-size: 1.2rem;
}

.mistake-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.letter-chip {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111315;
  color: var(--text);
  font-weight: 900;
}

.letter-chip.is-wrong {
  border-color: var(--danger);
  background: rgba(255, 116, 116, 0.16);
  color: #ffd0d0;
}

.letter-chip.is-missing {
  border-color: rgba(168, 179, 189, 0.48);
  color: var(--muted);
  opacity: 0.75;
}

.mistake-target {
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.toolbar {
  flex-wrap: wrap;
}

.load-status {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.settings-popover {
  position: fixed;
  z-index: 40;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 12px;
  width: min(480px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171b1f;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
}

.settings-popover[hidden] {
  display: none;
}

.settings-popover > span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-popover > strong {
  font-size: 1.35rem;
}

.settings-popover label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.settings-popover select,
.settings-popover input[type="text"],
.settings-popover input[type="url"] {
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0e1012;
  color: var(--text);
}

.sprite-style-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 7px;
}

.sprite-style-option {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 100px;
  padding: 6px;
  background: #0e1012;
  color: var(--muted);
}

.sprite-style-option img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-style-option[data-sprite-style="official"] img {
  image-rendering: auto;
}

.sprite-style-option span {
  font-size: 0.72rem;
  font-weight: 900;
}

.sprite-style-option.is-selected {
  border-color: var(--accent);
  background: #242312;
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 213, 71, 0.2);
}

.settings-popover .check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.settings-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

.settings-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-group {
  display: grid;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.settings-group > strong {
  font-size: 0.9rem;
}

.settings-status {
  color: var(--muted);
  font-weight: 800;
}

.reset-confirm-popover p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.danger-button {
  border-color: rgba(255, 116, 116, 0.72);
  background: #50262a;
  color: #fff;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: var(--danger);
}

.settings-save-actions {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.info-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 28px;
}

.info-steps li {
  padding-left: 4px;
  color: var(--text);
}

.info-steps li::marker {
  color: var(--accent);
  font-weight: 950;
}

.info-copy {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.info-copy p {
  margin: 0 0 8px;
}

.info-copy a {
  color: var(--accent-2);
}

.settings-player-list,
.transfer-player-list {
  display: grid;
  gap: 7px;
}

.settings-player-row,
.transfer-player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101316;
}

.settings-player-row small,
.transfer-player-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.dex-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr));
  gap: 2px;
  margin-top: 8px;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0;
  min-height: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(28, 32, 36, 0.84);
}

.tile.is-found::after {
  position: absolute;
  z-index: 6;
  bottom: calc(100% + 7px);
  left: 50%;
  min-width: max-content;
  max-width: 180px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  content: attr(data-tooltip);
  background: #101316;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.tile.is-found:hover::after,
.tile.is-found:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pokemon-sprite {
  width: 72%;
  height: 72%;
  object-fit: contain;
  filter: brightness(0) saturate(1) opacity(0.6);
  transform: scale(1.08);
  transition: filter 180ms ease, transform 180ms ease;
}

.tile.is-found {
  border-color: rgba(89, 217, 147, 0.6);
  background: rgba(29, 58, 44, 0.7);
  cursor: zoom-in;
}

.tile.is-found.is-last-success {
  z-index: 2;
  border: 3px solid #f5d547;
  box-shadow:
    0 0 0 2px rgba(245, 213, 71, 0.35),
    0 0 14px rgba(245, 213, 71, 0.9),
    inset 0 0 8px rgba(245, 213, 71, 0.28);
}

.tile.is-new-found {
  animation: tile-reveal 760ms ease-out;
}

@keyframes tile-reveal {
  0% {
    transform: scale(0.78) rotateY(70deg);
  }

  35% {
    transform: scale(1.18) rotateY(0deg);
  }

  100% {
    transform: scale(1) rotateY(0deg);
  }
}

.tile.is-found .pokemon-sprite {
  filter: none;
  transform: scale(1);
}

.tile-name {
  display: none;
  min-height: 0;
  max-width: 100%;
  padding: 0 8px;
  font-size: 0.83rem;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.tile.is-found .tile-name {
  display: none;
}

.tile-number {
  display: none;
}

.tile:not(.is-found) .tile-name {
  color: var(--muted);
}

.pokemon-popover {
  position: fixed;
  z-index: 12;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #15181b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.68);
  transform: translate(-50%, -50%);
  animation: pokemon-detail-pop 220ms ease-out;
}

.pokemon-popover[hidden] {
  display: none;
}

.pokemon-detail-hero {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  align-items: center;
  width: 100%;
  gap: 18px;
}

.pokemon-detail-hero > img {
  width: min(240px, 65vw);
  height: min(240px, 65vw);
  object-fit: contain;
  image-rendering: pixelated;
}

.pokemon-detail-hero span,
.sprite-gallery-section > span {
  color: var(--muted);
  font-weight: 850;
}

.pokemon-detail-hero strong {
  display: block;
  font-size: 2rem;
}

.pokemon-detail-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pokemon-type {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pokemon-detail-description {
  width: 100%;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.pokemon-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  width: 100%;
}

.pokemon-fact {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101316;
}

.pokemon-fact span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.pokemon-fact strong {
  font-size: 0.95rem;
}

.sprite-gallery-section {
  display: grid;
  gap: 8px;
  width: 100%;
}

.pokemon-sprite-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.sprite-variant {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 132px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101316;
}

.sprite-variant img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-variant.is-artwork img {
  image-rendering: auto;
}

.sprite-variant span {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.pokemon-popover-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
}

@keyframes pokemon-detail-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 600px) {
  .pokemon-detail-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .pokemon-detail-facts {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 8px, 1920px);
    padding-top: 4px;
  }

  .quiz-panel {
    padding: 10px;
  }

  .masthead,
  .playbar {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-slots {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .token-list {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .stats-charts {
    grid-template-columns: 1fr;
  }

  .score-card,
  .points-card {
    width: 100%;
  }

  .dex-board {
    grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr));
    gap: 2px;
  }

  .tile {
    min-height: 0;
  }
}
