@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg: #070d1a;
  --surface: #0e1826;
  --surface2: #131f30;
  --surface3: #192638;
  --border: rgba(255,255,255,.07);
  --border2: rgba(255,255,255,.13);
  --text: #f0f4ff;
  --muted: #6b7fa3;
  --muted2: #8ea3c8;
  --gold: #f0a500;
  --gold2: #ffc73a;
  --gold-dim: rgba(240,165,0,.12);
  --gold-glow: rgba(240,165,0,.22);
  --green: #22d47a;
  --green-dim: rgba(34,212,122,.1);
  --blue: #4fa8f5;
  --blue-dim: rgba(79,168,245,.1);
  --red: #f05050;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── PHONE SHELL ──────────────────────────────── */
.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 0 90px;
  position: relative;
  overflow-x: hidden;
}

/* ─── HEADER ──────────────────────────────────── */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom, var(--bg) 80%, transparent);
}

.header-left {}

.header-plan {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}

.header-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, #e05a00 100%);
  display: grid;
  place-items: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #0a0a00;
  flex-shrink: 0;
}

/* ─── SCREENS ─────────────────────────────────── */
.screen { display: none; padding: 0 20px; }
.screen.active { display: block; }

/* ─── SECTION HEADER ──────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.section-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* ─── SUMMARY CARD ────────────────────────────── */
.summary-card {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.summary-card-left { flex: 1 }

.summary-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.summary-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.summary-card-desc {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.4;
}

.kg-badge {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.kg-badge b {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
}

.kg-badge small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ─── DAY TABS ─────────────────────────────────── */
.days-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

.days-scroll::-webkit-scrollbar { display: none; }

.days {
  display: flex;
  gap: 8px;
  width: max-content;
}

.day-tab {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  background: var(--surface2);
  color: var(--muted);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}

.day-tab.active {
  background: var(--gold);
  color: #0e0900;
  border-color: var(--gold);
}

/* ─── DAY HEADER ──────────────────────────────── */
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
}

.day-head-left {}

.day-head-focus {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

.day-head-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.day-head-count {
  font-size: 12px;
  color: var(--muted);
}

/* ─── ROUTINE / EXERCISE CARDS ─────────────────── */
.routine { display: flex; flex-direction: column; gap: 12px; }

.exercise {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  transition: border-color .2s;
}

.exercise-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ex-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold-dim);
  border: 1px solid rgba(240,165,0,.2);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.ex-info { flex: 1; min-width: 0; }

.ex-name {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -.01em;
  color: var(--text);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}

.pill-blue { background: var(--blue-dim); border: 1px solid rgba(79,168,245,.18); color: #93c8fa; }
.pill-gold { background: var(--gold-dim); border: 1px solid rgba(240,165,0,.2); color: var(--gold2); }
.pill-green { background: var(--green-dim); border: 1px solid rgba(34,212,122,.18); color: #6efbb8; }

/* ─── REST BOX ─────────────────────────────────── */
.rest-box {
  background: rgba(240,165,0,.07);
  border: 1px solid rgba(240,165,0,.18);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.4;
}

.rest-box strong { color: var(--gold); font-weight: 600; }

/* ─── SET BUTTONS ──────────────────────────────── */
.sets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.set-btn {
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.3;
}

.set-btn small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  margin-top: 2px;
}

.set-btn.done {
  background: var(--green-dim);
  border-color: rgba(34,212,122,.3);
  color: #6efbb8;
}

.set-btn.done small { color: rgba(110,251,184,.6); }

/* ─── ACTION BUTTONS ───────────────────────────── */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  letter-spacing: .01em;
}

.btn:active { transform: scale(.97); opacity: .85; }

.btn-gold { background: var(--gold); color: #0a0800; }
.btn-dark { background: var(--surface3); color: var(--muted2); border: 1px solid var(--border2); }

/* ─── NUTRITION ─────────────────────────────────── */
.macros-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.macro-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.macro-value {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.macro-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.macro-card.kcal .macro-value { color: var(--gold); }
.macro-card.prot .macro-value { color: var(--blue); }
.macro-card.carb .macro-value { color: var(--green); }
.macro-card.fat  .macro-value { color: #f47070; }

.meals { display: flex; flex-direction: column; gap: 10px; }

.meal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.meal-name {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold2);
  margin-bottom: 5px;
  letter-spacing: .01em;
}

.meal-desc {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.45;
}

.note-card {
  background: rgba(240,165,0,.06);
  border: 1px solid rgba(240,165,0,.15);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.5;
}

.note-card strong { color: var(--text); }

/* ─── PROGRESO ──────────────────────────────────── */
.progress-cards { display: flex; flex-direction: column; gap: 10px; }

.progress-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.progress-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}

.pi-gold { background: var(--gold-dim); }
.pi-blue { background: var(--blue-dim); }
.pi-green { background: var(--green-dim); }

.progress-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold2);
  margin-bottom: 4px;
}

.progress-card-text {
  font-size: 13px;
  color: var(--muted2);
  line-height: 1.5;
}

/* ─── TABBAR ───────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  width: min(430px, calc(100% - 32px));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(10, 17, 32, .96);
  border: 1px solid var(--border2);
  border-radius: 22px;
  padding: 6px;
  backdrop-filter: blur(20px);
  z-index: 100;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 16px;
  padding: 10px 4px;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-btn span {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.nav-btn.active {
  background: var(--gold);
  color: #0a0800;
}

.nav-icon { font-size: 20px; line-height: 1; }

/* ─── MODALS ───────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
  backdrop-filter: blur(6px);
}

.hidden { display: none !important; }

.modal-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 22px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--muted2);
  font-size: 20px;
  display: grid;
  place-items: center;
  cursor: pointer;
  line-height: 1;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-right: 44px;
  letter-spacing: -.01em;
}

.video-wrap {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

.modal-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}

/* ─── TIMER MODAL ──────────────────────────────── */
.timer-card {
  width: min(320px, 100%);
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
}

.timer-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.timer-ex-name {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  min-height: 22px;
}

.big-timer {
  font-family: 'Syne', sans-serif;
  font-size: 72px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: 10px;
}

.timer-set-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  min-height: 18px;
}

.stop-btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: .02em;
}

/* ─── RESPONSIVE ───────────────────────────────── */
@media (max-width: 380px) {
  .sets { grid-template-columns: repeat(3, 1fr); }
  .macros-grid { grid-template-columns: repeat(2, 1fr); }
  .big-timer { font-size: 60px; }
}
