/* RLForge AI - dark Rocket League theme */

:root {
  --bg: #0b0e16;
  --bg-2: #11151f;
  --panel: #161b29;
  --panel-2: #1c2233;
  --border: #28304a;
  --border-soft: #20273b;
  --text: #e8ecf5;
  --muted: #9aa6c2;
  --faint: #8893b0; /* lightened for WCAG AA contrast on dark panels */

  --orange: #ff7a18;
  --orange-2: #ff9a3d;
  --blue: #3fa9ff;
  --sky: #65d6ff;
  --green: #36d399;
  --purple: #c084fc;
  --red: #f87272;
  --yellow: #fbbf24;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 0 1px rgba(255, 122, 24, 0.25), 0 8px 30px rgba(255, 122, 24, 0.12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(63, 169, 255, 0.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(255, 122, 24, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sky); }

/* ---------- Layout ---------- */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 20px 80px;
}

header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, var(--orange), #ff5e62);
  box-shadow: var(--shadow-glow);
}

.brand h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: 0.3px;
}
.brand h1 span { color: var(--orange-2); }
.brand .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.topbar .spacer { flex: 1; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.tab {
  flex: 1;
  min-width: 110px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.9), rgba(255, 94, 98, 0.85));
  box-shadow: 0 6px 18px rgba(255, 122, 24, 0.25);
}

.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 18px; }

.card {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

h2.section-title {
  font-size: 17px;
  margin: 0 0 4px;
  display: flex; align-items: center; gap: 8px;
}
.section-desc { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.row { margin-bottom: 20px; }

/* ---------- Form controls ---------- */
select, input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.15);
}
textarea { resize: vertical; min-height: 84px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover { color: var(--text); border-color: var(--orange); }

/* selectable weakness pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}
.pill:hover { color: var(--text); border-color: var(--blue); }
.pill.selected {
  color: #fff;
  background: linear-gradient(135deg, rgba(63, 169, 255, 0.9), rgba(101, 214, 255, 0.7));
  border-color: transparent;
}
.pill .cat { opacity: 0.6; font-size: 11px; margin-left: 6px; }

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--orange), #ff5e62);
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 122, 24, 0.3);
}
.btn.primary:hover { box-shadow: 0 10px 28px rgba(255, 122, 24, 0.42); }
.btn.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.ghost:hover { border-color: var(--orange); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-icon {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 17px;
  display: grid; place-items: center;
  transition: border 0.15s;
}
.btn-icon:hover { border-color: var(--orange); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- Generate output ---------- */
#gen-status {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result { margin-top: 8px; }
.result-block { margin-top: 18px; }
.result-block h3 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.result-block h3 .ico { font-size: 17px; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.tag.diff-easy { background: rgba(54,211,153,0.15); color: var(--green); }
.tag.diff-medium { background: rgba(251,191,36,0.15); color: var(--yellow); }
.tag.diff-hard { background: rgba(248,114,114,0.16); color: var(--red); }
.tag.diff-all { background: rgba(63,169,255,0.15); color: var(--sky); }
.tag.cat { background: rgba(192,132,252,0.15); color: var(--purple); }

.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.drill-card h4, .pack-card h4 { margin: 0 0 6px; font-size: 15px; }
.drill-card .meta, .pack-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.drill-card p, .pack-card p { margin: 6px 0; font-size: 13.5px; color: var(--text); }
.muted-line { color: var(--muted); font-size: 12.5px; }
.success-line { color: var(--green); font-size: 13px; }
.target-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mini-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--muted);
}

/* code block for pack codes */
.code-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Consolas", "SF Mono", monospace;
  background: var(--bg);
  border: 1px dashed var(--orange);
  color: var(--orange-2);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  letter-spacing: 0.5px;
}
.copy-btn {
  border: none; background: var(--panel); color: var(--muted);
  cursor: pointer; font-size: 12px; padding: 2px 7px; border-radius: 5px;
}
.copy-btn:hover { color: var(--text); }
.search-line { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.search-line code { color: var(--sky); background: var(--bg); padding: 1px 6px; border-radius: 5px; }

/* lists */
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li {
  padding: 8px 0 8px 22px;
  position: relative;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
ul.clean li:last-child { border-bottom: none; }
ul.clean li::before {
  content: "▹"; position: absolute; left: 2px; color: var(--orange);
}
ul.clean.checks li::before { content: "✓"; color: var(--green); }
ul.clean.warns li::before { content: "!"; color: var(--yellow); font-weight: 700; }

.mistake-item { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.mistake-item:last-child { border-bottom: none; }
.mistake-item .name { font-weight: 700; color: var(--red); font-size: 14px; }
.mistake-item .why { color: var(--muted); font-size: 13px; margin: 3px 0; }
.mistake-item .fix { color: var(--green); font-size: 13px; }

/* weekly plan */
.day-card { border-left: 3px solid var(--orange); }
.day-card .day-head { display: flex; justify-content: space-between; align-items: baseline; }
.day-card .day-name { font-weight: 700; font-size: 14px; }
.day-card .day-focus { color: var(--orange-2); font-size: 13px; }
.day-card .day-total { color: var(--faint); font-size: 12px; }
.session-row {
  display: flex; gap: 10px; padding: 6px 0; font-size: 13px;
  border-top: 1px dashed var(--border-soft);
}
.session-row:first-of-type { border-top: none; margin-top: 6px; }
.session-row .blk { font-weight: 600; min-width: 110px; color: var(--sky); }
.session-row .min { color: var(--faint); min-width: 48px; }

/* ---------- Skill tree ---------- */
.tree-path { margin-bottom: 22px; }
.tree-path-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.path-dot { width: 14px; height: 14px; border-radius: 50%; }
.tree-path-head h3 { margin: 0; font-size: 16px; }
.tree-path-head .pd { color: var(--muted); font-size: 12.5px; }
.tree-path-head .pct {
  margin-left: auto; font-size: 12px; color: var(--muted);
  background: var(--bg-2); padding: 3px 10px; border-radius: 999px;
}
.tier-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.node {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.node:hover { border-color: var(--orange); transform: translateY(-2px); }
.node.done {
  border-color: var(--green);
  background: linear-gradient(160deg, rgba(54,211,153,0.12), var(--panel-2));
}
.node .node-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; padding-right: 22px; }
.node .node-desc { color: var(--muted); font-size: 12px; }
.node .node-hint { color: var(--faint); font-size: 11.5px; margin-top: 6px; font-style: italic; }
.node .tier-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; color: var(--faint);
}
.node .check {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green); color: #04210f; font-weight: 900;
  display: none; place-items: center; font-size: 12px;
}
.node.done .check { display: grid; }
.node.done .tier-badge { display: none; }

/* ---------- Pros ---------- */
.pro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.pro-card { display: flex; flex-direction: column; gap: 8px; }
.pro-card .pro-head { display: flex; align-items: center; gap: 10px; }
.pro-avatar {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
}
.pro-card h3 { margin: 0; font-size: 16px; }
.pro-card .pro-role { color: var(--muted); font-size: 12px; }
.pro-card .pro-tag { color: var(--orange-2); font-size: 12.5px; font-style: italic; }
.pro-card .pro-line { font-size: 13px; }
.pro-card .pro-line b { color: var(--sky); }
.pro-card .known { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Progress ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel-2); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 16px; text-align: center;
}
.stat .num { font-size: 28px; font-weight: 800; color: var(--orange-2); }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

