:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #111d2e;
  --panel-2: #16243a;
  --ink: #f7fbff;
  --muted: #8fa1b8;
  --lime: #b9ff59;
  --cyan: #64dffc;
  --red: #ff647c;
  --line: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 32%, rgba(100, 223, 252, 0.09), transparent 18rem),
    var(--bg);
}

button, a {
  font: inherit;
}

.game-shell {
  display: flex;
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.back, .sound {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
  font-weight: 800;
  text-decoration: none;
}

.sound {
  cursor: pointer;
}

.sound[aria-pressed="false"] {
  color: #64758b;
}

.title-lockup {
  display: flex;
  align-items: center;
  flex-direction: column;
  line-height: 1.05;
}

.title-lockup span {
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.title-lockup small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 26px;
}

.status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
}

.status > div:first-child {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.status small {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status strong {
  font-size: 0.92rem;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 280ms ease;
}

.lives {
  min-width: 61px;
  color: var(--red);
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-align: right;
}

.streak {
  align-self: center;
  margin-top: 20px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 191, 82, 0.18);
  border-radius: 99px;
  color: #ffd27a;
  background: rgba(255, 191, 82, 0.08);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 270px;
  padding: 20px 0 10px;
}

.prompt p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.flag-stage {
  position: relative;
  display: grid;
  width: min(69vw, 330px);
  aspect-ratio: 1.5;
  place-items: center;
}

.glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: rgba(100, 223, 252, 0.17);
  filter: blur(35px);
}

.flag {
  position: relative;
  font-size: clamp(8.5rem, 40vw, 13rem);
  line-height: 1;
  filter: drop-shadow(0 24px 18px rgba(0, 0, 0, 0.32));
  animation: flag-in 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  position: relative;
  width: 100%;
  min-height: 66px;
  padding: 14px 50px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.answer::after {
  position: absolute;
  top: 50%;
  right: 18px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  content: "→";
  transform: translateY(-50%);
}

.answer:active {
  transform: scale(0.985);
}

.answer.correct {
  border-color: rgba(185, 255, 89, 0.65);
  color: var(--lime);
  background: rgba(185, 255, 89, 0.1);
}

.answer.correct::after {
  border-color: transparent;
  color: #07111f;
  background: var(--lime);
  content: "✓";
}

.answer.wrong {
  border-color: rgba(255, 100, 124, 0.65);
  color: #ff91a3;
  background: rgba(255, 100, 124, 0.1);
}

.answer.wrong::after {
  border-color: transparent;
  color: #07111f;
  background: var(--red);
  content: "×";
}

.answer:disabled {
  cursor: default;
}

.feedback {
  min-height: 28px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.feedback.good {
  color: var(--lime);
}

.feedback.bad {
  color: #ff91a3;
}

.result {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 38px 8px 20px;
  text-align: center;
  animation: result-in 420ms ease both;
}

.result-icon {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border: 1px solid rgba(185, 255, 89, 0.2);
  border-radius: 31px;
  background: rgba(185, 255, 89, 0.08);
  box-shadow: 0 0 60px rgba(185, 255, 89, 0.08);
  font-size: 3rem;
  transform: rotate(-4deg);
}

.overline {
  margin: 28px 0 8px;
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.result h1 {
  margin: 0;
  font-size: clamp(2.3rem, 10vw, 3.5rem);
  letter-spacing: -0.06em;
}

.result-copy {
  max-width: 370px;
  margin: 13px auto 25px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.score-card {
  display: flex;
  width: 100%;
  max-width: 330px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 21px;
  align-items: center;
  flex-direction: column;
  background: var(--panel);
}

.score-card span, .score-card small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-card strong {
  margin: 3px 0;
  color: var(--lime);
  font-size: 3.1rem;
  line-height: 1;
  letter-spacing: -0.06em;
}

.primary {
  width: 100%;
  max-width: 330px;
  min-height: 58px;
  margin-top: 14px;
  border: 0;
  border-radius: 17px;
  color: #07111f;
  background: var(--lime);
  cursor: pointer;
  font-weight: 900;
}

.all-games {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

@keyframes flag-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.88) rotate(-3deg);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (min-height: 780px) {
  .game {
    padding-top: 32px;
  }

  .prompt {
    min-height: 335px;
  }
}

@media (hover: hover) {
  .answer:hover:not(:disabled) {
    border-color: rgba(100, 223, 252, 0.45);
    background: var(--panel-2);
  }
}

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