.demo-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 176, 111, 0.14), transparent 24rem),
    radial-gradient(circle at 88% 24%, rgba(15, 154, 184, 0.12), transparent 27rem),
    linear-gradient(180deg, #fbfeff 0%, #eef9fc 100%);
}

.demo-hero {
  padding: clamp(42px, 7vw, 76px) 0 clamp(54px, 8vw, 88px);
}

.demo-heading {
  max-width: 780px;
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 46px);
}

.demo-heading h1 {
  margin-bottom: 12px;
  color: #12384a;
}

.demo-lead {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.02rem, 2vw, 1.2rem);
}

.demo-quick-facts {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 18px 0 0;
  color: #0b6980;
  font-size: 0.92rem;
  font-weight: 800;
}

.demo-quick-facts span {
  color: var(--accent);
}

.rhyme-demo {
  position: relative;
  width: min(780px, 100%);
  min-height: 610px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(15, 154, 184, 0.18);
  border-radius: clamp(24px, 4vw, 34px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 70px rgba(25, 83, 103, 0.15);
}

.rhyme-demo [hidden] {
  display: none !important;
}

.rhyme-demo::before,
.rhyme-demo::after {
  position: absolute;
  z-index: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.rhyme-demo::before {
  top: -105px;
  right: -65px;
  background: rgba(255, 176, 111, 0.18);
}

.rhyme-demo::after {
  bottom: -125px;
  left: -75px;
  background: rgba(15, 154, 184, 0.1);
}

.demo-start,
.demo-game,
.demo-complete {
  position: relative;
  z-index: 1;
  min-height: 610px;
  padding: clamp(28px, 6vw, 58px);
}

.demo-start {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(30px, 6vw, 64px);
  align-items: center;
}

.start-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-picture {
  display: grid;
  width: clamp(150px, 23vw, 220px);
  aspect-ratio: 1;
  place-items: center;
  padding: 16px;
  border: 1px solid #d8ebf1;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(22, 74, 91, 0.12);
}

.start-picture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.start-picture--left {
  z-index: 2;
  transform: rotate(-6deg) translateX(18px);
}

.start-picture--right {
  z-index: 1;
  transform: rotate(7deg) translateX(-18px);
}

.start-link {
  z-index: 3;
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 5px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 154, 184, 0.3);
}

.demo-kicker {
  margin: 0 0 10px;
  color: #0b6980;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.start-copy h2,
.demo-complete h2 {
  margin-bottom: 12px;
  color: #12384a;
}

.start-copy {
  min-width: 0;
}

.start-copy > p:not(.demo-kicker, .sound-note) {
  margin: 0;
  color: var(--muted);
}

.demo-primary-button,
.demo-next-button,
.demo-app-button,
.demo-restart-button {
  min-height: 54px;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.demo-primary-button,
.demo-next-button,
.demo-app-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 13px 28px rgba(15, 154, 184, 0.27);
  text-decoration: none;
}

.demo-primary-button {
  width: 100%;
  margin-top: 24px;
  padding: 13px 20px;
}

.demo-primary-button:hover,
.demo-next-button:hover,
.demo-app-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.sound-note {
  margin: 12px 0 0;
  color: #647985;
  font-size: 0.86rem;
  text-align: center;
}

.demo-game {
  display: flex;
  flex-direction: column;
}

.game-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-progress-row .demo-kicker,
.game-progress-text {
  margin: 0;
}

.game-progress-text {
  color: #315664;
  font-weight: 800;
}

.game-progress-track {
  height: 11px;
  margin: 12px 0 clamp(28px, 5vw, 42px);
  overflow: hidden;
  border-radius: 999px;
  background: #e4f0f4;
}

.game-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f9ab8, #49bfd1);
  transition: width 0.35s ease;
}

.game-question {
  display: grid;
  justify-items: center;
}

.game-instruction,
.answer-label {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.game-question-text {
  margin: 4px 0 18px;
  color: #12384a;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  text-align: center;
}

.prompt-card {
  position: relative;
  display: grid;
  width: clamp(210px, 34vw, 270px);
  aspect-ratio: 1;
  place-items: center;
  padding: 22px 22px 54px;
  overflow: hidden;
  border: 2px solid #bde0e9;
  border-radius: 26px;
  background: linear-gradient(180deg, #fbfeff, #eef9fc);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 15px 34px rgba(18, 83, 104, 0.11);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.prompt-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.prompt-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prompt-word {
  position: absolute;
  bottom: 18px;
  left: 20px;
  font-size: 1.05rem;
  font-weight: 800;
}

.listen-label {
  position: absolute;
  right: 18px;
  bottom: 19px;
  color: #0b6980;
  font-size: 0.8rem;
  font-weight: 750;
}

.answer-area {
  margin-top: 30px;
}

.answer-label {
  margin-bottom: 12px;
  text-align: center;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 190px));
  justify-content: center;
  gap: clamp(14px, 3vw, 22px);
}

.answer-button {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  padding: 14px 14px 42px;
  overflow: hidden;
  border: 2px solid #d6e8ee;
  border-radius: 22px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(23, 70, 87, 0.08);
  transition: transform 0.17s ease, border-color 0.17s ease, background-color 0.17s ease;
}

.answer-button:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-3px);
}

