:root {
  color-scheme: light;
  --ink: #161014;
  --muted: #806a72;
  --rose: #c95470;
  --rose-dark: #aa3f5c;
  --rose-soft: #f4c4cf;
  --rose-pale: #fff1f4;
  --line: rgba(188, 91, 113, 0.34);
  --panel: rgba(255, 250, 250, 0.74);
  --good: #c95470;
  --bad: #9a4658;
  --success: #42a96b;
  --danger: #d64c5f;
  --shadow: 0 18px 42px rgba(157, 74, 95, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #fff8f8;
}

body {
  min-height: 100svh;
  margin: 0;
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.95) 0 8rem, transparent 8.4rem),
    radial-gradient(circle at 85% 20%, rgba(222, 95, 125, 0.16) 0 4.2rem, transparent 4.6rem),
    linear-gradient(150deg, #fff 0%, #fff1f3 48%, #f9dbe2 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 19px;
  padding: 1rem 1.25rem;
  color: #fff;
  background: linear-gradient(180deg, #e17089 0%, #c84f6c 100%);
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(194, 74, 101, 0.26);
}

button:hover,
button:focus-visible {
  background: linear-gradient(180deg, #d7627d 0%, #b9415e 100%);
}

button.secondary {
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid var(--line);
  box-shadow: none;
}

.quit-game {
  position: absolute;
  z-index: 3;
  top: max(42px, calc(env(safe-area-inset-top) + 30px));
  right: 18px;
  width: 42px;
  min-height: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  border: 1px solid rgba(202, 84, 112, 0.28);
  border-radius: 999px;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 8px 20px rgba(130, 62, 78, 0.08);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
}

.quit-game:hover,
.quit-game:focus-visible {
  color: #fff;
  background: linear-gradient(180deg, #e17089 0%, #c84f6c 100%);
}

.app {
  position: relative;
  width: min(390px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: stretch;
  padding: 0;
}

.screen-transition {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.88), rgba(255, 242, 245, 0.86) 45%, rgba(245, 190, 204, 0.78)),
    #fff0f3;
  transition: opacity 220ms ease;
}

.screen-transition-active {
  opacity: 1;
}

.screen {
  position: relative;
  display: none;
  width: 100%;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 88% 3%, rgba(255, 255, 255, 0.8) 0 5rem, transparent 9rem),
    radial-gradient(ellipse at 5% 100%, rgba(255, 255, 255, 0.64) 0 5.5rem, transparent 12rem),
    linear-gradient(160deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 239, 242, 0.92) 48%, rgba(250, 215, 224, 0.92) 100%),
    #fff4f5;
  border: 1px solid rgba(203, 91, 118, 0.26);
  border-radius: 0;
  padding: max(12px, env(safe-area-inset-top)) 22px max(12px, env(safe-area-inset-bottom));
}

.screen-active {
  display: flex;
  flex-direction: column;
  animation: screenIn 320ms ease both;
}

.screen:not(.screen-active) {
  display: none;
}

@keyframes screenIn {
  from {
    opacity: 0.72;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen-transition,
  .screen-active {
    animation: none;
    transition: none;
  }
}

.decor {
  position: absolute;
  pointer-events: none;
}

.decor-ribbon {
  top: 0;
  right: -6px;
  width: 128px;
  height: 390px;
  opacity: 0.28;
  background:
    repeating-linear-gradient(90deg, rgba(198, 80, 106, 0.18) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0));
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 48% 88%);
}

.decor-orb {
  border-radius: 999px;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 12%, rgba(231, 117, 142, 0.7) 48%, rgba(180, 62, 90, 0.35) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 12px 28px rgba(166, 66, 91, 0.16);
}

.decor-orb-one {
  right: 24px;
  top: 178px;
  width: 58px;
  height: 58px;
}

.decor-orb-two {
  left: 26px;
  bottom: 82px;
  width: 42px;
  height: 42px;
  opacity: 0.72;
}

.brand {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  margin-top: 44px;
}

.brand img {
  width: 112px;
  height: auto;
  display: block;
}

.brand-result {
  margin: 16px 0 26px;
}

