:root {
  --kuku: #f06d56;
  --kuku-soft: #fff0ec;
  --kuku-blue: #4b88e5;
  --kuku-blue-soft: #eaf2ff;
}

.kuku-screen { padding: clamp(12px, 2.6vw, 28px); }
.kuku-screen[hidden] { display: none; }

#homeScreen {
  display: grid;
  grid-template-columns: minmax(310px, .68fr) minmax(0, 1.32fr);
  gap: clamp(18px, 3.2vw, 34px);
  align-items: start;
}

#homeScreen[hidden] { display: none; }

.kuku-hero {
  display: grid;
  gap: 18px;
  align-content: start;
}

.kuku-hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.8vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
  word-break: keep-all;
}

.kuku-result h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
  word-break: keep-all;
}

.kuku-hero h1 em,
.kuku-result h1 em { color: var(--kuku); font-style: normal; }
.kuku-hero h1 em { white-space: nowrap; }

.kuku-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.8;
}

.kuku-visual {
  position: relative;
  width: min(390px, 100%);
}

.kuku-hero-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border: 2px solid var(--ink);
  border-radius: 18px 14px 20px 15px;
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
  object-fit: cover;
}

.kuku-sheet {
  margin-top: 0;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
}

.kuku-sheet-head,
.kuku-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.kuku-sheet-head {
  margin: 0 2px 14px;
}

.kuku-sheet-head div {
  display: grid;
  gap: 3px;
}

.kuku-sheet-head span,
.kuku-section-title span {
  color: var(--ink);
  font-weight: 900;
}

.kuku-sheet-head small,
.kuku-section-title small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.kuku-sheet-head b {
  display: inline-grid;
  place-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--ink);
  font-size: 12px;
  box-shadow: 1px 2px 0 var(--ink);
  white-space: nowrap;
}

.kuku-mode-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.kuku-mode-section {
  min-width: 0;
  padding: 10px;
  border: 1.5px solid #d9e0ea;
  border-radius: 18px;
  background: #fbfcff;
}

.kuku-section-title {
  margin: 0 2px 10px;
}

.kuku-mode-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

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

.kuku-mode-button {
  display: grid;
  gap: 3px;
  place-items: center;
  min-height: 58px;
  padding: 7px 8px;
  border: 2px solid var(--ink);
  border-radius: 15px 12px 16px 13px;
  background: var(--button-bg, var(--paper));
  box-shadow: 2px 3px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.kuku-mode-button:nth-child(4n+1) { --button-bg: var(--kuku-soft); }
.kuku-mode-button:nth-child(4n+2) { --button-bg: var(--mint-soft); }
.kuku-mode-button:nth-child(4n+3) { --button-bg: var(--yellow-soft); }
.kuku-mode-button:nth-child(4n+4) { --button-bg: var(--kuku-blue-soft); }
.kuku-mode-button:hover { transform: translateY(-2px); box-shadow: 3px 5px 0 var(--ink); }
.kuku-mode-button strong {
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1;
  white-space: nowrap;
}
.kuku-mode-button small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.kuku-mode-button[data-kind="upto"] {
  min-height: 56px;
  justify-items: start;
  padding-inline: 12px;
  text-align: left;
}

.kuku-mode-button[data-kind="upto"] strong {
  font-size: clamp(16px, 1.75vw, 22px);
}

.kuku-mode-button[data-kind="upto"] small {
  font-size: 10px;
}

.kuku-home-record {
  grid-column: 2;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.kuku-home-next {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.kuku-home-next .kuku-home-record {
  grid-column: auto;
  margin: 0;
}

.kuku-next-link {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-underline-offset: 3px;
}

.kuku-topline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.kuku-status { display: grid; gap: 7px; }
.kuku-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.kuku-status-row strong {
  color: var(--kuku);
  font-size: 14px;
}

.kuku-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e7ed;
}

.kuku-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--kuku);
  transition: width .2s ease;
}

.kuku-quiet-button {
  min-height: 44px;
  padding: 8px 15px;
  border: 1.5px solid #cbd3df;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.kuku-question-stage {
  margin: clamp(18px, 4vw, 34px) auto 12px;
  text-align: center;
}

.kuku-question-stage h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .22em;
  margin: 0;
  font-size: clamp(50px, 10vw, 92px);
  line-height: 1;
  letter-spacing: 0;
}

.kuku-question-stage h1 em {
  color: var(--muted);
  font-size: .76em;
  font-style: normal;
}

