:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #e8eaec;
  --bg-deep: #cfd5db;
  --surface: #f5f6f7;
  --ink: #121417;
  --muted: #5f6870;
  --line: #c8ced4;
  --accent: #121417;
  --accent-contrast: #f5f6f7;
  --ok: #1f7a4c;
  --warm: #8a6d1f;
  --cold: #a33b2a;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Syne", "Outfit", sans-serif;
  --radius: 4px;
  --veil: linear-gradient(
    185deg,
    rgba(232, 234, 236, 0.35) 0%,
    rgba(232, 234, 236, 0.78) 48%,
    rgba(232, 234, 236, 0.97) 100%
  );
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1012;
  --bg-deep: #1a1f24;
  --surface: #16191c;
  --ink: #eef1f3;
  --muted: #8b939b;
  --line: #2a2f34;
  --accent: #eef1f3;
  --accent-contrast: #0e1012;
  --ok: #5dca8f;
  --warm: #d4b44a;
  --cold: #e07a68;
  --veil: linear-gradient(
    185deg,
    rgba(14, 16, 18, 0.35) 0%,
    rgba(14, 16, 18, 0.78) 48%,
    rgba(14, 16, 18, 0.97) 100%
  );
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg-deep) 55%, transparent) 0%, transparent 42%),
    radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--bg-deep) 65%, transparent), transparent 55%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

.top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.game-hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.reveal .game-hud {
  margin-top: 1rem;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  margin: 0;
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-toggle:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 28%, var(--line));
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.25rem 0.15rem 0.25rem 0.25rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.2s ease;
}

[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(14px);
}

.theme-toggle-label {
  min-width: 3.6rem;
  text-align: left;
}

main {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
}

.screen[hidden] {
  display: none !important;
}

.screen-start {
  position: relative;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.25rem;
}

.start-backdrop {
  position: absolute;
  inset: -2rem -10vw 18%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.marquee {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  opacity: 0.4;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-a {
  top: 18%;
}

.marquee-b {
  top: 48%;
  opacity: 0.28;
}

.marquee-track {
  display: flex;
  gap: 0.55rem;
  width: max-content;
  will-change: transform;
}

.marquee-a .marquee-track {
  animation: marquee-left 54s linear infinite;
}

.marquee-b .marquee-track {
  animation: marquee-right 64s linear infinite;
}

.marquee-tile {
  margin: 0;
  flex: 0 0 auto;
  width: 104px;
  height: 78px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: var(--surface);
}

.marquee-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #fff;
  filter: saturate(0.92);
}

[data-theme="dark"] .marquee-tile img {
  background: #222;
  filter: saturate(0.85) brightness(0.92);
}

.start-veil {
  position: absolute;
  inset: 0;
  background: var(--veil);
}

.start-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  opacity: 1;
  animation: rise 0.55s ease both;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.5rem 0 0.2rem;
  max-width: 36rem;
}

.logo-hero {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 11vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.92;
  opacity: 1;
  animation: rise 0.55s 0.04s ease both;
}

.lead {
  margin: 0;
  max-width: 24rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
  font-weight: 400;
  opacity: 1;
  animation: fade 0.55s 0.1s ease both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.55rem;
  opacity: 1;
  animation: fade 0.55s 0.16s ease both;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 34rem;
  margin-top: 0.55rem;
  opacity: 1;
  animation: fade 0.55s 0.12s ease both;
}

