/* Silly Story Lab — Solo Mode styles
   Bright, big, and friendly for elementary-age players. */

:root {
  --pink:   #ff5d8f;
  --purple: #8a5cff;
  --blue:   #2bb3ff;
  --green:  #3ddc84;
  --yellow: #ffd23f;
  --ink:    #2a2540;
  --paper:  #fffdf7;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Comic Sans MS", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #fef3ff 0%, #e8f6ff 50%, #eafff3 100%);
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--yellow);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 10;
}

/* ---------- header / footer ---------- */
.topbar {
  text-align: center;
  padding: 28px 16px 10px;
}
.logo {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 0;
  color: var(--purple);
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(138, 92, 255, 0.25);
}
.tagline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin: 6px 0 0;
  color: var(--ink);
}
.footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: #6a6480;
  font-size: 0.95rem;
}

/* ---------- screens ---------- */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 18px;
}
.screen { display: none; }
.screen.is-active { display: block; animation: pop 0.3s ease; }

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

h2 {
  text-align: center;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--ink);
}

/* ---------- story picker ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.story-card {
  border: none;
  border-radius: 22px;
  padding: 20px 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-family: inherit;
}
.story-card:hover,
.story-card:focus-visible {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.12);
  outline: 3px dashed var(--purple);
}
.story-card .emoji { font-size: 3rem; display: block; }
.story-card .name  { font-size: 1.15rem; font-weight: bold; margin-top: 8px; display: block; }
.story-card .band  {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  background: var(--yellow);
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- play screen ---------- */
.play-head { text-align: center; }
.progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 18px;
  flex-wrap: wrap;
}
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d9d4ec;
}
.dot.done    { background: var(--green); }
.dot.current { background: var(--pink); transform: scale(1.25); }

#word-form {
  background: var(--paper);
  border-radius: 24px;
  padding: 26px 22px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.formal-tag {
  font-size: 0.85rem;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 4px;
  min-height: 1em;
}
.prompt-label {
  display: block;
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  font-weight: bold;
  margin: 0 0 6px;
}
.examples {
  color: #6a6480;
  font-style: italic;
  margin: 0 0 18px;
}
#word-input {
  width: 100%;
  max-width: 420px;
  font-size: 1.4rem;
  font-family: inherit;
  padding: 14px 16px;
  border: 3px solid var(--blue);
  border-radius: 16px;
  text-align: center;
  outline: none;
}
#word-input:focus { border-color: var(--pink); }

.feedback {
  min-height: 1.4em;
  margin: 12px 0 0;
  font-weight: bold;
  color: var(--pink);
}
.feedback.ok { color: var(--green); }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: bold;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.08s ease;
  margin: 6px;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18); }
.btn-go    { background: var(--green); }
.btn-read  { background: var(--blue); }
.btn-stop  { background: var(--pink); }
.btn-again { background: var(--purple); }
.btn-new   { background: var(--ink); }

.play-buttons, .reveal-buttons {
  text-align: center;
  margin-top: 18px;
}

/* ---------- reveal ---------- */
.story-output {
  background: var(--paper);
  border-radius: 24px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  line-height: 1.7;
  white-space: pre-wrap;
}
.story-output .fill {
  background: var(--yellow);
  border-radius: 8px;
  padding: 1px 7px;
  font-weight: bold;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.story-output .fill.spoken { outline: 3px solid var(--pink); }

@media (prefers-reduced-motion: reduce) {
  .screen.is-active { animation: none; }
  .btn:active { transform: none; }
}
