[hidden] { display: none !important; }
:root {
  --bg: #0b0c10;
  --card: #15171d;
  --card-2: #1b1e25;
  --line: #2a2e37;
  --text: #eceef3;
  --muted: #9097a6;
  --quad: #34e089;
  --glute: #ff4d8d;
  --calf: #ffb020;
  --adduct: #5eead4;
  --hams: #b18cff;
  --shear: #ff8a3d;
  --back: #4c8dff;
  --handle: #ffd23f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(255, 77, 141, 0.12), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(52, 224, 137, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 32px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 4px 18px;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 9vw, 60px);
  letter-spacing: -0.04em;
  line-height: 1;
  font-weight: 800;
}

.sub { margin: 6px 0 0; color: var(--muted); font-size: 18px; font-weight: 500; }
.logo { width: 52px; height: 52px; }

h2 {
  margin: 0 0 14px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.layout { display: grid; gap: 16px; }

@media (min-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .stage-col { position: sticky; top: 16px; }
}

.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 20px;
}

.panel-col { display: grid; gap: 16px; }

/* Scene */
.stage { position: relative; padding: 0; overflow: hidden; }
#scene { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }

.stage-bar { display: flex; align-items: center; gap: 14px; padding: 0 18px 14px; }
.play {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid var(--handle);
  background: rgba(11, 12, 16, 0.75);
  box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.play svg { width: 24px; height: 24px; fill: var(--handle); }
.play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.readout {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 70%;
  z-index: 2;
  pointer-events: none;
}
.readout span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: rgba(11, 12, 16, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
}
.readout b { color: var(--text); font-weight: 600; }

.hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.hint b { color: var(--handle); font-weight: 600; }

.handle { cursor: grab; }
.handle:active { cursor: grabbing; }

/* Sliders */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  margin: 0;
  --p: 50%;
  --fill: linear-gradient(90deg, var(--handle), var(--handle));
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(#2d313a, #2d313a) right / calc(100% - var(--p)) 100% no-repeat, var(--fill);
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: #2d313a; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--fill); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--handle);
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--handle); border: none; }

