:root {
  --bg: #fdf6e3;
  --ink: #1a1a1a;
  --accent: #ff7a59;
  --accent-dark: #e85c3d;
  --good: #2e9e3a;
  --bad: #e53935;
  --tile: #fff;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Comic Sans MS', 'Andika', 'Trebuchet MS', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

.screen { width: 100%; max-width: 900px; text-align: center; }
.hidden { display: none !important; }

h1 { font-size: 2.4rem; margin: 0 0 1.2rem; }

/* Passage picker */
.passage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.passage-tile {
  background: var(--tile);
  border: none;
  border-left: 8px solid #888;
  border-radius: 14px;
  padding: 22px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  font: inherit;
  color: inherit;
}
.passage-tile.diff-easy   { border-left-color: #2e9e3a; }
.passage-tile.diff-medium { border-left-color: #ff9800; }
.passage-tile.diff-hard   { border-left-color: #e53935; }
.passage-tile .title { font-size: 1.4rem; font-weight: bold; }
.passage-tile .meta  { color: #666; margin-top: 6px; text-transform: capitalize; }

/* Reading */
.reading-title {
  color: #777;
  font-size: 1rem;
  margin-bottom: 16px;
}
.reading-line {
  font-size: 3rem;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
  margin-bottom: 16px;
}
.word { padding: 0 0.1em; transition: color 120ms, transform 120ms; }
.word-done    { color: var(--good); }
.word-current {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
.word-stuck { color: var(--bad); animation: shake 200ms ease-in-out; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%     { transform: translateX(-4px); }
  75%     { transform: translateX(4px); }
}

.partial {
  color: #999;
  font-style: italic;
  min-height: 1.5em;
  margin-bottom: 16px;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mic {
  font-size: 1.4rem;
  padding: 18px 28px;
  border-radius: 999px;
  border: 3px solid var(--accent);
  background: white;
  cursor: pointer;
  font-family: inherit;
}
.mic.on { background: var(--accent); color: white; }
.status { color: #888; font-size: 0.9rem; min-height: 1.2em; }

/* Hint overlay */
.hint-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 28px;
  z-index: 100;
}
.hint-word {
  font-size: 5rem;
  color: white;
  font-weight: bold;
  animation: pop 280ms ease-out;
}
@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
.hint-syllables {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.syl {
  background: white; color: var(--ink);
  padding: 14px 22px; border-radius: 14px;
  font-size: 2.4rem; font-weight: bold;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}
.syl.speaking { background: var(--accent); color: white; }
.hint-buttons { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hint-btn {
  font-size: 1.2rem;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}
.hint-btn.primary { background: var(--accent); color: white; }

/* End screen */
.stars     { font-size: 4.5rem; margin: 12px 0 20px; }
.end-stats { color: #666; margin-bottom: 20px; }
.big-button {
  font-size: 1.4rem;
  padding: 18px 32px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-family: inherit;
}
