/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f172a;
  --bg2:       #1e293b;
  --bg3:       #334155;
  --green:     #4ade80;
  --green-dim: #166534;
  --orange:    #fb923c;
  --red:       #f87171;
  --text:      #f1f5f9;
  --text-dim:  #94a3b8;
  --radius:    16px;
  --radius-sm: 8px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── Light fluid background canvas (behind white screens) ──── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: #f4f6f8; /* fallback if WebGL unavailable */
  pointer-events: none;
}

/* ─── Screens ───────────────────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}
.screen.active { display: flex; flex-direction: column; }

/* Home screen: transparent so bg-canvas shows through */
#screen-home {
  background: transparent;
}

/* Dark screens: opaque, cover the bg-canvas */
#screen-register,
#screen-forgot,
#screen-reset,
#screen-timer {
  background: var(--bg);
}

/* Profile: transparent zo de bg-canvas zichtbaar is, geen scroll */
#screen-stats {
  background: transparent;
  overflow: hidden;
}

/* Dim layer: sits between WebGL canvas and transparent screens (~28% darkening) */
#bg-dim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(4, 8, 24, 0.30);
  pointer-events: none;
}

/* ─── Login screen: transparent — WebGL fluid (#bg-canvas) shows through ── */
#screen-login {
  background: transparent;
  justify-content: space-between;
}

/* Top section: slogan + lang flags */
.login-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 56px 28px 0;
  flex-shrink: 0;
}

.login-slogan {
  display: flex;
  flex-direction: column;
  line-height: 0.88;
}

.login-slogan-line1 {
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.login-slogan-line2 {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #EA580C;
  font-style: italic;
  letter-spacing: -0.3px;
  margin-top: 4px;
}

.login-langs {
  display: flex;
  gap: 8px;
  padding-top: 2px;
  flex-shrink: 0;
}

.lang-flag {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.45;
  padding: 4px 7px;
  line-height: 1;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}

.lang-flag.active {
  opacity: 1;
  border-color: rgba(234,88,12,0.65);
  background: rgba(234,88,12,0.14);
  box-shadow: 0 0 14px rgba(234,88,12,0.2);
}

.lang-flag:hover { opacity: 0.78; }

/* Breathing room between top and form */
.login-spacer { flex: 0 0 32px; }

/* Form area — anchored to lower portion */
.login-body {
  position: relative;
  z-index: 1;
  padding: 0 24px 52px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* Glass input fields */
.glass-field {
  position: relative;
  display: flex;
  align-items: center;
}

.glass-field-icon {
  position: absolute;
  left: 15px;
  color: #EA580C;
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0.85;
  flex-shrink: 0;
}

.glass-field input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  color: #ffffff;
  padding: 16px 16px 16px 48px;
  font-size: 15px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  outline: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 0 0 1px rgba(255,255,255,0.08),
    0 12px 30px rgba(0,0,0,0.12),
    0 0 40px rgba(234,88,12,0.12);
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-appearance: none;
}

.glass-field input::placeholder {
  color: rgba(255,255,255,0.42);
}

.glass-field input:focus {
  border-color: rgba(234,88,12,0.65);
  background: rgba(255,255,255,0.13);
  box-shadow: 0 0 0 3px rgba(234,88,12,0.13);
}

/* Orange glowing login button */
.btn-login-cta {
  position: relative;
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, #F06020 0%, #C2400C 100%);
  border: none;
  border-radius: 14px;
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  box-shadow:
    0 10px 40px rgba(234,88,12,0.38),
    0 0 80px rgba(234,88,12,0.18),
    0 2px 8px rgba(0,0,0,0.22);
  transition: opacity .15s, transform .1s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}

/* Ambient energy bleed behind button — rendered via sibling to avoid stacking context issues */
.btn-login-cta::before {
  content: "";
  position: absolute;
  inset: -28px;
  background: radial-gradient(circle, rgba(234,88,12,0.55) 0%, transparent 65%);
  filter: blur(28px);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.btn-login-cta:hover {
  opacity: 0.92;
  box-shadow:
    0 12px 38px rgba(234,88,12,0.48),
    0 2px 8px rgba(0,0,0,0.22);
}

.btn-login-cta:active {
  transform: scale(.97);
  opacity: .88;
}

.btn-login-arrow {
  font-size: 19px;
  line-height: 1;
  font-style: normal;
}

.login-error-msg {
  color: #fca5a5;
  min-height: 18px;
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
}

/* Subtle white links below form */
.login-soft-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
}

.login-soft-links a {
  color: rgba(255,255,255,0.50);
  text-decoration: none;
  transition: color .15s;
}

.login-soft-links a:hover {
  color: rgba(255,255,255,0.82);
}

.login-dot {
  color: rgba(255,255,255,0.22);
}

/* Autofill on dark login background */
#screen-login input:-webkit-autofill,
#screen-login input:-webkit-autofill:hover,
#screen-login input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px rgba(12, 28, 80, 0.97) inset;
  -webkit-text-fill-color: #f1f5f9;
  transition: background-color 5000s ease-in-out 0s;
}