.main-ctl { padding: 14px 24px 4px; }
.main-ctl .big-ends { font-size: 16px; font-weight: 600; }
.ctl-big input { height: 44px; }
.ctl-big input::-webkit-slider-thumb { width: 36px; height: 36px; margin-top: -15px; }
.ctl-big input::-moz-range-thumb { width: 36px; height: 36px; }
.main-ctl .seg { margin-top: 2px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; background: #121419; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { flex: 1 1 auto; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--handle); color: #111; font-weight: 600; }
.seg button:not([aria-checked="true"]):hover { background: #232730; color: var(--text); }

.ends { font-size: 16px; font-weight: 600; }
.main-slider input { height: 44px; }
.main-slider input::-webkit-slider-thumb { width: 36px; height: 36px; margin-top: -15px; }
.main-slider input::-moz-range-thumb { width: 36px; height: 36px; }

.ends { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }


/* Bullets */
.bullets { padding: 8px 22px; }
.bullet { display: grid; grid-template-columns: 14px 1fr; gap: 16px; padding: 16px 0; font-size: 17px; line-height: 1.45; }
.bullet + .bullet { border-top: 1px solid var(--line); }
.bullet i { width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; }

/* Split */
.split { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: #2d313a; gap: 2px; }
.split > div { transition: width 0.12s; }
.split-legend { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 18px; font-size: 14px; font-variant-numeric: tabular-nums; }

#chart { display: block; width: 100%; height: auto; }
#chart .ax { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.chart-legend small { color: #6b7280; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* Pantallas */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.view[hidden] { display: none; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.5; margin: -6px 4px 20px; max-width: 640px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 6px; padding: 9px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #15171d; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600;
}
.back:hover { border-color: #3a3f4a; }

.group-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.group-card, .ex-card {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 12px 18px 12px 12px;
  border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(180deg, var(--card-2), var(--card));
  color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s;
}
.group-card { border-left: 4px solid var(--gc); }
.group-card:hover, .ex-card:hover { border-color: #3d424d; transform: translateY(-1px); }
.group-card:hover { border-left-color: var(--gc); }
.group-thumb, .ex-thumb { background: #101216; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 2; }
.group-thumb svg, .ex-thumb svg { display: block; width: 100%; height: 100%; }
.group-info h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.01em; text-transform: none; color: var(--text); font-weight: 700; }
.group-info p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.count { font-size: 12px; font-weight: 600; color: var(--gc); background: rgba(255, 255, 255, 0.05); padding: 3px 9px; border-radius: 999px; }
.chev { font-size: 28px; color: var(--muted); }
.ex-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ex-info h3 { margin: 0 0 8px; font-size: 17px; }
.ex-muscles { display: flex; flex-wrap: wrap; gap: 5px; }
.ex-muscles span { font-size: 12px; color: var(--mc); border: 1px solid color-mix(in srgb, var(--mc) 45%, transparent); padding: 2px 8px; border-radius: 999px; }
@media (max-width: 420px) {
  .group-card, .ex-card { grid-template-columns: 96px 1fr auto; gap: 12px; }
  .group-info h2 { font-size: 19px; }
  .ex-info h3 { font-size: 16px; }
}
.handle.dragging circle:nth-child(2) { stroke: #fff; }

.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 118px 1fr 42px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 8px; background: #2d313a; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width 0.12s; }
.bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.load { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); line-height: 1.5; }
.load b { color: var(--text); }

.warnings { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.warnings li { padding: 12px 14px; border-radius: 14px; background: rgba(255, 138, 61, 0.1); border: 1px solid rgba(255, 138, 61, 0.35); font-size: 15px; line-height: 1.45; }

/* Controls */
.controls { display: grid; gap: 14px; }
.controls h2 { margin-bottom: 0; }
.ctl { display: grid; gap: 2px; }
.ctl[hidden] { display: none; }
.ctl-head { display: flex; justify-content: space-between; font-size: 15px; font-weight: 500; }
.ctl-head output { color: var(--muted); font-variant-numeric: tabular-nums; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.presets button {
  flex: 1 1 auto;
  border: 1px solid var(--line);
  background: #232730;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.presets button:hover { background: #2b303a; }
.presets .ghost { background: transparent; color: var(--muted); }

/* Info */
.info { padding: 0; }
.info summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 24px;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.info summary::-webkit-details-marker { display: none; }
.info summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; }
.info[open] summary::after { transform: rotate(-135deg); }
.info-body { padding: 0 24px 20px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.muted { color: var(--muted); }

.foot { text-align: center; color: #555b68; font-size: 12px; margin-top: 28px; }

@media (max-width: 420px) {
  .card { border-radius: 22px; padding: 16px; }
  .bullets { padding: 4px 18px; }
  .bullet { font-size: 16px; }
  .bar { grid-template-columns: 104px 1fr 38px; font-size: 13px; }
}

.ex-summary { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: #c9ccd4; max-width: 720px; }
.ex-summary b { color: var(--handle); margin-right: 4px; }

.main-group { margin: -4px 0 14px; font-size: 18px; line-height: 1.4; }
.main-group b { font-weight: 700; }
.bar-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin: 10px 0 -2px; }
.bar-group:first-child { margin-top: 0; }

.approx { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: #7c8392; }
.small { font-size: 13px; margin: 0 0 4px; }
.bar-val { font-size: 12px; font-weight: 600; }
.bar-val.lvl-hi { color: var(--text); }
.bar-val.lvl-mid { color: #c9ccd4; }
.bar-val.lvl-lo { color: var(--muted); }
.bar-val.lvl-no { color: #4b5160; }
.bar { grid-template-columns: 118px 1fr 48px; }
#body-ctls { display: grid; gap: 14px; }

/* Marca */
.brand-hero { display: flex; align-items: center; gap: 18px; margin: 8px 4px 20px; }
.brand-hero img { width: 84px; height: 84px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.wordmark { margin: 0; font-size: clamp(44px, 11vw, 64px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.wordmark i, .brand-mini i { font-style: normal; color: var(--handle); }
.wordmark span { font-weight: 500; color: #c9ced8; }
.brand-hero .sub { margin-top: 8px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand-mini { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -0.03em; font-size: 18px; }
.brand-mini img { border-radius: 8px; }

/* Tipografía y fichas */
h1, .wordmark, .group-info h2, .ex-info h3, .brand-mini, .info summary { font-family: "Manrope", "Inter", ui-sans-serif, sans-serif; }
h1 { font-weight: 800; letter-spacing: -0.035em; }
h2 { letter-spacing: 0.1em; font-size: 12.5px; }
.ex-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid #2c303a; background: #15171d; color: #c9ccd4; }
.chip[style] { color: var(--cc); border-color: color-mix(in srgb, var(--cc) 45%, transparent); background: color-mix(in srgb, var(--cc) 10%, #15171d); }
.ex-sub { margin: -4px 0 8px; font-size: 12.5px; color: var(--muted); }
.card { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px rgba(0, 0, 0, 0.28); }
.bullet { font-size: 16px; }

.home-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 22px 4px 0; }
.install-btn { border: 0; background: var(--handle); color: #111; font: inherit; font-weight: 700; padding: 13px 18px; border-radius: 14px; cursor: pointer; }
.about-link { color: var(--muted); font-size: 14px; }

.tips-grid { display: grid; gap: 18px; }
@media (min-width: 560px) { .tips-grid { grid-template-columns: 1fr 1fr; } }
.tips h3 { margin: 0 0 8px; font-size: 14px; font-family: "Manrope", "Inter", sans-serif; }
.tips-bad { color: #ff8a8a; }
.tips-good { color: var(--c-quad, #34e089); }
.tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tips li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.45; color: #d5d8df; }
.tips div:first-child li::before { content: "✕"; position: absolute; left: 0; color: #ff8a8a; font-weight: 700; }
.tips div:last-child li::before { content: "✓"; position: absolute; left: 0; color: var(--c-quad, #34e089); font-weight: 700; }

.cmp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cmp-btn { border: 1px solid var(--handle); background: transparent; color: var(--handle); font: inherit; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 12px; cursor: pointer; }
.cmp-btn.on { background: var(--handle); color: #111; }
.chart-legend i.dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed #9097a6; vertical-align: 3px; }
.cmp-groups { margin: -6px 0 16px; padding: 12px 14px; border-radius: 14px; background: #121419; border: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; }
.cmp-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cmp-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.cmp-row .up { color: #34e089; } .cmp-row .down { color: #ff8a8a; } .cmp-row .same { color: var(--muted); }

.tut { position: absolute; z-index: 3; left: 50%; bottom: 84px; transform: translateX(-50%); width: min(300px, calc(100% - 24px)); pointer-events: none; display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; background: #ffd23f; color: #111; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); font-size: 14px; line-height: 1.4; }
.tut b { font-size: 15px; }
.tut button { pointer-events: auto; justify-self: end; border: 0; background: #111; color: #ffd23f; font: inherit; font-weight: 700; padding: 7px 12px; border-radius: 10px; cursor: pointer; }

.about-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.about p { font-size: 15.5px; line-height: 1.6; margin: 0 0 10px; color: #d5d8df; }
.about p.muted { color: var(--muted); }
.warn-card { border-color: rgba(255, 138, 61, 0.4); }
.refs { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; color: #d5d8df; }
.refs a, .foot a { color: var(--handle); }
