/* ══════════════════════════════════════════════
   DOTASK — Design System (Google Stitch Faithful)
   Neo-Brutalism · Dark Mode · Acid Green #ccff00
   Pure CSS — NO Tailwind
   ══════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ─── */
:root {
  /* Colors — ADHD-Friendly Cyber Candy Brutalism */
  --c-primary: #faff00; /* Electric Yellow */
  --c-primary-dim: rgba(250,255,0,0.15);
  --c-primary-glow: rgba(250,255,0,0.4);
  
  --c-pink: #ff2a85; /* Cyber Pink */
  --c-cyan: #00f0ff; /* Neon Cyan */
  --c-green: #00ff66; /* Acid Green */
  --c-purple: #9d4edd; /* Deep Neon Purple */
  --c-orange: #ff6b00; /* Blaze Orange */
  
  /* Deep Blue/Violet theme instead of plain black */
  --c-bg: #1e1b4b; /* Indigo deep */
  --c-bg-deep: #0f0e24;
  --c-surface: #2d2665;
  --c-surface-hover: #3b3285;
  --c-surface-light: #4c41a6;
  --c-border: #818cf8; /* Distinct colored internal borders */
  --c-border-dim: #3730a3;
  --c-text: #ffffff;
  --c-text-dim: #c7d2fe;
  --c-text-muted: #6366f1;

  /* Zone accent colors (Bento Sort) */
  --c-donow: var(--c-pink);
  --c-donow-bg: rgba(255,42,133,0.12);
  --c-donow-glow: rgba(255,42,133,0.5);
  --c-later: var(--c-cyan);
  --c-later-bg: rgba(0,240,255,0.12);
  --c-routines: var(--c-orange);
  --c-routines-bg: rgba(255,107,0,0.12);

  /* Typography */
  --font: 'Space Grotesk', system-ui, sans-serif;

  /* Spacing */
  --sidebar-width: 240px; /* slightly wider for better breathability */
  --topbar-height: 64px;

  /* Neo-Brutalism Settings */
  --border-w: 3px; /* Stronger thick borders for cognitive clarity */
  --border-c: #02020a; /* Practically black for outlines */
  --shadow-hard: 5px 5px 0px 0px var(--border-c);
  --shadow-hover: 8px 8px 0px 0px var(--border-c);

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-full: 9999px;
}

/* ─── Reset ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  background-image: radial-gradient(var(--c-text-muted) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; color: inherit; }
input, select, textarea { font-family: var(--font); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* ═══════════════════════════════════
   AUTH PAGES (login.html, register.html)
   ═══════════════════════════════════ */
.page-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--c-bg-deep);
}
.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.auth-header .accent { color: var(--c-primary); font-style: italic; }
.auth-header .subtitle {
  color: var(--c-text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 8px;
}
.auth-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 28px;
}
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-footer { text-align: center; margin-top: 20px; }
.auth-footer a { font-weight: 700; }