/* ─── Auth screens ──────────────────────────────────────────── */
.auth-container {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 40px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.logo {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--green);
  color: var(--bg);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.logo .tagline { color: var(--text-dim); font-size: 14px; }

form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.field input {
  background: var(--bg2);
  border: 1.5px solid var(--bg3);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--green); }
.field input::placeholder { color: var(--bg3); }

/* ─── Autofill override (removes browser yellow) ────────────── */
/* Dark screens: keep dark background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #1e293b inset;
  -webkit-text-fill-color: #f1f5f9;
  transition: background-color 5000s ease-in-out 0s;
}

/* Login screen autofill handled in login section above */

/* ─── Language switcher ─────────────────────────────────────── */
.lang-switcher {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: -8px;
}

.lang-btn {
  background: var(--bg2);
  border: 1.5px solid var(--bg3);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.lang-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(74,222,128,.1);
}
.lang-btn:hover { border-color: var(--green); color: var(--green); }

/* In header: smaller, icon-only on mobile */
.app-header .lang-btn {
  padding: 4px 8px;
  font-size: 16px;
  border: none;
  background: none;
  color: var(--text-dim);
  border-radius: 6px;
}
.app-header .lang-btn.active { color: var(--green); background: rgba(74,222,128,.1); }

.error-msg {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}
.success-msg {
  color: var(--green);
  font-size: 13px;
  min-height: 18px;
}

.auth-links {
  text-align: center;
  font-size: 14px;
  color: var(--text-dim);
  display: flex;
  justify-content: center;
  gap: 8px;
}
.auth-links a { color: var(--green); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--green); color: var(--bg); }
.btn-primary:hover { opacity: .9; }

.btn-secondary { background: var(--bg2); color: var(--text); border: 1.5px solid var(--bg3); }
.btn-secondary:hover { background: var(--bg3); }

.btn-danger { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger:hover { background: rgba(248,113,113,.1); }

.btn-full { width: 100%; }
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-whatsapp:active { background: #1ebe5a; transform: scale(0.98); }
.btn-large {
  width: 100%;
  padding: 18px 24px;
  font-size: 18px;
  border-radius: var(--radius);
  margin-top: 8px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--bg2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ─── App header ────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--bg2);
}
.header-logo { font-size: 18px; font-weight: 800; }
.header-actions { display: flex; gap: 4px; }

/* ─── Home screen ───────────────────────────────────────────── */
#screen-home {
  background: transparent;
}

.home-actions {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px 0;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  flex-shrink: 0;
}

#screen-home .icon-btn {
  color: rgba(255,255,255,0.75);
}
#screen-home .icon-btn:hover {
  background: rgba(255,255,255,0.1);
}