.kuku-reading {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  margin: 10px 0 0;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow-soft);
  box-shadow: 2px 3px 0 var(--ink);
  font-size: clamp(19px, 4vw, 30px);
  font-weight: 900;
}

.kuku-feedback {
  min-height: 26px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 3vw, 24px);
  font-weight: 900;
}

.kuku-feedback.good { color: #16826d; }
.kuku-feedback.bad { color: #dc4f3a; }

.kuku-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(620px, 100%);
  margin: 0 auto;
}

.kuku-choice {
  min-height: 82px;
  border: 3px solid var(--ink);
  border-radius: 18px 14px 20px 15px;
  background: white;
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  cursor: pointer;
  font-size: clamp(32px, 7vw, 54px);
  font-weight: 900;
  transition: transform .1s ease, box-shadow .1s ease;
}

.kuku-choice:nth-child(4n+1) { background: var(--kuku-soft); }
.kuku-choice:nth-child(4n+2) { background: var(--mint-soft); }
.kuku-choice:nth-child(4n+3) { background: var(--yellow-soft); }
.kuku-choice:nth-child(4n+4) { background: var(--kuku-blue-soft); }
.kuku-choice:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 5px 8px 0 var(--ink); }
.kuku-choice:active:not(:disabled) { transform: translateY(2px); box-shadow: 1px 2px 0 var(--ink); }
.kuku-choice:disabled { opacity: .56; }
.kuku-choice.is-correct,
.kuku-choice.is-correct:disabled {
  border-color: #13725f;
  background: var(--mint);
  color: white;
  opacity: 1;
  box-shadow: 4px 5px 0 #13725f;
}
.kuku-choice.is-wrong,
.kuku-choice.is-wrong:disabled {
  border-color: #b83d2a;
  background: var(--coral);
  color: white;
  opacity: 1;
  box-shadow: 4px 5px 0 #b83d2a;
}

.kuku-result {
  text-align: center;
}

.kuku-result-comment {
  color: var(--muted);
  font-weight: 800;
}

.kuku-result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: min(440px, 100%);
  margin: 14px auto;
}

.kuku-result-stats div {
  padding: 12px 10px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 2px 3px 0 var(--ink);
}

.kuku-result-stats div:first-child { background: var(--mint-soft); }
.kuku-result-stats div:last-child { background: var(--kuku-soft); }
.kuku-result-stats strong {
  display: block;
  color: var(--ink);
  font-size: 38px;
  line-height: 1;
}
.kuku-result-stats small {
  color: var(--muted);
  font-weight: 900;
}

.kuku-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  width: min(720px, 100%);
  margin: 12px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.kuku-result-list li {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 36px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
}
.kuku-result-list li.needs-review { background: var(--kuku-soft); }
.kuku-result-list strong { font-size: 15px; }
.kuku-result-list small { color: var(--muted); font-weight: 900; }
.result-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--kuku-blue-soft);
  font-weight: 900;
}

.kuku-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(480px, 100%);
  margin: 16px auto 0;
}

.kuku-primary-button,
.kuku-secondary-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 4px 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
}
.kuku-primary-button { background: var(--yellow); }
.kuku-secondary-button { background: white; }

.kuku-mode-button:focus-visible,
.kuku-choice:focus-visible,
.kuku-quiet-button:focus-visible,
.kuku-primary-button:focus-visible,
.kuku-secondary-button:focus-visible {
  outline: 5px solid rgba(75, 136, 229, .32);
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .row-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kuku-mode-button[data-kind="row"] { min-height: 64px; }
  .kuku-mode-button[data-kind="row"] strong { font-size: clamp(24px, 3.6vw, 34px); }
}

@media (min-width: 981px) and (max-width: 1100px) {
  #homeScreen {
    grid-template-columns: minmax(220px, .36fr) minmax(560px, 1fr);
    gap: clamp(16px, 2vw, 24px);
  }

  .kuku-sheet { margin-top: 0; }
  .kuku-hero h1 { font-size: clamp(32px, 3.6vw, 36px); }
  .kuku-visual { width: min(210px, 100%); }
}

@media (max-width: 980px) {
  #homeScreen {
    display: block;
    max-width: 860px;
    margin-inline: auto;
  }

  .kuku-hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    align-items: end;
    gap: 20px;
  }

  .kuku-sheet { margin-top: 16px; }
  .kuku-home-record { grid-column: auto; }
  .kuku-home-next { grid-column: auto; }
}