.progressbar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progressbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--green)); }

.saved-plan { border-left: 3px solid var(--blue); }
.saved-plan .sp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.saved-plan .sp-title { font-weight: 700; }
.saved-plan .sp-date { color: var(--faint); font-size: 12px; }

/* ---------- Library ---------- */
.lib-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 7, 12, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal h2 { margin: 0 0 4px; font-size: 19px; }
.modal p.note { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.modal .warn-box {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.3);
  color: var(--yellow);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin: 14px 0 18px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.seg { display: flex; gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 10px; border: 1px solid var(--border); }
.seg button {
  flex: 1; border: none; background: transparent; color: var(--muted);
  padding: 9px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.seg button.active { background: var(--orange); color: #fff; }

/* ---------- Misc ---------- */
.empty {
  text-align: center; color: var(--faint); padding: 40px 20px; font-size: 14px;
}
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow); font-size: 13.5px; opacity: 0;
  transition: all 0.25s ease; z-index: 200; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--red); color: #ffd7d7; }
.toast.ok { border-color: var(--green); }

.inline-note { font-size: 12px; color: var(--faint); margin-top: 6px; }
.danger { color: var(--red); }
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }

.badge-key {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border);
}
.badge-key.ok { color: var(--green); border-color: rgba(54,211,153,0.4); }
.badge-key.missing { color: var(--red); border-color: rgba(248,114,114,0.4); }

@media (max-width: 600px) {
  .brand h1 { font-size: 18px; }
  .tab { min-width: 84px; font-size: 13px; padding: 9px 8px; }
  .row.two-col { grid-template-columns: 1fr; }
}

/* ---------- Pack code editor (Library) ---------- */
.pack-card h4 .by { font-weight: 500; font-size: 12px; color: var(--faint); }
.tag.verified { background: rgba(54,211,153,0.2); color: var(--green); }
.tag.conf-high { background: rgba(54,211,153,0.14); color: var(--green); }
.tag.conf-medium { background: rgba(251,191,36,0.14); color: var(--yellow); }
.tag.conf-low, .tag.conf-none { background: rgba(154,166,194,0.14); color: var(--muted); }

.code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.code-row .code-label { font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.5px; }
.code-row.no-code { font-size: 12.5px; color: var(--muted); }

.mini-link {
  border: none; background: transparent; color: var(--sky);
  cursor: pointer; font-size: 12px; padding: 2px 4px; text-decoration: underline;
}
.mini-link:hover { color: var(--orange-2); }

.code-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.code-edit[hidden] { display: none; }
.code-edit .code-input {
  flex: 1; min-width: 170px;
  font-family: "Consolas", "SF Mono", monospace; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 8px 11px;
}
.btn.ghost.danger { color: var(--red); border-color: rgba(248,114,114,0.4); }

.source-link { font-size: 11.5px; margin-top: 6px; }
.source-link a { color: var(--faint); text-decoration: none; }
.source-link a:hover { color: var(--sky); text-decoration: underline; }

/* ---------- Replay analysis ---------- */
.row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
textarea.tall { min-height: 132px; }

#replay-status { margin-top: 18px; font-size: 14px; color: var(--muted); min-height: 20px; }

.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sys-card { border-left: 3px solid var(--blue); }
.sys-card h4 { margin: 0 0 6px; font-size: 13px; color: var(--sky); text-transform: uppercase; letter-spacing: 0.4px; }
.sys-card p { margin: 0; font-size: 13px; color: var(--text); }

.mistake-item .ev { color: var(--faint); font-size: 12.5px; font-style: italic; margin: 3px 0; }
.sev {
  display: inline-block; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0.3px; margin-left: 8px;
  vertical-align: 1px;
}
.sev-high { background: rgba(248,114,114,0.16); color: var(--red); }
.sev-medium { background: rgba(251,191,36,0.15); color: var(--yellow); }
.sev-low { background: rgba(63,169,255,0.15); color: var(--sky); }

/* ---------- Quick overlay (F5) ---------- */
.overlay-toggle {
  position: fixed; bottom: 22px; right: 22px; z-index: 150;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--orange), #ff5e62); color: #fff;
  font-size: 19px; cursor: pointer; box-shadow: var(--shadow-glow);
  display: grid; place-items: center; transition: transform 0.1s;
}
.overlay-toggle:hover { transform: scale(1.08); }

