/* ============================================================
   HATCH — Dark & Bold Redesign
   Deep navy/slate base, vivid kid colors, gold super chores
   ============================================================ */

:root {
  /* ── Core palette ── */
  --bg:           #0d1117;   /* near-black base */
  --bg-2:         #161b22;   /* card background */
  --bg-3:         #1e2530;   /* elevated card */
  --bg-4:         #252d38;   /* chore item bg */
  --border:       #30363d;   /* subtle border */
  --border-bright:#3d4f62;   /* brighter border */

  /* ── Text ── */
  --text:         #e6edf3;   /* primary text */
  --text-muted:   #8b949e;   /* muted text */
  --text-dim:     #4d5566;   /* very dim */

  /* ── Accent ── */
  --accent:       #e07b39;   /* HATCH orange */
  --accent-glow:  rgba(224,123,57,0.25);
  --accent-dim:   #8a4a1f;

  /* ── Gold for super chores ── */
  --gold:         #ffd700;
  --gold-dark:    #b8860b;
  --gold-glow:    rgba(255,215,0,0.15);

  /* ── Kept for compatibility ── */
  --rainstorm:    #0d1117;
  --ng:           #161b22;
  --ng-dark:      #30363d;
  --surface-text: #e6edf3;
  --surface-muted:#8b949e;
  --page-text:    #e6edf3;
  --page-muted:   #8b949e;
  --kid-color:    #e07b39;
  --shadow:       0 4px 32px rgba(0,0,0,0.6);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.4);
  --radius:       16px;
  --radius-sm:    10px;
}

html { font-size: 14px; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Nunito", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Subtle grid texture on page bg ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.hatch-layout {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 12px 36px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════ */
.hatch-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 4px 14px;
  margin-bottom: 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.header-brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.header-title {
  font-family: "Baloo 2", cursive;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--text);
  text-shadow:
    0 0 30px rgba(224,123,57,0.6),
    0 0 60px rgba(224,123,57,0.3);
  line-height: 1;
}

.header-title-wrap { display: flex; flex-direction: column; align-items: center; }

.header-slogan {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Accent line under header */
.hatch-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.header-admin-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}
.header-admin-btn:hover { color: var(--text); border-color: var(--border-bright); }

/* ════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════ */
.hatch-main { display: flex; flex-direction: column; gap: 14px; flex: 1; }

.kids-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr 1.2fr;
  gap: 12px;
  align-items: start;
}

.bottom-bar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  align-items: start;
}

/* ════════════════════════════════════════════
   BASE CARD
   ════════════════════════════════════════════ */
.kid-card,
.sidebar-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.sidebar-card { padding: 14px 16px; }

.sidebar-card-title {
  font-family: "Baloo 2", cursive;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

/* ════════════════════════════════════════════
   KID CARDS
   ════════════════════════════════════════════ */
.kid-card {
  padding: 12px 14px;
  border-top: 3px solid var(--kid-color);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

/* Subtle color wash behind the card */
.kid-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(var(--kid-color-rgb), 0.08) 0%, transparent 100%);
  pointer-events: none;
}

.kid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.kid-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  position: relative;
}

.kid-avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 2px solid var(--kid-color);
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(0,0,0,0.5);
  overflow: hidden;
}

.kid-name {
  font-family: "Baloo 2", cursive;
  font-size: 2.57rem;
  font-weight: 800;
  color: var(--kid-color);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.kid-progress-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

.kid-score-badge {
  margin-left: auto;
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--bg-3);
  color: var(--kid-color);
  border: 1.5px solid var(--kid-color);
  padding: 4px 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ── Progress Bar ── */
.progress-bar-track {
  height: 8px;
  background: var(--bg-4);
  border-radius: 999px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%;
  background: var(--kid-color);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px var(--kid-color);
}

/* ── Chore List ── */
.chore-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }

.chore-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-4);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.chore-item:not(.chore-done):hover {
  background: var(--bg-3);
  border-color: var(--border-bright);
}
.chore-item:active { transform: scale(0.97); }

.chore-done {
  background: rgba(255,255,255,0.02) !important;
  border-color: var(--border) !important;
  opacity: 0.4;
  cursor: default;
}
.chore-done .chore-title { text-decoration: line-through; }

.chore-check { font-size: 1.1rem; flex-shrink: 0; }
.chore-title {
  font-weight: 700;
  font-size: 1.14rem;
  flex: 1;
  color: var(--text);
  overflow-wrap: break-word;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.chore-pts {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   SUPER CHORES — Gold treatment
   ════════════════════════════════════════════ */
.super-chore-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  box-shadow: 0 4px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--gold-dark);
  border: 1px solid var(--gold-dark);
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
}

/* Gold shimmer top bar */
.super-chore-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), var(--gold), var(--gold-dark), transparent);
  animation: goldShimmer 3s ease-in-out infinite;
}

/* Faint gold glow behind content */
.super-chore-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, var(--gold-glow) 0%, transparent 65%);
  pointer-events: none;
}

@keyframes goldShimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.super-chore-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.super-chore-badge {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.super-chore-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,215,0,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(184,134,11,0.3);
  position: relative;
  z-index: 1;
  transition: background 0.15s, border-color 0.15s;
}
.super-chore-item:hover { background: rgba(255,215,0,0.08); border-color: var(--gold-dark); }

