:root {
  --bg: #050816;
  --bg-card: #0b1020;
  --bg-card-soft: #11172a;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.18);
  --accent-border: rgba(129, 140, 248, 0.7);
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-subtle: #1f2933;
  --shadow-soft: 0 22px 45px rgba(15, 23, 42, 0.65);
  --radius-lg: 1.25rem;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
  color: var(--text-main);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  letter-spacing: 0.03em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.tabs-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(12, 10, 26, 0.98));
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-soft);
}

.tab-list {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.14), transparent 55%),
              radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.12), transparent 60%),
              rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  margin-bottom: 1.1rem;
  overflow-x: auto;
}

.tab-list::-webkit-scrollbar {
  height: 4px;
}

.tab-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

.tab-button {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease-out;
}

.tab-button:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.8);
}

.tab-button.active {
  color: var(--text-main);
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.45);
}

.tab-panels {
  display: grid;
}

.tab-panel {
  border-radius: 1rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.5), rgba(3, 7, 18, 0.95));
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 1.2rem 1.1rem 1.15rem;
}

.tab-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.block-target {
  margin: 0 0 0.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.block-structure {
  margin: 0 0 0.9rem;
  font-size: 0.93rem;
}

.exercise-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.exercise-list[hidden] {
  display: none !important;
}

.exercise-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: radial-gradient(circle at left, rgba(79, 70, 229, 0.18), transparent 60%),
              radial-gradient(circle at right, rgba(45, 212, 191, 0.16), transparent 65%),
              rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
}

.exercise-list span:last-child {
  color: #a5b4fc;
  font-weight: 500;
  font-size: 0.9rem;
}

.exercise-toggle {
  margin: 0.35rem 0 0.55rem;
}

.exercise-toggle-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.9));
  color: #e5e7eb;
  font-size: 0.83rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: background 0.15s ease-out, transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.exercise-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.7);
}

.exercise-toggle-btn.open {
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.9), rgba(30, 64, 175, 1));
}

.workout-player {
  margin-top: 1rem;
  padding: 0.8rem 0.85rem 0.95rem;
  border-radius: 0.95rem;
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.28), transparent 60%),
              radial-gradient(circle at bottom right, rgba(45, 212, 191, 0.22), transparent 65%),
              rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(129, 140, 248, 0.7);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.86rem;
}

.player-label {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.player-round {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.7);
  background: rgba(15, 23, 42, 0.85);
  font-size: 0.78rem;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.exercise-animation {
  width: 108px;
  height: 108px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, rgba(248, 250, 252, 0.18), transparent 55%),
              radial-gradient(circle at 70% 80%, rgba(45, 212, 191, 0.3), transparent 60%),
              rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.9);
  flex-shrink: 0;
}

.exercise-video {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 2px solid rgba(248, 250, 252, 0.7);
  background: radial-gradient(circle at 30% 20%, rgba(248, 250, 252, 0.2), transparent 55%),
              radial-gradient(circle at 70% 80%, rgba(239, 68, 68, 0.5), transparent 60%),
              #020617;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.1), 0 18px 35px rgba(15, 23, 42, 0.9);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.exercise-video:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 1);
}

.video-play-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.video-label {
  font-size: 0.7rem;
  opacity: 0.9;
}

.exercise-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
}

.exercise-name {
  margin: 0;
  font-size: 1rem;
}

.exercise-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timer-display {
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  align-self: flex-start;
  border-radius: 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(129, 140, 248, 0.9);
  color: #bfdbfe;
}

.exercise-hint {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.player-controls {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.player-btn {
  flex: 1 1 0;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.4), rgba(37, 99, 235, 0.8));
  color: #e5e7eb;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
}

.player-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.6);
}

.player-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.player-btn[data-action="pause"] {
  background: radial-gradient(circle at top, rgba(234, 179, 8, 0.6), rgba(217, 119, 6, 0.9));
}

.player-btn[data-action="redo"] {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.5), rgba(37, 99, 235, 0.9));
}

.player-btn[data-action="next"] {
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.55), rgba(22, 163, 74, 0.95));
}

.player-status {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.food-section h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1rem;
}

.food-section ul {
  margin: 0 0 0.4rem 1.1rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.requirements-card {
  margin-top: 1.6rem;
  padding: 1.3rem 1.25rem 1.4rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(55, 65, 81, 0.95);
  box-shadow: var(--shadow-soft);
}

.requirements-card h2 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
}

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
}

.requirement-item {
  padding: 0.7rem 0.8rem;
  border-radius: 0.9rem;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.16), transparent 60%),
              rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.requirement-item h3 {
  margin: 0 0 0.3rem;
  font-size: 0.96rem;
}

.requirement-item p,
.requirement-item ul {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.requirement-item ul {
  padding-left: 1.1rem;
}

.footer {
  margin-top: 1.6rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal[hidden] {
  display: none !important;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(10px);
}

.video-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 92vw);
  border-radius: 1rem;
  padding: 1.1rem 1.1rem 1.2rem;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 1));
  border: 1px solid rgba(148, 163, 184, 0.8);
  box-shadow: 0 26px 55px rgba(15, 23, 42, 0.95);
}

.video-modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.video-modal-body {
  border-radius: 0.9rem;
  overflow: hidden;
}

.video-modal-aspect {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #020617;
}

.video-modal-aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.8rem;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile-first tweaks */

@media (max-width: 600px) {
  .page {
    padding: 1.1rem 0.9rem 2rem;
  }

  .tabs-card {
    padding: 1rem 0.9rem 1.1rem;
  }

  .tab-panel {
    padding: 0.95rem 0.85rem 1rem;
  }

  .tab-button {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
  }

  .player-main {
    flex-direction: column;
    align-items: center;
    text-align: left;
  }

  .exercise-animation {
    width: 96px;
    height: 96px;
    margin-bottom: 0.65rem;
  }

  .exercise-info {
    width: 100%;
  }

  .timer-display {
    font-size: 1.15rem;
  }

  .player-controls {
    flex-wrap: wrap;
  }

  .player-btn {
    flex: 1 1 100%;
  }

  .requirements-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-modal-dialog {
    width: 96vw;
    padding-inline: 0.85rem;
  }
}

/* Responsive adjustments */

@media (min-width: 720px) {
  .page {
    padding-top: 2rem;
  }

  .tabs-card {
    padding: 1.35rem 1.4rem 1.6rem;
  }

  .tab-panel {
    padding: 1.35rem 1.3rem 1.25rem;
  }

  .tab-list {
    gap: 0.6rem;
  }

  .tab-button {
    font-size: 0.95rem;
    padding-inline: 1.1rem;
  }

  .exercise-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-main {
    align-items: flex-start;
  }
}

@media (min-width: 960px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr);
  }

  .tabs-card {
    margin-bottom: 1.75rem;
  }
}