@media (max-width: 900px) {
  .kuku-screen { padding: clamp(10px, 2.6vw, 18px); }
  .kuku-hero h1 { font-size: clamp(42px, 7.4vw, 58px); }
  .kuku-hero h1 em { white-space: nowrap; }
  .kuku-visual {
    justify-self: start;
    transform: rotate(-2deg) scale(.9);
    transform-origin: left center;
  }
}

@media (max-width: 760px) {
  .kuku-frame .notebook { padding-bottom: 8px; }
  .kuku-frame .app-header { padding-bottom: 6px; }
  .kuku-frame .brand-logo.compact { width: min(132px, 40vw); }
  .kuku-screen { padding: 6px 8px 10px; }
  #homeScreen { display: block; }
  .kuku-hero { display: block; }
  .kuku-hero .eyebrow { margin-bottom: 2px; font-size: 9px; }
  .kuku-hero h1 {
    font-size: clamp(27px, 8vw, 34px);
    line-height: 1;
  }
  .kuku-hero h1 br { display: none; }
  .kuku-copy { margin-top: 8px; font-size: 13px; line-height: 1.6; }
  .kuku-visual { display: none; }
  .kuku-sheet {
    margin-top: 8px;
    padding: 8px;
    border-radius: 18px;
    box-shadow: 2px 3px 0 var(--ink);
  }
  .kuku-sheet-head {
    align-items: center;
    margin: 0 1px 8px;
  }
  .kuku-sheet-head span { font-size: 15px; }
  .kuku-sheet-head small,
  .kuku-sheet-head b,
  .kuku-section-title small,
  .kuku-mode-button small { display: none; }
  .kuku-mode-columns { gap: 8px; }
  .kuku-mode-section {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .kuku-section-title { margin: 0 1px 5px; }
  .kuku-section-title span { font-size: 12px; }
  .row-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kuku-mode-grid { gap: 5px; }
  .kuku-mode-button {
    min-height: 42px;
    padding: 4px 5px;
    border-width: 1.5px;
    border-radius: 12px 10px 13px 11px;
    box-shadow: 1.5px 2px 0 var(--ink);
  }
  .kuku-mode-button:hover { transform: none; box-shadow: 1.5px 2px 0 var(--ink); }
  .kuku-mode-button[data-kind="row"] strong { font-size: 24px; }
  .kuku-mode-button[data-kind="upto"] {
    min-height: 42px;
    justify-items: center;
    padding-inline: 5px;
    text-align: center;
  }
  .kuku-mode-button[data-kind="upto"] strong { font-size: 15px; }
  .kuku-question-stage { margin-top: 22px; }
  .kuku-question-stage h1 { font-size: clamp(48px, 15vw, 72px); }
  .kuku-choice { min-height: 76px; }
  .kuku-home-record { grid-column: auto; margin-top: 5px; font-size: 11px; }
  .kuku-home-next { flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; }
  .kuku-home-next .kuku-home-record { margin-top: 0; }
  .kuku-next-link { font-size: 11px; }
  .kuku-result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 460px) {
  .row-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .upto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kuku-screen { padding-inline: 6px; }
  .kuku-mode-button[data-kind="upto"] strong { font-size: 14px; }
  .kuku-topline { grid-template-columns: 1fr; }
  .kuku-quiet-button { justify-self: end; min-height: 38px; }
  .kuku-choice-grid { gap: 10px; }
  .kuku-choice { min-height: 76px; }
  .kuku-result-actions { grid-template-columns: 1fr 1fr; }
  .kuku-result-list { font-size: 12px; }
}

@media (max-height: 760px) and (min-width: 761px) {
  .kuku-frame .app-header { padding-bottom: 8px; }
  .kuku-frame .brand-logo.compact { width: 150px; }
  .kuku-screen { padding: 10px 18px 12px; }
  .kuku-hero h1,
  .kuku-result h1 { font-size: clamp(34px, 5vw, 52px); }
  .kuku-visual { transform: rotate(-2deg) scale(.88); transform-origin: top left; }
  .kuku-mode-button { min-height: 46px; padding: 6px 9px; }
  .kuku-mode-button small { display: none; }
  .kuku-home-record { display: none; }
  .kuku-question-stage { margin: 14px auto 10px; }
  .kuku-question-stage h1 { font-size: clamp(48px, 8vw, 78px); }
  .kuku-choice { min-height: 72px; }
  .kuku-result-list li { min-height: 32px; padding-block: 4px; }
  .kuku-result-actions { margin-top: 12px; }
}

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