:root {
  --ink: #183451;
  --soft-ink: #5d7186;
  --paper: rgba(255, 255, 255, 0.94);
  --blue: #3d8fda;
  --yellow: #ffce57;
  --green: #4bbf82;
  --coral: #f46e69;
  --shadow: 0 14px 30px rgba(30, 75, 112, 0.16);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Nunito, ui-rounded, system-ui, sans-serif;
  font-weight: 700;
  background: linear-gradient(#9fdbff 0%, #edfaff 51%, #caefad 100%);
}
button,
a {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 4px solid #173b63;
  outline-offset: 4px;
}
.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.sun {
  position: absolute;
  right: 7vw;
  top: 4vh;
  font-size: clamp(3rem, 7vw, 6rem);
}
.cloud {
  position: absolute;
  font-size: clamp(2rem, 5vw, 4.3rem);
  opacity: 0.75;
  animation: drift 38s linear infinite;
}
.cloud-one {
  top: 16vh;
  left: -8vw;
}
.cloud-two {
  top: 33vh;
  left: -25vw;
  animation-delay: -16s;
  animation-duration: 52s;
}
@keyframes drift {
  to {
    transform: translateX(140vw);
  }
}
.topbar,
.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}
.topbar {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  padding-top: 13px;
}
.brand {
  min-width: 0;
}
.brand > span,
.kicker {
  color: #2375bb;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}
.brand h1 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 3.6vw, 2.5rem);
  line-height: 1.02;
}
.actions {
  display: flex;
  gap: 9px;
  align-items: center;
}
.icon-button,
.grownup-button,
.replay-button,
.back-button {
  border: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 17px;
  font-size: 1.55rem;
  text-decoration: none;
}
.grownup-button {
  min-height: 52px;
  padding: 10px 15px;
  border-radius: 16px;
  color: #275a91;
  background: #e8f4ff;
}
.page-shell {
  padding: 10px 0 20px;
}
.welcome {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.05fr);
  gap: 24px;
  align-items: center;
  min-height: calc(100svh - 112px);
}
.guide-image {
  width: 100%;
  aspect-ratio: 1;
  border: 5px solid white;
  border-radius: 32px;
  object-fit: cover;
  box-shadow: 0 20px 48px rgba(30, 75, 112, 0.2);
}
.welcome-copy h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4.8vw, 3.7rem);
  line-height: 0.98;
}
.welcome-copy > p {
  max-width: 560px;
  margin: 12px 0 18px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.35;
}
.pack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.pack-button {
  min-height: 125px;
  padding: 14px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}