.home-content {
  padding: 4px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* ─── Greeting ──────────────────────────────────────────────── */
.home-greeting {
  padding-top: 0;
}
.home-greeting span {
  font-family: 'Manrope', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.home-subtitle {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  margin-top: -8px;
}

/* ─── Start button ──────────────────────────────────────────── */
@keyframes ctaGlow {
  0%, 100% { box-shadow: 0 8px 32px rgba(234,88,12,0.40), 0 0 56px rgba(234,88,12,0.14); }
  50%       { box-shadow: 0 8px 44px rgba(234,88,12,0.65), 0 0 80px rgba(234,88,12,0.30); }
}

.btn-start-home {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px 20px;
  background: linear-gradient(135deg, #F06020 0%, #C2400C 100%);
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  animation: ctaGlow 3s ease-in-out infinite;
}
.btn-start-home:active { transform: scale(.97); animation: none; }

.btn-start-home-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.btn-start-home-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-start-home-text > span:first-child {
  font-family: 'Manrope', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.btn-start-home-sub {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
}

.btn-start-home > svg:last-child {
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
}

/* ─── Home stat cards ───────────────────────────────────────── */
.home-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.home-stat-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-stat-icon { font-size: 18px; line-height: 1; }

.home-stat-value {
  font-family: 'Manrope', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.05;
}

.home-stat-label {
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Japanese walking card ─────────────────────────────────── */
.jw-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 16px;
}

.jw-card-title {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #EA580C;
  margin-bottom: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.jw-phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.jw-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px 4px;
  border-radius: 10px;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.80);
  text-align: center;
}

.jw-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.jw-phase-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.jw-duration {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.42);
}
.jw-duration em {
  font-style: normal;
  color: rgba(255,255,255,0.60);
  font-weight: 700;
}

.jw-warmup  { background: rgba(234,179,8,0.12); }
.jw-warmup  .jw-dot { background: #EAB308; }

.jw-fast    { background: rgba(234,88,12,0.16); }
.jw-fast    .jw-dot { background: #EA580C; }

.jw-easy    { background: rgba(29,78,216,0.18); }
.jw-easy    .jw-dot { background: #1D4ED8; }

.jw-cooldown { background: rgba(21,128,61,0.14); }
.jw-cooldown .jw-dot { background: #15803D; }

/* ─── Stats disclaimer ──────────────────────────────────────── */
.stats-disclaimer {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  text-align: center;
  margin-top: -8px;
}

/* ─── Quote card ────────────────────────────────────────────── */
.home-quote-card {
  background: rgba(249,115,22,0.07);
  border: 1px solid rgba(249,115,22,0.20);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 16px;
  padding: 20px 20px;
}

.home-quote-text {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

/* ─── Timer screen ──────────────────────────────────────────── */

/* WebGL fluid canvas — fills timer screen behind all UI */
#fluid-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 0;
}

/* UI layers sit above the canvas */
#screen-timer .app-header,
#screen-timer .timer-content {
  position: relative;
  z-index: 1;
}

/* CSS gradient fallback (shown when WebGL not available) */
@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#screen-timer.timer-phase-fast {
  background: linear-gradient(145deg,
    #3d0800, #D33A00, #FF5100, #ff8040, #D33A00, #3d0800);
  background-size: 300% 300%;
  animation: gradientFlow 14s ease infinite;
}

#screen-timer.timer-phase-slow {
  background: linear-gradient(145deg,
    #011215, #0A5C66, #1EA39D, #2ec8c0, #0A5C66, #011215);
  background-size: 300% 300%;
  animation: gradientFlow 14s ease infinite;
}

/* Timer header — no title, just back button */
.timer-header {
  border-bottom: none;
  padding: 12px 16px 0;
}

/* Header transparent on colored backgrounds */
#screen-timer.timer-phase-start .app-header,
#screen-timer.timer-phase-fast  .app-header,
#screen-timer.timer-phase-slow  .app-header,
#screen-timer.timer-phase-end   .app-header {
  background: transparent;
  border-bottom: none;
}

/* Shorthand: all active phase classes */
#screen-timer.timer-phase-start,
#screen-timer.timer-phase-fast,
#screen-timer.timer-phase-slow,
#screen-timer.timer-phase-end { /* placeholder for specificity */ }

/* Ring adapts to colored backgrounds */
#screen-timer[class*="timer-phase-"] .ring-bg {
  stroke: rgba(255, 255, 255, 0.18);
}
#screen-timer[class*="timer-phase-"] .ring-progress {
  stroke: rgba(255, 255, 255, 0.9);
}

/* Text stays white on colored backgrounds */
#screen-timer[class*="timer-phase-"] .timer-display,
#screen-timer[class*="timer-phase-"] .timer-phase,
#screen-timer[class*="timer-phase-"] .next-phase-info {
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* Phase dots on colored backgrounds */
#screen-timer[class*="timer-phase-"] .phase-dot {
  background: rgba(255, 255, 255, 0.6);
}
#screen-timer[class*="timer-phase-"] .phase-dot.active-fast,
#screen-timer[class*="timer-phase-"] .phase-dot.active-slow {
  background: #ffffff;
}
#screen-timer[class*="timer-phase-"] .phase-dot.done {
  background: rgba(255, 255, 255, 0.35);
}

