:root {
  --obsidian: #000000;
  --surface: #111113;
  --elevated: #1B1B1F;
  --hairline: rgba(255, 255, 255, 0.12);
  --platinum: #F2F2F7;
  --platinum-deep: #C7C7CC;
  --emerald: #30D158;
  --volt: #B8FC35;
  --cyan: #38D4FF;
  --amber: #FF9F0A;
  --coral: #FF453A;
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, 0.68);
  --text-muted: rgba(255, 255, 255, 0.48);
  --radius-card: 24px;
  --radius-sm: 14px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--obsidian);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "Vazirmatn", "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(640px 360px at 50% -10%, rgba(184, 252, 53, 0.08), transparent 68%);
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

.mono {
  font-variant-numeric: tabular-nums;
}

.app-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--text-2);
  text-transform: uppercase;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--elevated);
  color: var(--platinum);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.18s var(--spring), background 0.18s ease;
}

.icon-btn:active {
  transform: scale(0.92);
}

/* Gate / Login */
.gate-wrap {
  max-width: 460px;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: staggerIn 0.45s var(--spring) both;
}

.gate-hero {
  text-align: center;
  padding: 10px 6px 4px;
}

.gate-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--platinum);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 10px;
}

.gate-wordmark {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
}

.gate-sub {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-2);
}

/* Cards & Liquid Glass Hierarchy */
.card {
  background: linear-gradient(160deg, rgba(24, 24, 28, 0.94), rgba(11, 11, 13, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 16px 36px rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  animation: staggerIn 0.42s var(--spring) both;
}

.card-platinum {
  border-color: rgba(255, 255, 255, 0.16);
}

.card-cyan {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-volt {
  border-color: rgba(178, 242, 58, 0.30);
}

.card-emerald {
  border-color: rgba(58, 210, 159, 0.32);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge-platinum {
  background: rgba(224, 231, 242, 0.12);
  border-color: rgba(224, 231, 242, 0.28);
  color: var(--platinum);
}

.badge-cyan {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--platinum);
}

.badge-volt {
  background: rgba(178, 242, 58, 0.14);
  border-color: rgba(178, 242, 58, 0.34);
  color: var(--volt);
}

.badge-emerald {
  background: rgba(58, 210, 159, 0.14);
  border-color: rgba(58, 210, 159, 0.32);
  color: var(--emerald);
}

.badge-amber {
  background: rgba(245, 165, 36, 0.15);
  border-color: rgba(245, 165, 36, 0.35);
  color: var(--amber);
}

.badge-coral {
  background: rgba(240, 106, 106, 0.15);
  border-color: rgba(240, 106, 106, 0.35);
  color: var(--coral);
}

/* Segmented Controls & Tabs */
.seg {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hairline);
}

.seg-3 {
  grid-template-columns: repeat(3, 1fr);
  border-radius: 14px;
}

.seg-btn {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  min-height: 40px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s var(--spring);
}

.seg-3 .seg-btn {
  border-radius: 10px;
  min-height: 36px;
  font-size: 12px;
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--volt), var(--emerald));
  color: #000;
}

.seg-btn.active-volt {
  background: linear-gradient(135deg, var(--volt), var(--emerald));
  color: #000;
}

/* Form Elements */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin: 10px 0 6px;
}

.input, .textarea, .select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.08);
}

.textarea {
  min-height: 82px;
  resize: vertical;
}

.select option {
  background: #101319;
  color: #fff;
}

.range-wrap {
  margin: 8px 0;
}

.range-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--volt);
  cursor: pointer;
}

/* Capsule CTAs */
.btn {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  transition: transform 0.16s var(--spring), opacity 0.16s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-platinum {
  background: linear-gradient(135deg, var(--platinum), var(--platinum-deep));
  color: #000;
}

.btn-volt {
  background: linear-gradient(135deg, var(--volt), var(--emerald));
  color: #000;
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), #25A57A);
  color: #000;
}

.btn-quiet {
  background: var(--elevated);
  border-color: var(--hairline);
  color: #fff;
}

.btn-coral {
  background: rgba(240, 106, 106, 0.15);
  border-color: rgba(240, 106, 106, 0.34);
  color: var(--coral);
}

