:root {
  color-scheme: light;
  --ink: #172554;
  --muted: #526078;
  --paper: #fffdf7;
  --card: #ffffff;
  --accent: #e85d3f;
  --accent-dark: #b93420;
  --mint: #bce8d2;
  --line: #d9deea;
  --shadow: 0 20px 50px rgb(23 37 84 / 12%);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, #ffe4a9 0 8rem, transparent 8.1rem),
    radial-gradient(circle at 92% 30%, #c9efe0 0 10rem, transparent 10.1rem),
    var(--paper);
}

header {
  min-height: 4.5rem;
  padding: 1rem clamp(1rem, 5vw, 5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgb(23 37 84 / 10%);
  background: rgb(255 253 247 / 88%);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 850;
  text-decoration: none;
}

.brand span { color: var(--accent); }

nav { display: flex; gap: clamp(.75rem, 3vw, 2rem); }
nav a { color: var(--ink); font-weight: 700; text-decoration: none; }
nav a:hover { text-decoration: underline; text-underline-offset: .3rem; }

main { overflow: hidden; }

.hero {
  min-height: 72vh;
  max-width: 72rem;
  margin: auto;
  padding: clamp(5rem, 12vw, 9rem) clamp(1rem, 5vw, 5rem);
}

.eyebrow {
  margin: 0 0 .75rem;
  color: var(--accent-dark);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.3rem, 10vw, 7.5rem);
  line-height: .9;
  letter-spacing: -.065em;
}

h1 span { color: var(--accent); }

.hero > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1.75rem 0 2.25rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
}

.button, button {
  border: 0;
  border-radius: .75rem;
  color: white;
  background: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button {
  display: inline-block;
  padding: .9rem 1.2rem;
  text-decoration: none;
}

.button:hover, button:hover { background: #273a78; }

.game-shell {
  padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 5rem);
  background: var(--ink);
}

.game-heading, .game-card {
  width: min(100%, 44rem);
  margin-inline: auto;
}

.game-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: white;
}

.game-heading .eyebrow { color: #ffb7a7; }

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  letter-spacing: -.035em;
}

.streak {
  min-width: 5.3rem;
  padding: .55rem .7rem;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: .35rem;
  align-items: center;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: .8rem;
  text-align: center;
}

.streak strong { font-size: 1.35rem; }
.streak small { grid-column: 1 / -1; color: #d6dcf1; }

.game-card {
  min-height: 25rem;
  padding: clamp(1.25rem, 5vw, 2.5rem);
  border-radius: 1.4rem;
  background: var(--card);
  box-shadow: var(--shadow);
}

.message { min-height: 1.5rem; margin-top: 0; color: var(--muted); }

.clues {
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: .65rem;
  list-style: none;
  counter-reset: clues;
}

.clues li {
  counter-increment: clues;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #f8f9fc;
  font-weight: 750;
  animation: arrive .25s ease-out;
}

.clues li::before {
  content: counter(clues);
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--mint);
  font-size: .8rem;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(.4rem); }
}

label { display: block; margin-bottom: .45rem; font-weight: 800; }
.guess-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }

input {
  min-width: 0;
  padding: .8rem .9rem;
  border: 2px solid var(--line);
  border-radius: .7rem;
  color: var(--ink);
  background: white;
  font: inherit;
}

input:focus { border-color: var(--accent); outline: 3px solid rgb(232 93 63 / 22%); }
button { padding: .8rem 1.1rem; }

.previous-guesses {
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  align-items: baseline;
  color: var(--muted);
  font-size: .78rem;
}

.previous-guesses p {
  margin: 0;
  font-weight: 800;
}

.previous-guesses ul {
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .5rem;
  list-style: none;
}

.previous-guesses li:not(:last-child)::after { content: ","; }

.secondary {
  color: var(--ink);
  background: #e8ebf3;
}

.secondary:hover { background: #daddE8; }

.result {
  margin-top: 1.25rem;
  padding: 1rem;
  border-left: .4rem solid var(--accent);
  border-radius: .4rem;
  background: #fff0eb;
  line-height: 1.5;
}

footer {
  padding: 2rem 1rem;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
}

:focus-visible { outline: 3px solid #ffb000; outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 34rem) {
  header { align-items: flex-start; }
  nav { flex-direction: column; gap: .35rem; }
  .hero { min-height: 65vh; }
  .game-heading { align-items: center; }
  .guess-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .clues li { animation: none; }
}