.brand-result img {
  width: 86px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 255px;
  margin: 52px 0 12px 28px;
  color: var(--rose-dark);
  font-size: clamp(2.35rem, 11vw, 3.65rem);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  text-align: center;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

h3 {
  color: var(--rose-dark);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 260px;
  margin: 0 0 28px 30px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

.start-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.start-form label {
  text-align: center;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 500;
}

.start-form input {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  outline: none;
}

.start-form input::placeholder {
  color: rgba(112, 86, 96, 0.62);
}

.start-form input:focus {
  border-color: rgba(191, 78, 104, 0.82);
  box-shadow: 0 0 0 4px rgba(201, 84, 112, 0.1);
}

.rules {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin: 20px 18px 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 18px 38px rgba(145, 66, 83, 0.08);
  backdrop-filter: blur(10px);
}

.rules div {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 10px;
}

.rules strong {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--rose);
  font-size: 1.25rem;
  font-weight: 500;
}

.rules span,
.rules em {
  color: var(--ink);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.35;
}

.rules em {
  grid-column: 2;
  color: var(--muted);
}

.game-screen {
  padding-top: max(34px, calc(env(safe-area-inset-top) + 22px));
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 132px auto auto;
  align-content: center;
  gap: 12px;
  overflow-y: hidden;
}

.game-screen:not(.screen-active) {
  display: none;
}

.hud {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 8px;
  margin-top: 28px;
}

.hud div {
  text-align: center;
}

.hud span {
  display: block;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 700;
}

.progress {
  position: relative;
  z-index: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(52, 37, 43, 0.1);
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d7607c, #f0a2b2);
  transition: width 180ms ease;
}

.question-card {
  position: relative;
  z-index: 1;
  min-height: 132px;
  display: grid;
  grid-template-rows: 1fr 24px;
  align-content: center;
  text-align: center;
  margin-top: 8px;
  padding: 4px 12px 0;
}

.prompt {
  width: 100%;
  min-height: 88px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: clamp(1.18rem, 5.5vw, 1.62rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.prompt-good,
.prompt-bad {
  color: var(--rose);
  font-size: clamp(1.26rem, 6vw, 1.82rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.feedback {
  min-height: 24px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

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

.feedback.bad {
  color: var(--bad);
}

.answers {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  align-self: end;
  margin-top: 0;
  padding: 0 18px;
}

.answer {
  min-height: 58px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid rgba(178, 107, 123, 0.42);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 24px rgba(130, 62, 78, 0.08);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.answer-correct {
  border-color: rgba(66, 169, 107, 0.92);
  box-shadow: 0 10px 24px rgba(130, 62, 78, 0.08), 0 0 0 2px rgba(66, 169, 107, 0.16);
}

.answer-wrong {
  border-color: rgba(214, 76, 95, 0.92);
  box-shadow: 0 10px 24px rgba(130, 62, 78, 0.08), 0 0 0 2px rgba(214, 76, 95, 0.16);
}

.answer:focus,
.answer:focus-visible {
  outline: none;
}

.answer:focus,
.answer:focus-visible,
.answer:active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}

.answer-letter {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: 7px;
  border: 1px solid rgba(202, 84, 112, 0.32);
  border-radius: 999px;
  color: var(--rose);
  font-size: 1rem;
  font-weight: 700;
}

.answer-correct .answer-letter {
  color: var(--success);
  border-color: rgba(66, 169, 107, 0.9);
  background: rgba(66, 169, 107, 0.08);
}

.answer-wrong .answer-letter {
  color: var(--danger);
  border-color: rgba(214, 76, 95, 0.9);
  background: rgba(214, 76, 95, 0.08);
}

.answer-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.progress-streak {
  width: 44%;
  margin: 8px auto 0;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 28px 0 18px;
  text-align: center;
  color: var(--rose);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.final-score {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 28px;
}

.final-score span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
}

.final-score strong {
  color: var(--rose);
  font-size: clamp(4.2rem, 18vw, 6.2rem);
  font-weight: 400;
  line-height: 0.94;
}

.summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.summary div {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
  text-align: center;
}

.summary span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
}

.summary strong {
  color: var(--rose);
  font-size: 2rem;
  font-weight: 500;
}

.leaderboard {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  margin-bottom: 28px;
}

.leaderboard h3 {
  margin: 0 0 10px;
  text-align: center;
}

.leaderboard ol {
  max-height: 190px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(178, 107, 123, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
  padding: 10px 12px;
  font-size: 0.86rem;
}

.leaderboard .rank {
  color: var(--rose);
  font-weight: 700;
}

.leaderboard .points {
  font-weight: 700;
}

.actions {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-bottom: 8px;
}

.result-screen {
  padding-top: max(22px, env(safe-area-inset-top));
}

.result-screen .decor-orb-one {
  top: 84px;
}

@media (min-width: 680px) {
  body {
    padding: 24px;
  }

  .app {
    align-items: center;
  }

  .screen {
    min-height: 844px;
    border-radius: 28px;
    box-shadow: 0 26px 70px rgba(123, 53, 71, 0.18);
  }
}

@media (max-width: 370px) {
  .screen {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    margin-left: 18px;
    font-size: 2.25rem;
  }

  .lead {
    margin-left: 20px;
  }

  .prompt {
    font-size: clamp(1.28rem, 7vw, 1.82rem);
  }

  .answers {
    padding: 0 8px;
  }
}
