/* =============================================================
   Questline — styles
   Dark "engine viewport" aesthetic. Gold = progress/XP, teal =
   interaction, mono = labels. The progress rings are the signature.
   ============================================================= */

:root {
  --bg: #0E1116;
  --surface: #161B22;
  --surface-2: #1B222C;
  --surface-3: #222B36;
  --line: #2A3340;
  --line-strong: #3A4452;

  --ink: #E7EDF4;
  --ink-dim: #9AA7B6;
  --ink-faint: #66727F;

  --gold: #FFB454;
  --gold-deep: #E08A2B;
  --gold-glow: rgba(255, 180, 84, 0.16);

  --teal: #45D3C5;
  --teal-deep: #2BB3A6;
  --green: #5BD98A;
  --red: #FF6B6B;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --maxw: 880px;

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  /* faint editor-viewport grid */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center top;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- shared bits ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.62rem 1.05rem;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
a.btn { display: inline-block; text-decoration: none; }
.btn:hover { background: #ffc06e; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--teal-deep); }
.btn-danger { color: #fff; background: transparent; border: 1px solid rgba(255, 107, 107, 0.4); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); border-color: var(--red); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Header
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.brand__mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  background: linear-gradient(160deg, #20283340, #0E1116);
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
}
.brand__mark svg { width: 18px; height: 18px; display: block; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}
.header__spacer { flex: 1; }

.header__bar {
  display: none;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
}
@media (min-width: 620px) { .header__bar { display: flex; } }
.minibar { width: 120px; height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.minibar__fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: inherit; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

.icon-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-dim);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn__dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); display: none;
  box-shadow: 0 0 0 2px var(--surface-2);
}
.icon-btn__dot--on { display: block; }

.account { position: relative; }
.account__btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.4rem 0.28rem 0.75rem;
  cursor: pointer; color: var(--ink);
}
.account__btn:hover { border-color: var(--line-strong); }
.account__name { font-size: 0.82rem; font-weight: 500; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #2a1c08; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.72rem;
}
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 180px; padding: 0.35rem; display: none;
}
.menu--open { display: block; }
.menu__email { padding: 0.5rem 0.6rem; font-size: 0.76rem; color: var(--ink-faint); border-bottom: 1px solid var(--line); margin-bottom: 0.3rem; word-break: break-all; }
.menu__item {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 0.6rem; border-radius: 8px;
  background: transparent; border: none; color: var(--ink);
  font-size: 0.86rem; cursor: pointer; font-family: var(--font-body);
}
.menu__item:hover { background: var(--surface-3); }

/* ============================================================
   Layout
   ============================================================ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.1rem 4rem; }

/* ---- hero ---- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 140% at 88% -10%, var(--gold-glow), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1.6rem;
  overflow: hidden;
}
.hero__ring { flex: none; }
.hero__body { min-width: 0; }
.hero__label { margin-bottom: 0.5rem; }
.hero__headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 0 0 0.55rem;
}
.hero__sub { color: var(--ink-dim); font-size: 0.92rem; margin: 0 0 0.9rem; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.stat__num--gold { color: var(--gold); }
.stat__label { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }

/* ring */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring__track { fill: none; stroke: var(--surface-3); }
.ring__bar { fill: none; stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring__pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700;
}
.ring__pct b { font-size: 1.7rem; line-height: 1; }
.ring__pct span { font-size: 0.85rem; color: var(--ink-dim); margin-left: 1px; }

/* ---- section heading ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2.2rem 0 0.9rem; }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; margin: 0; color: var(--ink-dim); text-transform: uppercase; }
.section-head .eyebrow { color: var(--ink-faint); }

/* ---- acts grid ---- */
.acts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
@media (min-width: 720px) { .acts { grid-template-columns: repeat(4, 1fr); } }