/* ═══════════════════════════════════
   SPA LAYOUT — App Shell
   ═══════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar (Desktop) ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--c-bg);
  border-right: 1px solid var(--c-border-dim);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  padding: 20px 0;
  transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);
}
.sidebar-logo {
  padding: 0 20px;
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  color: var(--c-primary);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.sidebar-phase {
  padding: 0 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-phase-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  font-size: 18px;
  color: #000;
  border: var(--border-w) solid var(--border-c);
  box-shadow: 2px 2px 0 var(--border-c);
}
.sidebar-phase-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1.4;
}
.sidebar-phase-text span {
  display: block;
  color: var(--c-text-dim);
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

/* Nav items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text);
  border: var(--border-w) solid transparent;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); /* playful spring */
  cursor: pointer;
}
.sidebar-nav-item:hover:not(.active) {
  background: var(--c-surface-hover);
  border-color: var(--c-border);
  transform: translateX(4px);
}
/* Color specific active states */
.sidebar-nav-item.active {
  font-weight: 700;
  border-color: var(--border-c);
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0px var(--border-c);
}
.sidebar-nav-item[data-phase="dump"].active { background: var(--c-green); color: #000; }
.sidebar-nav-item[data-phase="bento"].active { background: var(--c-cyan); color: #000; }
.sidebar-nav-item[data-phase="focus"].active { background: var(--c-pink); color: #fff; }
.sidebar-nav-item[data-phase="vault"].active { background: var(--c-purple); color: #fff; }
.sidebar-nav-item .material-symbols-outlined {
  font-size: 18px;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--c-border-dim);
  margin-top: auto;
}
.sidebar-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar-level-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--c-surface-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.sidebar-level-text {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-level-bar {
  width: 100%;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.sidebar-level-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.sidebar-newtask-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--c-primary);
  color: #000;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sidebar-newtask-btn:hover { transform: scale(1.02); }

/* ─── Main Content Area ─── */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.4s cubic-bezier(0.85, 0, 0.15, 1);
}

/* ─── Top Bar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 28px;
  border-bottom: var(--border-w) solid var(--c-border-dim);
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1);
}

/* --- ZEN MODE (Focus Phase) --- */
.zen-mode .sidebar { transform: translateX(-100%); }
.zen-mode .topbar { transform: translateY(-100%); }
.zen-mode .app-main { margin-left: 0; }
.zen-mode .mobile-nav { transform: translateY(100%); }
.zen-mode { background-image: none; }
.topbar-brand {
  font-size: 1rem;
  font-weight: 700;
  font-style: italic;
  color: var(--c-primary);
  letter-spacing: -0.02em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
  transition: background 0.2s;
}
.topbar-icon-btn:hover { background: var(--c-surface-hover); }
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #000;
}

/* ─── XP Header Bar ─── */
.xp-bar-container {
  padding: 8px 28px 12px;
  background: var(--c-bg);
}
.xp-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.xp-bar-level {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.xp-bar-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-primary);
}
.xp-bar-track {
  width: 100%;
  height: 8px;
  background: var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-cyan), var(--c-primary), var(--c-pink));
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Phase Views ─── */
.app-view { display: none; flex: 1; padding: 28px; overflow-y: auto; }
.app-view.active { display: flex; flex-direction: column; }

/* ─── Mobile Bottom Nav ─── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border-dim);
  z-index: 50;
  padding: 6px 0 env(safe-area-inset-bottom, 8px);
}
.mobile-nav-items {
  display: flex;
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.mobile-nav-item .material-symbols-outlined { font-size: 22px; }
.mobile-nav-item.active { color: var(--c-primary); }

/* ═══════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════ */
.label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-primary);
  margin-bottom: 6px;
}
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--c-bg-deep);
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}
.input:focus {
  outline: none;
  border-color: var(--c-primary);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--c-primary);
}
.input::placeholder { color: var(--c-text-muted); }

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--c-primary);
  color: #000;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid #000;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 4px 4px 0px rgba(0,0,0,1);
}
.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0,0,0,1);
  background: #d4ff33;
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px rgba(0,0,0,1);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--c-text-dim);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--c-pink); }
.btn-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--c-primary);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid #000;
  border-radius: var(--r-sm);
  cursor: pointer;
  box-shadow: 4px 4px 0px rgba(0,0,0,1);
  transition: all 0.15s;
}
.btn-done:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0,0,0,1);
  background: #d4ff33;
}
.btn-done:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(0,0,0,1);
}

