/* ────────────────────────────────────────────
   MY WINTER ARC — style.css
   Ice blue theme · Mobile-first SPA
──────────────────────────────────────────── */

/* ─── VARIABLES ─── */
:root {
  --orange:      #38bdf8;
  --orange2:     #7dd3fc;
  --orange-glow: rgba(56,189,248,0.10);
  --card:        #0b1118;
  --card2:       #121a24;
  --border:      #1c2a3a;
  --text:        #ddeef9;
  --muted:       #45607a;
  --sub:         #7090aa;
  --bg:          #010710;
  --danger:      #ef4444;
  --success:     #22c55e;
  --radius:      14px;
  --shadow:      0 4px 32px rgba(0,0,0,0.6);
}

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

html {
  background: #010710;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* Winter night sky with faint moon glow top-right */
  background:
    radial-gradient(circle 300px at 74% 9%, rgba(190,220,255,0.07) 0%, transparent 60%),
    linear-gradient(180deg, #010a18 0%, #030e20 30%, #040f24 58%, #030c1c 82%, #020910 100%);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

input, textarea, button, select { font-family: inherit; }

/* ─── SNOW CANVAS ─── */
#snow-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ─── SCREEN SYSTEM ─── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.screen.hidden { display: none !important; }
.hidden { display: none !important; }

/* ════════════════════════════════════════════
   LANDING SCREEN
════════════════════════════════════════════ */
#screen-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.landing-wrap {
  text-align: center;
  padding: 40px 28px;
  max-width: 420px;
  width: 100%;
  /* Frosted glass card */
  background: rgba(8, 18, 32, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: 24px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  margin: 20px;
}

.landing-icon {
  font-size: 88px;
  display: block;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 32px rgba(56,189,248,0.7));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.landing-title {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #f0f8ff 0%, #38bdf8 50%, #7dd3fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  line-height: 1.1;
}

.landing-sub {
  font-size: 16px;
  color: var(--sub);
  line-height: 1.65;
  margin-bottom: 40px;
}

.landing-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.landing-note {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

/* ════════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════════ */
#screen-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  position: relative;
}

.back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--text); }

.login-icon {
  font-size: 40px;
  display: block;
  text-align: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 12px rgba(56,189,248,0.5));
}

.auth-card h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-sub {
  text-align: center;
  font-size: 14px;
  color: var(--sub);
  margin-bottom: 24px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-divider span { font-size: 12px; color: var(--muted); }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--sub);
  font-size: 15px;
  cursor: not-allowed;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.coming-soon-tag {
  background: var(--orange-glow);
  color: var(--orange);
  border: 1px solid rgba(56,189,248,0.25);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.auth-switch {
  text-align: center;
  font-size: 14px;
  color: var(--sub);
  margin-top: 20px;
}
.auth-switch a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

/* ════════════════════════════════════════════
   SETUP WIZARD
════════════════════════════════════════════ */
#screen-setup {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
}

.setup-card {
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
}

.setup-card h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.setup-goal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.setup-goal-row input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.setup-goal-row button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
}
.setup-goal-row button:hover { color: var(--danger); }

/* ════════════════════════════════════════════
   MAIN APP SCREEN
════════════════════════════════════════════ */
#screen-app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #080f18 0%, #060c14 100%);
}

/* Header */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(6,11,16,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 1px 24px rgba(56,189,248,0.04), 0 2px 8px rgba(0,0,0,0.4);
}
#header-left, #header-right {
  width: 44px;
  display: flex;
  align-items: center;
}
#header-right { justify-content: flex-end; }
.header-day {
  font-size: 12px;
  color: var(--orange);
  font-weight: 600;
  background: var(--orange-glow);
  border: 1px solid rgba(56,189,248,0.2);
  padding: 3px 8px;
  border-radius: 6px;
}
#header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
#btn-settings {
  background: none;
  border: none;
  color: var(--sub);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  transition: color 0.15s, background 0.15s;
}
#btn-settings:hover { color: var(--text); background: var(--card2); }

