:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  background: var(--bg-primary);
  border-bottom: 1px solid #22222e;
  flex-shrink: 0;
}
.topbar-center { justify-content: center; text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-mark { font-size: 26px; color: var(--accent-secondary); }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: 0.2px; }
.topdate { font-size: 15px; color: var(--text-secondary); white-space: nowrap; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-name { font-size: 22px; font-weight: 700; }
.topbar-sub { font-size: 14px; color: var(--text-secondary); font-style: italic; }
.iconbtn {
  width: 52px; height: 52px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text-primary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* ---- Body ---- */
.body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 16px;
}
.section-label {
  font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}

/* ---- Pose card ---- */
.pose-card {
  background: linear-gradient(150deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 18px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.pose-card-head { display: flex; flex-direction: column; gap: 4px; }
.pose-name { font-size: 30px; font-weight: 800; line-height: 1.1; }
.pose-sanskrit { font-size: 17px; color: var(--accent); font-style: italic; }
.card-hint { font-size: 13px; color: var(--text-muted); }

/* ---- Badges ---- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  font-size: 14px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.badge.lvl-Beginner { color: var(--accent-secondary); }
.badge.lvl-Intermediate { color: #ffd166; }
.badge.lvl-Advanced { color: var(--danger); }
.badge.dur { color: var(--accent); }

/* ---- Buttons ---- */
.btn {
  min-height: 64px; width: 100%;
  border-radius: var(--radius-md);
  font-size: 19px; font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 18px;
}
.btn-ico { font-size: 16px; }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-secondary));
  color: #03121a;
  min-height: 72px; font-size: 21px;
}
.btn-secondary { background: var(--bg-tertiary); }
.btn-ghost { background: var(--bg-secondary); color: var(--text-secondary); }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }

/* ---- Detail ---- */
.detail-body { gap: 18px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block-title {
  font-size: 14px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
}
.steps { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.steps li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 17px; line-height: 1.35; color: var(--text-primary);
}
.steps li::before {
  content: counter(step);
  counter-increment: step;
  flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-tertiary); color: var(--accent);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps { counter-reset: step; }
.info-line {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 16px; color: var(--text-secondary); line-height: 1.3;
}
.info-ico { font-size: 22px; flex-shrink: 0; }
.center-line { justify-content: center; text-align: center; }

/* ---- Session ---- */
.session-body {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 16px;
}
.ring-wrap { position: relative; width: 320px; height: 320px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-tertiary); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.breath-circle {
  position: absolute;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,255,0.30), rgba(0,255,136,0.10));
  border: 2px solid rgba(0,212,255,0.5);
  transform: scale(0.7);
  transition: transform 4s ease-in-out;
  z-index: 0;
}
.breath-circle.inhale { transform: scale(1.15); }
.breath-circle.exhale { transform: scale(0.7); }
.breath-circle.hold-phase { transition: transform 0.4s ease; }
.ring-time { position: relative; z-index: 1; font-size: 56px; font-weight: 800; letter-spacing: 1px; }
.breath-text { position: relative; z-index: 1; font-size: 18px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.session-cue {
  text-align: center; font-size: 17px; color: var(--text-secondary);
  line-height: 1.35; max-width: 460px; min-height: 46px;
}
.session-controls {
  flex-shrink: 0; padding: 18px 22px;
  display: flex; gap: 12px;
  border-top: 1px solid #22222e; background: var(--bg-primary);
}
.session-controls .btn { flex: 1; }
.session.paused .ring-fg { stroke: var(--text-muted); }

/* ---- Done ---- */
.done-body {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px;
}
.done-check {
  width: 130px; height: 130px; border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-secondary));
  color: #03121a; font-size: 70px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.done-title { font-size: 32px; font-weight: 800; }
.done-pose { font-size: 20px; color: var(--accent); font-style: italic; }
.done-streak { font-size: 18px; color: var(--text-secondary); margin-top: 6px; text-align: center; }
.done-actions { padding: 22px; flex-shrink: 0; }

/* ---- List (library) ---- */
.list { gap: 12px; }
.list-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.list-item .li-main { flex: 1; min-width: 0; }
.li-name { font-size: 19px; font-weight: 700; }
.li-sanskrit { font-size: 14px; color: var(--accent); font-style: italic; }
.li-meta { font-size: 15px; color: var(--text-secondary); white-space: nowrap; }
.li-today {
  font-size: 12px; font-weight: 700; color: #03121a;
  background: var(--accent-secondary);
  padding: 3px 8px; border-radius: 6px;
}

/* ---- Stats ---- */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.stat-num { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-card:nth-child(2) .stat-num { color: var(--accent-secondary); }
.stat-lbl { font-size: 14px; color: var(--text-secondary); text-align: center; }

/* ---- Streak bar ---- */
.streakbar {
  flex-shrink: 0;
  padding: 16px 22px;
  background: var(--bg-primary);
  border-top: 1px solid #22222e;
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; color: var(--text-secondary);
}
.flame { font-size: 20px; }

/* scrollbar */
.body::-webkit-scrollbar { width: 6px; }
.body::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 3px; }
