:root {
  color-scheme: light;
  --ink: #1a1a1a;
  --paper: #fff8ee;
  --cream: #fff1d6;
  --sun: #ffb347;
  --sky: #c7f1ff;
  --mint: #b8f3d8;
  --coral: #ff6b6b;
  --berry: #5f45ff;
  --shadow: rgba(26, 26, 26, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Baloo 2", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, var(--sky), transparent 55%),
    radial-gradient(circle at 20% 20%, var(--mint), transparent 60%),
    linear-gradient(120deg, var(--cream), var(--paper));
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: white;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.hero h1 {
  font-family: "Bungee", "Trebuchet MS", sans-serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 12px 0 6px;
  color: #101010;
}

.hero p {
  margin: 0 auto;
  max-width: 720px;
  font-size: 18px;
}

.studio {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  max-width: 920px;
  margin: 0 auto;
}

.controls {
  display: grid;
  gap: 20px;
}

.card {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}


.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.tool-button {
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.tool-button svg {
  width: 34px;
  height: 34px;
  display: block;
}

.mic-wave {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.tool-button.tool-mic[aria-pressed="true"] .mic-wave,
.talk-button[aria-pressed="true"] .mic-wave {
  opacity: 1;
  animation: wave 1.1s infinite ease-in-out;
}

.tool-button.tool-mic[aria-pressed="true"] .mic-wave.wave2,
.tool-button.tool-mic[aria-pressed="true"] .mic-wave.wave4,
.talk-button[aria-pressed="true"] .mic-wave.wave2,
.talk-button[aria-pressed="true"] .mic-wave.wave4 {
  animation-delay: 0.14s;
}

.tool-button.tool-mic[aria-pressed="true"] .mic-wave.wave3,
.talk-button[aria-pressed="true"] .mic-wave.wave3 {
  animation-delay: 0.08s;
}

.print-spark {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.tool-button.tool-print:not(:disabled) .print-spark {
  opacity: 1;
  animation: twinkle 1.3s infinite ease-in-out;
}

.tool-button.tool-print:not(:disabled) .print-spark.spark2 {
  animation-delay: 0.18s;
}

@keyframes wave {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(0.92) rotate(-8deg);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.12) rotate(8deg);
    opacity: 1;
  }
}

.tool-button.tool-mic {
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #121212;
  box-shadow: 0 12px 20px rgba(255, 107, 107, 0.35);
}

.tool-button.tool-mic:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(255, 107, 107, 0.4);
}

.tool-button.tool-mic[aria-pressed="true"] {
  background: linear-gradient(135deg, #ff9a62, #ffd93d);
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.2);
}

.tool-button.tool-print {
  background: linear-gradient(135deg, #111, #3a3a3a);
  color: white;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.18);
}

.tool-button.tool-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.22);
}

.tool-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.section-title {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
}

.mic {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  color: #121212;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(255, 107, 107, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mic:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 24px rgba(255, 107, 107, 0.4);
}

.mic[aria-pressed="true"] {
  background: linear-gradient(135deg, #ff9a62, #ffd93d);
  box-shadow: 0 0 0 6px rgba(255, 107, 107, 0.2);
}

.mic-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #101010;
  position: relative;
}

.mic-dot::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px dashed rgba(16, 16, 16, 0.45);
  animation: pulse 1.4s infinite ease-in-out;
  opacity: 0;
}

.mic[aria-pressed="true"] .mic-dot::after {
  opacity: 1;
}

.status {
  margin: 12px 0 10px;
  font-size: 15px;
  color: #333;
  text-align: center;
}

.input-label {
  font-weight: 700;
  display: block;
  margin: 12px 0 6px;
}

textarea {
  width: 100%;
  border: 2px solid #f3d7b6;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
}

.toggle {
  margin: 14px 0 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;
}