/* ─── Alert ─── */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 0.8rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(255,68,68,0.1); border: 1px solid rgba(255,68,68,0.3); color: #ff6b6b; }
.alert-success { background: rgba(0,204,100,0.1); border: 1px solid rgba(0,204,100,0.3); color: #66ffaa; }

/* ═══════════════════════════════════
   PHASE 1: BRAIN DUMP
   ═══════════════════════════════════ */
.braindump-content {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Phase badge */
.phase-badge {
  display: inline-block;
  padding: 6px 18px;
  background: var(--c-primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: 20px;
}

/* Title */
.braindump-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.braindump-title .accent {
  color: var(--c-primary);
  font-style: italic;
}

/* Terminal Input — Neo Brutalism */
.braindump-input-wrap {
  position: relative;
}
.braindump-input {
  width: 100%;
  padding: 18px 110px 18px 28px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 500;
}
.braindump-input:focus {
  outline: none;
  border-color: var(--c-primary);
}
.braindump-input::placeholder { color: var(--c-text-muted); }
/* Neo-Brutal hard shadow */
.braindump-input-shadow {
  display: block;
  height: 8px;
  background: var(--c-primary);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  margin-top: -2px;
}
.braindump-input-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.braindump-enter-hint {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
}
.braindump-enter-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.braindump-enter-btn .material-symbols-outlined { color: #000; font-weight: 700; }

/* Task list */
.braindump-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.braindump-list-header h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--c-text-dim);
}
.braindump-list-header .count {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
}

/* Task card */
.task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  transition: all 0.2s ease;
  animation: fadeInUp 0.3s ease-out both;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.8);
}
.task-card:hover {
  border-color: var(--c-primary);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0px var(--c-primary);
}
.task-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  overflow: hidden;
}
.task-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.task-card-icon .material-symbols-outlined { font-size: 20px; }
.task-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-card-delete {
  padding: 6px;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
}
.task-card-delete:hover { color: #ff6b6b; background: rgba(255,107,107,0.1); }
.task-card-delete .material-symbols-outlined { font-size: 18px; }

/* CTA */
.braindump-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-cyan) 100%);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 2px solid #000;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 4px 4px 0px rgba(0,0,0,1);
}
.braindump-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0,0,0,1);
}
.braindump-cta .material-symbols-outlined { font-size: 1.4rem; }
.braindump-cta-sub {
  text-align: center;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--c-text-muted);
  margin-top: 10px;
}

/* ═══════════════════════════════════
   PHASE 2: BENTO SORT
   ═══════════════════════════════════ */
.bento-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.bento-header p {
  color: var(--c-text-dim);
  font-size: 0.85rem;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
  margin-top: 24px;
  flex: 1;
}

/* Zone — generic */
.zone {
  border-radius: var(--r-md);
  border: var(--border-w) solid var(--border-c);
  background: var(--c-surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 4px 4px 0px var(--border-c);
}
.zone.drag-over { transform: scale(1.02); box-shadow: 8px 8px 0px var(--border-c); }
.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border-dim);
}
.zone-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.zone-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 80px;
}
.zone-count {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--c-text-dim);
  text-transform: uppercase;
}

/* INBOX zone */
.zone-inbox { grid-row: 1 / 3; }
.zone-inbox .zone-header h3 { color: var(--c-text-dim); }

/* DO NOW zone — RED */
.zone-donow {
  border-color: var(--c-donow);
  background: var(--c-donow-bg);
}
.zone-donow .zone-header {
  border-bottom-color: rgba(255,68,68,0.2);
}
.zone-donow .zone-header h3 { color: var(--c-donow); }
.zone-donow.drag-over { box-shadow: 0 0 25px var(--c-donow-glow); }
.badge-active {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 10px;
  background: rgba(0,200,100,0.15);
  color: #66ff99;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* LATER zone — CYAN */
.zone-later {
  border-color: var(--c-later);
  border-style: dashed;
  background: var(--c-later-bg);
}
.zone-later .zone-header h3 { color: var(--c-later); }
.zone-later .zone-header { border-bottom-color: rgba(0,204,255,0.2); }
.zone-later.drag-over { box-shadow: 0 0 25px rgba(0,204,255,0.3); border-style: solid; }

/* ROUTINES zone — PURPLE */
.zone-routines {
  border-color: var(--c-routines);
  background: var(--c-routines-bg);
}
.zone-routines .zone-header h3 { color: var(--c-routines); }
.zone-routines .zone-header { border-bottom-color: rgba(204,102,255,0.2); }

/* Drag task card */
.drag-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: grab;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, border-color 0.2s;
  animation: fadeInUp 0.25s ease-out both;
}
.drag-card:active { cursor: grabbing; opacity: 0.7; transform: scale(0.95); box-shadow: 0 0 0 transparent; }
.drag-card:hover { 
  border-color: var(--c-primary);
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 var(--border-c);
}
.drag-card h4 { font-weight: 600; font-size: 0.85rem; }
.drag-card-sub { font-size: 0.7rem; color: var(--c-text-dim); margin-top: 2px; }
.drag-card .material-symbols-outlined { color: var(--c-text-muted); font-size: 18px; }