/* Control buttons on colored backgrounds */
#screen-timer[class*="timer-phase-"] .btn-timer-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255,255,255,0.85);
}
#screen-timer[class*="timer-phase-"] .btn-timer-stop {
  color: rgba(255,255,255,0.45);
  border-color: rgba(255,255,255,0.14);
}
#screen-timer[class*="timer-phase-"] .btn-timer-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Icon button in header on colored backgrounds */
#screen-timer[class*="timer-phase-"] .icon-btn {
  color: #ffffff;
}

.timer-content {
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

/* Phase dots */
.phase-dots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.phase-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg3);
  transition: background .3s, transform .3s, box-shadow .3s;
}
.phase-dot.active-fast {
  background: var(--orange);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(251,146,60,0.7);
}
.phase-dot.active-slow {
  background: var(--green);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(74,222,128,0.7);
}
.phase-dot.done { background: var(--bg3); opacity: .4; }

/* Timer ring */
.timer-ring-container {
  position: relative;
  width: min(280px, 75vw);
  height: min(280px, 75vw);
}
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--bg2);
  stroke-width: 10;
}
.ring-progress {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 603;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .5s linear, stroke .3s;
}
.ring-progress.phase-fast { stroke: var(--orange); }
.ring-progress.phase-slow { stroke: var(--green); }
.ring-progress.phase-countdown { stroke: var(--text-dim); }

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.timer-display {
  font-size: clamp(44px, 13vw, 64px);
  font-weight: 800;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.timer-phase {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .8px;
  text-align: center;
  padding: 0 20px;
}

.next-phase-info {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  min-height: 20px;
}

/* Total session progress bar */
.timer-total-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timer-total-bar-bg {
  display: none;
}
.timer-total-bar-fill {
  display: none;
}
.timer-total-label {
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
}

/* Timer control buttons — vertical, subtle */
.timer-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.btn-timer-ghost {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.80);
  font-size: 15px;
  font-weight: 600;
  padding: 13px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-timer-ghost:hover {
  background: rgba(255,255,255,0.18);
}
.btn-timer-stop {
  color: rgba(255,255,255,0.45);
  border-color: rgba(255,255,255,0.12);
  font-size: 14px;
}

/* ─── Done screen ───────────────────────────────────────────── */
#screen-done {
  background: transparent;
}

.done-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 28px 40px;
  flex: 1;
  gap: 0;
  max-width: 420px;
  margin: auto;
  width: 100%;
}

