:root {
  --paper: #fffaf0;
  --ink: #2b2b2b;
  --done: #2e8b3a;
  --now-bg: #fff1a8;
  --now-line: #e8b800;
  --help-bg: #ffd9c7;
  --help-line: #ff7a3d;
  --start: #ff9f1c;
  --start-shadow: #c76f00;
  --bubble: #eaf4ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Andika', 'Comic Sans MS', sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.screen[hidden] { display: none !important; }

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
}

/* Start screen: one big button. */
.home { justify-content: center; gap: 24px; }
.cover { width: min(90vw, 560px); max-height: 45dvh; object-fit: contain; }
.start {
  width: min(56vw, 220px);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: var(--start);
  color: #fff;
  font: 700 clamp(32px, 9vw, 52px) 'Andika', sans-serif;
  box-shadow: 0 8px 0 var(--start-shadow);
  animation: breathe 2.4s ease-in-out infinite;
}
.start:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--start-shadow); }
.home-note { margin: 0; font-size: 18px; color: #666; text-align: center; }

@keyframes breathe { 50% { transform: scale(1.05); } }

/* Reading screen. */
.reader { gap: 12px; position: relative; }
.exit {
  position: absolute; top: 10px; left: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #0000000f; color: #888; font-size: 18px;
}
.stars { min-height: 28px; font-size: 22px; letter-spacing: 2px; }
.picture {
  width: min(100%, 720px);
  aspect-ratio: 3 / 2;
  max-height: 48dvh;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 4px 14px #0002;
  background: #e8f1e4;
}
.sentence {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  margin: 8px 0;
  max-width: 720px;
  font-size: clamp(32px, 10vw, 56px);
  line-height: 1.45;
}
.word {
  display: inline-block;
  margin: 0 0.12em;
  padding: 0 0.12em;
  border-radius: 10px;
  transition: background-color 0.2s, color 0.2s;
}
.word.done { color: var(--done); }
.word.now { background: var(--now-bg); box-shadow: 0 0 0 3px var(--now-line); }
.word.help { background: var(--help-bg); box-shadow: 0 0 0 3px var(--help-line); animation: wiggle 0.4s; }

@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

.helper {
  margin-top: auto;
  width: min(100%, 720px);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bubble);
  border-radius: 18px;
  padding: 10px 14px;
}
.owl { font-size: 40px; }
.bubble { flex: 1; margin: 0; font-size: 18px; min-height: 1.4em; }
.ear { font-size: 26px; opacity: 0.2; transition: opacity 0.2s; }
.ear.on { opacity: 1; animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse { 50% { transform: scale(1.2); } }

/* Phones on their side: picture left, words right. */
@media (orientation: landscape) and (max-height: 500px) {
  .reader { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; align-items: center; }
  .stars { grid-column: 1 / -1; }
  .picture { max-height: 60dvh; }
  .sentence { font-size: clamp(26px, 5vw, 40px); }
  .helper { grid-column: 1 / -1; }
}