/* Main content */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: 80px;
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Bottom Nav */
#bottom-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: rgba(6,11,16,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
  z-index: 10;
  padding: 4px 8px;
  padding-bottom: calc(4px + env(safe-area-inset-bottom));
  gap: 4px;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
  border-radius: 12px;
}
.nav-btn svg { width: 20px; height: 20px; }
.nav-btn.active {
  color: var(--orange);
  background: rgba(56,189,248,0.1);
}
.nav-btn:hover:not(.active) { color: var(--sub); background: rgba(255,255,255,0.04); }

/* ════════════════════════════════════════════
   CARDS
════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}

.arc-card {
  background: linear-gradient(135deg, #0b1520 0%, #0d1f30 60%, #0a1826 100%);
  border-color: rgba(56,189,248,0.25);
  border-top-color: rgba(56,189,248,0.35);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sub);
  margin-bottom: 14px;
}

/* Arc card internals */
.arc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.arc-day-label { font-size: 14px; color: var(--sub); font-weight: 500; }
.arc-pct {
  font-size: 30px;
  font-weight: 900;
  color: var(--orange);
  text-shadow: 0 0 20px rgba(56,189,248,0.4);
  letter-spacing: -1px;
}
.prog-outer {
  height: 12px;
  background: rgba(56,189,248,0.06);
  border: 1px solid rgba(56,189,248,0.1);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}
.prog-inner {
  height: 100%;
  background: linear-gradient(90deg, #0369a1, #0ea5e9, #38bdf8, #7dd3fc);
  border-radius: 100px;
  transition: width 0.6s ease;
  box-shadow: 0 0 16px rgba(56,189,248,0.5);
}
.arc-dates {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* ─── METRICS GRID ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.metric-card {
  background: linear-gradient(160deg, #0e1b28 0%, var(--card) 100%);
  border: 1px solid var(--border);
  border-top: 2px solid rgba(56,189,248,0.28);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.metric-card:hover {
  border-color: rgba(56,189,248,0.4);
  border-top-color: rgba(56,189,248,0.55);
  background: linear-gradient(160deg, #101f30 0%, #0e1520 100%);
  transform: translateY(-1px);
}
.metric-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 5px;
  letter-spacing: -1px;
}
.metric-key {
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.metric-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

/* ─── WEIGHT CARD ─── */
.weight-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.weight-current {
  font-size: 28px;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}
.weight-sub {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
}
.weight-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── BIG GOALS ─── */
.goal-group {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card2);
  cursor: pointer;
}
.goal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.goal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.goal-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.goal-delete-btn, .goal-addsub-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 5px;
  border-radius: 5px;
  transition: background 0.15s;
  color: var(--muted);
}
.goal-delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.08); }
.goal-addsub-btn:hover { color: var(--orange); background: var(--orange-glow); }
.goal-chevron {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s;
  margin-left: 4px;
}
.goal-group.open .goal-chevron { transform: rotate(180deg); }

.subgoals {
  border-left: 2px solid rgba(56,189,248,0.2);
  margin: 0 14px 12px 24px;
}
.subgoal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 8px 12px;
  border-bottom: 1px solid rgba(26,35,50,0.5);
  cursor: pointer;
}
.subgoal-row:last-child { border-bottom: none; }
.sub-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sub-dot.done {
  background: var(--orange);
  border-color: var(--orange);
}
.sub-dot.done::after {
  content: '✓';
  font-size: 9px;
  color: #000;
  font-weight: 800;
}
.sub-label {
  font-size: 14px;
  color: var(--sub);
  flex: 1;
  transition: color 0.15s;
}
.subgoal-row.done .sub-label {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.sub-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 5px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.subgoal-row:hover .sub-delete-btn { opacity: 1; }
.sub-delete-btn:hover { color: var(--danger); }

.add-subgoal-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 14px 10px 24px;
}
.add-subgoal-inline button {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}

/* ─── TODAY CHECKLIST ─── */
.checklist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.checklist-row:last-child { border-bottom: none; }
.check-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.check-dot.done { background: var(--success); }
.check-dot.miss { background: var(--muted); }
.check-dot.pending { background: var(--orange-glow); border: 1px solid var(--orange); }
.checklist-label { color: var(--sub); flex: 1; }
.checklist-val { color: var(--text); font-weight: 600; font-size: 13px; }

