/* myWordPath.
   Built for people relearning language after a stroke or brain injury, so the
   whole stylesheet leans one way: large type, generous spacing, high contrast,
   big targets, and one thing to look at per screen. Nothing here should ever
   need reading twice. */

:root {
  --accent: #4f46e5;
  --accent-dark: #4338ca;
  --accent-soft: #eef2ff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --ink: #1a1a2e;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-2: #f7f7fb;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(26, 26, 46, .06);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 18px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

/* Focus must always be obvious — several people using this navigate by keyboard. */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: #fff;
  padding: 12px 18px; border-radius: 8px; }

.wrap { width: min(1120px, 92vw); margin: 0 auto; }
.wrap.narrow { width: min(760px, 92vw); }
.small { font-size: 15px; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.center { text-align: center; }

/* ---------- header ---------- */
.site-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: #fff;
}
.brand { font-weight: 800; font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav a, .linkish {
  padding: 10px 14px; border-radius: 10px; text-decoration: none; color: var(--ink-2);
  font-weight: 600; font-size: 16.5px; background: none; border: 0; cursor: pointer;
}
.site-nav a:hover, .linkish:hover { background: var(--bg-2); color: var(--ink); }
.site-nav a.on { background: var(--accent-soft); color: var(--accent-dark); }
.site-nav form { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 30px; border-radius: 12px;
  background: var(--accent); color: #fff; border: 2px solid var(--accent);
  font-weight: 700; font-size: 19px; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: #fff; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.quiet { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.quiet:hover { background: var(--bg-2); color: var(--ink); }
.btn.big { min-height: 68px; font-size: 22px; padding: 16px 40px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- landing ---------- */
.hero { padding: clamp(52px, 8vw, 92px) 0 clamp(44px, 6vw, 72px); background: var(--bg-2); }
.hero h1 { font-size: clamp(32px, 5.4vw, 52px); line-height: 1.15; letter-spacing: -.02em; max-width: 17ch; }
.hero p.lede { font-size: clamp(19px, 2.3vw, 23px); color: var(--ink-2); margin-top: 20px; max-width: 54ch; }
.hero .btn-row { margin-top: 32px; }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
  padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: 15px; margin-bottom: 20px; }

.band { padding: clamp(48px, 7vw, 78px) 0; }
.band h2 { font-size: clamp(25px, 3.4vw, 34px); margin-bottom: 14px; }
.band > .wrap > p.lede { font-size: 19px; color: var(--ink-2); max-width: 60ch; margin-bottom: 34px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow);
}
.card h3 { font-size: 20px; margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 17px; }
.step-n { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; margin-bottom: 14px; }

/* ---------- forms ---------- */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(26px, 4vw, 40px); box-shadow: var(--shadow);
}
.form-page { padding: clamp(34px, 6vw, 64px) 0; background: var(--bg-2); flex: 1; }
.field { display: grid; gap: 8px; margin-bottom: 22px; }
.field label { font-weight: 700; font-size: 17px; }
.field .help { font-size: 15.5px; color: var(--ink-3); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 56px; padding: 14px 16px; font-size: 18px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }
.notice { padding: 16px 20px; border-radius: 12px; font-size: 17.5px; margin-bottom: 24px; }
.notice.good { background: var(--good-soft); color: var(--good); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice ul { margin: 6px 0 0 20px; }
.hp { position: absolute; left: -9999px; }

/* ---------- practice setup ---------- */
.setup { padding: clamp(30px, 5vw, 56px) 0; flex: 1; background: var(--bg-2); }
.setup h1 { font-size: clamp(28px, 4.2vw, 38px); margin-bottom: 8px; }
.setup .lede { font-size: 19px; color: var(--ink-2); margin-bottom: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: block; padding: 14px 22px; border: 2px solid var(--line); border-radius: 999px;
  background: #fff; font-weight: 700; font-size: 17px; cursor: pointer; min-height: 54px;
  display: flex; align-items: center; gap: 8px;
}
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 3px; }
.chip .n { color: var(--ink-3); font-weight: 600; font-size: 15px; }
.chip input:checked + span .n { color: var(--accent-dark); }
fieldset { border: 0; padding: 0; margin: 0 0 32px; }
legend { font-weight: 800; font-size: 20px; margin-bottom: 14px; padding: 0; }

/* ---------- the practice screen ---------- */
.play { flex: 1; display: flex; flex-direction: column; background: var(--bg-2); }
.play-bar { display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 40px);
  background: #fff; border-bottom: 1px solid var(--line); }
.meter { flex: 1; height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px;
  transition: width .35s ease; }
.play-count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.play-stage { width: min(760px, 92vw); margin: 0 auto; padding: clamp(20px, 4vw, 38px) 0 60px;
  display: flex; flex-direction: column; gap: 22px; flex: 1; }
