:root {
  --bg: #14200f;
  --panel: #1d2c17;
  --panel-2: #25371d;
  --line: #34492a;
  --green: #5c8a3a;
  --green-bright: #7ab04e;
  --gold: #c9a84c;
  --text: #eef2ea;
  --muted: #a6b59c;
  --warn: #e0a83a;
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

/* ---- top bar ---- */
.topbar {
  background: linear-gradient(160deg, #243a1a, #14200f);
  border-bottom: 1px solid var(--line);
  padding: max(env(safe-area-inset-top), 14px) 16px 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner { max-width: 760px; margin: 0 auto; }
.topbar h1 { margin: 0; font-size: 1.25rem; letter-spacing: .3px; }
.topbar h1::before { content: "🥖 "; }
.subtitle { margin: 2px 0 0; color: var(--muted); font-size: .82rem; }

/* ---- tab nav ---- */
.tabnav {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 12px; max-width: 760px; margin: 0 auto;
  scrollbar-width: none;
}
.tabnav::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); padding: 8px 14px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.tab-btn.active { background: var(--green); color: #fff; border-color: var(--green-bright); }

/* ---- content ---- */
main { max-width: 760px; margin: 0 auto; padding: 8px 14px 40px; }
.section-blurb {
  color: var(--muted); font-size: .9rem; margin: 4px 2px 16px;
  border-left: 3px solid var(--gold); padding: 6px 0 6px 12px;
}

/* ---- question cards ---- */
.qcard {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.qcard.done { border-color: var(--green); }
.qhead {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px; cursor: pointer; user-select: none;
}
.qhead:hover { background: var(--panel-2); }
.q-check {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--line); border-radius: 6px;
  display: grid; place-items: center; font-size: 13px; color: transparent;
}
.qcard.done .q-check { background: var(--green); border-color: var(--green); color: #fff; }
.q-text { flex: 1; font-weight: 600; font-size: .98rem; }
.q-caret { flex: 0 0 auto; color: var(--muted); transition: transform .2s; margin-top: 2px; }
.qcard.open .q-caret { transform: rotate(90deg); }

.qbody { display: none; padding: 0 16px 16px; }
.qcard.open .qbody { display: block; }
.answer-label { color: var(--green-bright); font-size: .72rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin: 8px 0 4px; }
.answer { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; font-size: .94rem; white-space: pre-wrap; }
.coach-note {
  margin-top: 10px; font-size: .85rem; color: var(--gold);
  background: rgba(201,168,76,.08); border: 1px solid rgba(201,168,76,.25);
  border-radius: 10px; padding: 8px 12px;
}
.coach-note::before { content: "💡 "; }
.story-chip {
  display: inline-block; margin-top: 10px; font-size: .78rem;
  color: var(--green-bright); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; cursor: pointer; background: var(--panel);
}
.story-chip::before { content: "📎 "; }

.notes-label { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; margin: 14px 0 4px; }
textarea.notes {
  width: 100%; min-height: 70px; resize: vertical;
  background: #0f1a0b; color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: .9rem;
}
textarea.notes:focus { outline: none; border-color: var(--green); }

/* ---- Claude critique ---- */
.critique-btn {
  margin-top: 14px; width: 100%;
  background: var(--green); color: #fff; border: none;
  border-radius: 10px; padding: 11px 14px; font: inherit; font-weight: 600;
  font-size: .9rem; cursor: pointer; transition: background .15s;
}
.critique-btn:hover:not(:disabled) { background: var(--green-bright); }
.critique-btn:disabled { opacity: .6; cursor: default; }
.critique-btn::before { content: "✨ "; }
.critique-out {
  display: none; margin-top: 10px; padding: 12px 14px;
  background: #0f1a0b; border: 1px solid var(--line); border-radius: 10px;
  font-size: .9rem; white-space: pre-wrap; line-height: 1.55;
}
.critique-out.show { display: block; }
.critique-out.loading { color: var(--muted); font-style: italic; }
.critique-out.err { border-color: #6b3a2a; color: var(--warn); }

/* ---- game plan page ---- */
.gp-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.gp-block h2 { margin: 0 0 10px; font-size: 1.05rem; }
.gp-block h2 .tag { font-size: .7rem; color: var(--muted); font-weight: 500; }
.gp-list { margin: 0; padding-left: 18px; }
.gp-list li { margin-bottom: 8px; font-size: .92rem; }
.defend-item { border-left: 3px solid var(--warn); padding: 4px 0 4px 12px; margin-bottom: 12px; }
.defend-gap { font-weight: 700; color: var(--warn); font-size: .9rem; }
.defend-reframe { font-size: .9rem; color: var(--text); margin-top: 2px; }
.reminder { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: .92rem; }
.reminder::before { content: "✓"; color: var(--green-bright); font-weight: 700; }

/* ---- stories page ---- */
.story-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.story-card h3 { margin: 0 0 4px; font-size: 1rem; color: var(--gold); }
.story-use { font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.story-body { font-size: .94rem; }

/* progress bar */
.progress-wrap { max-width: 760px; margin: 0 auto; padding: 0 14px; }
.progress-bar { height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0 0; }
.progress-fill { height: 100%; background: var(--green-bright); width: 0; transition: width .3s; }
.progress-text { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* footer */
.foot {
  max-width: 760px; margin: 0 auto; padding: 20px 14px max(env(safe-area-inset-bottom),20px);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: .78rem;
}
.link-btn { background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .78rem; }
.link-btn:hover { color: var(--text); }
