:root {
  --ink: #121c28;
  --ink-soft: #2a3c4f;
  --muted: #5d7186;
  --paper: #ebf1f6;
  --paper-2: #dde7f0;
  --line: rgba(18, 28, 40, 0.12);
  --accent: #ff5a45;
  --accent-deep: #e04130;
  --accent-soft: rgba(255, 90, 69, 0.16);
  --teal: #14a897;
  --teal-deep: #0e8578;
  --teal-soft: rgba(20, 168, 151, 0.16);
  --gold: #f0a202;
  --ok: #14a897;
  --bad: #e04545;
  --white: #ffffff;
  --radius: 1.35rem;
  --shadow: 0 22px 50px rgba(18, 28, 40, 0.12);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Outfit", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(165deg, #f4f8fb 0%, #e8f0f6 48%, #e5eef5 100%);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(78px);
  opacity: 0.58;
  animation: drift 18s var(--ease) infinite alternate;
}

.bg__glow--a {
  width: min(58vw, 460px);
  height: min(58vw, 460px);
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, #ffb3a6 0%, transparent 70%);
}

.bg__glow--b {
  width: min(52vw, 400px);
  height: min(52vw, 400px);
  bottom: -4%;
  left: -12%;
  background: radial-gradient(circle, #8fe0d4 0%, transparent 70%);
  animation-delay: -7s;
}

.bg__glow--c {
  width: min(34vw, 260px);
  height: min(34vw, 260px);
  top: 42%;
  left: 52%;
  background: radial-gradient(circle, #ffe0a3 0%, transparent 70%);
  opacity: 0.35;
  animation-delay: -12s;
}

.bg__orbits {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 90, 69, 0.05), transparent 28%),
    radial-gradient(circle at 78% 68%, rgba(20, 168, 151, 0.06), transparent 26%);
  animation: orbitPulse 12s ease-in-out infinite;
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-24px, 18px) scale(1.08); }
}

@keyframes orbitPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  overflow: hidden;
}

.fx__piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--x), 110vh, 0) rotate(720deg);
    opacity: 0;
  }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo__mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, var(--accent), #ff8a55);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px var(--accent-soft);
}

.logo__reel {
  width: 0.72rem;
  height: 0.72rem;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px transparent;
  animation: spin 4.5s linear infinite;
  position: relative;
}

.logo__reel::before,
.logo__reel::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.85);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.logo__tag {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.app {
  flex: 1;
  width: min(100% - 2rem, 580px);
  margin: 0 auto;
  padding: 0.5rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen {
  display: none;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.screen.is-active {
  display: block;
  animation: screenIn 0.55s var(--ease) both;
}

.screen.is-leaving {
  animation: screenOut 0.28s ease forwards;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes screenOut {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 10vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  background: linear-gradient(120deg, var(--ink) 20%, #3a556f 55%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 34ch;
}

.start-visual {
  position: relative;
  height: 4.5rem;
  margin-bottom: 1.1rem;
}

.start-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(18, 28, 40, 0.08);
  font-size: 1.15rem;
  animation: floatChip 4.8s var(--ease) infinite;
}

.start-chip--1 { left: 0; top: 0.2rem; animation-delay: 0s; }
.start-chip--2 { left: 28%; top: 1.4rem; animation-delay: -1.2s; }
.start-chip--3 { right: 24%; top: 0; animation-delay: -2.1s; }
.start-chip--4 { right: 0; top: 1.55rem; animation-delay: -0.7s; }

@keyframes floatChip {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.start-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.start-perks li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.15rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  overflow: hidden;
  transition:
    transform 0.22s var(--ease),
    background 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    border-color 0.22s var(--ease);
}

.btn:active {
  transform: scale(0.975);
}

.btn--primary {
  background: linear-gradient(135deg, #ff6a4d 0%, var(--accent) 55%, #ff7a42 100%);
  color: var(--white);
  box-shadow: 0 14px 30px var(--accent-soft);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(255, 90, 69, 0.3);
}

.btn--glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn--glow:hover::after {
  opacity: 1;
}

.btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: shine 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn--compact {
  min-width: 8.2rem;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  border-color: rgba(18, 28, 40, 0.22);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 28, 40, 0.08);
}

.btn--next {
  width: 100%;
  background: linear-gradient(135deg, #16b8a5, var(--teal-deep));
  color: var(--white);
  box-shadow: 0 14px 30px var(--teal-soft);
}

.btn--next:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(20, 168, 151, 0.28);
}

.btn__arrow {
  transition: transform 0.25s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

#replay-btn:hover .btn__arrow {
  transform: rotate(-35deg);
}

.link-btn {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}

.link-btn:hover {
  color: var(--accent-deep);
}

.play-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.progress {
  flex: 1;
}

.progress__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(18, 28, 40, 0.08);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--accent));
  background-size: 200% 100%;
  animation: progressGlow 2.8s linear infinite;
  transition: width 0.5s var(--ease);
}

@keyframes progressGlow {
  to { background-position: 200% 0; }
}

.progress__text {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

.live-score {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
  min-width: 3.5rem;
}

.live-score__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-score__value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.25s var(--ease), color 0.25s ease;
}

.live-score__value.is-bump {
  animation: scoreBump 0.45s var(--ease);
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: var(--teal); }
  100% { transform: scale(1); }
}