/* Trophy */
.done-trophy-wrap {
  margin-bottom: 28px;
  animation: doneGlow 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 28px rgba(234,88,12,0.50));
}
.done-trophy-svg {
  width: 110px;
  height: auto;
  display: block;
}
@keyframes doneGlow {
  0%,100% { filter: drop-shadow(0 0 20px rgba(234,88,12,0.45)); }
  50%      { filter: drop-shadow(0 0 44px rgba(234,88,12,0.75)); }
}

.done-container h1 {
  font-size: 34px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.done-container p {
  color: rgba(255,255,255,0.60);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 6px;
}

.done-sub {
  font-size: 13px !important;
  color: rgba(255,255,255,0.38) !important;
  margin-bottom: 32px !important;
}

/* Stats row */
.done-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 32px;
}
.done-stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 15px 8px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.done-stat-streak {
  background: rgba(234,88,12,0.10);
  border-color: rgba(234,88,12,0.28);
}
.done-stat-icon { font-size: 22px; line-height: 1; }
.done-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.done-stat-streak .done-stat-value { color: var(--orange); }
.done-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ─── Profile screen ─────────────────────────────────────────── */
.stats-content {
  padding: 10px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
}

.profile-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F06020, #C2400C);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 18px; font-weight: 800;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(234,88,12,0.35);
}

.profile-hero-info {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0;
}

.profile-name-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Manrope', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #fff;
  width: 100%;
  padding: 0;
}
.profile-name-input::placeholder { color: rgba(255,255,255,0.35); }

.profile-email {
  font-size: 12px;
  color: rgba(255,255,255,0.40);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Cards */
.profile-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}

.profile-card-label {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.40);
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* Language pills */
.profile-lang-row {
  display: flex; gap: 8px;
}
.profile-lang-pill {
  flex: 1; padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  font-family: 'Manrope', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.profile-lang-pill.active {
  background: linear-gradient(135deg, #F06020, #C2400C);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(234,88,12,0.35);
}

/* Stats grid */
.profile-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}
.profile-stat {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.profile-stat-icon { font-size: 14px; }
.profile-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 16px; font-weight: 800; color: #fff;
}
.profile-stat-label {
  font-size: 8px; font-weight: 700;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase; letter-spacing: 0.4px;
  text-align: center;
}

/* Last session */
.profile-last-session {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: rgba(255,255,255,0.70);
}
.profile-last-badge {
  background: var(--green-dim);
  color: var(--green);
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

/* Personal fields */
.profile-personal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.profile-field { display: flex; flex-direction: column; gap: 4px; }
.profile-field-label {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.45);
}
.profile-field-input-wrap {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 6px 10px;
}
.profile-field-input-wrap input {
  background: transparent; border: none; outline: none;
  font-family: 'Manrope', sans-serif;
  font-size: 14px; font-weight: 600; color: #fff;
  width: 100%; -moz-appearance: textfield;
}
.profile-field-input-wrap input::-webkit-outer-spin-button,
.profile-field-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.profile-field-unit { font-size: 12px; color: rgba(255,255,255,0.35); flex-shrink: 0; }

.profile-gender-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.profile-gender-pills { display: flex; gap: 8px; }
.profile-gender-pill {
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.60);
  font-family: 'Manrope', sans-serif;
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.profile-gender-pill.active {
  background: rgba(249,115,22,0.20);
  border-color: rgba(249,115,22,0.50);
  color: var(--orange);
}

.profile-local-note {
  font-size: 10px; color: rgba(255,255,255,0.28);
  display: flex; align-items: center; gap: 4px;
}

/* Keep stat-item styles for backwards compat */
.stat-item-badge {
  background: var(--green-dim);
  color: var(--green);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ─── Loader ────────────────────────────────────────────────── */
.btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive tweaks ─────────────────────────────────────── */
@media (max-height: 600px) {
  .auth-container { padding: 20px 24px; }
  .logo-icon { width: 48px; height: 48px; font-size: 24px; }
  .logo h1 { font-size: 22px; }
}