.mode-btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 1.15rem 1.15rem 1.2rem;
  min-height: 5.6rem;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mode-btn-mark {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  box-shadow: inset 0 0 0 0 var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mode-btn-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.mode-btn-title {
  display: block;
  font-family: var(--display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}

.mode-btn-sub {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}

.mode-btn:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.mode-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.mode-btn.is-active .mode-btn-title {
  color: var(--bg);
}

.mode-btn.is-active .mode-btn-sub {
  color: var(--bg);
  opacity: 0.72;
}

.mode-btn.is-active .mode-btn-mark {
  border-color: var(--bg);
  background: var(--bg);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.mode-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.rank-note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  min-height: 1.1em;
}

.rank-note[hidden] {
  display: none !important;
}

.setup {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.7fr;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  opacity: 1;
  animation: rise 0.55s 0.18s ease both;
}

.setup.is-ranked {
  grid-template-columns: 1.2fr 1fr;
}

.setup.is-ranked #field-rounds {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field select,
.field input[type="text"],
.price-field input {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.55rem 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.field select {
  padding: 0.55rem 1.5rem 0.55rem 0.65rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) calc(50% + 2px), calc(100% - 7px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field select option {
  padding: 0.55rem 0.85rem;
  margin: 0.15rem;
  background-color: #f5f6f7;
  color: #121417;
}

[data-theme="dark"] .field select option {
  background-color: #16191c;
  color: #eef1f3;
}

[data-theme="dark"] .field select,
[data-theme="dark"] .field input[type="text"],
[data-theme="dark"] .price-field input {
  color-scheme: dark;
}

.field select:focus,
.field input[type="text"]:focus,
.price-field input:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.price-field input::placeholder {
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  font-weight: 400;
}

.guess-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.8rem 1.35rem;
  font: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  opacity: 0.9;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 550;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  padding: 1.25rem 1.25rem 1.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.about-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.about-card h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: -0.04em;
}

.about-card h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.about-card p,
.about-card li {
  color: var(--muted);
  line-height: 1.55;
}

.about-card strong {
  color: var(--ink);
  font-weight: 600;
}

.about-kicker {
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.about-contacts a {
  color: var(--ink);
}

.about-note {
  margin-top: 1.5rem;
  font-size: 0.88rem;
}

.about-card .cta-row {
  margin-top: 1.5rem;
}

.about-card .btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@media (max-width: 640px) {
  .top-nav a {
    font-size: 0.8rem;
  }

  .site-footer {
    font-size: 0.76rem;
    padding-inline: 1rem;
  }
}


.leaderboard {
  margin-top: 2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  opacity: 1;
  animation: rise 0.55s 0.24s ease both;
}

.leaderboard[hidden] {
  display: none !important;
}

.leaderboard-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.leaderboard-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.leaderboard-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0.65rem;
}

.lb-tab {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 0.35rem 0.15rem;
  margin-right: 0.85rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.lb-tab:hover {
  color: var(--ink);
}

.lb-tab.active {
  background: transparent;
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.leaderboard-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.leaderboard-list .rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.leaderboard-list .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-list .score {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.leaderboard-empty {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.results-rank {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 1.2em;
}

.product {
  display: grid;
  gap: 1.1rem;
  animation: fade 0.35s ease both;
}

.product-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 1 / 1;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 1rem;
  animation: fade 0.35s ease both;
  background: #fff;
}

[data-theme="dark"] .product-media img {
  background: #1a1a1a;
}

.tag {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
}

[data-theme="dark"] .tag {
  background: rgba(20, 22, 26, 0.88);
  border-color: rgba(238, 241, 243, 0.22);
  color: #eef1f3;
}

.product-body h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.guess-form {
  display: grid;
  gap: 0.75rem;
}

.price-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.reveal,
.results {
  animation: fade 0.35s ease both;
  text-align: left;
  padding: 0.5rem 0;
}

.reveal-status {
  margin: 0 0 1.1rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.reveal-status.hot {
  color: var(--ok);
}

.reveal-status.warm {
  color: var(--warm);
}

.reveal-status.cold {
  color: var(--cold);
}

.reveal-prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.reveal-prices > div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.reveal-prices .muted {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
  font-weight: 500;
}

.reveal-prices strong {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.reveal-delta {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.results h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.results-score {
  margin: 0.35rem 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.results-blurb {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.results-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.results-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}

.results-list .pts {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes marquee-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes marquee-right {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-a .marquee-track,
  .marquee-b .marquee-track {
    animation: none;
  }

  .hero,
  .logo-hero,
  .lead,
  .cta-row,
  .setup,
  .start-panel,
  .leaderboard {
    animation: none;
  }
}

@media (max-width: 640px) {
  .mode-switch {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    max-width: none;
  }

  .mode-btn {
    min-height: 0;
    padding: 1.05rem 1.05rem 1.1rem;
  }

  .mode-btn-title {
    font-size: 1.08rem;
  }

  .mode-btn-sub {
    font-size: 0.8rem;
  }

  .setup {
    grid-template-columns: 1fr;
  }

  .leaderboard-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .reveal-prices {
    grid-template-columns: 1fr;
  }

  main {
    padding-top: 1.25rem;
  }

  .screen-start {
    min-height: min(70vh, 580px);
  }

  .marquee-tile {
    width: 88px;
    height: 66px;
  }

  .marquee-a {
    top: 12%;
  }

  .marquee-b {
    top: 38%;
  }
}