/* Interactive Pure-Anatomy Stage & VIP FIT Equipment Roster */
.anatomy-stage {
  position: relative;
  width: 100%;
  height: 390px;
  border-radius: 24px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.anatomy-figure-wrap {
  position: relative;
  width: 270px;
  height: 360px;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center center;
}

.anatomy-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.anatomy-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.anatomy-hotspot {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.anatomy-hotspot.active {
  border-color: var(--volt);
  background: rgba(184, 252, 53, 0.35);
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(184, 252, 53, 0.7);
}

.eq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.eq-card {
  background: var(--elevated);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 12px;
  text-align: right;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.18s ease;
}

.eq-card.active {
  border-color: rgba(184, 252, 53, 0.42);
}

.eq-card:active {
  transform: scale(0.98);
}
}

.btn-sm {
  width: auto;
  min-height: 36px;
  padding: 6px 13px;
  font-size: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-row > .btn {
  flex: 1 1 130px;
}

/* Coach Acting Notice */
.acting-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(46, 217, 155, 0.14), rgba(56, 212, 255, 0.09));
  border: 1px solid rgba(58, 210, 159, 0.34);
  margin-bottom: 12px;
  font-size: 13px;
}

/* Readiness Ring & SmartGym Muscle Map */
.hero-telemetry {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  align-items: center;
}

.ring-box {
  position: relative;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
}

.ring-glow {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 242, 58, 0.18), transparent 68%);
  animation: breathe 3.4s ease-in-out infinite;
}

.ring-val {
  position: relative;
  text-align: center;
}

.ring-val strong {
  display: block;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
}

.ring-val span {
  font-size: 11px;
  color: var(--text-2);
}

.anatomy-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.anatomy-side {
  text-align: center;
}

.anatomy-side span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.muscle-pulse {
  animation: pulseOpacity 2.4s ease-in-out infinite;
}

/* Set Pills & Steppers */
.set-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0;
}

.set-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
}

.set-pill.done {
  background: linear-gradient(135deg, var(--volt), var(--emerald));
  color: #000;
  border-color: transparent;
}

.set-pill.next {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--volt);
  color: #fff;
}

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
}

.stepper-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}

.stepper-tile-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}

.stepper-tile-val {
  font-size: 22px;
  font-weight: 900;
  margin: 2px 0 8px;
}

.stepper-btns {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.step-btn {
  width: 38px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--elevated);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.step-btn:active {
  transform: scale(0.92);
}

/* Exercise Queue */
.ex-item {
  width: 100%;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
}

.ex-item.selected {
  border-color: var(--volt);
  background: rgba(178, 242, 58, 0.09);
}

.ex-item.finished {
  border-color: rgba(178, 242, 58, 0.35);
}

/* HR 5-Zone Bar */
.zone-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 10px 0;
}

.zone-seg {
  height: 12px;
  border-radius: 999px;
  opacity: 0.32;
}

.zone-seg.active {
  opacity: 1;
  box-shadow: 0 0 12px rgba(66, 212, 255, 0.45);
}

/* Metric Grid & Roster Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 11px;
}

.kpi-tile strong {
  display: block;
  font-size: 20px;
  font-weight: 900;
}

.kpi-tile span {
  font-size: 11px;
  color: var(--text-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.chip {
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  padding: 7px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: rgba(245, 165, 36, 0.22);
  border-color: var(--amber);
  color: var(--amber);
}

.chip.active-volt {
  background: rgba(178, 242, 58, 0.18);
  border-color: var(--volt);
  color: var(--volt);
}

/* Override Exercise Row */
.override-box {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 10px;
  margin-top: 8px;
}

.override-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}

/* Rest Countdown Overlay */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 7, 10, 0.86);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid rgba(224, 231, 242, 0.24);
  border-radius: 26px;
  padding: 20px;
}

.rest-circle {
  width: 150px;
  height: 150px;
  margin: 14px auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(178, 242, 58, 0.24), rgba(178, 242, 58, 0.03) 70%);
  border: 2px solid rgba(178, 242, 58, 0.55);
  display: grid;
  place-items: center;
  animation: restWave 4s ease-in-out infinite;
}

.rest-num {
  font-size: 52px;
  font-weight: 900;
  color: var(--volt);
}

/* Bottom Floating Pill Tab Bar */
.bottom-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 60;
  width: min(calc(100% - 24px), 640px);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(22, 22, 26, 0.78);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 38px rgba(0, 0, 0, 0.6);
}

.tab-btn {
  flex: 1 1 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  min-height: 44px;
  padding: 6px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.22s var(--spring);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.11);
  color: var(--volt);
  border: 1px solid rgba(184, 252, 53, 0.30);
}

/* Toast */
.toast-root {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  width: min(calc(100% - 28px), 440px);
  pointer-events: none;
}

.toast {
  background: rgba(24, 24, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 16px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  margin-bottom: 8px;
}

.toast.err {
  border-color: var(--coral);
  color: #ffd9d9;
}

.muted {
  color: var(--text-2);
  font-size: 13px;
}

.small {
  color: var(--text-muted);
  font-size: 12px;
}

@keyframes staggerIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.72; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes restWave {
  0%, 100% { transform: scale(0.94); }
  50% { transform: scale(1.06); }
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