.quick-overlay {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  width: 320px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: rgba(14, 18, 28, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--orange); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), var(--shadow-glow);
  font-size: 13px;
}
.quick-overlay[hidden] { display: none; }
.quick-overlay .qo-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--border-soft);
  font-weight: 800; color: var(--orange-2); position: sticky; top: 0;
  background: rgba(14, 18, 28, 0.96);
}
.qo-close {
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 5px;
}
.qo-close:hover { color: var(--text); }
#quick-overlay-body { padding: 6px 14px 12px; }
.qo-sec { margin-top: 10px; }
.qo-sec .qo-h { font-size: 12px; font-weight: 700; color: var(--sky); margin-bottom: 6px; letter-spacing: 0.3px; }
.qo-row { padding: 3px 0; }
.qo-drill { padding: 6px 0; border-bottom: 1px dashed var(--border-soft); }
.qo-drill:last-child { border-bottom: none; }
.qo-mini { font-size: 11px; color: var(--faint); margin-left: 4px; }
.qo-code {
  font-family: "Consolas", monospace; color: var(--orange-2);
  font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 8px;
}
.qo-empty { color: var(--muted); padding: 14px 0; text-align: center; }
.quick-overlay .qo-foot {
  padding: 9px 14px; border-top: 1px solid var(--border-soft);
  font-size: 11px; color: var(--faint); text-align: center;
}

/* ============================================================
   RLForge v2 — premium visual polish (cooler + smoother)
   Layered on top of the base styles; original RLForge identity.
   ============================================================ */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glass: rgba(20, 25, 38, 0.62);
  --glass-brd: rgba(255, 255, 255, 0.09);
  --grad-fire: linear-gradient(135deg, #ff7a18, #ff4d6d);
}

/* ---- animated aurora backdrop (sits behind content) ---- */
body::before {
  content: "";
  position: fixed; inset: -25%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 48% at 16% 12%, rgba(255, 122, 24, 0.20), transparent 60%),
    radial-gradient(36% 44% at 86% 8%,  rgba(63, 169, 255, 0.18), transparent 60%),
    radial-gradient(46% 56% at 78% 92%, rgba(192, 132, 252, 0.14), transparent 60%);
  filter: blur(26px);
  animation: aurora 26s var(--ease) infinite alternate;
  will-change: transform;
}
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2.5%, 0) scale(1.08); }
  100% { transform: translate3d(3%, -2%, 0) scale(1.05); }
}

/* ---- brand: gradient title + pulsing logo ---- */
.brand h1 {
  background: linear-gradient(120deg, #ffffff, #ffd9c2 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand h1 span { -webkit-text-fill-color: var(--orange-2); }
.logo { animation: logoGlow 4.5s ease-in-out infinite; }
@keyframes logoGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(45,212,191,0.35), 0 8px 24px rgba(45,212,191,0.22); }
  50%      { box-shadow: 0 0 0 1px rgba(168,85,247,0.5), 0 10px 32px rgba(168,85,247,0.4); }
}

/* ---- glass panels with entrance + top sheen ---- */
.panel {
  background: linear-gradient(180deg, rgba(28,34,51,0.66), rgba(16,20,30,0.66));
  backdrop-filter: blur(14px) saturate(125%);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  border-color: var(--glass-brd);
  box-shadow: 0 20px 54px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative; overflow: hidden;
  animation: rise 0.5s var(--ease-out) both;
}
.panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent 22%);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- tabs: glassy bar, smooth active ---- */
.tabs { background: var(--glass); backdrop-filter: blur(10px); border-color: var(--glass-brd); }
.tab { transition: color .2s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease), transform .15s var(--ease); }
.tab:hover { transform: translateY(-1px); }
.tab.active { box-shadow: 0 8px 24px rgba(255,122,24,0.4); }

/* ---- buttons: glow + shine sweep ---- */
.btn { transition: transform .18s var(--ease), box-shadow .26s var(--ease), border-color .2s var(--ease), filter .2s var(--ease); }
.btn.primary {
  background: var(--grad-fire);
  box-shadow: 0 8px 24px rgba(255,90,80,0.34), inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative; overflow: hidden;
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255,90,80,0.5); filter: brightness(1.05); }
.btn.primary::after {
  content: ""; position: absolute; top: 0; left: -130%; width: 65%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.38), transparent);
  transform: skewX(-20deg); transition: left .6s var(--ease); pointer-events: none;
}
.btn.primary:hover::after { left: 150%; }
.btn.ghost:hover { transform: translateY(-2px); border-color: var(--orange); box-shadow: 0 10px 26px rgba(0,0,0,0.4); }

/* ---- cards: smooth lift + glow ---- */
.card { transition: transform .22s var(--ease), box-shadow .28s var(--ease), border-color .22s var(--ease); }
.pack-card:hover, .drill-card:hover, .day-card:hover, .pro-card:hover, .sys-card:hover, .grid .card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,122,24,0.5);
  box-shadow: 0 18px 38px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,122,24,0.16);
}

/* ---- result blocks fade/slide in ---- */
.result-block { animation: rise .5s var(--ease-out) both; }
.result-block:nth-of-type(2) { animation-delay: .05s; }
.result-block:nth-of-type(3) { animation-delay: .10s; }
.result-block:nth-of-type(4) { animation-delay: .15s; }
.result-block:nth-of-type(5) { animation-delay: .20s; }

/* ---- inputs: softer, glowy focus ---- */
select, input[type="text"], input[type="password"], textarea {
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease);
}
select:focus, input:focus, textarea:focus {
  box-shadow: 0 0 0 4px rgba(255,122,24,0.16), 0 6px 20px rgba(255,122,24,0.12);
}

/* ---- pills / chips: smoother, lift ---- */
.pill, .chip { transition: color .18s var(--ease), background .2s var(--ease), border-color .18s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease); }
.pill:hover, .chip:hover { transform: translateY(-1px); }
.pill.selected { box-shadow: 0 8px 20px rgba(63,169,255,0.32); }

/* ---- skill nodes: nicer hover + done glow ---- */
.node { transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .26s var(--ease), background .3s var(--ease); }
.node:hover { transform: translateY(-3px) scale(1.012); box-shadow: 0 16px 32px rgba(0,0,0,0.4); }
.node.done { box-shadow: inset 0 0 0 1px rgba(54,211,153,0.4), 0 10px 24px rgba(54,211,153,0.14); }

/* ---- code pill hover glow ---- */
.code-pill { transition: box-shadow .2s var(--ease); }
.code-pill:hover { box-shadow: 0 0 0 1px rgba(255,122,24,0.45), 0 6px 16px rgba(255,122,24,0.18); }