.super-chore-item-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.super-chore-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.super-chore-pts-badge {
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(255,215,0,0.1);
  border: 1.5px solid var(--gold-dark);
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.super-chore-claim-btn {
  background: linear-gradient(135deg, var(--gold-dark), #9a7000);
  color: #1a1200;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: "Baloo 2", cursive;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 40px;
  transition: opacity 0.15s;
}
.super-chore-claim-btn:hover { opacity: 0.85; }

/* ════════════════════════════════════════════
   CALENDAR
   ════════════════════════════════════════════ */
.calendar-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-row-2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 75%;
  margin: 0 auto;
}

.calendar-day {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 8px 8px 6px;
  min-height: 80px;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.calendar-day.today {
  background: var(--bg-4);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), inset 0 0 20px rgba(224,123,57,0.08);
}

.calendar-day-name {
  font-size: 1.29rem;
  font-weight: 800;
  color: #A0A5A7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
  text-align: center;
  line-height: 1.3;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 3px 4px;
}
.calendar-day.today .calendar-day-name {
  background: var(--accent-glow);
  color: #f5a06e;
}

.calendar-day-event {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 5px;
  padding: 3px 6px;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.calendar-day-event.bill {
  background: rgba(30,80,160,0.5);
  color: #c8dcf8;
  border: 1px solid rgba(60,120,220,0.3);
}
.calendar-day-event.family {
  background: rgba(224,123,57,0.35);
  color: #fcd9b8;
  border: 1px solid rgba(224,123,57,0.6);
}
.calendar-day-time {
  font-size: 0.65rem;
  font-weight: 800;
  display: block;
  opacity: 0.8;
}

/* ════════════════════════════════════════════
   MENU & GROCERY CARDS
   ════════════════════════════════════════════ */
.menu-text {
  font-size: 1.14rem;
  font-weight: 600;
  color: #A0A5A7;
  line-height: 1.4;
}
.menu-empty {
  font-size: 1.14rem;
  color: var(--text-muted);
  font-style: italic;
}
.grocery-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.grocery-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.grocery-bullet { color: var(--accent); font-weight: 800; }
.weekend-badge {
  font-size: 0.55rem;
  font-weight: 800;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 1px 5px;
  border-radius: 999px;
  vertical-align: middle;
}

.connect-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.connect-link:hover { text-decoration: underline; }
.sidebar-empty { font-size: 0.82rem; color: var(--text-muted); }

/* ════════════════════════════════════════════
   REPORTS
   ════════════════════════════════════════════ */
.report-layout { max-width: 1080px; margin: 0 auto; padding: 0 14px 48px; font-family: "Nunito", sans-serif; }
.report-card { background: var(--bg-2); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); border-left-width: 4px; padding: 20px; margin-bottom: 14px; }
.report-stat { background: var(--bg-3); border-radius: var(--radius-sm); padding: 12px; text-align: center; border: 1px solid var(--border); }
.report-stat-val { font-family: "Baloo 2", cursive; font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.report-stat-lbl { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-top: 3px; }
.report-kid-name { font-family: "Baloo 2", cursive; font-size: 1.17rem; font-weight: 800; }
.report-chore-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.report-chore-name { font-weight: 700; color: var(--text); flex: 1; min-width: 0; }
.report-chore-done { font-weight: 800; color: var(--text-muted); font-size: 0.85rem; }

/* ════════════════════════════════════════════
   ANIMATIONS — All-done overlay
   ════════════════════════════════════════════ */
.anim-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}
.anim-overlay.hidden { display: none; }
.anim-stage { position: absolute; inset: 0; }
.anim-msg {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Baloo 2", cursive;
  font-size: 1.8rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: fadeInOut 2s ease forwards;
}
@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

.alldone-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.alldone-overlay.hidden { display: none; }
.alldone-inner {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 52px;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.alldone-emoji { font-size: 4rem; margin-bottom: 12px; }
.alldone-name {
  font-family: "Baloo 2", cursive;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.alldone-text {
  font-family: "Baloo 2", cursive;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 20px;
}
.alldone-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-200px) scale(0.6); opacity: 0; }
}
.float-particle {
  position: absolute;
  animation: floatUp 1.2s ease-out forwards;
  font-size: 2rem;
  pointer-events: none;
}

/* ════════════════════════════════════════════
   PIN MODAL
   ════════════════════════════════════════════ */
.pin-chore-title {
  font-family: "Baloo 2", cursive;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

/* ════════════════════════════════════════════
   ADMIN
   ════════════════════════════════════════════ */
.chore-row:hover { background: rgba(255,255,255,0.02); }
.drag-ghost { background: rgba(255,255,255,0.05) !important; opacity: 0.6; }
.drag-handle:hover { color: var(--accent) !important; }

/* ════════════════════════════════════════════
   CSS CHECKBOXES
   ════════════════════════════════════════════ */
.chore-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid var(--border-bright);
  background: var(--bg-4);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.chore-done .chore-check {
  border-color: var(--kid-color);
  background: var(--kid-color);
}
.chore-done .chore-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
  .kids-row { gap: 8px; }
  .info-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kid-name { font-size: 1.8rem; }
}

#cal-month-header { color: #fcd9b8 !important; }