.act {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
  display: flex; flex-direction: column; gap: 0.7rem;
}
.act:hover { border-color: var(--line-strong); background: var(--surface-2); }
.act:active { transform: translateY(1px); }
.act--current { border-color: var(--teal-deep); box-shadow: 0 0 0 1px var(--teal-deep); }
.act--done { border-color: rgba(91, 217, 138, 0.35); }
.act__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.act__n { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--gold); }
.act__check { color: var(--green); display: none; }
.act--done .act__check { display: block; }
.act__name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.25; }
.act__tag { font-size: 0.74rem; color: var(--ink-faint); }
.act__bar { height: 5px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; margin-top: auto; }
.act__bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); border-radius: inherit; transition: width 0.5s ease; }
.act__count { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-faint); }

/* ---- weeks ---- */
.phase-intro { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1rem; }
.weeks { display: flex; flex-direction: column; gap: 0.6rem; }

.week {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.week:hover { border-color: var(--line-strong); }
.week--done { background: linear-gradient(0deg, rgba(91, 217, 138, 0.04), rgba(91, 217, 138, 0.04)), var(--surface); border-color: rgba(91, 217, 138, 0.22); }

.week__row { display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 1rem; }
.week__check {
  flex: none; width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
  background: transparent;
  cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  padding: 0;
}
.week__check:hover { border-color: var(--teal); }
.week__check svg { width: 15px; height: 15px; color: var(--bg); opacity: 0; transform: scale(0.5); transition: opacity 0.15s ease, transform 0.15s ease; }
.week--done .week__check { background: var(--green); border-color: var(--green); }
.week--done .week__check svg { opacity: 1; transform: scale(1); }

.week__main { flex: 1; min-width: 0; cursor: pointer; }
.week__n { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.week--done .week__n { color: var(--green); }
.week__title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.3; margin-top: 1px; }
.week__chevron { flex: none; color: var(--ink-faint); transition: transform 0.2s ease; }
.week--open .week__chevron { transform: rotate(180deg); }

.week__detail { display: none; padding: 0 1rem 1rem 3.7rem; }
.week--open .week__detail { display: block; }
.week__focus { color: var(--ink-dim); font-size: 0.9rem; margin: 0.2rem 0 0.9rem; }
.deliverable {
  display: flex; gap: 0.6rem; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.65rem 0.8rem; margin-bottom: 0.9rem;
}
.deliverable__icon { color: var(--gold); flex: none; margin-top: 1px; }
.deliverable__text { font-size: 0.88rem; }
.deliverable__text b { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 2px; font-weight: 700; }
.resources { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.pill {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--ink-dim); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 0.22rem 0.6rem;
}
a.pill--link { text-decoration: none; transition: color 0.15s ease, border-color 0.15s ease; }
a.pill--link:hover { color: var(--ink); border-color: var(--teal-deep); }
.pill__star { color: var(--gold); margin-right: 0.3rem; }
.pill__free { color: var(--green); margin-left: 0.35rem; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---- Field guide ---- */
.guide { display: flex; flex-direction: column; gap: 0.55rem; }
.gblock { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.gblock__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1rem; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--ink);
}
.gblock__head::-webkit-details-marker { display: none; }
.gblock__head:hover { color: var(--gold); }
.gblock__chevron { color: var(--ink-faint); flex: none; transition: transform 0.2s ease; }
.gblock[open] .gblock__chevron { transform: rotate(180deg); }
.gblock__body { padding: 0 1rem 1.1rem; }

.g-lead { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 0.8rem; }
.g-list { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--ink-dim); font-size: 0.88rem; }
.g-list li { margin-bottom: 0.45rem; }
.g-alts { display: grid; gap: 0.6rem; }
.g-alt { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; }
.g-alt__name { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold); text-decoration: none; }
.g-alt__name:hover { text-decoration: underline; }
.g-alt p { margin: 0.3rem 0 0; font-size: 0.86rem; color: var(--ink-dim); }

.g-toolkit { display: grid; gap: 0.5rem; }
.g-tk { display: grid; grid-template-columns: 9rem 1fr; gap: 0.6rem; align-items: start; }
.g-tk__cat { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); padding-top: 0.25rem; }
.g-tk__opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.g-grp { margin-bottom: 1rem; }
.g-grp:last-child { margin-bottom: 0; }
.g-grp__title { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.5rem; }
.g-grp .resources { margin-bottom: 0; }