/* Drop placeholder */
.drop-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
  border: 2px dashed var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text-muted);
  gap: 6px;
  min-height: 80px;
}
.drop-placeholder .material-symbols-outlined { font-size: 28px; opacity: 0.4; }
.drop-placeholder p { font-size: 0.8rem; font-weight: 500; }

/* Routine chips */
.routine-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--c-border);
  background: var(--c-bg);
  cursor: pointer;
  transition: all 0.2s;
}
.routine-chip:hover { border-color: var(--c-routines); }
.routine-chip.done {
  background: rgba(0,200,100,0.12);
  border-color: #44cc88;
  color: #66ffaa;
}
.routine-chip .check { font-size: 14px; }

/* Bento bottom CTA bar */
.bento-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border-dim);
  margin: 24px -28px -28px;
}
.bento-cta-ready {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.bento-cta-ready span { color: var(--c-primary); }

/* ═══════════════════════════════════
   PHASE 3: FOCUS TIMER
   ═══════════════════════════════════ */
.focus-view {
  background: var(--c-bg-deep);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 32px;
  position: relative;
}
.focus-protocol {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--c-primary);
}
.focus-task-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
/* Timer ring */
.timer-ring-wrap {
  position: relative;
  width: 240px;
  height: 240px;
}
.timer-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-ring-bg-circle {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 6;
}
.timer-ring-progress {
  fill: none;
  stroke: var(--c-primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.timer-time {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: 0.05em;
  line-height: 1;
}
.timer-status {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--c-primary);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.timer-status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--c-primary);
  animation: timerPulse 1.5s ease-in-out infinite;
}
.focus-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ═══════════════════════════════════
   PHASE 4: DOPAMINE VAULT
   ═══════════════════════════════════ */
.vault-view {
  background: var(--c-bg-deep);
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
  position: relative;
  overflow: hidden;
}
.vault-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  font-style: italic;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-cyan) 40%, var(--c-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  line-height: 1;
  filter: drop-shadow(0 0 40px var(--c-primary-glow));
  animation: fadeInScale 0.5s ease both;
}
.vault-task-name {
  font-size: 1.2rem;
  color: var(--c-text-dim);
  text-decoration: line-through;
  text-decoration-color: var(--c-primary);
  font-style: italic;
  animation: fadeInUp 0.4s ease 0.3s both;
}
.vault-xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 2px solid var(--c-xp-purple);
  border-radius: var(--r-xl);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c-text);
  box-shadow: 0 0 30px rgba(168,85,247,0.25);
  animation: fadeInScale 0.5s ease 0.5s both;
}
.vault-xp-badge .material-symbols-outlined { color: var(--c-xp-purple); font-size: 1.5rem; }

