/* style.css — warm dark theme for Dad's Field Guide (thedaddyproject.org) */

:root {
  --bg: #13110e;
  --bg-elevated: #1e1a14;
  --bg-card: #252018;
  --border: #3c3428;
  --text: #ede8de;
  --text-dim: #9a8a72;
  --amber: #f0a832;
  --amber-dim: #b88828;
  --green: #4caf78;
  --orange: #e8732a;
  --blue: #5ba3d4;
  --red: #e06060;
  --purple: #b07fd4;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.nav-bar a {
  color: var(--amber-dim);
  text-decoration: none;
}

.nav-bar a:hover {
  color: var(--amber);
}

.nav-brand {
  color: var(--text-dim);
}

.nav-brand strong a {
  color: var(--amber);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

footer p {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

footer p:last-child { margin-bottom: 0; }

footer strong { color: var(--text); }

footer a {
  color: var(--amber);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

footer .c3-mission {
  max-width: 600px;
  margin: 0.75rem auto;
  line-height: 1.5;
}

footer .donate { margin: 0.75rem 0; }

footer .copyright {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 1rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1a1510 0%, var(--bg) 100%);
  position: relative;
}


.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.title-the {
  font-weight: 700;
  font-size: 0.72em;
  color: #b89050;
  letter-spacing: 0.04em;
  vertical-align: 0.12em;
}

.title-main {
  background: linear-gradient(135deg, #f5e0a0 0%, #f0a832 55%, #c87820 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero-tagline {
  color: #c0b09a;
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

/* XP bar */
.xp-block {
  max-width: 520px;
  margin: 0 auto;
}

.xp-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.xp-meta #level-label {
  color: var(--amber);
  font-weight: 600;
}

.xp-meta #xp-tally {
  color: var(--text-dim);
}

.xp-bar-track {
  height: 12px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber), #f5c050);
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(240, 168, 50, 0.5);
}

.xp-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.streak-badge {
  display: inline-block;
  background: #2a1a06;
  border: 1px solid #5a3010;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-top: 1rem;
}

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar-container {
  position: absolute;
  right: max(1.5rem, calc(50% - 430px));
  bottom: 2rem;
  width: 68px;
  text-align: center;
  pointer-events: none;
}
.avatar-container svg {
  width: 100%;
  height: auto;
  display: block;
}
.avatar-label {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.25rem;
}
@keyframes avatar-pop {
  0%   { opacity: 0.2; transform: scale(0.85); }
  60%  { opacity: 1;   transform: scale(1.08); }
  100% { opacity: 1;   transform: scale(1); }
}
.avatar-pop { animation: avatar-pop 0.55s ease-out; }
@media (max-width: 680px) { .avatar-container { display: none; } }

/* ── Floating avatar (fixed, appears on scroll) ───────────────────────────── */
#floating-avatar {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 52px;
  text-align: center;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#floating-avatar.visible {
  opacity: 1;
  transform: translateY(0);
}
#floating-avatar svg { width: 100%; height: auto; display: block; }
#floating-avatar .avatar-label { font-size: 0.55rem; }
@media (max-width: 680px) { #floating-avatar { display: none; } }

/* ── Essential Ten — Start Here panel ────────────────────────────────────── */
#essential-ten {
  max-width: 900px;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem 0.25rem;
}

.ess-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.2rem 1rem;
}