/* ---- stat cards ---- */
.stat { transition: transform .2s var(--ease), box-shadow .26s var(--ease), border-color .2s var(--ease); }
.stat:hover { transform: translateY(-2px); border-color: rgba(255,122,24,0.4); box-shadow: 0 12px 28px rgba(0,0,0,0.4); }

/* ---- overlay FAB ---- */
.overlay-toggle { transition: transform .2s var(--ease), box-shadow .25s var(--ease); }
.overlay-toggle:hover { transform: scale(1.12) rotate(8deg); box-shadow: 0 10px 28px rgba(255,122,24,0.55); }

/* ---- custom scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,122,24,0.55) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--orange), #ff4d6d);
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--orange-2), #ff6b82); background-clip: padding-box; }

/* ---- toast polish ---- */
.toast { backdrop-filter: blur(10px); background: rgba(28,34,51,0.85); }

/* ---- F5 quick overlay: premium match ---- */
.quick-overlay {
  width: 340px;
  background: linear-gradient(180deg, rgba(26,32,48,0.90), rgba(13,17,27,0.92));
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  border: 1px solid rgba(255,122,24,0.5);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,122,24,0.18), 0 0 42px rgba(255,122,24,0.18);
  overflow: hidden;
  animation: overlayIn .32s var(--ease-out) both;
}
@keyframes overlayIn {
  from { opacity: 0; transform: translateX(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.quick-overlay .qo-head {
  background: linear-gradient(180deg, rgba(255,122,24,0.16), rgba(255,122,24,0.03));
  border-bottom: 1px solid rgba(255,122,24,0.25);
  font-size: 13.5px; letter-spacing: 0.3px;
}
.quick-overlay .qo-head span {
  background: linear-gradient(120deg, #ffb37a, #ff5e62);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.qo-close { transition: color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); border-radius: 6px; }
.qo-close:hover { color: #fff; background: rgba(255,255,255,0.08); transform: scale(1.1); }
.qo-sec .qo-h {
  text-transform: uppercase; letter-spacing: .5px; font-size: 10.5px; color: var(--orange-2);
}
.qo-drill {
  transition: background .18s var(--ease);
  border-radius: 8px; padding: 8px; margin: 0 -8px;
}
.qo-drill:hover { background: rgba(255,255,255,0.04); }
.qo-code {
  background: var(--bg); border: 1px dashed var(--orange);
  border-radius: 8px; padding: 5px 9px; width: fit-content;
  transition: box-shadow .2s var(--ease);
}
.qo-code:hover { box-shadow: 0 0 0 1px rgba(255,122,24,0.45), 0 6px 16px rgba(255,122,24,0.18); }
.quick-overlay .qo-foot { background: rgba(255,255,255,0.02); }
.quick-overlay .qo-foot b { color: var(--orange-2); }

/* Motion is intentional in this build (user-requested animated UI) — no reduced-motion suppression. */

/* ============================================================
   RLForge v3 — Teal / Purple / Black / Gold · moving · floaty · bubbly
   ============================================================ */
:root {
  --teal: #2dd4bf;   --teal-2: #5eead4;
  --purple: #a855f7; --purple-2: #c084fc;
  --gold: #f6c453;   --gold-2: #ffe08a;
  /* remap base tokens so every existing component recolors to the new palette */
  --orange: #2dd4bf; --orange-2: #5eead4;
  --blue: #a855f7;   --sky: #c084fc;
  --green: #2dd4bf;  --yellow: #f6c453; --purple: #c084fc;
  --bg: #05070c;     --bg-2: #0a0e16;
  --panel: #0d1119;  --panel-2: #111725;
  --border: #233049; --border-soft: #19202f;
  --radius: 22px;    --radius-sm: 16px;
  --grad-fire: linear-gradient(135deg, #2dd4bf, #a855f7 55%, #c084fc);
}

body { background-color: #05070c; }

/* ---- moving color: two drifting, blurred gradient layers ---- */
body::before {
  inset: -35%;
  background:
    radial-gradient(40% 46% at 14% 12%, rgba(45,212,191,0.42), transparent 60%),
    radial-gradient(42% 48% at 88% 8%,  rgba(168,85,247,0.42), transparent 60%),
    radial-gradient(46% 52% at 78% 92%, rgba(246,196,83,0.26), transparent 62%);
  filter: blur(42px);
  animation: drift1 22s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: -35%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 44% at 82% 20%, rgba(45,212,191,0.30), transparent 60%),
    radial-gradient(44% 50% at 14% 84%, rgba(168,85,247,0.34), transparent 62%),
    radial-gradient(36% 42% at 48% 50%, rgba(246,196,83,0.18), transparent 60%);
  filter: blur(50px);
  animation: drift2 29s ease-in-out infinite alternate;
}
@keyframes drift1 {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(6%, 4%, 0) scale(1.12); }
  100% { transform: translate3d(-5%, -3%, 0) scale(1.06); }
}
@keyframes drift2 {
  0%   { transform: translate3d(0,0,0) scale(1.05); }
  50%  { transform: translate3d(-6%, -5%, 0) scale(1); }
  100% { transform: translate3d(5%, 4%, 0) scale(1.12); }
}

/* ---- bubbly: rounder + softer ---- */
.btn { border-radius: 16px; }
.btn-icon { border-radius: 14px; }
.pill, .chip { border-radius: 999px; }

/* ---- glassy panels recolored, with new accent bar ---- */
.panel {
  background: linear-gradient(180deg, rgba(20,28,44,0.66), rgba(10,14,22,0.72));
  border-color: rgba(120,200,255,0.12);
}
.panel::after {
  background: linear-gradient(90deg, #2dd4bf, #a855f7 50%, #f6c453);
  box-shadow: 0 0 18px rgba(45,212,191,0.5);
}

/* ---- floaty: gentle bob on cards (panels stay still for readability) ---- */
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.pack-card, .drill-card, .pro-card, .day-card, .stat, .sys-card {
  animation: floaty 6.5s ease-in-out infinite;
}
.pack-card:nth-child(2n), .drill-card:nth-child(2n), .pro-card:nth-child(2n), .day-card:nth-child(2n) { animation-delay: -2.2s; }
.pack-card:nth-child(3n), .drill-card:nth-child(3n), .pro-card:nth-child(3n), .day-card:nth-child(3n) { animation-delay: -4.1s; }
.pack-card:hover, .drill-card:hover, .pro-card:hover, .day-card:hover, .stat:hover, .sys-card:hover { animation-play-state: paused; }
.logo { animation: floaty 5s ease-in-out infinite, logoGlow 4.5s ease-in-out infinite; }

/* ---- recolor literal-color accents to teal/purple/gold ---- */
.brand h1 {
  background: linear-gradient(100deg, #2dd4bf, #c084fc 50%, #f6c453);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
h2.section-title::before {
  background: linear-gradient(180deg, #2dd4bf, #a855f7);
  box-shadow: 0 0 12px rgba(168,85,247,0.6);
}
.btn.primary { box-shadow: 0 12px 30px rgba(45,212,191,0.4), 0 0 0 1px rgba(168,85,247,0.25); }
.tab.active {
  background: linear-gradient(135deg, rgba(45,212,191,0.95), rgba(168,85,247,0.9));
  box-shadow: 0 8px 26px rgba(168,85,247,0.5);
}
.logo { background: linear-gradient(135deg, #2dd4bf, #a855f7); }
.pill.selected {
  background: linear-gradient(135deg, rgba(45,212,191,0.92), rgba(168,85,247,0.82));
  box-shadow: 0 8px 22px rgba(45,212,191,0.42), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.overlay-toggle { background: linear-gradient(135deg, #2dd4bf, #a855f7); }
.quick-overlay { border-color: rgba(168,85,247,0.5); box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(45,212,191,0.2), 0 0 42px rgba(168,85,247,0.22); }
.quick-overlay .qo-head span { background: linear-gradient(120deg, #5eead4, #c084fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---- fade transitions: views + content rise in ---- */
.view.active { animation: fadeUp .45s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   RLForge v2.1 — BOLD, unmistakable look (fully visible at rest,
   no hover or motion required)
   ============================================================ */
body { background-color: #070a13; }

/* vivid glowing aurora — strong enough to read even with motion off */
body::before {
  inset: -30%;
  background:
    radial-gradient(46% 52% at 10% 4%,   rgba(255, 122, 24, 0.42), transparent 60%),
    radial-gradient(44% 50% at 92% 2%,    rgba(63, 140, 255, 0.38), transparent 60%),
    radial-gradient(52% 58% at 84% 98%,   rgba(168, 85, 247, 0.34), transparent 62%),
    radial-gradient(42% 48% at 24% 104%,  rgba(54, 211, 153, 0.22), transparent 60%);
  filter: blur(34px);
}

/* glowing multi-color accent bar across the top of every panel */
.panel {
  background: linear-gradient(180deg, rgba(36, 43, 64, 0.74), rgba(18, 23, 36, 0.74));
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.panel::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #ff7a18, #ff4d6d 38%, #c084fc 66%, #3fa9ff);
  box-shadow: 0 0 18px rgba(255, 122, 24, 0.55);
}

/* full tri-color gradient brand title (whole word, not just "Forge") */
.brand h1 {
  background: linear-gradient(100deg, #ff9a3d, #ff4d6d 46%, #65d6ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand h1 span { -webkit-text-fill-color: transparent; }

/* section titles: glowing gradient left bar */
h2.section-title { position: relative; padding-left: 15px; }
h2.section-title::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; border-radius: 4px;
  background: linear-gradient(180deg, #ff7a18, #ff4d6d);
  box-shadow: 0 0 12px rgba(255, 122, 24, 0.6);
}

/* cards read as premium even at rest: soft depth + accent edge */
.card { border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.pack-card, .drill-card { border-left: 3px solid rgba(255, 122, 24, 0.6); }

/* brighter glowing active tab + bolder primary button */
.tab.active { box-shadow: 0 8px 26px rgba(255, 122, 24, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.btn.primary { box-shadow: 0 10px 30px rgba(255, 90, 80, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

/* selected weakness pills pop more */
.pill.selected { box-shadow: 0 8px 22px rgba(63, 169, 255, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.18); }

/* ============================================================
   v3.1 — ensure Teal/Purple/Gold theme WINS the cascade (must stay LAST).
   Reuses the structural ::after / ::before / section-bar rules above;
   only re-colors + re-animates what the older bold (orange) block overrode.
   ============================================================ */
body { background-color: #05070c; }
body::before {
  background:
    radial-gradient(40% 46% at 14% 12%, rgba(45,212,191,0.42), transparent 60%),
    radial-gradient(42% 48% at 88% 8%,  rgba(168,85,247,0.42), transparent 60%),
    radial-gradient(46% 52% at 78% 92%, rgba(246,196,83,0.26), transparent 62%);
  filter: blur(42px);
  animation: drift1 22s ease-in-out infinite alternate;
}
.panel {
  background: linear-gradient(180deg, rgba(20,28,44,0.66), rgba(10,14,22,0.72));
  border-color: rgba(120,200,255,0.12);
}
.panel::after { background: linear-gradient(90deg, #2dd4bf, #a855f7 50%, #f6c453); box-shadow: 0 0 18px rgba(45,212,191,0.5); }
.brand h1 { background: linear-gradient(100deg, #2dd4bf, #c084fc 50%, #f6c453); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand h1 span { -webkit-text-fill-color: transparent; }
h2.section-title::before { background: linear-gradient(180deg, #2dd4bf, #a855f7); box-shadow: 0 0 12px rgba(168,85,247,0.6); }
.pack-card, .drill-card { border-left: 3px solid rgba(45,212,191,0.6); }
.tab.active { background: linear-gradient(135deg, rgba(45,212,191,0.95), rgba(168,85,247,0.9)); box-shadow: 0 8px 26px rgba(168,85,247,0.5); }
.btn.primary { box-shadow: 0 12px 30px rgba(45,212,191,0.4), 0 0 0 1px rgba(168,85,247,0.25); }
.pill.selected { background: linear-gradient(135deg, rgba(45,212,191,0.92), rgba(168,85,247,0.82)); box-shadow: 0 8px 22px rgba(45,212,191,0.42), inset 0 0 0 1px rgba(255,255,255,0.18); }

/* ============================================================
   Generate wizard (step-by-step, fade-in) + hyped loading state
   ============================================================ */
.wiz-progress { display: flex; gap: 8px; margin: 2px 0 22px; }
.wiz-dot {
  width: 26px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.12);
  transition: background .35s var(--ease), box-shadow .35s var(--ease);
}
.wiz-dot.active { background: linear-gradient(90deg, var(--teal), var(--purple)); box-shadow: 0 0 10px rgba(45,212,191,0.55); }

.wiz-step { margin-bottom: 22px; }
.wiz-step[hidden] { display: none; }
.wiz-step:not([hidden]) { animation: wizIn .5s var(--ease-out) both; }
@keyframes wizIn { from { opacity: 0; transform: translateY(16px) scale(.99); } to { opacity: 1; transform: none; } }
.wiz-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.field-label .opt { color: var(--faint); text-transform: none; letter-spacing: 0; font-weight: 500; }

.gen-loading { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 18px; gap: 15px; }
.gen-spinner-big {
  width: 60px; height: 60px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.10);
  border-top-color: var(--teal); border-right-color: var(--purple);
  animation: spin 0.9s linear infinite;
  box-shadow: 0 0 28px rgba(45,212,191,0.4);
}
.gen-load-title {
  font-size: 17px; font-weight: 800;
  background: linear-gradient(100deg, var(--teal-2), var(--purple-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gen-quote { font-size: 14.5px; font-style: italic; color: var(--text); max-width: 480px; line-height: 1.45; }
.gen-fact { font-size: 12.5px; color: var(--muted); max-width: 480px; }
.gen-load-title, .gen-quote, .gen-fact { animation: fadeSwap .55s var(--ease-out); }
@keyframes fadeSwap { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Intro / hero — only the brand fades in first, then tagline, then CTA.
   The app stays hidden until "Get started".
   ============================================================ */
body.intro-mode .app { display: none; }
body:not(.intro-mode) #intro { display: none; }

.intro {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  background: transparent; /* let the moving aurora show through */
  transition: opacity .65s var(--ease);
}
.intro.hide { opacity: 0; pointer-events: none; }
.intro-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.intro-logo {
  width: 78px; height: 78px; border-radius: 22px; display: grid; place-items: center;
  font-size: 40px; background: linear-gradient(135deg, var(--teal), var(--purple));
  box-shadow: 0 0 0 1px rgba(45,212,191,0.4), 0 16px 50px rgba(168,85,247,0.4);
  animation: introFade 1.3s var(--ease-out) .15s both, floaty 5s ease-in-out 1.6s infinite;
}
.intro-brand {
  margin: 0; font-weight: 900; letter-spacing: 1px;
  font-size: clamp(42px, 9vw, 88px); line-height: 1.04;
  background: linear-gradient(100deg, #2dd4bf, #c084fc 50%, #f6c453);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: introFade 1.5s var(--ease-out) .3s both;
}
.intro-brand span { -webkit-text-fill-color: transparent; }
.intro-tagline {
  margin: 0; color: var(--muted); font-size: clamp(16px, 2.6vw, 23px); letter-spacing: .3px;
  animation: introFade 1s var(--ease-out) 1.6s both;
}
.intro-cta {
  font-size: 17px; padding: 15px 30px; border-radius: 999px; margin-top: 6px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  box-shadow: 0 14px 40px rgba(45,212,191,0.4), 0 0 0 1px rgba(168,85,247,0.3);
  animation: introFade .9s var(--ease-out) 2.5s both;
}
.intro-cta .arr { display: inline-block; transition: transform .2s var(--ease); }
.intro-cta:hover .arr { transform: translateX(5px); }

@keyframes introFade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* clicking "Get started" fades the brand/tagline/CTA out and the hype line in */
.intro-inner.go .intro-logo,
.intro-inner.go .intro-brand,
.intro-inner.go .intro-tagline,
.intro-inner.go .intro-cta {
  animation: none; opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
.intro-hype[hidden] { display: none; }
.intro-hype {
  position: absolute; font-weight: 800; letter-spacing: .3px;
  font-size: clamp(22px, 4.5vw, 36px);
  background: linear-gradient(100deg, var(--teal-2), var(--purple-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hypeIn .55s var(--ease-out) both;
}
@keyframes hypeIn { from { opacity: 0; transform: scale(.9) translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   PRE-LAUNCH GATE — only the Generate tab is available for now.
   Replay / Skill Tree / Playstyles / Progress / Library are gated behind
   a future account + payment flow. To unlock them later, delete this block.
   ============================================================ */
/* Hosted FREE (and signed-out) users get only the Generate tab; PRO unlocks the rest.
   In direct/local mode (no .cloud-mode class) everything shows. */
body.cloud-mode:not(.is-pro) .tab[data-view="replay"],
body.cloud-mode:not(.is-pro) .tab[data-view="tree"],
body.cloud-mode:not(.is-pro) .tab[data-view="pros"],
body.cloud-mode:not(.is-pro) .tab[data-view="progress"],
body.cloud-mode:not(.is-pro) .tab[data-view="library"] { display: none; }
body.cloud-mode:not(.is-pro) #goto-tree,
body.cloud-mode:not(.is-pro) #save-plan-btn { display: none; }

/* ---- desktop overlay mode (Electron #overlay): widen the quick-ref to fill the window ---- */
body.overlay-app .quick-overlay { top: 12px; left: 12px; right: 12px; width: auto; max-height: calc(100vh - 24px); }
.qo-head .qo-actions { display: flex; align-items: center; gap: 8px; }
.qo-newplan {
  border: none; cursor: pointer; font-size: 12px; font-weight: 700; color: #fff;
  padding: 5px 11px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  box-shadow: 0 4px 14px rgba(45,212,191,0.35);
  transition: filter .15s var(--ease), transform .12s var(--ease);
}
.qo-newplan[hidden] { display: none; }
.qo-newplan:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---- desktop overlay first-run onboarding (fading welcome messages) ---- */
.ov-onboard {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center; padding: 26px; text-align: center;
  background: rgba(5, 7, 12, 0.95);
  backdrop-filter: blur(12px);
  transition: opacity .5s var(--ease);
}
.ov-onboard[hidden] { display: none; }
.ov-onboard.hide { opacity: 0; pointer-events: none; }
.ov-onboard-inner { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.ov-msg {
  font-size: clamp(22px, 5.2vw, 34px); font-weight: 800; line-height: 1.32; max-width: 460px;
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  background: linear-gradient(100deg, var(--teal-2), var(--purple-2) 65%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ov-msg.in { opacity: 1; transform: none; }
.ov-cta {
  font-size: 16px; padding: 14px 28px; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--purple));
  box-shadow: 0 12px 36px rgba(45,212,191,0.42), 0 0 0 1px rgba(168,85,247,0.32);
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.ov-cta.in { opacity: 1; transform: none; }
.ov-cta[hidden] { display: none; }
.ov-cta .arr { display: inline-block; transition: transform .2s var(--ease); }
.ov-cta:hover .arr { transform: translateX(5px); }

/* ============================================================
   Quality fixes (legibility, mobile, intro) — kept LAST so they win.
   ============================================================ */
/* Readable dark text on the bright teal/purple filled controls (white failed WCAG contrast). */
.btn.primary, .tab.active, .intro-cta, .ov-cta, .qo-newplan, .overlay-toggle { color: #06231c; }

/* Make not-yet-reached wizard step dots visible (active dot keeps its gradient via higher specificity). */
.wiz-dot { background: rgba(255, 255, 255, 0.24); }

/* Center the intro "champ" hype line where the brand was (it is position:absolute). */
.intro-inner { position: relative; }
.intro-hype { top: 50%; left: 50%; }
@keyframes hypeIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* Mobile: keep the quick-ref inside narrow viewports (the Electron overlay already does this). */
@media (max-width: 420px) { .quick-overlay { left: 12px; right: 12px; width: auto; max-width: none; } }

/* Mobile: the two-up rank/playlist row must stack (overrides the earlier same-specificity rule). */
@media (max-width: 600px) { .row.two-col { grid-template-columns: 1fr; } }

/* Mobile perf: one animated aurora layer + lighter blur instead of two heavy full-viewport ones. */
@media (max-width: 600px) { body::after { display: none; } body::before { filter: blur(26px); } }

/* ============================================================
   Cloud mode: sign-in gate + account chip (injected by cloud.js,
   only present when RLFORGE_CONFIG.mode === "cloud").
   ============================================================ */
/* Email field: blended into the card, soft-rounded, with a cycling teal/purple/gold outline. */
.cloud-email-wrap {
  margin-bottom: 12px;
  padding: 2px;              /* this thin ring IS the animated outline */
  border-radius: 12px;
  background: linear-gradient(90deg, #2dd4bf, #a855f7, #f6c453, #2dd4bf, #a855f7, #f6c453, #2dd4bf);
  background-size: 200% 100%;
  animation: borderflow 5s linear infinite;
}
@keyframes borderflow { from { background-position: 0% 50%; } to { background-position: -200% 50%; } }
.cloud-email-wrap input {
  width: 100%; margin: 0; border: none; border-radius: 10px;
  background: #141a29;       /* matches the card, so no visible "box" */
  color: var(--text); padding: 11px 13px; font-size: 14px; outline: none;
}
.cloud-email-wrap input:focus { border: none; box-shadow: none; }
/* stop the browser's white/yellow autofill background */
.cloud-email-wrap input:-webkit-autofill,
.cloud-email-wrap input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #141a29 inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}
.cloud-msg { margin-top: 12px; font-size: 13px; color: var(--teal-2); min-height: 18px; }
.cloud-msg.err { color: #f87171; }  /* errors in red, not the default green */

/* Brand logo image replaces the old emoji in the topbar + intro hero. The logo SVG is a
   self-contained badge, so drop the gradient fill and let the image be the whole mark. */
.logo, .intro-logo { background: transparent; }
.logo > svg, .logo > img, .intro-logo > svg, .intro-logo > img { width: 100%; height: 100%; display: block; }
.logo { box-shadow: 0 6px 20px rgba(45,212,191,0.25); flex-shrink: 0; }

.cloud-account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cloud-account .ca-plan {
  font-size: 11px; font-weight: 800; letter-spacing: .4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); color: var(--muted);
}
.cloud-account .ca-plan.pro { background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06231c; }
.cloud-account .ca-usage { font-size: 11px; color: var(--faint); }

/* Hosted (cloud) mode: hide the direct-mode "uses your Anthropic API key" notes. */
body.cloud-mode .api-key-note { display: none; }
/* Keep the signed-in account chip from crowding the topbar on small screens. */
@media (max-width: 600px) {
  .cloud-account { width: 100%; justify-content: flex-end; margin-top: 6px; }
  .cloud-account .btn.small { padding: 5px 9px; }
}

/* ============================================================
   Scroll-reveal: plan/replay sections fade in as you scroll to them
   (overrides the earlier all-at-once entrance on .result-block).
   ============================================================ */
.result-block {
  animation: none;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.result-block.revealed { opacity: 1; transform: none; }

/* ============================================================
   Cloud v2: sign-in/upgrade modal, Free vs Pro, trial tag,
   intro sequence, and the upgrade-success celebration.
   ============================================================ */
#cloud-modal .modal { position: relative; max-width: 460px; }
.modal-x {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent;
  color: var(--muted); font-size: 15px; cursor: pointer; line-height: 1;
}
.modal-x:hover { color: var(--text); }

/* Free vs Pro comparison */
.plan-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.plan-box { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.plan-box.pro { border-color: rgba(168,85,247,0.5); box-shadow: 0 0 0 1px rgba(45,212,191,0.18), 0 10px 30px rgba(168,85,247,0.18); }
.plan-name { font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.plan-box.pro .plan-name {
  background: linear-gradient(100deg, var(--teal-2), var(--purple-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.plan-price { font-size: 26px; font-weight: 900; margin-bottom: 10px; }
.plan-price span { font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-box ul { list-style: none; padding: 0; margin: 0 0 12px; }
.plan-box li { font-size: 12.5px; color: var(--text); padding: 5px 0 5px 20px; position: relative; }
.plan-box li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
@media (max-width: 480px) { .plan-compare { grid-template-columns: 1fr; } }

/* free-trial plan-length tag + locked select */
.trial-tag { display: block; margin-top: 8px; font-size: 12px; color: var(--gold-2); }
.link-btn { border: none; background: transparent; color: var(--teal-2); cursor: pointer; text-decoration: underline; font-size: 12px; padding: 0; }
#days-input:disabled { opacity: 0.8; cursor: not-allowed; }

/* intro post–"Get started" sequence (reuses #intro-hype, one line at a time) */
.intro-hype { animation: none; opacity: 0; transform: translate(-50%, -52%); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.intro-hype.show { opacity: 1; transform: translate(-50%, -50%); }

/* upgrade-success celebration */
.cloud-celebrate {
  position: fixed; inset: 0; z-index: 700; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(5,7,12,0.92); backdrop-filter: blur(8px);
  transition: opacity .5s var(--ease);
}
.cloud-celebrate.hide { opacity: 0; pointer-events: none; }
.confetti-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebrate-inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px; max-width: 430px; }
.celebrate-title {
  font-size: clamp(26px, 5vw, 40px); font-weight: 900; opacity: 0;
  background: linear-gradient(100deg, var(--teal-2), var(--purple-2) 60%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: celebFade .7s var(--ease-out) 2s both;
}
.pro-benefits {
  width: 100%; padding: 2px; border-radius: 18px; opacity: 0;
  background: linear-gradient(90deg, #2dd4bf, #a855f7, #f6c453, #2dd4bf, #a855f7, #f6c453, #2dd4bf);
  background-size: 200% 100%;
  animation: borderflow 5s linear infinite, celebFade .7s var(--ease-out) 2.6s both;
}
.pb-inner { background: #11151f; border-radius: 16px; padding: 20px; text-align: left; }
.pb-h { font-weight: 800; color: var(--teal-2); text-transform: uppercase; letter-spacing: .5px; font-size: 12px; margin-bottom: 10px; }
.pb-inner ul { list-style: none; padding: 0; margin: 0 0 14px; }
.pb-inner li { font-size: 13.5px; padding: 6px 0 6px 22px; position: relative; }
.pb-inner li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 800; }
@keyframes celebFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Engagement: daily session card, streak, rank-up roadmap
   ============================================================ */
.today-card {
  background: linear-gradient(180deg, rgba(45,212,191,0.08), rgba(168,85,247,0.06));
  border: 1px solid rgba(45,212,191,0.25);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 20px;
}
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.today-title { font-weight: 800; font-size: 14px; }
.streak { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(246,196,83,0.15); color: var(--gold-2); }
.today-tip { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.today-warmup .tw-name { font-size: 13px; font-weight: 700; color: var(--teal-2); margin-bottom: 2px; }
.today-warmup ul.clean li { padding: 4px 0 4px 22px; font-size: 12.5px; }
#mark-trained { margin-top: 10px; }

.roadmap-card { background: var(--panel-2); border: 1px solid var(--border-soft); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.rm-head { font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.rl-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.rl-rank { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); color: var(--faint); border: 1px solid var(--border-soft); }
.rl-rank.current { background: linear-gradient(135deg, var(--teal), var(--purple)); color: #06231c; border-color: transparent; box-shadow: 0 6px 16px rgba(45,212,191,0.3); }
.rl-arrow { color: var(--faint); font-size: 12px; }
.rm-next { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rm-next b { color: var(--gold-2); }

/* ============================================================
   Accessibility: visible focus, reduced motion, tap targets
   ============================================================ */
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 6px; }
.btn.primary:focus-visible, .tab.active:focus-visible { outline-color: #ffffff; }
/* Restore a real focus indicator on the sign-in email field (its wrapper resets it). */
.cloud-email-wrap input:focus-visible { box-shadow: 0 0 0 2px var(--gold-2) inset !important; }

@media (prefers-reduced-motion: reduce) {
  /* Only stop CONTINUOUS / large motion (the vestibular-trigger kind). All the one-shot
     fade-in entrances (introFade, wizIn, rise, fadeUp, hypeIn, celebFade) and transitions
     are gentle opacity fades, so they stay — the brand experience is preserved. */
  body::before, body::after { animation: none !important; }                        /* background aurora drift */
  .pack-card, .drill-card, .pro-card, .day-card, .stat, .sys-card,
  .logo, .cloud-email-wrap { animation: none !important; }                         /* card bob, logo bob+glow, ring flow */
  .intro-logo { animation: introFade 1.3s var(--ease-out) .15s both !important; }  /* keep the fade, drop the bob */
  html { scroll-behavior: auto; }
}

@media (max-width: 600px) {
  .btn.small { min-height: 42px; }
  .modal-x, .qo-close, .copy-btn { min-height: 44px; min-width: 44px; }
}

/* ============================================================
   Site footer (legal + non-affiliation disclaimer)
   ============================================================ */
.site-footer { margin-top: 40px; padding: 24px 16px 40px; border-top: 1px solid rgba(255,255,255,0.07); }
.sf-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.sf-disclaimer { color: var(--faint); font-size: 12px; line-height: 1.6; margin: 0 0 12px; }
.sf-links { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 13px; }
.sf-links a { color: var(--muted); text-decoration: none; }
.sf-links a:hover { color: var(--teal-2); }
.sf-copy { color: var(--faint); }
body.intro-mode .site-footer, body.overlay-app .site-footer { display: none; }

/* In-product "AI output is not a guarantee" note shown with generated plans. */
.ai-disclaimer { font-size: 12px; color: var(--faint); border: 1px dashed rgba(255,255,255,0.14); border-radius: 8px; padding: 8px 12px; margin: 2px 0 16px; }

/* Upgrade modal extras: value sub-line, risk-reversal, contextual reason banner */
.plan-sub { font-size: 11px; color: var(--faint); margin: -4px 0 8px; }
.plan-reassure { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }
.upgrade-reason { background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.3); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--teal-2); margin-bottom: 12px; }
