:root {
  --bg: #08080a;
  --bg2: #0f0f13;
  --card: #14141a;
  --card2: #1a1a22;
  --border: #26262f;
  --amber: #e8c547;
  --amber-dim: #a88a2c;
  --red: #e74c3c;
  --text: #d8d4cc;
  --muted: #7d7a72;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(circle at 50% -10%, #1a1410 0%, var(--bg) 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 220px 60px #000;
  z-index: 1;
}

.app-wrap { position: relative; z-index: 2; max-width: 1000px; margin: 0 auto; padding: 0 14px 80px; }

/* Header */
.header {
  position: relative;
  text-align: center;
  padding: 48px 16px 30px;
  overflow: hidden;
}
.fog {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(232,197,71,0.06), transparent 60%);
  pointer-events: none;
}
.title {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 6rem);
  letter-spacing: 0.15em;
  color: var(--amber);
  line-height: 1;
}
.glow { animation: flicker 4.5s infinite; }
@keyframes flicker {
  0%, 100% { text-shadow: 0 0 18px rgba(232,197,71,0.55), 0 0 40px rgba(232,197,71,0.25); }
  8% { text-shadow: 0 0 4px rgba(232,197,71,0.2); }
  10% { text-shadow: 0 0 22px rgba(232,197,71,0.7); }
  40% { text-shadow: 0 0 8px rgba(232,197,71,0.3); }
  42% { text-shadow: 0 0 20px rgba(232,197,71,0.6); }
  70% { text-shadow: 0 0 3px rgba(232,197,71,0.15); }
  72% { text-shadow: 0 0 24px rgba(232,197,71,0.75); }
}
.subtitle {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  letter-spacing: 0.5em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 6px 0 2px;
  padding-left: 0.5em;
}
.tagline { color: var(--muted); font-size: 0.72rem; font-style: italic; margin-bottom: 22px; }

.stat-big { display: flex; align-items: baseline; justify-content: center; gap: 14px; margin-bottom: 12px; }
.stat-num { font-size: 2.4rem; font-weight: 600; color: var(--text); }
.stat-slash { color: var(--muted); font-size: 1.4rem; }
.stat-pct { font-size: 2.4rem; font-weight: 600; color: var(--amber); }

.status-msg { color: var(--amber-dim); font-size: 0.78rem; font-style: italic; margin: 14px 0 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px; font-size: 0.7rem;
}
.chip-count { color: var(--amber); font-weight: 600; }

/* Progress bar */
.progress-track {
  width: 100%; height: 7px; background: #000;
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.progress-track.big { height: 11px; max-width: 480px; margin: 0 auto; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  box-shadow: 0 0 12px rgba(232,197,71,0.5);
  transition: width 0.5s cubic-bezier(.2,.8,.2,1);
}

/* Controls */
.controls {
  position: sticky; top: 0; z-index: 5;
  background: rgba(8,8,10,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.search-box { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; font-size: 0.85rem; opacity: 0.6; }
.search-input {
  width: 100%; background: #000; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 34px;
  font-family: inherit; font-size: 0.85rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus { border-color: var(--amber); box-shadow: 0 0 0 2px rgba(232,197,71,0.15); }
.clear-btn { position: absolute; right: 10px; background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; line-height: 1; }

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { height: 4px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.pill, .tab {
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: 0.72rem;
  padding: 6px 14px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; transition: all 0.18s;
}
.pill:hover, .tab:hover { border-color: var(--amber-dim); color: var(--text); }
.pill-active { background: var(--amber); color: #1a1400; border-color: var(--amber); font-weight: 600; }
.tab-active { background: rgba(232,197,71,0.12); color: var(--amber); border-color: var(--amber-dim); }
.tab-danger { color: #b25248; border-color: #3a2320; margin-left: auto; }
.tab-danger:hover { background: rgba(231,76,60,0.12); color: var(--red); border-color: var(--red); }

/* Areas */
.area {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber-dim);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  overflow: hidden;
}
.accent-amber { border-left-color: var(--amber-dim); }
.accent-red { border-left-color: #7a2b23; }
.accent-green { border-left-color: #2e6b3a; }
.accent-orange { border-left-color: #8a5522; }

.area-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; cursor: pointer;
  transition: background 0.15s;
}
.area-head:hover { background: rgba(255,255,255,0.02); }
.area-title { font-family: 'Cinzel', serif; font-weight: 600; font-size: 1.15rem; flex: 1; letter-spacing: 0.04em; }
.area-count { color: var(--amber); font-size: 0.8rem; font-weight: 600; }
.caret { color: var(--muted); font-size: 0.9rem; width: 16px; text-align: center; }
.caret.sm { font-size: 0.7rem; }

.subs { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.sub-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.sub-head { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 10px; }
.sub-title { flex: 1; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.sub-count { font-size: 0.72rem; color: var(--muted); }

.ach-grid {
  display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 12px;
}
@media (min-width: 720px) {
  .ach-grid { grid-template-columns: 1fr 1fr; }
}

.ach-row {
  display: flex; align-items: flex-start; gap: 10px;
  text-align: left; width: 100%;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; cursor: pointer;
  font-family: inherit; color: var(--text);
  transition: all 0.16s;
}
.ach-row:hover { border-color: var(--amber-dim); background: #1e1e26; }
.ach-done {
  border-left: 3px solid var(--amber);
  background: rgba(232,197,71,0.05);
  opacity: 0.72;
}
.checkbox {
  flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px;
  border: 1.5px solid var(--border); border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: #1a1400; background: #000;
  transition: all 0.2s;
}
.checkbox.checked {
  background: var(--amber); border-color: var(--amber);
  box-shadow: 0 0 10px rgba(232,197,71,0.5);
  animation: pop 0.3s;
}
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.ach-name { display: block; font-size: 0.82rem; font-weight: 500; line-height: 1.3; }
.ach-done .ach-name { text-decoration: line-through; text-decoration-color: var(--amber-dim); }
.ach-desc { display: block; font-size: 0.68rem; color: var(--muted); margin-top: 3px; line-height: 1.35; }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-emoji { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }

/* Footer */
.footer { text-align: center; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.72rem; line-height: 1.9; }
.footer-joke { font-style: italic; opacity: 0.7; }
.remix { color: var(--amber-dim); text-decoration: none; border-bottom: 1px dashed var(--amber-dim); }
.remix:hover { color: var(--amber); }

/* To top */
.to-top {
  position: fixed; bottom: 20px; right: 20px; z-index: 10;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--amber); color: #1a1400; border: none;
  font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 14px rgba(232,197,71,0.4);
  transition: transform 0.15s;
}
.to-top:hover { transform: translateY(-3px); }

/* Confetti */
.confetti-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.confetti {
  position: absolute; top: -20px; width: 9px; height: 14px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: 0.2; }
}
</parameter>