/* ===== SECTION 1: BASE RESET + THEME ===== */

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

:root {
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #09111f 0%, #111827 54%, #0f172a 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --accent: #38bdf8;
  --blue: #60a5fa;
  --green: #16a34a;
  --green-hover: #15803d;
  --radius-lg: 1rem;
  --radius-md: 0.5rem;
  --font-display: "Segoe UI Variable Display", "Aptos Display", "SF Pro Display", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Aptos", "Inter", "Segoe UI", sans-serif;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font: inherit;
}

button {
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
}

.dashboard {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(96, 165, 250, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 20%, rgba(34, 197, 94, 0.14), transparent 30rem),
    #0f172a;
}

.dashboard-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.dashboard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.back-link,
.product-mark {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text-primary);
}

.product-mark {
  font-weight: 700;
  letter-spacing: 0;
}

.product-mark::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.65);
}

.brain-panel {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  animation: riseIn 420ms ease both;
}

.brain-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 32px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.eyebrow,
.control-label,
.coin-balance span {
  color: #93c5fd;
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brain-header h1 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 850;
  line-height: 1;
  margin: 8px 0 14px;
  letter-spacing: -0.025em;
}

.header-copy {
  color: var(--text-secondary);
  max-width: 680px;
  font-size: 1rem;
  margin: 0;
}

.brain-header h1,
.timer-display,
.coin-balance strong {
  letter-spacing: 0;
}

.coin-balance {
  min-width: 150px;
  padding: 18px;
  text-align: center;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 18px;
  animation: softPulse 3s ease-in-out infinite;
}

.coin-balance strong {
  display: block;
  font-family: var(--font-display);
  color: white;
  font-size: 3rem;
  font-weight: 850;
  line-height: 1;
  margin-top: 8px;
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 16px;
  align-items: end;
  padding: 22px 32px;
  background: rgba(15, 23, 42, 0.46);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.controls-row strong {
  color: white;
  display: block;
  font-size: 1.4rem;
  margin-top: 4px;
}

.controls-row label {
  display: block;
}

#ageSelect {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
}

#ageSelect option {
  color: #f8fafc;
  background: #111827;
}

.helper-text {
  display: block;
  min-height: 20px;
  margin-top: 8px;
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 600;
}

#unlockBtn {
  min-height: 44px;
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: white;
  border: none;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

#unlockBtn:disabled {
  background: rgba(148, 163, 184, 0.22);
  color: rgba(241, 245, 249, 0.55);
}

.task-list {
  display: grid;
  gap: 16px;
  padding: 24px 32px 32px;
}

.task-card {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  animation: taskIn 360ms ease both;
}

.task-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
}

.task-title {
  color: white;
  font-size: 1.05rem;
  font-weight: 850;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.task-info .task-title {
  margin-bottom: 8px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.76rem;
  font-weight: 850;
}

.meta-pill.repeatable {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.26);
}

.meta-pill.once {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
}

.timer-display {
  color: #60a5fa;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 850;
  line-height: 1;
  margin: 20px 0 12px;
  text-align: center;
  letter-spacing: -0.03em;
}

.timer-progress-text,
.task-status {
  color: #94a3b8;
  font-weight: 700;
  text-align: center;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  margin: 18px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  border-radius: inherit;
  transition: width 0.3s ease;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.32);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes taskIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(96, 165, 250, 0); }
  50% { box-shadow: 0 0 34px rgba(96, 165, 250, 0.16); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.action-btn {
  min-height: 44px;
  padding: 0 18px;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.action-btn.primary {
  background: #3b82f6;
}

.action-btn.pause {
  background: #f59e0b;
}

.action-btn.claim,
.action-btn.done {
  background: #16a34a;
}

.task-card.simple {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.task-card.simple .task-meta {
  margin-bottom: 0;
}
/* ===== SECTION 2: LAYOUT + GLASS CARDS ===== */

.app-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5rem 1rem;
}

.app-container {
  width: 100%;
  max-width: 1152px;
  padding: 1.5rem;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 4rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 850;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.btn-primary {
  background-color: var(--green);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--green-hover);
  transform: translateY(-2px);
}

/* How it works */
.how-it-works h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

/* Pure CSS Grid - Harry #46-48 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* Glassmorphism - Harry #49-50 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease;
}
.task-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s;
}

.task-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.task-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 255, 0, 0.2); /* Green when done */
}

.glass-card:hover {
  transform: scale(1.05);
  cursor: pointer;
}

.card-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.glass-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.glass-card p {
  color: var(--text-secondary);
}

/* Floating coins */
.coin {
  position: fixed;
  pointer-events: none;
}

.coin-1 {
  top: 5rem;
  left: 2.5rem;
  font-size: 2.25rem;
  animation: bounce 2s infinite;
}

.coin-2 {
  top: 10rem;
  right: 5rem;
  font-size: 1.875rem;
  animation: pulse 2s infinite;
}

.coin-3 {
  bottom: 5rem;
  left: 25%;
  font-size: 3rem;
  animation: bounce 2s infinite 0.3s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-25%); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* ===== SECTION 3: RESPONSIVE ===== */

@media (max-width: 1024px) {
 .hero h1 {
    font-size: 2.5rem;
  }
 .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
 .dashboard-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 16px;
  }
 .dashboard-nav {
    margin-bottom: 14px;
  }
 .brain-panel {
    border-radius: 18px;
  }
 .brain-header,
 .controls-row,
 .task-list {
    padding-left: 16px;
    padding-right: 16px;
  }
 .brain-header {
    grid-template-columns: 1fr;
  }
 .coin-balance {
    min-width: 0;
    width: 100%;
  }
 .controls-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
 #unlockBtn {
    width: 100%;
  }
 .task-card.simple {
    grid-template-columns: 1fr;
  }
 .action-btn {
    width: 100%;
  }
 .app-wrapper {
    padding: 3rem 1rem;
  }
 .hero h1 {
    font-size: 2rem;
  }
 .hero p {
    font-size: 1rem;
  }
 .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
 .coin {
    display: none;
  }
}

.task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: 12px;
  margin: 10px 0;
}

.add-btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.add-btn:hover {
  background: var(--green-hover);
}