.g-tracks { display: grid; gap: 0.55rem; }
.g-track { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.65rem 0.85rem; }
.g-track b { font-family: var(--font-display); font-size: 0.88rem; color: var(--ink); }
.g-track p { margin: 0.25rem 0 0; font-size: 0.85rem; color: var(--ink-dim); }

.g-advice { margin: 0; padding-left: 1.2rem; color: var(--ink-dim); font-size: 0.9rem; }
.g-advice li { margin-bottom: 0.5rem; }
.notes-label { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 0.35rem; }
.notes {
  width: 100%; min-height: 64px; resize: vertical;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem; font-family: var(--font-body); font-size: 0.88rem; line-height: 1.5;
}
.notes:focus { border-color: var(--teal-deep); }
.notes-saved { font-size: 0.7rem; color: var(--green); margin-top: 0.3rem; height: 0.9rem; opacity: 0; transition: opacity 0.2s ease; }
.notes-saved--show { opacity: 1; }

/* ---- "act complete" pulse ---- */
@keyframes actPulse { 0% { box-shadow: 0 0 0 0 rgba(91, 217, 138, 0.5); } 100% { box-shadow: 0 0 0 16px rgba(91, 217, 138, 0); } }
.act--pulse { animation: actPulse 0.9s ease-out; }

/* ============================================================
   Notifications panel (slide-over)
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 40;
}
.scrim--open { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(420px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  z-index: 50; transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column;
}
.panel--open { transform: translateX(0); }
.panel__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.panel__body { padding: 1.2rem; overflow-y: auto; }
.panel__lead { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1.2rem; }

.field { margin-bottom: 1.3rem; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.field__label { font-weight: 600; font-size: 0.92rem; }
.field__hint { color: var(--ink-faint); font-size: 0.8rem; margin-top: 0.2rem; }

/* toggle */
.toggle { position: relative; width: 46px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__track { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--radius-pill); cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; }
.toggle__track::after { content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--ink-dim); transition: transform 0.18s ease, background 0.15s ease; }
.toggle input:checked + .toggle__track { background: rgba(69, 211, 197, 0.2); border-color: var(--teal-deep); }
.toggle input:checked + .toggle__track::after { transform: translateY(-50%) translateX(20px); background: var(--teal); }

.time-input { background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.45rem 0.6rem; font-family: var(--font-mono); font-size: 0.9rem; }
.time-input::-webkit-calendar-picker-indicator { filter: invert(0.7); }

.note-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.7rem 0.85rem; font-size: 0.82rem; color: var(--ink-dim); }
.note-box--warn { border-color: rgba(255, 180, 84, 0.3); background: rgba(255, 180, 84, 0.06); }
.panel__actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }

/* ============================================================
   Toasts
   ============================================================ */