.ess-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.ess-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.ess-progress-text {
  font-size: 0.75rem;
  color: var(--text-dim, #888);
  font-weight: 600;
}

.ess-sub {
  font-size: 0.78rem;
  color: var(--text-dim, #888);
  margin-bottom: 0.85rem;
}

.ess-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.ess-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.4rem 0.5rem;
  background: var(--bg, #12120f);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.ess-card:hover {
  border-color: var(--accent, #d4c5a9);
  background: #1a1a16;
}

.ess-card.completed {
  border-color: #3a5a3a;
  background: #141e14;
}

.ess-card.mastered {
  border-color: #6a8028;
  background: #161c10;
}

.ess-cat-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.ess-title {
  font-size: 0.68rem;
  color: var(--text-dim, #888);
  line-height: 1.25;
}

.ess-card.completed .ess-title,
.ess-card.mastered .ess-title {
  color: var(--text, #e0e0e0);
}

.ess-check {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #6aaa6a;
}

.ess-card.mastered .ess-check {
  color: var(--accent, #d4c5a9);
}

.ess-footer {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.ess-bar-wrap {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.ess-bar {
  height: 100%;
  background: var(--accent, #d4c5a9);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.ess-badge-hint {
  font-size: 0.7rem;
  color: var(--text-dim, #888);
  white-space: nowrap;
}

.ess-badge-hint.unlocked {
  color: var(--accent, #d4c5a9);
  font-weight: 600;
}

@media (max-width: 540px) {
  .ess-grid { grid-template-columns: repeat(5, 1fr); gap: 0.3rem; }
  .ess-panel { padding: 0.85rem 0.9rem 0.85rem; }
  .ess-cat-icon { font-size: 1.05rem; }
  .ess-title { font-size: 0.6rem; }
}

/* ── Control bar (tabs + search on one row) ───────────────────────────────── */
.control-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem 0.5rem;
}

/* ── Search bar ───────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.search-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.search-bar input[type="search"] {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.search-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--amber-dim);
}

.search-bar input[type="search"]::placeholder {
  color: var(--text-dim);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
  font-family: inherit;
}

.search-clear:hover { color: var(--text); }

/* ── Search results panel ─────────────────────────────────────────────────── */
.search-results {
  max-width: 720px;
  margin: 0.5rem auto 1rem;
  padding: 0 1.5rem;
}

.search-count {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  padding: 0 0.25rem;
}

.search-count strong { color: var(--amber); }

.search-empty {
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 1rem;
  text-align: center;
}

.search-empty strong { color: var(--text); }

.search-cat-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0.75rem 0 0.3rem;
  padding: 0 0.25rem;
}

.search-results .skill-list {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

/* ── Inline field slots ───────────────────────────────────────────────────── */
.skill-fields {
  margin: 0 1rem 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #181410;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.fields-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 0.3rem;
  grid-column: 1 / -1;
}

.field-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.field-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 140px;
}

.field-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  transition: border-color 0.15s;
}

.field-input:focus {
  outline: none;
  border-color: var(--amber-dim);
}

.field-input::placeholder { color: var(--text-dim); opacity: 0.5; }

.field-input:not(:placeholder-shown) {
  border-color: #3a3020;
  color: var(--amber);
}

@media (min-width: 500px) {
  .skill-fields {
    grid-template-columns: 1fr 1fr;
  }
  .fields-label { grid-column: 1 / -1; }
}

/* ── Section headings ─────────────────────────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dim);
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0.75rem 1.2rem;
  border-left: 3px solid var(--amber-dim);
  display: block;
}

/* Category strip ends cleanly; skill panel sits below it as its own section */
#category-section {
  padding-bottom: 0.5rem;
  scroll-margin-top: 56px;
}


/* Full-width separator between sections */
hr.section-break {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0 0;
}

/* Badge label — achievement zone header */
#badge-label {
  max-width: 1040px;
  padding-top: 2.5rem;
  border-left-color: var(--amber);
  color: var(--amber);
}

/* ── Category strip ───────────────────────────────────────────────────────── */
.category-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.6rem;
  padding: 0 1.5rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
  color: var(--text);
  font-family: inherit;
  flex: 1 1 200px;
  min-width: 170px;
  max-width: min(320px, calc(25% - 0.5rem));
  min-height: 72px;
}

.cat-card:hover {
  border-color: var(--amber-dim);
  background: #231f18;
  transform: translateY(-1px);
}

.cat-card.active {
  border-color: var(--amber);
  background: #221c10;
}

.cat-card.complete {
  border-color: var(--green);
}

.cat-card.complete.active {
  border-color: var(--green);
  background: #0e1f12;
}

.cat-ring-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.cat-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  line-height: 1;
}

.cat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cat-name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.2;
  hyphens: auto;
}

.cat-count {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.cat-tier {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 0.1rem;
}

/* Tier section dividers in "All" view */
.tier-divider {
  flex-basis: 100%;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  padding: 0.75rem 0.5rem 0.35rem 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  border-left: 3px solid transparent;
}
.tier-divider:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.tier-divider[data-tier="core"]    { border-left-color: #a87820; color: #a87820; }
.tier-divider[data-tier="growth"]  { border-left-color: #4a9a6a; color: #4a9a6a; }
.tier-divider[data-tier="explore"] { border-left-color: #8a6bc8; color: #8a6bc8; }

/* Hide per-card tier label in "All" view — dividers already tell the story */
.category-strip[data-view="all"] .cat-tier { display: none; }

/* ── Tier filter bar ──────────────────────────────────────────────────────── */
.tier-filter-bar {
  display: flex;
  justify-content: flex-start;
  gap: 0.4rem;
  padding: 0 1.5rem 0.6rem;
  max-width: 900px;
  margin: 0 auto;
}

.tier-pill {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: color 0.15s, border-color 0.15s;
}

.tier-pill:hover {
  color: var(--text);
  border-color: var(--amber-dim);
}

.tier-pill.active                    { color: var(--amber); border-color: var(--amber); }
.tier-pill.active[data-tier="core"]    { color: #c89830; border-color: #c89830; }
.tier-pill.active[data-tier="growth"]  { color: #4a9a6a; border-color: #4a9a6a; }
.tier-pill.active[data-tier="explore"] { color: #8a6bc8; border-color: #8a6bc8; }

/* ── Skill panel ──────────────────────────────────────────────────────────── */
.skill-panel {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  scroll-margin-top: 60px; /* clears floating XP bar (42px) + breathing room */
}

@media (min-width: 960px) {
  .skill-panel { margin: 0 auto 1.5rem; }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #1e1b16;
}

.panel-icon { font-size: 1.2rem; }

.panel-title {
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.panel-close:hover { color: var(--text); }

.skill-list {
  list-style: none;
}

.skill-item {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.skill-item:last-child { border-bottom: none; }

.skill-item.done { background: #151210; }

.skill-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.skill-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.skill-check-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.skill-row:hover .skill-check-box {
  border-color: var(--amber-dim);
}

input[type="checkbox"]:checked ~ .skill-text ~ .skill-xp { /* sibling skip */  }
.skill-item.done .skill-check-box {
  background: var(--green);
  border-color: var(--green);
}

.skill-item.done .skill-check-box::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #0f0d0a;
  border-left: none;
  border-top: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.skill-text {
  flex: 1;
  min-width: 0;
}

.skill-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.skill-item.done .skill-title {
  color: var(--text-dim);
  text-decoration: line-through;
}

.skill-summary {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.skill-xp {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.skill-item.done .skill-xp {
  color: var(--green);
}

.skill-footer {
  padding: 0 1rem 0.85rem;
}

.tip-toggle {
  background: none;
  border: none;
  color: var(--amber-dim);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
}

.tip-toggle:hover { color: var(--amber); }

.skill-tip {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: #221c10;
  border-left: 3px solid var(--amber-dim);
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── Deep Dive accordion ──────────────────────────────────────────────────── */
.dd-toggle {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.1rem 0;
  margin-top: 0.4rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.dd-toggle:hover { color: #8ec8f0; }

.skill-deepdive {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  background: #111620;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  font-size: 0.83rem;
  line-height: 1.7;
}

.dd-body p {
  color: var(--text);
  margin-bottom: 0.75rem;
}
.dd-body p:last-child { margin-bottom: 0; }

.dd-section {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #1e2430;
}

.dd-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.45rem;
}

.dd-prompts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dd-prompts li {
  color: var(--text);
  padding-left: 1.2em;
  position: relative;
}
.dd-prompts li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}

.dd-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dd-links a {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.8rem;
}
.dd-links a:hover { text-decoration: underline; color: #8ec8f0; }

/* ── Badge shelf ──────────────────────────────────────────────────────────── */
.badge-shelf {
  padding: 0 1.5rem 2rem;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.badge-group { margin-bottom: 1rem; }
.badge-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, #888);
  margin: 0 0 0.5rem 0.1rem;
}
.badge-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.6rem;
}

.badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  position: relative;
  transition: transform 0.1s, border-color 0.15s;
}

.badge.unlocked {
  border-color: var(--amber-dim);
}

.badge.unlocked:hover {
  transform: translateY(-2px);
  border-color: var(--amber);
}

.badge.locked {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.badge-icon {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.badge-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  line-height: 1.3;
}

.badge.unlocked .badge-label {
  color: var(--amber);
}

.badge-lock {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 0.65rem;
  opacity: 0.4;
}

/* CSS tooltip for badges */
.badge[data-tip] {
  position: relative;
}

.badge[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0e0c09;
  border: 1px solid var(--amber);
  color: #f0e8d8;
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  max-width: 160px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.badge[data-tip]:hover::after {
  opacity: 1;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #2a2217;
  border: 1px solid var(--amber-dim);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  max-width: 300px;
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Share modal ─────────────────────────────────────────────────────────── */
#share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.share-modal-box {
  background: #1a1509;
  border: 1px solid var(--amber);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 240px;
  text-align: center;
}

.share-modal-title {
  color: var(--amber);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.share-opt {
  background: #2a1e06;
  border: 1px solid var(--amber);
  color: var(--amber);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.share-opt:hover {
  background: #3a2a0a;
}

.share-cancel {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem;
}

.share-cancel:hover {
  color: var(--text);
}

/* ── Level modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--amber);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  max-width: 320px;
  width: calc(100% - 2rem);
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-burst {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: burst 0.6s ease;
}

@keyframes burst {
  0%   { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin-bottom: 0.25rem;
}

.modal-level-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.15rem;
}

.modal-level-title {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.modal-xp {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.modal-close {
  background: var(--amber);
  border: none;
  color: #0f0d0a;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.modal-close:hover { opacity: 0.85; }

/* ── Floating XP bar ──────────────────────────────────────────────────────── */
#floating-xp {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 42px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

#floating-xp.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fxp-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}

#fxp-level {
  font-size: 0.75rem;
  color: var(--amber);
  font-weight: 600;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.fxp-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.fxp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#fxp-tally {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Hero action buttons ───────────────────────────────────────────────────── */
.hero-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.btn-sheet {
  background: none;
  border: 1px solid #3a3020;
  color: var(--amber-dim);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sheet:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-study {
  background: none;
  border: 1px solid #2a2a3a;
  color: var(--purple);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-study:hover {
  border-color: var(--purple);
  color: var(--text);
}

.btn-reset-all {
  background: none;
  border: 1px solid #3a2222;
  color: #7a5050;
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-reset-all:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-save-menu {
  background: none;
  border: 1px solid #1a3a1a;
  color: #4a8a4a;
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-save-menu:hover {
  border-color: #4a8a4a;
  color: #6abf6a;
}

/* ── Save / Restore modal ── */
.save-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  align-items: center; justify-content: center;
}
.save-modal-overlay.open { display: flex; }

.save-modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--amber);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  max-width: 320px;
  width: 90vw;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.save-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.save-opt {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.save-opt:hover {
  border-color: var(--amber-dim);
  background: rgba(240, 168, 50, 0.06);
}
.save-opt-dim { color: var(--text-dim); }

.save-cancel {
  background: none; border: none;
  color: var(--text-dim); font-size: 0.75rem;
  font-family: inherit; cursor: pointer;
  padding: 0.4rem; margin-top: 0.25rem;
  transition: color 0.15s;
}
.save-cancel:hover { color: var(--text); }

/* ── Filter pills ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #1a1713;
  flex-wrap: wrap;
}

.filter-pill {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-family: inherit;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--amber-dim);
  color: var(--text);
}

.filter-pill.active {
  background: #2a1f08;
  border-color: var(--amber);
  color: var(--amber);
}

/* ── Mastered skill state ─────────────────────────────────────────────────── */
.skill-item.mastered .skill-check-box {
  background: var(--amber);
  border-color: var(--amber);
}

.skill-item.mastered .skill-check-box::after {
  content: '★';
  display: block;
  color: #0f0d0a;
  font-size: 12px;
  line-height: 1;
  border: none;
  transform: none;
  width: auto;
  height: auto;
}

.skill-item.mastered .skill-title {
  color: var(--amber);
  text-decoration: none;
}

.skill-item.mastered .skill-xp {
  color: var(--amber);
}

/* ── Star (master) button ─────────────────────────────────────────────────── */
.master-btn {
  background: none;
  border: 1px dashed var(--amber-dim);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.5rem;
  flex-shrink: 0;
  align-self: center;
  color: var(--amber-dim);
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.master-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(240, 168, 50, 0.07);
}

.master-btn.on {
  background: var(--amber);
  border-color: var(--amber);
  border-style: solid;
  color: #0f0d0a;
  font-weight: 600;
}

.master-btn.on:hover {
  background: var(--amber-dim);
  border-color: var(--amber-dim);
}

/* ── Panel hint ───────────────────────────────────────────────────────────── */
.panel-hint {
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  margin: 0;
  line-height: 1.5;
}
.panel-hint em {
  font-style: normal;
  color: var(--amber-dim);
}

/* ── Notes textarea ───────────────────────────────────────────────────────── */
.skill-notes {
  margin: 0 1rem 0.85rem;
}

.skill-notes textarea {
  width: 100%;
  min-height: 56px;
  background: #1a1510;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 0.4rem 0.6rem;
  resize: vertical;
  transition: border-color 0.15s;
}

.skill-notes textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.skill-notes textarea:focus {
  outline: none;
  border-color: var(--amber-dim);
}

/* ── Category switcher FAB ────────────────────────────────────────────────── */
#cat-menu-fab {
  position: fixed;
  bottom: 5.5rem;
  left: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  z-index: 45;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, border-color 0.15s;
}
#cat-menu-fab:hover {
  background: #2a2318;
  border-color: var(--amber);
}
@media (max-width: 680px) {
  #cat-menu-fab { bottom: 1rem; }
}

#cat-menu {
  background: #1e1b16;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0;
  z-index: 200;
  min-width: 210px;
  max-height: 65vh;
  overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.cat-menu-tier {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.65rem 0.9rem 0.2rem;
  opacity: 0.9;
}

.cat-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}
.cat-menu-item:hover { background: rgba(255, 255, 255, 0.05); }
.cat-menu-item.active { background: rgba(240, 168, 50, 0.1); color: var(--amber); }

.cat-menu-icon { font-size: 0.9rem; flex-shrink: 0; }
.cat-menu-name { flex: 1; }
.cat-menu-prog { font-size: 0.7rem; color: var(--text-dim); }
.cat-menu-item.active .cat-menu-prog { color: var(--amber-dim); }

/* ── Reset category button ────────────────────────────────────────────────── */
.btn-reset-cat {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
  font-family: inherit;
}

.btn-reset-cat:hover { color: var(--red); }

/* ── Footer override ──────────────────────────────────────────────────────── */
footer {
  border-top-color: var(--border);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero { padding: 2rem 1rem 1.5rem; }
  .control-bar { flex-wrap: wrap; padding: 0.75rem 1rem 0.4rem; gap: 0.5rem; }
  .search-bar { flex: 1 1 100%; }
  .category-strip { gap: 0.5rem; padding: 0 1rem 0.75rem; }
  .cat-card { flex: 0 1 calc(50% - 0.5rem); min-width: 130px; padding: 0.5rem; }
  .cat-name { font-size: 0.75rem; }
  .skill-panel { margin: 0 0.75rem 1rem; }
  .badge-shelf { padding: 0 1rem 1.5rem; }
  .badge-row { grid-template-columns: repeat(4, 1fr); }
  .section-label { padding: 1.25rem 1rem 0.6rem 0.75rem; }
}

/* ── Mobile hero overflow menu ───────────────────────────────────────────── */
.hero-more-wrap { position: relative; display: none; }

.btn-more {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  padding: 0.28rem 0.65rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s;
}
.btn-more:hover { border-color: var(--accent-dim); color: var(--text); }

.hero-more-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  background: #1e1b16;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0;
  min-width: 130px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.hero-more-menu.open { display: block; }

.more-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 0.55rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.more-item:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.more-item.more-danger:hover { color: var(--red); }

@media (max-width: 480px) {
  .btn-save-menu, .btn-reset-all { display: none; }
  .hero-more-wrap { display: block; }
}

/* ── Konami code easter egg ───────────────────────────────────────────────── */
@keyframes konami-flash {
  0%, 100% { filter: none; }
  15%  { filter: brightness(1.6) hue-rotate(110deg) saturate(3); }
  35%  { filter: brightness(0.6) hue-rotate(130deg) saturate(4); }
  55%  { filter: brightness(1.8) hue-rotate(90deg)  saturate(2); }
  75%  { filter: brightness(0.8) hue-rotate(120deg) saturate(3); }
}
body.konami-flash {
  animation: konami-flash 0.8s ease;
}

/* ── Onboarding "start here" ──────────────────────────────────────────────── */
#onboarding {
  max-width: 900px;
  margin: 0.75rem auto 0;
  padding: 0 1.25rem;
}
.onboarding-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(168, 120, 32, 0.08);
  border: 1px solid rgba(168, 120, 32, 0.3);
  border-radius: 10px;
  padding: 0.9rem 1rem;
}
.onboarding-wave { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.onboarding-text { flex: 1; font-size: 0.88rem; color: var(--text-dim, #aaa); line-height: 1.4; }
.onboarding-text strong { color: var(--text, #e0e0e0); }
.onboarding-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.onboarding-chip {
  background: rgba(168, 120, 32, 0.15);
  border: 1px solid rgba(168, 120, 32, 0.4);
  border-radius: 16px;
  color: #c8a24a;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.onboarding-chip:hover { background: rgba(168, 120, 32, 0.3); border-color: #a87820; }
.onboarding-dismiss {
  background: none;
  border: none;
  color: var(--text-dim, #666);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 4px;
}
.onboarding-dismiss:hover { color: var(--text, #e0e0e0); background: rgba(255,255,255,0.05); }

/* ── View tabs (Skills / Quizzes) — lives inside .control-bar ────────────── */
.view-tabs {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.view-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.view-tab:hover { color: var(--text); border-color: var(--amber-dim); }
.view-tab.active {
  background: var(--amber-dim);
  border-color: var(--amber-dim);
  color: #fff;
  font-weight: 600;
}

/* ── Quiz CTA (inside skill panel) ───────────────────────────────────────── */
.quiz-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(168, 120, 32, 0.12);
  border: 1px solid rgba(168, 120, 32, 0.35);
  flex-wrap: wrap;
}
.quiz-cta--aced { background: rgba(76, 175, 120, 0.1); border-color: rgba(76, 175, 120, 0.3); }
.quiz-cta--tried { background: rgba(100, 120, 200, 0.1); border-color: rgba(100, 120, 200, 0.3); }
.quiz-cta-icon { font-size: 1.3rem; flex-shrink: 0; }
.quiz-cta-text { flex: 1; font-size: 0.88rem; color: var(--text-dim, #888); }
.quiz-cta-btn {
  background: #a87820;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.quiz-cta-btn:hover { background: #c8940a; }
.quiz-cta--aced .quiz-cta-btn { background: #3a7a54; }
.quiz-cta--aced .quiz-cta-btn:hover { background: #4caf78; }

/* ── Quiz panel (Quizzes tab) ─────────────────────────────────────────────── */
#quiz-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}
.quiz-panel-header { margin-bottom: 1.25rem; }
.quiz-panel-title { font-size: 1.2rem; font-weight: 700; color: var(--text, #e0e0e0); margin: 0 0 0.25rem; }
.quiz-panel-sub { font-size: 0.82rem; color: var(--text-dim, #888); margin: 0 0 0.5rem; }
.quiz-panel-stats { font-size: 0.82rem; color: #a87820; }
.qpstat-sep { color: var(--text-dim, #888); }

.qcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.qcard {
  background: var(--surface, #1e1c18);
  border: 1.5px solid var(--border, #2a2820);
  border-radius: 10px;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
  border-top: 3px solid var(--cat-color, #888);
}
.qcard:not(.qcard--locked):hover { transform: translateY(-2px); border-color: var(--cat-color, #888); background: #252218; }
.qcard--locked { opacity: 0.45; cursor: default; }
.qcard--ace { box-shadow: 0 0 0 1px rgba(76,175,120,0.4); }
.qcard-icon { font-size: 1.5rem; }
.qcard-name { font-size: 0.78rem; font-weight: 600; color: var(--text, #e0e0e0); line-height: 1.2; }
.qcard-score { font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 10px; margin-top: 0.1rem; }
.qcard-score--ace    { background: rgba(76,175,120,0.15); color: #4caf78; }
.qcard-score--tried  { background: rgba(100,120,200,0.15); color: #8899dd; }
.qcard-score--ready  { background: rgba(168,120,32,0.15);  color: #a87820; }
.qcard-score--locked { color: var(--text-dim, #888); }

/* ── Quiz modal ───────────────────────────────────────────────────────────── */
#quiz-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
#quiz-modal.visible { display: flex; }

.quiz-modal-box {
  background: #1c1a16;
  border: 1px solid #3a3528;
  border-radius: 14px;
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}
.quiz-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quiz-cat-label { font-size: 0.9rem; font-weight: 700; color: #a87820; flex: 1; }
.quiz-progress { font-size: 0.78rem; color: var(--text-dim, #888); }
.quiz-close-btn {
  background: none;
  border: none;
  color: var(--text-dim, #888);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}
.quiz-close-btn:hover { color: var(--text, #e0e0e0); background: rgba(255,255,255,0.05); }

.quiz-question {
  font-size: 1rem;
  color: var(--text, #e0e0e0);
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}

.quiz-options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.quiz-opt-btn {
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.04);
  border: 1px solid #3a3528;
  border-radius: 8px;
  color: var(--text, #e0e0e0);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.3;
}
.quiz-opt-btn:hover:not(:disabled) { background: rgba(168,120,32,0.12); border-color: #a87820; }
.quiz-opt-btn.correct { background: rgba(76,175,120,0.2); border-color: #4caf78; color: #a0e0b8; }
.quiz-opt-btn.wrong   { background: rgba(220,80,80,0.2);  border-color: #e06060; color: #f09090; }
.quiz-opt-btn:disabled { cursor: default; }

.quiz-next-btn {
  background: #a87820;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-end;
  transition: background 0.15s;
}
.quiz-next-btn:hover { background: #c8940a; }
.quiz-next-btn--secondary { background: #2a2820; color: var(--text-dim, #888); }
.quiz-next-btn--secondary:hover { background: #3a3528; color: var(--text, #e0e0e0); }

/* Quiz results state */
.quiz-results { text-align: center; }
.quiz-result-icon { font-size: 2.5rem; }
.quiz-result-score { font-size: 2rem; font-weight: 800; color: #a87820; margin: 0; }
.quiz-result-msg { font-size: 1rem; color: var(--text, #e0e0e0); margin: 0; }
.quiz-result-sub { font-size: 0.8rem; color: var(--text-dim, #888); margin: 0; }
.quiz-result-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 0.5rem; }

@media (max-width: 600px) {
  .qcard-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; }
  .quiz-modal-box { padding: 1.1rem; }
  .quiz-question { font-size: 0.92rem; }
}