.emoji-stage {
  position: relative;
  padding: clamp(1.7rem, 5vw, 2.35rem) 1.2rem 1.35rem;
  border-radius: calc(var(--radius) + 0.2rem);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s var(--ease);
}

.emoji-stage__ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(18, 28, 40, 0.08);
  animation: spin 28s linear infinite;
  pointer-events: none;
}

.emoji-stage.is-ok {
  box-shadow: 0 22px 48px rgba(20, 168, 151, 0.2);
  animation: stageOk 0.55s var(--ease);
}

.emoji-stage.is-bad {
  box-shadow: 0 22px 48px rgba(224, 69, 69, 0.16);
  animation: stageBad 0.45s var(--ease);
}

@keyframes stageOk {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.025); }
}

@keyframes stageBad {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.emoji-set {
  position: relative;
  margin: 0;
  text-align: center;
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  letter-spacing: 0.14em;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15em;
}

.emoji-set span {
  display: inline-block;
  animation: emojiPop 0.55s var(--ease) both;
}

.emoji-set span:nth-child(1) { animation-delay: 0.02s; }
.emoji-set span:nth-child(2) { animation-delay: 0.08s; }
.emoji-set span:nth-child(3) { animation-delay: 0.14s; }
.emoji-set span:nth-child(4) { animation-delay: 0.2s; }
.emoji-set span:nth-child(5) { animation-delay: 0.26s; }

@keyframes emojiPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.7) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

.emoji-caption {
  position: relative;
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.answer-form {
  display: grid;
  gap: 0.55rem;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
}

.field {
  width: 100%;
  min-height: 3.15rem;
  padding: 0.75rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.field::placeholder {
  color: #8a9aab;
}

.field:focus {
  border-color: rgba(255, 90, 69, 0.55);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: translateY(-1px);
}

.form-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.6rem;
}

.feedback {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: right;
  flex: 1;
}

.feedback.is-ok {
  color: var(--ok);
  animation: riseSoft 0.35s var(--ease);
}

.feedback.is-bad {
  color: var(--bad);
  animation: riseSoft 0.35s var(--ease);
}

@keyframes riseSoft {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.round-actions {
  margin-top: 1rem;
  animation: riseSoft 0.4s var(--ease);
}

.result-hero {
  position: relative;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: calc(var(--radius) + 0.15rem);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.result-hero__burst {
  position: absolute;
  inset: -30%;
  background:
    conic-gradient(from 90deg, transparent, rgba(255, 90, 69, 0.08), transparent 35%, rgba(20, 168, 151, 0.08), transparent 70%);
  animation: spin 18s linear infinite;
  opacity: 0.7;
}

.result-hero[data-rank="perfect"] {
  background:
    linear-gradient(155deg, rgba(255, 248, 230, 0.98), rgba(255, 255, 255, 0.85));
}

.result-hero[data-rank="great"] {
  background:
    linear-gradient(155deg, rgba(230, 250, 246, 0.98), rgba(255, 255, 255, 0.85));
}

.result-hero > *:not(.result-hero__burst) {
  position: relative;
}

.result-badge {
  display: inline-flex;
  margin: 0 0 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  animation: badgeIn 0.55s var(--ease) both;
}

.result-hero[data-rank="perfect"] .result-badge,
.result-hero[data-rank="great"] .result-badge {
  color: var(--teal-deep);
  background: var(--teal-soft);
}

@keyframes badgeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 6vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.result-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 28, 40, 0.08);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.result-meter__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--accent));
  transition: width 1s var(--ease);
}

.result-score {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 0.7rem;
}

.result-score__num {
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 12vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent);
}

.result-score__den {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
}

.result-lede {
  margin-bottom: 0;
  max-width: 38ch;
}

.result-panel {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.result-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.result-panel__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.result-panel__note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.review {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.review__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.72rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  animation: riseSoft 0.45s var(--ease) both;
}

.review__item:nth-child(1) { animation-delay: 0.04s; }
.review__item:nth-child(2) { animation-delay: 0.08s; }
.review__item:nth-child(3) { animation-delay: 0.12s; }
.review__item:nth-child(4) { animation-delay: 0.16s; }
.review__item:nth-child(5) { animation-delay: 0.2s; }
.review__item:nth-child(6) { animation-delay: 0.24s; }
.review__item:nth-child(7) { animation-delay: 0.28s; }
.review__item:nth-child(8) { animation-delay: 0.32s; }

.review__emoji {
  font-size: 1.3rem;
  line-height: 1;
}

.review__body {
  min-width: 0;
}

.review__title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.review__given {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review__mark {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}

.review__mark.is-ok {
  color: var(--ok);
  background: var(--teal-soft);
}

.review__mark.is-bad {
  color: var(--bad);
  background: rgba(224, 69, 69, 0.12);
}

.result-actions {
  display: grid;
  gap: 0.65rem;
}

.share-status {
  min-height: 1.2em;
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-deep);
  text-align: center;
}

.site-footer {
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 520px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .btn--primary,
  .btn--ghost,
  .btn--next {
    width: 100%;
  }

  .form-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .feedback {
    text-align: left;
  }

  .start-chip--2,
  .start-chip--3 {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