/* Level card */
.vault-level-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px 28px;
  width: 100%;
  max-width: 420px;
  animation: fadeInUp 0.4s ease 0.7s both;
}
.vault-level-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.vault-level-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--c-text-dim);
}
.vault-level-value {
  font-size: 1.5rem;
  font-weight: 700;
}
.vault-level-current { color: var(--c-primary); }
.vault-level-next { color: var(--c-text-dim); }
.vault-xp-track {
  width: 100%;
  height: 12px;
  background: var(--c-border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.vault-xp-fill {
  height: 100%;
  background: var(--c-xp-gradient);
  border-radius: 6px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.vault-xp-text {
  font-size: 0.75rem;
  color: var(--c-text-dim);
  text-align: center;
}
.vault-xp-text span { color: var(--c-primary); font-weight: 700; }

/* Vault CTA */
.vault-cta {
  width: 100%;
  max-width: 350px;
  animation: fadeInUp 0.4s ease 0.9s both;
}

/* Particles */
.vault-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.vault-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  animation: floatParticle 4s ease-in-out infinite;
}

/* ═══════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes floatParticle {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-120px) rotate(180deg); opacity: 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px var(--c-donow); }
  50% { box-shadow: 0 0 20px var(--c-donow), 0 0 40px rgba(255,68,68,0.15); }
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Shake body */
body.shake { animation: shake 0.3s ease; }

/* Zen mode also hides the XP bar */
.zen-mode .xp-bar-container { transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* ═══════════════════════════════════
   DURATION PICKER (Bento Sort)
   ═══════════════════════════════════ */
.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: var(--border-w) solid var(--c-border);
  background: var(--c-bg);
  box-shadow: 2px 2px 0 var(--c-bg-deep);
}
.duration-badge:hover { 
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--c-bg-deep);
}
.duration-badge .material-symbols-outlined { font-size: 14px; }
.duration-badge.short { color: var(--c-primary); border-color: var(--c-primary); box-shadow: 2px 2px 0 rgba(204,255,0,0.3); }
.duration-badge.medium { color: #ffc800; border-color: #ffc800; box-shadow: 2px 2px 0 rgba(255,200,0,0.3); }
.duration-badge.long { color: var(--c-pink); border-color: var(--c-pink); box-shadow: 2px 2px 0 rgba(255,0,85,0.3); }

.duration-picker {
  display: none;
  padding: 14px;
  background: var(--c-surface);
  border: var(--border-w) solid var(--c-border);
  border-radius: var(--r-md);
  margin-top: 10px;
  animation: fadeInUp 0.2s ease;
  box-shadow: var(--shadow-hard) var(--c-bg-deep);
}
.duration-picker.open { display: block; }
.duration-picker-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-dim);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.duration-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.duration-pill {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--c-bg);
  border: var(--border-w) solid var(--c-border);
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 var(--c-bg-deep);
}
.duration-pill:hover { 
  color: var(--c-primary); 
  border-color: var(--c-primary);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(204,255,0,0.3);
}
.duration-pill.active {
  background: var(--c-primary);
  color: #000;
  border-color: var(--c-primary);
  box-shadow: 2px 2px 0 var(--c-bg-deep);
}

/* ═══════════════════════════════════
   AMBIENT SOUND PANEL (Focus)
   ═══════════════════════════════════ */
.ambient-panel {
  background: var(--c-surface);
  border: var(--border-w) solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-hard) var(--c-bg-deep);
  transition: opacity 0.3s;
}
/* Ambient panel always visible in zen mode */

.ambient-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--c-text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ambient-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ambient-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--c-bg);
  border: var(--border-w) solid var(--c-border);
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 2px 2px 0 var(--c-bg-deep);
}
.ambient-btn:hover { 
  border-color: var(--c-primary); 
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(204,255,0,0.3);
}
.ambient-btn.active {
  border-color: var(--c-primary);
  background: var(--c-primary-dim);
  color: var(--c-primary);
  box-shadow: var(--shadow-hard) var(--c-primary);
}
.ambient-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ambient-volume label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.ambient-volume input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--c-border);
  border-radius: 2px;
  outline: none;
}
.ambient-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-primary);
  cursor: pointer;
  box-shadow: 0 0 6px var(--c-primary-glow);
}
.ambient-volume-val {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-text-dim);
  min-width: 30px;
  text-align: right;
}

/* ═══════════════════════════════════
   TRANSITION OVERLAYS
   ═══════════════════════════════════ */
/* Completion overlay */
.overlay-complete {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  background: rgba(0,0,0,0.92);
}
.overlay-complete.active { display: flex; }
.overlay-complete-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
}
.overlay-complete-flash.fire { animation: flashBang 0.4s ease-out; }
.overlay-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
}
.overlay-checkmark.animate { animation: checkBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards; }
.overlay-checkmark .material-symbols-outlined { font-size: 40px; color: #000; font-weight: 700; }
.overlay-complete-text {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-primary);
  opacity: 0;
  transform: translateY(20px);
}
.overlay-complete-text.animate { animation: fadeInUp 0.4s ease 0.3s forwards; }
.overlay-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  /* animation applied inline via JS using explodeConfetti */
}

/* Glitch Give Up overlay */
.overlay-giveup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  background: rgba(5,0,5,0.95);
}
.overlay-giveup.active { 
  display: flex;
  animation: crtFlicker 0.15s infinite, hardShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
}