.answer-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.answer-word {
  position: absolute;
  bottom: 12px;
  font-weight: 800;
}

.answer-button.is-correct {
  border-color: #45a96e;
  background: #edf9f1;
  box-shadow: 0 0 0 4px rgba(69, 169, 110, 0.13);
}

.answer-button.is-correct::after {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #45a96e;
  color: #fff;
  content: "✓";
  font-weight: 900;
}

.answer-button.is-wrong {
  border-color: #e67c72;
  background: #fff4f2;
  animation: demo-shake 0.34s ease;
}

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

.answer-button:disabled:not(.is-correct, .is-wrong) {
  opacity: 0.72;
}

.game-feedback {
  min-height: 30px;
  margin: 18px 0 0;
  color: #315664;
  font-weight: 800;
  text-align: center;
}

.game-feedback.is-success {
  color: #2e8652;
}

.game-feedback.is-hint {
  color: #a25047;
}

.demo-next-button {
  width: min(100%, 410px);
  margin: 12px auto 0;
  padding: 12px 20px;
}

.demo-complete {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.complete-badge {
  display: grid;
  width: 90px;
  height: 90px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 50%;
  background: #e9f8ef;
  color: #31905a;
  font-size: 2.8rem;
  font-weight: 900;
  box-shadow: 0 0 0 12px rgba(69, 169, 110, 0.1);
}

.complete-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.completed-pairs {
  display: grid;
  width: min(100%, 780px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin: 25px 0 30px;
  padding: 0;
  list-style: none;
}

.completed-pairs li {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid #cfe8ef;
  border-radius: 16px;
  background: #f3fbfd;
  color: #24566a;
  font-weight: 750;
}

.completed-pairs .rhyme-example-word {
  gap: 4px;
}

.completed-pairs .rhyme-example-word img {
  width: clamp(42px, 4.5vw, 58px);
}

.completed-pairs .rhyme-example-word > span {
  font-size: clamp(0.68rem, 1.2vw, 0.8rem);
}

.complete-actions {
  display: grid;
  width: min(100%, 430px);
  gap: 11px;
}

.demo-app-button,
.demo-restart-button {
  width: 100%;
  padding: 12px 20px;
}

.demo-restart-button {
  border: 2px solid #c8e4ec;
  background: #fff;
  color: #15586b;
}

.demo-restart-button:hover {
  border-color: var(--primary);
  background: #f4fbfd;
  transform: translateY(-1px);
}

.demo-content {
  width: min(860px, 100%);
  margin: clamp(44px, 8vw, 78px) auto 0;
}

.demo-content-section {
  padding: clamp(28px, 5vw, 44px) 0;
  border-top: 1px solid #d5e9ef;
}

.demo-content-section h2,
.demo-app-cta h2 {
  margin-bottom: 14px;
  color: #12384a;
}

.demo-content-section p,
.demo-app-cta > p:not(.demo-kicker, .demo-app-note) {
  margin: 0;
  color: #496572;
  font-size: 1.02rem;
}

.demo-content-section p + p {
  margin-top: 14px;
}

.rhyme-examples {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.rhyme-examples li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 152px;
  padding: 14px 8px;
  border: 1px solid #d4e9ef;
  border-radius: 18px;
  background: #fff;
  color: #174b5d;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(22, 74, 91, 0.06);
}

.rhyme-example-word {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.rhyme-example-word img {
  width: clamp(54px, 5.5vw, 72px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.rhyme-example-word > span {
  max-width: 100%;
  font-size: clamp(0.78rem, 1.4vw, 0.94rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rhyme-example-divider {
  color: var(--primary);
  line-height: 1;
}

.demo-app-cta {
  margin: clamp(28px, 5vw, 44px) 0;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid #c7e5ed;
  border-radius: 26px;
  background:
    radial-gradient(circle at 95% 12%, rgba(255, 176, 111, 0.23), transparent 10rem),
    linear-gradient(145deg, #f1fbfd 0%, #ffffff 100%);
  box-shadow: 0 16px 38px rgba(20, 86, 106, 0.09);
}

.demo-app-cta .demo-app-button {
  width: fit-content;
  margin-top: 24px;
}

.demo-app-note {
  margin: 13px 0 0;
  color: #627983;
  font-size: 0.88rem;
}

.demo-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.demo-link-grid a {
  display: grid;
  gap: 6px;
  min-height: 126px;
  align-content: center;
  padding: 20px;
  border: 1px solid #d4e9ef;
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(22, 74, 91, 0.06);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.demo-link-grid a:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 13px 28px rgba(22, 74, 91, 0.1);
}

.demo-link-grid strong {
  color: #15586b;
  font-size: 1.02rem;
}

.demo-link-grid span {
  color: var(--muted);
  font-size: 0.91rem;
}

.demo-page button:focus-visible,
.demo-page a:focus-visible {
  outline: 4px solid var(--ring);
  outline-offset: 4px;
}

@keyframes demo-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-7px); }
  65% { transform: translateX(7px); }
}

@media (max-width: 700px) {
  .rhyme-demo,
  .demo-start,
  .demo-game,
  .demo-complete {
    min-height: 0;
  }

  .demo-start {
    grid-template-columns: 1fr;
  }

  .start-visual {
    padding: 8px 24px 0;
  }

  .start-picture {
    width: min(46vw, 190px);
  }

  .start-copy {
    text-align: center;
  }

  .demo-game {
    padding-inline: clamp(18px, 5vw, 30px);
  }

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

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

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

@media (max-width: 430px) {
  .demo-hero {
    padding-top: 32px;
  }

  .demo-heading {
    margin-bottom: 16px;
  }

  .demo-start,
  .demo-game,
  .demo-complete {
    padding: 16px 16px 22px;
  }

  .demo-start {
    gap: 10px;
  }

  .start-visual {
    padding-top: 0;
  }

  .start-picture {
    width: min(22vw, 92px);
    padding: 7px;
    border-radius: 18px;
  }

  .start-link {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border-width: 3px;
    font-size: 1rem;
  }

  .prompt-card {
    width: min(64vw, 240px);
  }

  .answer-button {
    min-height: 142px;
    aspect-ratio: auto;
    border-radius: 18px;
  }

  .listen-label {
    font-size: 0.74rem;
  }

  .demo-quick-facts {
    flex-wrap: wrap;
  }

  .rhyme-examples,
  .completed-pairs,
  .demo-link-grid {
    grid-template-columns: 1fr;
  }

  .rhyme-examples li {
    min-height: 124px;
    padding-inline: 18px;
  }

  .rhyme-example-word img {
    width: 72px;
  }

  .completed-pairs .rhyme-example-word img {
    width: 56px;
  }

  .demo-app-cta .demo-app-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-progress-fill,
  .prompt-card,
  .answer-button,
  .demo-primary-button,
  .demo-next-button,
  .demo-app-button,
  .demo-restart-button {
    transition: none;
  }

  .answer-button.is-wrong {
    animation: none;
  }
}