/* ─── LAST SCORE ─── */
.score-display {
  text-align: center;
  padding: 12px 0;
}
.score-num {
  font-size: 48px;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
}
.score-label { font-size: 14px; color: var(--sub); margin-top: 4px; }
.score-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--sub);
}
.score-bar-outer {
  flex: 1;
  height: 6px;
  background: var(--card2);
  border-radius: 100px;
  overflow: hidden;
}
.score-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  border-radius: 100px;
}

/* ════════════════════════════════════════════
   DAILY LOG
════════════════════════════════════════════ */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.date-nav button {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.date-nav button:hover { background: var(--orange-glow); }
.date-nav button:disabled { color: var(--muted); cursor: default; }
#log-date-label, #week-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.warn-banner {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.log-section { margin-bottom: 14px; }
.log-section .card-title { margin-bottom: 12px; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 12px;
}

/* Form row */
.fr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.fr:last-child { border-bottom: none; }
.fr label {
  font-size: 14px;
  color: var(--sub);
  flex: 1;
}
.toggle-fr { padding: 11px 0; }

/* Form group (stacked) */
.fg {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.fg label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.2px;
}
.fg input, .fg select {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.fg input:focus, .fg select:focus { border-color: rgba(56,189,248,0.5); }

/* Input with unit */
.inp-unit {
  display: flex;
  align-items: center;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  min-width: 110px;
}
.inp-unit input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 15px;
  padding: 10px 10px;
  outline: none;
  width: 70px;
  -moz-appearance: textfield;
}
.inp-unit input::-webkit-inner-spin-button,
.inp-unit input::-webkit-outer-spin-button { -webkit-appearance: none; }
.unit {
  font-size: 12px;
  color: var(--muted);
  padding-right: 10px;
  white-space: nowrap;
}

.time-inp {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 8px 12px;
  outline: none;
  min-width: 110px;
}

textarea {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s;
}
textarea:focus { border-color: rgba(56,189,248,0.5); }

/* Toggle */
.tog {
  width: 46px;
  height: 26px;
  background: var(--card2);
  border: 2px solid var(--border);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.tog.on {
  background: var(--orange);
  border-color: var(--orange);
}
.tog-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.tog.on .tog-thumb {
  transform: translateX(20px);
  background: #000;
}

.save-btn { margin-top: 6px; }

/* ════════════════════════════════════════════
   WEEKLY REVIEW
════════════════════════════════════════════ */
.week-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.week-big-score {
  font-size: 48px;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
}
.week-score-label { font-size: 12px; color: var(--sub); }

.week-day-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.week-day-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.week-day-name { font-size: 14px; font-weight: 600; }
.week-day-pts {
  font-size: 16px;
  font-weight: 800;
  color: var(--orange);
}
.week-day-body {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.week-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  color: var(--sub);
}
.week-chip.done {
  border-color: rgba(56,189,248,0.3);
  color: var(--orange);
  background: var(--orange-glow);
}
.week-empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 12px 0;
}

/* ════════════════════════════════════════════
   PROGRESS / CHARTS
════════════════════════════════════════════ */
.sub-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
  scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.stab {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--sub);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  white-space: nowrap;
  transition: all 0.15s;
}
.stab.active {
  background: var(--orange-glow);
  border-color: rgba(56,189,248,0.4);
  color: var(--orange);
}

.chart-wrap {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  height: 240px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}

.stat-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 4px;
}
.stat-lbl { font-size: 12px; color: var(--sub); }

