:root {
  --bg: #0A0E1A;
  --bg-elevated: #121829;
  --bg-card: #161D33;
  --violet: #8B7FFF;
  --violet-deep: #3C2896;
  --amber: #FFB84D;
  --cyan: #4DE8C2;
  --text: #ECEEF5;
  --text-dim: #8891A8;
  --border: rgba(139, 127, 255, 0.18);
  --radius: 18px;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(139,127,255,0.22), transparent 60%),
    radial-gradient(500px 380px at 100% 10%, rgba(77,232,194,0.10), transparent 60%),
    var(--bg);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.brand-bolt {
  width: 26px;
  height: 26px;
  fill: var(--amber);
  filter: drop-shadow(0 0 6px rgba(255,184,77,0.55));
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 12px 7px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease;
}

.streak-badge:active { transform: scale(0.95); }

.streak-bolt {
  width: 16px;
  height: 16px;
  fill: var(--amber);
}

.streak-badge.is-lit {
  box-shadow: 0 0 0 1px rgba(255,184,77,0.35), 0 0 18px rgba(255,184,77,0.35);
}

/* Superpowers row */
.powers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.power-btn, .power-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px;
  text-align: left;
  color: var(--text);
  font-family: var(--font-body);
}

.power-btn {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.power-btn:active { transform: scale(0.98); }

.power-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  fill: none;
  stroke: var(--violet);
  stroke-width: 1.6;
}

.power-icon-bolt { fill: var(--violet); stroke: none; }

.power-info .power-icon {
  stroke: none;
  fill: var(--amber);
}

.power-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.power-text strong { font-size: 0.85rem; font-weight: 600; }
.power-text small { font-size: 0.72rem; color: var(--text-dim); line-height: 1.25; }

.power-btn[aria-pressed="true"] {
  border-color: rgba(139,127,255,0.6);
  box-shadow: 0 0 0 1px rgba(139,127,255,0.35), 0 0 22px rgba(139,127,255,0.35);
  background: linear-gradient(180deg, rgba(139,127,255,0.14), rgba(139,127,255,0.03));
}
.power-btn[aria-pressed="true"] .power-icon { stroke: var(--cyan); }
.power-btn[aria-pressed="true"] .power-icon-bolt { fill: var(--cyan); }

/* Add form */
.add-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 22px;
}

.add-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 6px 4px 12px;
  border-bottom: 1px solid var(--border);
}

.add-input::placeholder { color: var(--text-dim); }

.add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
}

.chip-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip.is-active {
  color: var(--bg);
  background: var(--violet);
  border-color: var(--violet);
  font-weight: 600;
}

.add-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--amber), #ff9d4d);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255,184,77,0.4);
}

.add-btn svg { width: 18px; height: 18px; fill: var(--bg); }
.add-btn:active { transform: scale(0.92); }

/* Lists */
.lists { display: flex; flex-direction: column; gap: 20px; }

.list-section { transition: opacity 0.3s ease, filter 0.3s ease, max-height 0.3s ease; }

.list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 10px 2px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-hoy { background: var(--amber); box-shadow: 0 0 8px rgba(255,184,77,0.7); }
.dot-semana { background: var(--violet); box-shadow: 0 0 8px rgba(139,127,255,0.7); }
.dot-importante { background: var(--cyan); box-shadow: 0 0 8px rgba(77,232,194,0.7); }

.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
}

.note-check {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.6px solid var(--text-dim);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.note-check svg { width: 12px; height: 12px; fill: none; stroke: var(--bg); stroke-width: 3; opacity: 0; }

.note-item.is-done .note-check {
  background: var(--cyan);
  border-color: var(--cyan);
}
.note-item.is-done .note-check svg { opacity: 1; }

.note-text {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
  padding-top: 1px;
}

.note-item.is-done .note-text {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(136,145,168,0.6);
}

.note-del {
  flex: none;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
}
.note-del:hover, .note-del:active { opacity: 1; color: var(--amber); }

.empty {
  display: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding: 12px 2px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  margin: 0;
}
.list-section.is-empty .empty { display: block; }

/* Focus mode: dim everything except "hoy" */
.app.focus-on .list-section:not([data-section="hoy"]) {
  opacity: 0.16;
  filter: blur(1.5px) saturate(0.6);
  pointer-events: none;
  max-height: 46px;
  overflow: hidden;
}
.app.focus-on .add-form { box-shadow: 0 0 0 1px rgba(139,127,255,0.4), 0 0 26px rgba(139,127,255,0.25); }
.app.focus-on [data-section="hoy"] .note-item {
  border-color: rgba(139,127,255,0.4);
}

.foot {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: 28px;
}

/* Streak pulse animation */
@keyframes streakPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.streak-badge.pulse { animation: streakPulse 0.4s ease; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media (max-width: 380px) {
  .power-text small { display: none; }
}