.pack-button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
.pack-button:hover,
.pack-button:active {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 19px 32px rgba(30, 75, 112, 0.2);
}
.pack-button .emoji {
  display: block;
  margin-bottom: 3px;
  font-size: 2.35rem;
}
.pack-button strong {
  display: block;
  font-size: 1.2rem;
  line-height: 1.08;
}
.pack-button small {
  display: block;
  margin-top: 4px;
  color: var(--soft-ink);
  font-size: 0.92rem;
}
.play {
  padding-top: 5px;
}
.play-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.back-button {
  min-height: 48px;
  padding: 8px 13px;
  border-radius: 15px;
  color: #275a91;
}
.pack-name {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
}
.round-count {
  margin: 2px 0 0;
  color: var(--soft-ink);
  font-size: 0.9rem;
}
.replay-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff6ce;
  font-size: 1.4rem;
}
.prompt-panel {
  margin-top: 12px;
  padding: 19px 23px;
  border: 5px solid rgba(255, 255, 255, 0.8);
  border-radius: 25px;
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.prompt {
  margin: 0;
  font-size: clamp(1.5rem, 3.8vw, 2.3rem);
  line-height: 1.08;
}
.sequence {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  margin-top: 12px;
}
.sequence:empty {
  display: none;
}
.sequence-piece {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 3px solid #dbe8f4;
  border-radius: 15px;
  background: #f8fcff;
  font-size: 1.75rem;
}
.sequence-piece.color {
  border-color: rgba(20, 52, 81, 0.15);
}
.sequence-piece.size {
  font-size: 1.1rem;
}
.sequence-piece.question {
  color: #7790a7;
  background: #fff8d9;
  font-size: 1.75rem;
}
.choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.choice {
  min-height: 255px;
  padding: 12px;
  border: 5px solid rgba(255, 255, 255, 0.84);
  border-radius: 25px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
  animation: rise 300ms both ease-out;
}
.choice:hover:not(:disabled) {
  transform: translateY(-4px);
}
.choice:active:not(:disabled) {
  transform: scale(0.97);
}
.choice:disabled {
  cursor: default;
}
.choice.correct {
  border-color: var(--green);
  background: #e8fff3;
  transform: scale(1.025);
}
.choice.retry {
  border-color: var(--yellow);
  background: #fff9de;
}
.visual {
  display: grid;
  place-items: center;
  width: 100%;
  height: 190px;
  overflow: hidden;
  border-radius: 17px;
  background: linear-gradient(145deg, #e6f5ff, #fffdf1);
}
.visual.letter,
.visual.number {
  color: #2469b4;
  font-size: clamp(5.5rem, 11vw, 9rem);
  line-height: 1;
}
.visual.emoji {
  font-size: clamp(5rem, 10vw, 8rem);
}
.visual.color > span {
  display: block;
  width: min(70%, 130px);
  aspect-ratio: 1;
  border: 7px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow:
    inset 0 -10px 0 rgba(0, 0, 0, 0.08),
    0 8px 15px rgba(30, 75, 112, 0.16);
}
.visual.group {
  align-content: center;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 3px;
  padding: 16px;
  font-size: clamp(2.3rem, 4vw, 3.8rem);
  line-height: 1;
}
.visual.group span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  line-height: 1;
}
.visual.size span {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  color: white;
  background: #4d90fe;
  box-shadow: inset 0 -9px 0 rgba(0, 0, 0, 0.1);
}
.visual.size.big span {
  width: 120px;
  height: 120px;
}
.visual.size.tall span {
  width: 72px;
  height: 130px;
  border-radius: 36px;
}
.visual.size.tiny span {
  width: 42px;
  height: 42px;
}
.visual.shape span {
  display: block;
  width: 130px;
  height: 130px;
  background: #4d90fe;
  box-shadow:
    inset 0 -9px 0 rgba(0, 0, 0, 0.1),
    0 8px 15px rgba(30, 75, 112, 0.16);
}
.visual.shape.circle span {
  border-radius: 50%;
  background: #f46e69;
}
.visual.shape.square span {
  border-radius: 18px;
  background: #62bc74;
}
.visual.shape.rectangle span {
  width: 160px;
  height: 94px;
  border-radius: 18px;
  background: #ffb454;
}
.visual.shape.oval span {
  width: 160px;
  height: 104px;
  border-radius: 50%;
  background: #e58bca;
}
.visual.shape.triangle span {
  width: 0;
  height: 0;
  background: transparent;
  border-right: 72px solid transparent;
  border-bottom: 132px solid #a16de3;
  border-left: 72px solid transparent;
  box-shadow: none;
}
.choice-label {
  display: block;
  min-height: 1.3em;
  margin-top: 9px;
  text-align: center;
  color: #50667d;
  font-size: 0.98rem;
}
.choice-label:empty {
  display: none;
}
.feedback {
  min-height: 2em;
  margin: 13px 0 0;
  text-align: center;
  font-size: 1.18rem;
}
.feedback.good {
  color: #177d55;
}
.feedback.retry-copy {
  color: #9a710e;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(19, 49, 76, 0.47);
  backdrop-filter: blur(5px);
}
.overlay.active {
  display: grid;
}
.loading-card,
.finish-card,
.grownup-card {
  width: min(560px, 100%);
  padding: 30px;
  border: 5px solid white;
  border-radius: 30px;
  text-align: center;
  background: #fffdf7;
  box-shadow: 0 28px 74px rgba(22, 47, 73, 0.36);
}
.loading-card span,
.finish-card > span {
  display: block;
  font-size: 4rem;
}
.loading-card p {
  margin: 8px 0 0;
  font-size: 1.2rem;
}
.finish-card h2,
.grownup-card h2 {
  margin: 6px 0;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}
.finish-card p {
  margin: 0 0 19px;
  color: var(--soft-ink);
  font-size: 1.15rem;
}
.finish-card button {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-radius: 17px;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 800;
  font-size: 1.08rem;
}
.grownup-card {
  position: relative;
  max-height: calc(100svh - 38px);
  overflow-y: auto;
  text-align: left;
}
.grownup-card p {
  color: #50667d;
  line-height: 1.42;
}
.grownup-card code {
  color: #173b63;
  font-size: 0.86em;
}
.close-button {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #50667d;
  background: #edf4f9;
  font-size: 2rem;
  line-height: 1;
}
@media (max-width: 720px) {
  .topbar,
  .page-shell {
    width: min(100% - 20px, 640px);
  }
  .topbar {
    min-height: 65px;
    gap: 8px;
    padding-top: 8px;
  }
  .icon-button {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.3rem;
  }
  .grownup-button {
    min-height: 46px;
    padding: 8px 10px;
    border-radius: 14px;
  }
  .grownup-button span {
    display: none;
  }
  .brand > span {
    font-size: 0.65rem;
  }
  .brand h1 {
    font-size: 1.2rem;
  }
  .welcome {
    grid-template-columns: 1fr;
    gap: 13px;
    min-height: auto;
    padding: 10px 0 22px;
  }
  .guide-image {
    width: min(250px, 70vw);
    margin: auto;
    border-radius: 25px;
  }
  .welcome-copy {
    text-align: center;
  }
  .welcome-copy h2 {
    font-size: 2rem;
  }
  .welcome-copy > p {
    margin: 9px auto 14px;
    font-size: 1rem;
  }
  .pack-grid {
    gap: 9px;
  }
  .pack-button {
    min-height: 106px;
    padding: 11px;
    border-radius: 18px;
  }
  .pack-button .emoji {
    font-size: 1.9rem;
  }
  .pack-button strong {
    font-size: 1.04rem;
  }
  .pack-button small {
    font-size: 0.78rem;
  }
  .play-heading {
    gap: 8px;
  }
  .back-button {
    min-height: 43px;
    padding: 7px 10px;
    font-size: 0.86rem;
  }
  .replay-button {
    width: 47px;
    height: 47px;
  }
  .prompt-panel {
    margin-top: 9px;
    padding: 14px 12px;
    border-radius: 20px;
  }
  .prompt {
    font-size: 1.33rem;
  }
  .sequence-piece {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.35rem;
  }
  .choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 11px;
  }
  .choice {
    min-height: 172px;
    padding: 8px;
    border-radius: 18px;
  }
  .visual {
    height: 125px;
    border-radius: 12px;
  }
  .visual.letter,
  .visual.number {
    font-size: 5rem;
  }
  .visual.emoji {
    font-size: 4.3rem;
  }
  .visual.group {
    padding: 8px;
    font-size: 2rem;
  }
  .visual.size span {
    width: 62px;
    height: 62px;
  }
  .visual.size.big span {
    width: 89px;
    height: 89px;
  }
  .visual.size.tall span {
    width: 55px;
    height: 100px;
  }
  .visual.shape span {
    width: 86px;
    height: 86px;
  }
  .visual.shape.rectangle span {
    width: 104px;
    height: 62px;
  }
  .visual.shape.oval span {
    width: 104px;
    height: 68px;
  }
  .visual.shape.triangle span {
    width: 0;
    height: 0;
    border-right-width: 50px;
    border-bottom-width: 91px;
    border-left-width: 50px;
  }
  .choice-label {
    margin-top: 5px;
    font-size: 0.8rem;
  }
  .feedback {
    margin-top: 8px;
    font-size: 1rem;
  }
  .grownup-card,
  .loading-card,
  .finish-card {
    padding: 25px 20px;
    border-radius: 25px;
  }
}
@media (min-width: 721px) and (max-width: 1366px) and (orientation: landscape) {
  html,
  body {
    height: 100dvh;
    overflow: hidden;
  }
  .topbar {
    min-height: 68px;
    padding-top: 7px;
  }
  .icon-button {
    width: 48px;
    height: 48px;
  }
  .grownup-button {
    min-height: 46px;
  }
  .welcome {
    grid-template-columns: 270px 1fr;
    gap: 18px;
    min-height: calc(100dvh - 80px);
  }
  .guide-image {
    border-radius: 25px;
  }
  .welcome-copy h2 {
    font-size: 2.65rem;
  }
  .welcome-copy > p {
    margin: 8px 0 11px;
    font-size: 1.05rem;
  }
  .pack-grid {
    gap: 9px;
  }
  .pack-button {
    min-height: 94px;
    padding: 10px;
    border-radius: 17px;
  }
  .pack-button .emoji {
    float: left;
    margin: 0 8px 0 0;
    font-size: 1.7rem;
  }
  .pack-button strong {
    padding-top: 2px;
    font-size: 1rem;
  }
  .pack-button small {
    font-size: 0.78rem;
  }
  .play-heading {
    height: 52px;
  }
  .prompt-panel {
    margin-top: 8px;
    padding: 12px;
  }
  .prompt {
    font-size: 1.6rem;
  }
  .choices {
    gap: 11px;
    margin-top: 11px;
  }
  .choice {
    min-height: 0;
    padding: 8px;
    border-radius: 19px;
  }
  .visual {
    height: min(28dvh, 172px);
  }
  .visual.group {
    padding: 10px;
    font-size: clamp(2rem, 3.5vw, 2.8rem);
  }
  .choice-label {
    margin-top: 5px;
  }
  .feedback {
    margin-top: 7px;
  }
}