/* ════════════════════════════════════════════
   LEADERBOARD
════════════════════════════════════════════ */
.lb-header {
  text-align: center;
  padding: 12px 0 20px;
}
.lb-header h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}
.lb-header p { font-size: 13px; color: var(--sub); }

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: border-color 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.lb-row.me { border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.04); }
.lb-row:first-of-type .lb-rank { color: #ffd700; }
.lb-row:nth-of-type(2) .lb-rank { color: #c0c0c0; }
.lb-row:nth-of-type(3) .lb-rank { color: #cd7f32; }
.lb-rank {
  font-size: 18px;
  font-weight: 900;
  color: var(--muted);
  min-width: 30px;
  text-align: center;
}
.lb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.lb-score-block { text-align: right; }
.lb-score {
  font-size: 20px;
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
}
.lb-score-lbl { font-size: 10px; color: var(--muted); }

.lb-me-badge {
  font-size: 10px;
  background: var(--orange-glow);
  color: var(--orange);
  border: 1px solid rgba(56,189,248,0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* ════════════════════════════════════════════
   INFO (CONTRACT / RULES / DAY PLAN)
════════════════════════════════════════════ */
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top-color: rgba(56,189,248,0.12);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  line-height: 1.7;
  font-size: 14px;
  color: var(--sub);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), inset 0 1px 0 rgba(56,189,248,0.04);
}
.info-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.info-card p { margin-bottom: 10px; }
.info-card ul { padding-left: 18px; }
.info-card ul li { margin-bottom: 6px; }
.info-card .highlight {
  color: var(--orange);
  font-weight: 600;
}

/* ════════════════════════════════════════════
   MODALS
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-card {
  background: #0f1923;
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #0f1923;
  z-index: 1;
}
.modal-hdr h3 { font-size: 17px; font-weight: 700; }
.modal-hdr button {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  padding: 5px 9px;
  transition: color 0.15s, background 0.15s;
}
.modal-hdr button:hover { color: var(--text); background: var(--muted); }

.modal-body {
  padding: 20px;
}

.settings-goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--sub);
}
.settings-goal-row:last-child { border-bottom: none; }
.settings-goal-row button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 13px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.settings-goal-row button:hover { opacity: 1; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0ea5e9, #38bdf8);
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 22px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 20px rgba(56,189,248,0.3), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-primary:hover { opacity: 0.92; box-shadow: 0 4px 28px rgba(56,189,248,0.45); }
.btn-primary:active { transform: scale(0.98); opacity: 1; }

.btn-outline {
  background: transparent;
  color: var(--orange);
  border: 2px solid rgba(56,189,248,0.4);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 22px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-outline:hover { background: var(--orange-glow); border-color: var(--orange); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 22px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-full { width: 100%; }

.btn-add-goal {
  background: var(--card2);
  border: 1px dashed rgba(56,189,248,0.3);
  border-radius: 10px;
  color: var(--orange);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  width: 100%;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
}
.btn-add-goal:hover { background: var(--orange-glow); border-color: rgba(56,189,248,0.5); }

/* ════════════════════════════════════════════
   TOAST
════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14,24,38,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 100px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(56,189,248,0.08);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-orange { color: var(--orange); }
.text-sub { color: var(--sub); }
.text-muted { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

.no-data {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 32px 16px;
}

/* Responsive: wider screens */
@media (min-width: 480px) {
  #main-content { max-width: 540px; margin: 0 auto; }
  .modal-card { border-radius: 16px; margin-bottom: 20px; }
  .modal-overlay { align-items: center; padding: 20px; }
}

/* ════════════════════════════════════════════
   LOADING SCREEN
════════════════════════════════════════════ */
#screen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
.loading-wrap { text-align: center; }
.loading-wrap .loading-icon {
  font-size: 56px;
  display: block;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 20px rgba(56,189,248,0.6));
  animation: float 2s ease-in-out infinite;
}
.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.loading-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
  animation: dotPulse 1.4s ease-in-out infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ─── HIDE ALL SCROLLBARS ─── */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ════════════════════════════════════════════
   LOG FIELD SETTINGS (in Settings modal)
════════════════════════════════════════════ */
.lf-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--orange);
  margin: 16px 0 6px;
}
.lf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.lf-row:last-of-type { border-bottom: none; }
.lf-info { flex: 1; }
.lf-label { font-size: 14px; color: var(--text); }
.lf-meta  { font-size: 11px; color: var(--muted); margin-top: 1px; }

/* ─── CUSTOM FIELD LIST IN SETTINGS ─── */
.cf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.cf-item:last-of-type { border-bottom: none; }
.cf-item-info { flex: 1; }
.cf-item-label { color: var(--text); font-weight: 500; }
.cf-item-meta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cf-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.cf-delete-btn:hover { color: var(--danger); background: rgba(239,68,68,0.08); }

/* ─── TURNSTILE ─── */
.turnstile-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