.toasts { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; width: min(420px, 92vw); }
.toast {
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem;
  font-size: 0.86rem; box-shadow: var(--shadow);
  animation: toastIn 0.2s ease;
}
.toast--gold { border-left-color: var(--gold); }
.toast--error { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- install prompt ---------- */
.install-pop {
  position: fixed;
  left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 140%);
  z-index: 70;
  width: min(440px, 92vw);
  display: flex; align-items: center; gap: 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease;
}
.install-pop[hidden] { display: none; }
.install-pop--in { transform: translate(-50%, 0); opacity: 1; }
.install-pop__icon { flex: none; }
.install-pop__icon img { display: block; border-radius: var(--radius-sm); }
.install-pop__body { flex: 1; min-width: 0; }
.install-pop__title { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.install-pop__text { font-size: 0.78rem; color: var(--ink-dim); margin-top: 0.15rem; }
.install-pop__actions { flex: none; display: flex; gap: 0.4rem; }
.install-pop__actions .btn { padding: 0.45rem 0.75rem; font-size: 0.82rem; }
@media (max-width: 520px) {
  .install-pop { flex-wrap: wrap; }
  .install-pop__actions { width: 100%; justify-content: flex-end; }
  .g-tk { grid-template-columns: 1fr; gap: 0.3rem; }
  .g-tk__cat { padding-top: 0; }
}

/* ============================================================
   Auth (login.php)
   ============================================================ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.4rem; }
.auth__card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.8rem; }
.auth__brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.auth__brand .brand__name { font-size: 1.25rem; }
.auth__tagline { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1.5rem; }
.tabs { display: flex; gap: 0.3rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0.25rem; margin-bottom: 1.3rem; }
.tab { flex: 1; text-align: center; padding: 0.5rem; border-radius: var(--radius-pill); border: none; background: transparent; color: var(--ink-dim); font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.tab--active { background: var(--surface-3); color: var(--ink); }
.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.4rem; }
.input { width: 100%; background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0.7rem 0.8rem; font-family: var(--font-body); font-size: 0.95rem; }
.input:focus { border-color: var(--teal-deep); }
.auth__submit { width: 100%; padding: 0.8rem; font-size: 0.95rem; margin-top: 0.4rem; }
.auth__error { display: none; background: rgba(255, 107, 107, 0.1); border: 1px solid rgba(255, 107, 107, 0.35); color: #ffb1b1; border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.84rem; margin-bottom: 1rem; }
.auth__error--show { display: block; }
.auth__error--ok { background: rgba(91, 217, 138, 0.1); border-color: rgba(91, 217, 138, 0.35); color: #aef0c4; }
.auth__resend { display: block; width: 100%; margin: -0.4rem 0 1rem; background: transparent; border: none; color: var(--teal); font-size: 0.82rem; cursor: pointer; text-align: center; }
.auth__resend:hover { text-decoration: underline; }
.auth__resend:disabled { color: var(--ink-faint); cursor: default; text-decoration: none; }
.auth__hint { text-align: center; color: var(--ink-faint); font-size: 0.8rem; margin-top: 1.1rem; }

.hidden { display: none !important; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 560px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 1.1rem; padding: 1.3rem; }
  .hero__headline { font-size: 1.3rem; }
  .week__detail { padding-left: 1rem; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Landing page
   ============================================================ */
.app-header__inner .lp-nav-btn { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

.lp-hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.2rem 1.1rem 2.6rem;
  text-align: center;
}
.lp-hero .eyebrow { display: block; margin-bottom: 1rem; }
.lp-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  /* gold viewport-glow on the headline */
  background: linear-gradient(180deg, var(--ink) 0%, #cdd7e2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-hero__sub {
  color: var(--ink-dim);
  font-size: 1.02rem;
  max-width: 620px;
  margin: 0 auto 1.7rem;
}
.lp-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}
.lp-cta__primary {
  padding: 0.78rem 1.5rem;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px var(--gold-glow);
}
.lp-hero__note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-top: 1.3rem;
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
.lp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
}
.lp-card__title { font-family: var(--font-display); font-size: 1.02rem; margin: 0 0 0.4rem; }
.lp-card__text { color: var(--ink-dim); font-size: 0.9rem; margin: 0; }

