:root {
  --bg: #0f0f0f;
  --panel: #171717;
  --panel-soft: #1f1f1f;
  --violet: #8b5cf6;
  --violet-soft: #b79cff;
  --text: #f4f4f4;
  --muted: #adadad;
  --line: #2e2e2e;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, #252525 0%, transparent 30%),
    radial-gradient(circle at 92% 90%, #2a1f3d 0%, transparent 34%),
    var(--bg);
}

.app-shell {
  width: min(1500px, 96vw);
  margin: 2rem auto;
  display: grid;
  gap: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  margin: 0.2rem 0;
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
}

.subtext {
  margin: 0;
  color: #cfcfcf;
}

.bento-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 290px 1fr 320px;
  align-items: start;
}

.column {
  display: grid;
  gap: 0.9rem;
}

.card {
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.card-wide {
  padding: 1.1rem;
}

.label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", monospace;
}

.composer form {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.6rem;
}

.voice-btn {
  border-color: #4d3d71;
  background: #191623;
}

.voice-btn.listening {
  border-color: #9b7bdf;
  background: #2b1f41;
}

.voice-status {
  margin: -0.15rem 0 0;
  font-size: 0.74rem;
  color: #cbc0e6;
  font-family: "IBM Plex Mono", monospace;
}

input,
select,
button {
  border: 1px solid var(--line);
  background: #131313;
  color: var(--text);
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

button:hover {
  background: #221b30;
  border-color: #5e4299;
}

input:focus,
select:focus,
button:focus,
.delete-btn:focus {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.stats-list {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.stats-list p,
.insight-grid p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  color: #d4d4d4;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

.stats-list span,
.insight-grid span {
  color: var(--violet-soft);
}

.level-card {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
}

.level-meter {
  width: 106px;
  height: 106px;
  position: relative;
}

.level-meter svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.level-bg,
.level-fg {
  fill: none;
  stroke-width: 9;
}

.level-bg {
  stroke: #2d2d2d;
}

.level-fg {
  stroke: var(--violet);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s ease;
}

.level-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.level-display {
  font-size: 1.02rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
  letter-spacing: 0.02em;
}

.insight-grid {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.5rem;
}

.stat-board {
  display: grid;
  gap: 0.75rem;
}

.stat-row p {
  margin: 0 0 0.35rem;
  display: flex;
  justify-content: space-between;
  color: #dadada;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.stat-row span {
  color: var(--violet-soft);
}

.mini-progress {
  height: 7px;
  border-radius: 999px;
  background: #101010;
  border: 1px solid #2a2a2a;
  overflow: hidden;
}

.mini-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), #ffffff);
  transition: width 0.3s ease;
}

.section-count {
  margin: 0.45rem 0 0.8rem;
  color: #d1d1d1;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  max-height: 360px;
  overflow: auto;
}

.task-list-completed .task-item {
  background: #101010;
}

.task-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  background: #141414;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.task-title {
  overflow-wrap: anywhere;
}

.task-item.completed .task-title {
  opacity: 0.6;
  text-decoration: line-through;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.task-points {
  color: #cfcfcf;
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
}

.delete-btn {
  border: 1px solid #4d3d71;
  background: #202020;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: #f1f1f1;
}

.progress-wrap {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  background: #101010;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--violet), #ffffff);
  transition: width 0.35s ease;
}

.challenge-reward {
  margin: 0.45rem 0 0.75rem;
  color: #d6d6d6;
  font-size: 0.83rem;
  font-family: "IBM Plex Mono", monospace;
}

#challengeClaimBtn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.badges {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.badge {
  border: 1px solid #5a4a7e;
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: #141414;
}

.badge strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
}

.badge span {
  color: #bfbfbf;
  font-size: 0.74rem;
}

.badge.locked {
  opacity: 0.48;
  border-color: #2e2e2e;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1220px) {
  .bento-grid {
    grid-template-columns: 260px 1fr 290px;
  }
}

@media (max-width: 980px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .task-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