.primary,
.secondary {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary {
  background: linear-gradient(135deg, var(--berry), #ff89c2);
  color: white;
  box-shadow: 0 12px 24px rgba(95, 69, 255, 0.3);
}

.primary:hover {
  transform: translateY(-2px);
}

.secondary {
  background: #111;
  color: white;
}

.secondary:disabled,
.primary:disabled,
.mic:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.preview {
  min-height: 540px;
}

.kid-steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.kid-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.04);
  border: 2px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  user-select: none;
}

.kid-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  background: white;
  border: 2px solid rgba(17, 17, 17, 0.12);
}

.kid-step__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kid-step__icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.kid-step__label {
  font-weight: 800;
  letter-spacing: 0.2px;
}

.image-frame {
  background: radial-gradient(circle at 12% 18%, rgba(255, 179, 71, 0.26), transparent 54%),
    radial-gradient(circle at 86% 22%, rgba(184, 243, 216, 0.34), transparent 52%),
    radial-gradient(circle at 30% 88%, rgba(255, 107, 107, 0.22), transparent 58%),
    radial-gradient(rgba(26, 26, 26, 0.045) 2px, transparent 2px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 238, 0.92));
  background-size: auto, auto, auto, 34px 34px, auto;
  background-position: center, center, center, -8px -8px, center;
  border-radius: 18px;
  border: 2px dashed #f0cfa5;
  padding: 16px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.image-frame img {
  max-width: 100%;
  max-height: 420px;
  display: none;
  border-radius: 12px;
  background: white;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.frame-screen {
  position: absolute;
  inset: 0;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.prompt-bubble {
  width: min(540px, 100%);
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid rgba(17, 17, 17, 0.09);
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
  position: relative;
}

.prompt-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 2px solid rgba(17, 17, 17, 0.09);
  border-bottom: 2px solid rgba(17, 17, 17, 0.09);
  transform: translateX(-50%) rotate(45deg);
}

.prompt-bubble__title {
  font-weight: 900;
  font-size: 18px;
}

.prompt-bubble__subtitle {
  margin-top: 6px;
  font-weight: 800;
  color: rgba(26, 26, 26, 0.72);
  font-size: 14px;
}

.prompt-bubble__examples {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: grid;
  gap: 6px;
  font-weight: 800;
  color: rgba(26, 26, 26, 0.9);
}

.talk-button {
  width: min(520px, 100%);
  border: none;
  border-radius: 24px;
  padding: 18px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #111;
  background: linear-gradient(135deg, var(--sun), var(--coral));
  box-shadow: 0 16px 28px rgba(255, 107, 107, 0.35);
  transform: translateZ(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  animation: invite 1.9s ease-in-out infinite;
}

.talk-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(255, 107, 107, 0.4);
  filter: saturate(1.05);
}

.talk-button:active {
  transform: translateY(0);
  box-shadow: 0 12px 20px rgba(255, 107, 107, 0.33);
}

.talk-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  animation: none;
}

.talk-button__icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.36);
  border: 2px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.22);
}

.talk-button__icon svg {
  width: 44px;
  height: 44px;
  display: block;
}

.talk-button__text {
  display: grid;
  gap: 4px;
  text-align: left;
}

.talk-button__title {
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.2px;
}

.talk-button__hint {
  font-weight: 800;
  font-size: 14px;
  color: rgba(17, 17, 17, 0.75);
}

.type-link {
  border: 2px solid rgba(17, 17, 17, 0.12);
  background: rgba(255, 255, 255, 0.68);
  color: #111;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  user-select: none;
}

.type-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
}

.type-link:active {
  transform: translateY(0);
}

.new-link {
  display: block;
  margin: 12px auto 0;
}

.type-panel {
  width: min(560px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 14px;
  border: 2px solid rgba(17, 17, 17, 0.09);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.08);
}

.type-panel__title {
  font-weight: 1000;
  font-size: 16px;
  margin-bottom: 8px;
}

.type-panel__input {
  min-height: 86px;
}

.type-panel__actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.type-panel__actions .primary,
.type-panel__actions .secondary {
  width: auto;
  flex: 1;
}