.lp-acts { display: flex; flex-direction: column; gap: 0.8rem; }
.lp-act {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.lp-act__n {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--gold);
  flex: none;
  line-height: 1.1;
}
.lp-act__body { min-width: 0; }
.lp-act__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.8rem; margin-bottom: 0.35rem; }
.lp-act__name { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.lp-act__summary { color: var(--ink-dim); font-size: 0.9rem; margin: 0; }

.lp-final {
  text-align: center;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.6rem 1.4rem;
}
.lp-final__title { font-family: var(--font-display); font-size: clamp(1.4rem, 3.6vw, 1.9rem); margin: 0 0 0.5rem; }
.lp-final__sub { color: var(--ink-dim); margin: 0 0 1.4rem; }

.lp-footer {
  max-width: var(--maxw);
  margin: 2.5rem auto 0;
  padding: 1.6rem 1.1rem 2.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}
.lp-footer__note { color: var(--ink-faint); font-size: 0.82rem; }
.lp-footer__link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--ink-dim); font: inherit; font-size: 0.82rem;
  text-decoration: underline; text-underline-offset: 2px;
}
.lp-footer__link:hover { color: var(--ink); }
.footer__spacer { flex: 1; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 1.1rem;
  opacity: 0; transition: opacity 0.2s ease;
}
.modal[hidden] { display: none; }
.modal--in { opacity: 1; }
.modal__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.modal__dialog {
  position: relative;
  width: min(540px, 100%);
  max-height: 86vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem 1.3rem;
  transform: translateY(10px); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal--in .modal__dialog { transform: translateY(0); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.modal__head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin: 0; color: var(--ink); }
.modal__body { color: var(--ink-dim); font-size: 0.9rem; line-height: 1.55; }
.modal__body p { margin: 0 0 0.7rem; }
.modal__body strong { color: var(--ink); }
.modal__actions { display: flex; justify-content: flex-end; margin-top: 0.6rem; }
.modal__actions--split { justify-content: flex-start; align-items: center; gap: 0.6rem; margin-top: 1.1rem; }
.modal__actions-right { display: flex; gap: 0.5rem; margin-left: auto; }   /* stays right even when Delete is hidden */

/* ---------- game ideas ---------- */
.ideas { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
@media (min-width: 560px) { .ideas { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 780px) { .ideas { grid-template-columns: repeat(3, 1fr); } }

.idea {
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 132px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.idea:hover { border-color: var(--line-strong); background: var(--surface-2); }
.idea:active { transform: translateY(1px); }
.idea__title {
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.idea__excerpt {
  flex: 1;
  color: var(--ink-dim); font-size: 0.84rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.idea__excerpt--empty { color: var(--ink-faint); font-style: italic; }
.idea__meta { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }

.idea--add {
  align-items: center; justify-content: center; gap: 0.5rem;
  border-style: dashed; background: transparent; color: var(--ink-dim);
}
.idea--add:hover { border-color: var(--gold); color: var(--gold); background: rgba(255, 180, 84, 0.04); }
.idea__plus { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--gold); }
.idea__add-label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* modal: read view */
#ideaModal .modal__head h2 { overflow-wrap: anywhere; }
.idea-view__meta { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 0.8rem; }
.idea-view__body > *:first-child { margin-top: 0; }
.idea-view__body > *:last-child { margin-bottom: 0; }
.idea-view__body ul, .idea-view__body ol { margin: 0 0 0.7rem; padding-left: 1.3rem; }
.idea-view__body li { margin-bottom: 0.3rem; }
.idea-view__body em { color: var(--ink-dim); }
.idea-view__empty { color: var(--ink-faint); font-style: italic; }

/* modal: rich text editor */
.idea-edit .input { margin-bottom: 1rem; }
.rte { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.rte:focus-within { border-color: var(--teal-deep); }
.rte__bar { display: flex; align-items: center; gap: 0.25rem; padding: 0.35rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rte__sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 0.25rem; }
.rte__btn {
  display: grid; place-items: center;
  min-width: 30px; height: 28px; padding: 0 0.4rem;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--ink-dim); font-family: var(--font-body); font-size: 0.88rem; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.rte__btn:hover { background: var(--surface-3); color: var(--ink); }
.rte__btn svg { width: 16px; height: 16px; display: block; }
.rte__btn--on { background: var(--surface-3); color: var(--gold); border-color: var(--line-strong); }
.rte__area {
  min-height: 180px; max-height: 44vh; overflow-y: auto;
  padding: 0.7rem 0.8rem;
  color: var(--ink); font-family: var(--font-body); font-size: 0.92rem; line-height: 1.6;
  outline: none;
}
.rte__area:empty::before { content: attr(data-placeholder); color: var(--ink-faint); }
.rte__area > *:first-child { margin-top: 0; }
.rte__area p { margin: 0 0 0.6rem; }
.rte__area ul, .rte__area ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.rte__area li { margin-bottom: 0.25rem; }

@media (max-width: 560px) {
  .lp-hero { padding-top: 2.8rem; }
  .lp-grid { grid-template-columns: 1fr; }
  .lp-cta { flex-direction: column; }
  .lp-cta a { width: 100%; }
}
