:root {
  --kiwi-yellow: #f6b600;
  --kiwi-black: #0a0a0a;
  --kiwi-white: #ffffff;
  --ink-muted: #4a4a4a;
  --line: #d8d8d8;
  --soft-yellow: #fff4cc;
  --soft-gray: #f3f3f3;
  --success: #166534;
  --success-bg: #e8f5ed;
  --warning: #8a5a00;
  --warning-bg: #fff1bf;
  --caution: #315a93;
  --caution-bg: #e8f0ff;
  --shadow: 0 18px 42px rgba(10, 10, 10, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(10, 10, 10, 0.06) 1px, transparent 1px),
    var(--kiwi-yellow);
  background-size: 34px 34px;
  color: var(--kiwi-black);
  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.has-pattern {
  background-image: var(--brand-pattern), linear-gradient(180deg, var(--kiwi-yellow), var(--kiwi-yellow));
  background-size: 360px auto, auto;
}

button,
a {
  font: inherit;
}

button {
  overflow-wrap: break-word;
}

.app-shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  place-items: center;
}

.screen {
  width: 100%;
  overflow: hidden;
  border: 3px solid var(--kiwi-black);
  border-radius: 8px;
  background: var(--kiwi-white);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.start-screen {
  padding: clamp(20px, 5vw, 46px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(24px, 6vw, 54px);
}

.brand-logo {
  width: min(128px, 42vw);
  height: auto;
  object-fit: contain;
}

.brand-mark {
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--kiwi-black);
  border-radius: 4px;
  background: var(--kiwi-yellow);
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.hero-grid {
  display: grid;
  gap: 26px;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.category-label,
.recommendation-card span,
.bonus-card span {
  margin: 0 0 10px;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p,
span,
strong,
a {
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: clamp(2.65rem, 13vw, 6.8rem);
  line-height: 1.16;
  letter-spacing: 0;
  font-weight: 950;
}

.quick-subtitle {
  max-width: 560px;
  margin: 16px 0 18px;
  color: var(--kiwi-black);
  font-size: clamp(1.12rem, 3vw, 1.45rem);
  font-weight: 850;
  line-height: 1.28;
}

.challenge-title {
  width: fit-content;
  max-width: 100%;
  margin: 18px 0 16px;
  padding: 8px 12px;
  background: var(--kiwi-black);
  color: var(--kiwi-white);
  border-radius: 4px;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 900;
}

.intro {
  max-width: 660px;
  margin: 0 0 18px;
  color: var(--kiwi-black);
  font-size: clamp(1rem, 2.8vw, 1.22rem);
  line-height: 1.55;
}

.explain-grid {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.explain-card {
  min-height: 118px;
  padding: 14px;
  border: 2px solid var(--kiwi-black);
  border-radius: 6px;
  background: var(--kiwi-white);
  box-shadow: 5px 5px 0 var(--kiwi-black);
}

.explain-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.2;
}

.explain-card p,
.round-note {
  margin: 0;
  line-height: 1.42;
}

.round-note {
  width: fit-content;
  max-width: 100%;
  margin: 20px 0 18px;
  padding: 9px 12px;
  border: 2px solid var(--kiwi-black);
  border-radius: 999px;
  background: var(--soft-yellow);
  font-weight: 900;
}

.microcopy {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 52px;
  border-radius: 6px;
  border: 2px solid var(--kiwi-black);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 14px 18px;
  text-align: center;
  line-height: 1.2;
}

.primary-button {
  background: var(--kiwi-yellow);
  color: var(--kiwi-black);
  box-shadow: 0 7px 0 var(--kiwi-black);
}

.secondary-button {
  background: var(--kiwi-white);
  color: var(--kiwi-black);
}

.text-button {
  margin-top: 18px;
  padding: 10px 14px;
  background: transparent;
  border-color: transparent;
  color: var(--kiwi-black);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover,
.answer-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.answer-button:focus-visible {
  outline: 3px solid rgba(10, 10, 10, 0.24);
  outline-offset: 3px;
}

.hero-asset {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  margin: 18px 0 16px;
  padding: 0;
  display: grid;
  gap: 6px;
  place-items: center;
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.gif-frame {
  width: 160px;
  height: 160px;
  padding: 12px;
  display: grid;
  place-items: center;
  border: 2px solid var(--kiwi-black);
  border-radius: 8px;
  background: var(--soft-yellow);
  overflow: hidden;
}

.gif-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-gif {
  opacity: 0;
  animation: softBrandIn 480ms ease forwards;
}

.hero-asset-label {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 2px solid var(--kiwi-black);
  border-radius: 999px;
  background: var(--kiwi-white);
  color: var(--kiwi-black);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.kiwi-placeholder {
  width: 100%;
  height: 100%;
  padding: 10px;
  display: grid;
  gap: 6px;
  place-items: center;
  border: 2px solid var(--kiwi-black);
  border-radius: 6px;
  color: var(--kiwi-black);
  text-align: center;
}

@keyframes softBrandIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.kiwi-placeholder span,
.kiwi-placeholder strong {
  display: block;
  line-height: 1.12;
  font-weight: 950;
}

.kiwi-placeholder strong {
  font-size: clamp(1.3rem, 5vw, 2rem);
}

.kiwi-placeholder span {
  padding: 5px 10px;
  background: var(--kiwi-yellow);
  color: var(--kiwi-black);
  border-radius: 4px;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.game-screen,
.result-screen {
  padding: clamp(18px, 4.5vw, 42px);
}

.game-header {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.game-header h1 {
  font-size: clamp(2rem, 8vw, 4.3rem);
}

.score-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
  padding: 12px 14px;
  border: 2px solid var(--kiwi-black);
  border-radius: 6px;
  background: var(--kiwi-black);
  color: var(--kiwi-white);
  font-weight: 800;
}

.round-pill {
  grid-column: 1 / -1;
  width: fit-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--kiwi-yellow);
  color: var(--kiwi-black);
  font-weight: 950;
}

.score-stat {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.score-stat small {
  display: block;
  margin-bottom: 4px;
  color: var(--kiwi-yellow);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.score-stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--kiwi-black);
  border-radius: 999px;
  background: var(--kiwi-white);
  margin-bottom: 20px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--kiwi-yellow);
  transition: width 220ms ease;
}

.question-card {
  padding: clamp(18px, 4vw, 30px);
  border: 2px solid var(--kiwi-black);
  border-radius: 8px;
  background: var(--soft-gray);
}

.question-card h2 {
  margin: 0 0 20px;
  font-size: clamp(1.35rem, 4.6vw, 2.45rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.answer-grid {
  display: grid;
  gap: 12px;
}

.answer-button {
  width: 100%;
  min-height: 74px;
  padding: 14px 15px;
  border: 2px solid var(--kiwi-black);
  border-radius: 6px;
  background: var(--kiwi-white);
  color: var(--kiwi-black);
  cursor: pointer;
  font-weight: 850;
  line-height: 1.22;
  text-align: left;
  box-shadow: 0 0 0 var(--kiwi-black);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.answer-button:hover:not(:disabled) {
  background: var(--soft-yellow);
  box-shadow: 5px 5px 0 var(--kiwi-black);
}

.answer-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 2px 2px 0 var(--kiwi-black);
}

.answer-button small {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.32;
}

.answer-button:disabled {
  cursor: default;
}

.answer-button.correct {
  background: var(--success-bg);
  border-color: var(--success);
}

.answer-button.incorrect {
  background: var(--warning-bg);
  border-color: var(--warning);
}

.feedback {
  margin-top: 18px;
  padding: 16px;
  border: 2px solid var(--kiwi-black);
  border-left-width: 8px;
  border-radius: 6px;
  background: var(--kiwi-white);
  color: var(--kiwi-black);
  line-height: 1.5;
}

.feedback.is-hit {
  border-left-color: var(--success);
  background: var(--success-bg);
}

.feedback.is-bold {
  border-left-color: var(--warning);
  background: var(--warning-bg);
}

.feedback.is-cautious {
  border-left-color: var(--caution);
  background: var(--caution-bg);
}

.feedback strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.feedback b {
  display: inline-block;
  margin-bottom: 9px;
  padding: 5px 8px;
  border: 2px solid var(--kiwi-black);
  border-radius: 999px;
  background: var(--kiwi-white);
  font-size: 0.86rem;
  line-height: 1.1;
}

.feedback span {
  display: block;
}

.feedback em {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 9px;
  border: 2px solid var(--kiwi-black);
  border-radius: 999px;
  background: var(--kiwi-yellow);
  color: var(--kiwi-black);
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 950;
}

.feedback-brandline {
  width: fit-content;
  max-width: 100%;
  margin-top: 12px;
  display: block !important;
}

.feedback-gif-frame {
  margin: 0;
}

#next-button {
  margin-top: 16px;
}

.result-screen h1 {
  margin-bottom: 16px;
  font-size: clamp(2.1rem, 9vw, 5rem);
}

.result-text {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--kiwi-black);
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  line-height: 1.58;
}

.recommendation-card,
.bonus-card {
  max-width: 760px;
  padding: 16px;
  border: 2px solid var(--kiwi-black);
  border-radius: 8px;
}

.recommendation-card {
  background: var(--kiwi-yellow);
  box-shadow: 7px 7px 0 var(--kiwi-black);
}

.recommendation-card strong {
  display: block;
  font-size: clamp(1.15rem, 4vw, 1.7rem);
  line-height: 1.2;
}

.bonus-card {
  display: grid;
  gap: 9px;
  margin-top: 22px;
  background: var(--soft-yellow);
}

.bonus-card strong {
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--kiwi-black);
  border-radius: 4px;
  background: var(--kiwi-white);
  font-size: clamp(1.35rem, 5vw, 2rem);
  line-height: 1.1;
}

.bonus-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

.bonus-card small {
  color: var(--ink-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.helper-section {
  margin-top: 30px;
}

.helper-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 4vw, 2rem);
}

.helper-grid {
  display: grid;
  gap: 12px;
}

.helper-card {
  padding: 14px;
  border: 2px solid var(--kiwi-black);
  border-radius: 8px;
  background: var(--kiwi-white);
}

.helper-card h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
  line-height: 1.2;
}

.helper-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.cta-row {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.link-button {
  text-decoration: none;
}

.footer-brand {
  display: grid;
  gap: 5px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 2px solid var(--kiwi-black);
  color: var(--kiwi-black);
  line-height: 1.35;
}

.result-brand-asset {
  margin-bottom: 8px;
}

.result-brand-gif {
  opacity: 0;
  animation: softBrandIn 480ms ease forwards;
}

.result-brand-asset > span {
  padding: 5px 7px;
  background: var(--kiwi-yellow);
  color: var(--kiwi-black);
  font-size: 0.78rem;
  font-weight: 950;
}

.footer-brand strong {
  font-size: 1.25rem;
  font-weight: 950;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 28px;
  }

  .hero-grid {
    display: block;
  }

  .hero-copy {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    column-gap: 26px;
    align-items: start;
  }

  .hero-copy > .eyebrow,
  .hero-copy > h1,
  .hero-copy > .quick-subtitle,
  .hero-copy > .challenge-title,
  .hero-copy > .intro,
  .hero-copy > .explain-grid,
  .hero-copy > .round-note,
  .hero-copy > .primary-button,
  .hero-copy > .microcopy {
    grid-column: 1;
  }

  .hero-asset {
    grid-column: 2;
    grid-row: 1 / span 4;
    width: fit-content;
    min-height: 0;
    margin: 4px 0 0 auto;
    align-self: start;
    justify-self: end;
  }

  .hero-gif {
    min-height: 0;
  }

  .primary-button,
  .secondary-button {
    width: auto;
  }

  .explain-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-header {
    grid-template-columns: minmax(0, 1fr) minmax(240px, max-content);
    align-items: start;
  }

  .answer-grid,
  .helper-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .answer-button {
    text-align: left;
  }

  .cta-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 8px;
    align-items: start;
  }

  .start-screen {
    padding: 14px;
  }

  .brand-row {
    margin-bottom: 10px;
  }

  .brand-mark {
    padding: 6px 9px;
    font-size: 0.8rem;
  }

  .hero-grid {
    gap: 0;
  }

  .hero-copy {
    max-width: none;
  }

  .hero-copy .eyebrow {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  .start-screen h1 {
    font-size: clamp(2.75rem, 13vw, 3.9rem);
    line-height: 0.98;
  }

  .quick-subtitle {
    margin: 10px 0 14px;
    font-size: 1rem;
    line-height: 1.3;
  }

  .start-screen .primary-button {
    width: 100%;
    min-height: 52px;
    margin-bottom: 11px;
  }

  .round-note {
    margin: 0 0 12px;
    padding: 6px 9px;
    border-width: 2px;
    background: var(--kiwi-yellow);
    font-size: 0.86rem;
    line-height: 1.2;
  }

  .hero-asset {
    display: none;
  }

  .gif-frame {
    width: 110px;
    height: 110px;
    padding: 8px;
  }

  .feedback-brandline {
    width: fit-content;
  }

  .intro {
    margin: 0 0 10px;
    font-size: 0.94rem;
    line-height: 1.36;
  }

  .explain-grid {
    gap: 7px;
    margin: 10px 0 0;
  }

  .explain-card {
    min-height: 0;
    padding: 9px 10px;
    border-radius: 6px;
    box-shadow: none;
  }

  .explain-card strong {
    margin-bottom: 3px;
    font-size: 0.92rem;
  }

  .explain-card p {
    font-size: 0.86rem;
    line-height: 1.28;
  }

  .microcopy {
    margin-top: 12px;
    font-size: 0.82rem;
    line-height: 1.36;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 10px;
    align-items: start;
  }

  .screen,
  .question-card,
  .recommendation-card,
  .helper-card {
    border-width: 2px;
  }

  .start-screen,
  .game-screen,
  .result-screen {
    padding: 14px;
  }

  .brand-row {
    margin-bottom: 10px;
  }

  .hero-asset {
    width: fit-content;
    min-height: 0;
    margin: 10px 0 12px;
  }

  .score-box {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }

  .primary-button,
  .secondary-button {
    min-height: 52px;
  }

  .score-stat {
    padding: 7px 5px;
  }

  .score-stat small {
    font-size: 0.66rem;
  }

  .score-stat strong {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  .hero-gif,
  .feedback-brandline img,
  .result-brand-gif {
    animation: none;
    opacity: 1;
  }
}