@keyframes hardShake {
  0% { transform: translate(15px, -15px) rotate(-2deg); }
  20% { transform: translate(-15px, 15px) rotate(2deg); }
  40% { transform: translate(15px, 0) rotate(-2deg); }
  60% { transform: translate(-15px, 5px) rotate(2deg); }
  80% { transform: translate(5px, -5px) rotate(0); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes crtFlicker {
  0% { opacity: 0.95; box-shadow: inset 0 0 100px 20px rgba(255,0,60,0.2); }
  50% { opacity: 1; box-shadow: inset 0 0 150px 30px rgba(255,0,60,0.5); }
  100% { opacity: 0.95; box-shadow: inset 0 0 100px 20px rgba(255,0,60,0.2); }
}

.tv-static {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.1), rgba(0,0,0,0.1) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
  opacity: 0.4;
  z-index: 1;
}

.glitch-wrapper {
  position: relative;
  z-index: 2;
  opacity: 0;
}
.glitch-wrapper.animate { animation: fadeInScale 0.2s ease forwards; }

.glitch-text {
  font-size: clamp(2rem, 8vw, 5rem);
  font-weight: 700;
  color: #ff003c;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  position: relative;
  text-shadow: 4px 4px 0 rgba(0,0,0,1);
}
.glitch-text::before, .glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
.glitch-text::before {
  left: 4px;
  text-shadow: -2px 0 var(--c-cyan);
  animation: glitch-anim-1 2s infinite linear alternate-reverse;
}
.glitch-text::after {
  left: -4px;
  text-shadow: 2px 0 var(--c-primary);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip-path: inset(20% 0 80% 0); }
  20% { clip-path: inset(60% 0 10% 0); }
  40% { clip-path: inset(10% 0 50% 0); }
  60% { clip-path: inset(80% 0 5% 0); }
  80% { clip-path: inset(30% 0 20% 0); }
  100% { clip-path: inset(50% 0 30% 0); }
}
@keyframes glitch-anim-2 {
  0% { clip-path: inset(10% 0 60% 0); }
  20% { clip-path: inset(80% 0 5% 0); }
  40% { clip-path: inset(30% 0 20% 0); }
  60% { clip-path: inset(50% 0 30% 0); }
  80% { clip-path: inset(20% 0 80% 0); }
  100% { clip-path: inset(60% 0 10% 0); }
}

.overlay-giveup-msg {
  text-align: center;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
}
.overlay-giveup-msg.animate { animation: fadeInUp 0.4s ease 0.3s forwards; }
.overlay-giveup-msg h3 {
  color: var(--c-text);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 2px 2px 0 #000;
}
.overlay-giveup-msg p {
  color: var(--c-cyan);
  font-size: 0.9rem;
  font-style: italic;
  font-weight: 500;
}

/* Overlay keyframes */
@keyframes flashBang {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}
@keyframes checkBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes explodeConfetti {
  0% { transform: translate(-50%, -50%) scale(0) rotate(0deg); opacity: 1; }
  50% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1) rotate(720deg); opacity: 0; }
}

/* ═══════════════════════════════════
   IMMERSIVE FOCUS MODE (ZEN)
   ═══════════════════════════════════ */
.app-shell.focus-mode-active .sidebar {
  transform: translateX(-100%);
}
.app-shell.focus-mode-active .topbar {
  transform: translateY(-100%);
}
.app-shell.focus-mode-active .mobile-nav {
  transform: translateY(100%);
}
.app-shell.focus-mode-active .app-main {
  margin-left: 0 !important;
}
.app-shell.focus-mode-active .focus-view {
  display: flex !important; /* Force visible and isolated */
}
.app-shell.focus-mode-active .bento-cta-bar, 
.app-shell.focus-mode-active .xp-bar-container {
  opacity: 0;
  pointer-events: none;
}

/* ═══════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .app-main { margin-left: 0; padding-bottom: 70px; }
  .app-view { padding: 20px 16px; }
  .topbar { padding: 10px 16px; }
  .xp-bar-container { padding: 8px 16px 12px; }
  .bento-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .zone-inbox { grid-row: auto; }
  .bento-cta-bar { margin: 16px -16px -20px; padding: 14px 16px; }
  .braindump-title { font-size: 2rem; }
}