.shot { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); display: grid; place-items: center; min-height: 300px; }
.shot img { width: 100%; height: clamp(280px, 42vh, 460px); object-fit: contain; padding: 14px; }
.ask { font-size: clamp(22px, 3vw, 28px); font-weight: 700; text-align: center; }
.answer-row { display: flex; gap: 12px; flex-wrap: wrap; }
.answer-row input {
  flex: 1; min-width: 220px; min-height: 68px; padding: 16px 20px; font-size: 23px;
  border: 2px solid var(--line); border-radius: 14px; text-align: center; font-weight: 700;
}
.answer-row input:focus { border-color: var(--accent); outline: none; }
.mic { min-width: 68px; min-height: 68px; border-radius: 14px; border: 2px solid var(--accent);
  background: #fff; color: var(--accent-dark); cursor: pointer; display: grid; place-items: center; }
.mic:hover { background: var(--accent-soft); }
.mic.live { background: var(--bad); border-color: var(--bad); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(185, 28, 28, .55); }
  70%  { box-shadow: 0 0 0 14px rgba(185, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}
.helpers { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.helper { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 12px 22px;
  font-weight: 700; font-size: 16.5px; cursor: pointer; min-height: 52px; color: var(--ink-2); }
.helper:hover { border-color: var(--accent); color: var(--accent-dark); }
.hint-out { background: var(--accent-soft); color: var(--accent-dark); border-radius: 12px;
  padding: 16px 20px; font-size: 19px; text-align: center; font-weight: 600; }
.hint-out[hidden] { display: none; }

/* Feedback is the most important moment on the screen: unmissable, and never
   scolding — a wrong answer says what the word was and moves on. */
.verdict { border-radius: 16px; padding: 26px; text-align: center; }
.verdict[hidden] { display: none; }
.verdict.right { background: var(--good-soft); color: var(--good); }
.verdict.wrong { background: var(--bad-soft); color: var(--bad); }
.verdict .mark { font-size: 46px; line-height: 1; }
.verdict .said { font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin: 8px 0 4px; }
.verdict .note { font-size: 18px; opacity: .9; }
.verdict .btn { margin-top: 20px; }
.badge-up { display: inline-block; background: #fff; border-radius: 999px; padding: 6px 16px;
  font-size: 15.5px; font-weight: 700; margin-top: 12px; }

/* ---------- progress ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 34px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stat .k { font-size: 15.5px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.bar { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 999px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 17px; }
table.plain th { text-align: left; font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-3); padding: 12px; border-bottom: 2px solid var(--line); }
table.plain td { padding: 14px 12px; border-bottom: 1px solid var(--line); }
.tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 14.5px; font-weight: 700; }
.tag.done { background: var(--good-soft); color: var(--good); }
.tag.part { background: #fef3c7; color: #92400e; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.thumb { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; }
.thumb img { height: 110px; width: 100%; object-fit: contain; padding: 8px; }
.thumb b { display: block; padding: 8px; font-size: 16px; }

/* ---------- footer ---------- */
.site-foot { padding: 34px 0 44px; border-top: 1px solid var(--line); text-align: center;
  color: var(--ink-2); margin-top: auto; background: #fff; }
.site-foot p { padding: 0 20px; }

@media (max-width: 620px) {
  body { font-size: 17px; }
  .site-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { width: 100%; }
  .answer-row input { min-width: 100%; }
  .mic { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- admin ----------
   Same visual language as the rest of the app, a little denser: this is the
   one part used by someone who is not mid-recovery. */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { font-size: clamp(26px, 4vw, 34px); }
.sub { font-size: 21px; margin: 30px 0 14px; }
.filter-bar { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 24px; }
.nowrap { white-space: nowrap; }

.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.word-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: border-color .15s; }
.word-card:hover { border-color: var(--accent); }
.word-card.broken { border-color: var(--bad); }
.word-pic { position: relative; height: 150px; background: var(--bg-2); display: grid; place-items: center; }
.word-pic img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.word-body { padding: 12px 14px 14px; display: grid; gap: 3px; }
.word-body b { font-size: 18px; }
.flag { position: absolute; top: 8px; right: 8px; font-size: 12.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.flag.ext { background: #fef3c7; color: #92400e; }
.pic-missing { display: grid; place-items: center; width: 100%; height: 100%;
  color: var(--ink-3); font-size: 15px; font-weight: 700;
  background: repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 10px, #e9eaee 10px, #e9eaee 20px); }
.pic-missing.tall { height: 220px; border-radius: 12px; }

.pic-edit { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; margin-bottom: 10px; }
.pic-now img { width: 100%; height: 220px; object-fit: contain; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.field input[type=file] { padding: 12px; background: var(--bg-2); }

.pager { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.pager a { min-width: 48px; min-height: 48px; display: grid; place-items: center; border-radius: 10px;
  border: 2px solid var(--line); background: #fff; text-decoration: none; font-weight: 700; }
.pager a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.cat-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.cat-list li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cat-list form { margin: 0; }
.cat-row { display: flex; gap: 12px; align-items: center; flex: 1; flex-wrap: wrap; }
.cat-row input { min-height: 48px; padding: 10px 14px; font-size: 17px; border: 2px solid var(--line);
  border-radius: 10px; flex: 1; min-width: 180px; }

.plain-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.plain-list.two-col { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #991b1b; border-color: #991b1b; }
.btn.danger.quiet { background: #fff; color: var(--bad); border-color: var(--line); }
.btn.danger.quiet:hover { background: var(--bad-soft); border-color: var(--bad); }
.danger-zone { border-color: rgba(185, 28, 28, .35); }

@media (max-width: 700px) { .pic-edit { grid-template-columns: 1fr; } }

/* ---------- caretaker ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.person { display: grid; gap: 6px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: border-color .15s; }
.person:hover { border-color: var(--accent); }
.person-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.person-top b { font-size: 20px; }
.person-nums { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15.5px; color: var(--ink-2); margin-top: 6px; }
.person-nums b { color: var(--ink); }
.person .bar { margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.word-edit { border-top: 1px solid var(--line); }
.word-edit summary { cursor: pointer; padding: 12px 14px; font-weight: 700; font-size: 15.5px;
  color: var(--ink-2); list-style: none; }
.word-edit summary::-webkit-details-marker { display: none; }
.word-edit summary:hover { color: var(--accent-dark); }
.word-edit form { padding: 0 14px 14px; }
.word-edit .field { margin-bottom: 12px; }
.word-edit .field input { min-height: 46px; font-size: 16px; padding: 10px 12px; }