.type-panel__actions .secondary {
  background: rgba(17, 17, 17, 0.9);
}

.frame-screen--listening {
  background: radial-gradient(circle at 50% 30%, rgba(255, 217, 61, 0.35), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 238, 0.92));
}

.listening-pulse {
  width: 148px;
  height: 148px;
  border-radius: 44px;
  background: linear-gradient(135deg, #ff9a62, #ffd93d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 18px 34px rgba(255, 107, 107, 0.25);
}

.listening-pulse::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 52px;
  border: 4px solid rgba(255, 107, 107, 0.25);
  animation: pulseRing 1.1s infinite ease-in-out;
}

.listening-mic {
  width: 74px;
  height: 74px;
  display: block;
  color: #111;
}

.listening-title {
  font-weight: 1000;
  font-size: 28px;
  letter-spacing: 0.3px;
}

.heard-text {
  width: min(560px, 100%);
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(17, 17, 17, 0.1);
  font-weight: 800;
  color: rgba(26, 26, 26, 0.85);
}

.stop-button {
  width: min(420px, 100%);
  border: none;
  border-radius: 22px;
  padding: 16px 18px;
  font-weight: 1000;
  font-size: 20px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #ff4d4d, #ff9a62);
  box-shadow: 0 16px 28px rgba(255, 77, 77, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stop-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(255, 77, 77, 0.34);
}

.stop-button:active {
  transform: translateY(0);
  box-shadow: 0 12px 20px rgba(255, 77, 77, 0.28);
}

.frame-screen--loading {
  background: radial-gradient(circle at 50% 30%, rgba(199, 241, 255, 0.6), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 238, 0.92));
}

.loading-spinner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 8px solid rgba(17, 17, 17, 0.12);
  border-top-color: rgba(17, 17, 17, 0.85);
  animation: spin 0.9s linear infinite;
}

.loading-title {
  font-weight: 1000;
  font-size: 22px;
}

.loading-subtitle {
  font-weight: 800;
  color: rgba(26, 26, 26, 0.7);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

.action-button {
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  min-width: 180px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 1000;
  font-size: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.action-button__icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.action-button--print {
  background: linear-gradient(135deg, #111, #3a3a3a);
  color: white;
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.18);
}

.action-button--download {
  background: linear-gradient(135deg, var(--berry), #ff89c2);
  color: white;
  box-shadow: 0 14px 22px rgba(95, 69, 255, 0.22);
}

.action-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.action-button--print:hover {
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.22);
}

.action-button--download:hover {
  box-shadow: 0 18px 28px rgba(95, 69, 255, 0.26);
}

.action-button:active {
  transform: translateY(0);
}

@keyframes invite {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(0.92);
    opacity: 0.35;
  }
  60% {
    transform: scale(1.06);
    opacity: 0.14;
  }
  100% {
    transform: scale(1.14);
    opacity: 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.model {
  margin-top: 12px;
  font-size: 14px;
  color: #4a4a4a;
}

.model.warning {
  color: #8a2a00;
  font-weight: 700;
}

.note {
  margin-top: 12px;
  font-size: 14px;
  color: #4a4a4a;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.3;
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .studio {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    margin: 0;
  }

  html,
  body {
    height: auto !important;
  }

  body {
    background: white;
    min-height: 0 !important;
  }

  .hero,
  .toolbar,
  .controls,
  .model,
  .frame-screen,
  .kid-steps,
  .result-actions,
  .type-link,
  .type-panel,
  .status,
  .section-title {
    display: none !important;
  }

  .page {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .studio {
    grid-template-columns: 1fr;
  }

  .preview {
    box-shadow: none;
    padding: 0;
    min-height: auto !important;
  }

  .image-frame {
    min-height: auto;
    border: none;
    padding: 0;
    background: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .image-frame img {
    max-height: none;
    width: 100%;
    display: block;
    box-shadow: none;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
