/* sight-words.css - First Steps 50 First Sight Words (the shell lives in assets/first-steps-shell.css) */
:root {
  color-scheme: light;
  --paper: #fcfaf4; --surface: #ffffff; --ink: #1e2927; --muted: #516560;
  --forest: #1f5c51; --forest-hover: #17463d; --forest-soft: #e3f1ed;
  --gold: #b88943; --gold-deep: #8a5a12; --gold-soft: #fff6e2; --gold-glow: #ffd36b;
  --sky: #1d6fd6; --sky-soft: #e7f2ff; --berry: #c2410c; --line: #dbe2d9;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-print: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100dvh; display: flex; flex-direction: column; font-family: var(--font-sans); color: var(--ink); background: var(--paper); line-height: 1.45; overflow-x: hidden; }
a { color: var(--forest); }
button { font: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sw { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 16px 16px 40px; }
.sw h1 { font-family: var(--font-serif); color: var(--forest); font-size: clamp(1.6rem, 5vw, 2.4rem); margin: 2px 0 2px; }
.sw-lede { color: var(--muted); margin: 0 0 14px; }

/* set tabs + case toggle */
.sw-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sw-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.sw-set { min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; }
.sw-set small { font-weight: 600; color: var(--muted); margin-left: 2px; }
.sw-set[aria-selected="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.sw-set.twins[aria-selected="true"] { border-color: var(--sky); background: var(--sky-soft); color: var(--sky); }
.sw-case { display: inline-flex; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.sw-case button { min-height: 40px; min-width: 52px; border: 0; background: transparent; font-family: var(--font-print); font-size: 1.05rem; cursor: pointer; color: var(--muted); }
.sw-case button[aria-pressed="true"] { background: var(--forest-soft); color: var(--forest); font-weight: 700; }

/* buttons */
.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 8px 18px; border-radius: 999px; border: 2px solid var(--forest); background: var(--forest); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.sw-btn:hover { background: var(--forest-hover); border-color: var(--forest-hover); }
.sw-btn.ghost { background: #fff; color: var(--forest); }
.sw-btn.ghost:hover { background: var(--forest-soft); }
.sw-btn.round { width: 48px; padding: 0; background: #fff; color: var(--forest); }
.sw-btn.round:hover { background: var(--forest-soft); }
.sw-btn.round.small { width: 40px; min-height: 40px; }
.sw-btn.big { min-width: 170px; font-size: 1.05rem; }
.sw-btn.spot-btn { background: var(--gold-soft); color: var(--gold-deep); border-color: var(--gold); }
.sw-btn.spot-btn:hover { background: #ffecc2; }
.sw-set:focus-visible, .sw-case button:focus-visible, .sw-btn:focus-visible, .sw-word:focus-visible, .sw-chip:focus-visible, .sw-pill:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* story theater */
.sw-theater { background: #1c2733; border-radius: 20px; padding: 12px; margin: 0 auto 16px; max-width: 760px; }
.sw-theater-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 2px 4px 10px; }
.sw-theater h2 { color: #fff; font-size: 1.05rem; margin: 0; }
.sw-video-wrap { border-radius: 12px; overflow: hidden; background: #000; }
.sw-video-wrap video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }

/* card stage */
.sw-stage { background: var(--surface); border: 2px solid var(--line); border-radius: 22px; padding: 16px; box-shadow: 0 8px 28px rgba(31, 92, 81, .08); }
.sw-stage:focus { outline: none; }
.sw-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; min-height: 230px; }
.sw-cards.pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.sw-vs { align-self: center; color: var(--muted); font-weight: 700; }
.sw-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 14px 10px; border-radius: 18px; background: linear-gradient(180deg, var(--gold-soft), #fff 70%); min-width: 0; }
.sw-icon { font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1; }
.sw-word { font-family: var(--font-print); font-weight: 700; font-size: clamp(3.2rem, 15vw, 6rem); line-height: 1.05; color: var(--ink); background: none; border: 0; padding: 4px 18px; border-radius: 16px; cursor: pointer; letter-spacing: .01em; }
.pair .sw-word { font-size: clamp(2.4rem, 11vw, 4.6rem); }
.sw-card.saying .sw-word { background: #fff0c9; box-shadow: 0 0 0 4px var(--gold-glow); }
.sw-sentence { margin: 0; font-family: var(--font-print); font-size: clamp(1.15rem, 4.6vw, 1.7rem); line-height: 1.35; color: var(--ink); max-width: 26ch; transition: opacity .25s; }
.sw-card.waiting .sw-sentence { opacity: 0; }
.sw-target { background: linear-gradient(180deg, transparent 55%, #ffe39a 55%); color: var(--gold-deep); font-weight: 800; padding: 0 2px; border-radius: 4px; transition: background .15s, box-shadow .15s, transform .15s; display: inline-block; }
.sw-target.lit { background: var(--gold-glow); color: #5a3a06; box-shadow: 0 0 0 4px rgba(255, 211, 107, .55); transform: scale(1.08); }
.sw-done { grid-column: 1 / -1; margin: 0; text-align: center; font-weight: 700; color: var(--forest); }

.sw-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; margin: 14px 0 6px; }

/* Quick Spot */
.sw-spot { margin: 10px auto 4px; max-width: 520px; text-align: center; background: var(--gold-soft); border: 2px solid #ecd6a6; border-radius: 18px; padding: 12px; }
.sw-spot-q { margin: 0 0 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.sw-spot-pills { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sw-pill { min-width: 120px; min-height: 64px; padding: 6px 22px; border-radius: 999px; border: 3px solid var(--line); background: #fff; font-family: var(--font-print); font-weight: 700; font-size: clamp(1.8rem, 8vw, 2.4rem); color: var(--ink); cursor: pointer; }
.sw-pill.right { border-color: var(--forest); background: var(--forest-soft); color: var(--forest); }
.sw-pill.wrong { border-color: #e5b3a0; color: #9b4a2c; animation: nudge .35s; }
.sw-spot-msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 700; color: var(--forest); }
@keyframes nudge { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* word strip */
.sw-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0; margin: 12px 0 0; }
.sw-chip { min-height: 38px; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-family: var(--font-print); font-size: 1rem; color: var(--ink); cursor: pointer; }
.sw-chip.seen::after { content: " \2713"; color: var(--forest); }
.sw-chip[aria-current="step"] { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; }

/* arcade bridge + notes */
.sw-arcade { margin-top: 18px; }
.sw-arcade h2, .sw-how h2 { font-size: 1.1rem; margin: 0 0 8px; }
.sw-arcade-row { display: flex; flex-wrap: wrap; gap: 10px; }
.sw-btn.arcade { flex: 1 1 140px; font-size: 1.05rem; }
.sw-btn.arcade span { font-weight: 600; opacity: .85; }
.sw-how { margin-top: 24px; color: var(--muted); font-size: .92rem; max-width: 70ch; }
.sw-how h2 { color: var(--ink); }

@media (max-width: 560px) {
  .sw { padding: 12px 12px 32px; }
  .sw-stage { padding: 12px 8px; border-radius: 18px; }
  .sw-cards.pair { grid-template-columns: minmax(0, 1fr); }
  .sw-vs { justify-self: center; }
  .sw-set { padding: 4px 11px; min-height: 40px; font-size: .92rem; }
  .sw-btn.big { min-width: 0; flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-target, .sw-sentence { transition: none; }
  .sw-target.lit { transform: none; }
  .sw-pill.wrong { animation: none; }
}
