:root {
  --escuela_phys_mov-ruby: #9B111E;
  --escuela_phys_mov-blue: #0000FF;
  --escuela_phys_mov-gold: #BDA838;
  --escuela_phys_mov-gold-line: rgba(189, 168, 56, 0.35);
  --escuela_phys_mov-panel-bg: rgba(6, 9, 22, 0.92);
  --escuela_phys_mov-mono: Consolas, "Merriweather", Menlo, "Courier New", monospace;
}

/* ------------------------------------------------------------------ */
/* Page cosmos (applied via body class so it is Django-integration safe) */
/* ------------------------------------------------------------------ */

body.escuela_phys_mov-body {
  margin: 0;
  min-height: 100vh;
  color: var(--escuela_phys_mov-gold);
  font-family: "Merriweather", "Trebuchet MS", "DejaVu Sans", Verdana, sans-serif;
  font-size: 14px;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(155, 17, 30, 0.18), transparent 62%),
    radial-gradient(950px 680px at 88% 108%, rgba(0, 0, 255, 0.16), transparent 58%),
    radial-gradient(780px 480px at 68% 6%, rgba(70, 90, 255, 0.09), transparent 60%),
    linear-gradient(180deg, #040514 0%, #05061a 46%, #030410 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.escuela_phys_mov-body ::selection {
  background: rgba(155, 17, 30, 0.65);
}

/* Twinkling star field layer */
.escuela_phys_mov-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.3px 1.3px at 22px 44px, rgba(255, 255, 255, 0.70), transparent 100%),
    radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.42), transparent 100%),
    radial-gradient(1.7px 1.7px at 310px 262px, rgba(214, 224, 255, 0.55), transparent 100%),
    radial-gradient(1px 1px at 424px 64px, rgba(255, 255, 255, 0.34), transparent 100%),
    radial-gradient(1.2px 1.2px at 90px 330px, rgba(226, 232, 255, 0.48), transparent 100%),
    radial-gradient(1px 1px at 360px 400px, rgba(255, 255, 255, 0.30), transparent 100%);
  background-size: 460px 460px, 380px 380px, 620px 620px, 520px 520px, 560px 560px, 700px 700px;
  background-repeat: repeat;
  animation: escuela_phys_mov-twinkle 7s ease-in-out infinite alternate;
}

@keyframes escuela_phys_mov-twinkle {
  from { opacity: 0.55; }
  to   { opacity: 0.95; }
}

/* ------------------------------------------------------------------ */
/* Layout shell + header                                               */
/* ------------------------------------------------------------------ */

.escuela_phys_mov-shell {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 22px 42px;
}

.escuela_phys_mov-header {
  text-align: center;
  margin-bottom: 26px;
}

.escuela_phys_mov-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #BDA838;
}

.escuela_phys_mov-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #BDA838;
  text-shadow: 0 0 26px rgba(189, 168, 56, 0.28);
}

.escuela_phys_mov-subtitle {
  margin: 10px 0 0;
  font-family: var(--escuela_phys_mov-mono);
  font-size: 13.5px;
  color: #BDA838;
}

.escuela_phys_mov-titleRule {
  width: 240px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--escuela_phys_mov-ruby), var(--escuela_phys_mov-blue));
  box-shadow: 0 0 16px rgba(90, 40, 190, 0.85);
}

/* ------------------------------------------------------------------ */
/* Control console                                                     */
/* ------------------------------------------------------------------ */

.escuela_phys_mov-controls {
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(var(--escuela_phys_mov-panel-bg), var(--escuela_phys_mov-panel-bg)) padding-box,
    linear-gradient(135deg, rgba(155, 17, 30, 0.9), rgba(28, 22, 130, 0.9), rgba(0, 0, 255, 0.9)) border-box;
  box-shadow:
    0 14px 40px rgba(0, 0, 10, 0.5),
    0 0 30px rgba(70, 40, 160, 0.14);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.escuela_phys_mov-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.escuela_phys_mov-presetsLabel {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-right: 4px;
  color: #BDA838;
}

.escuela_phys_mov-presetBtn {
  font: inherit;
  font-size: 12px;
  color: #BDA838;
  background: rgba(189, 168, 56, 0.07);
  border: 1px solid rgba(189, 168, 56, 0.4);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.escuela_phys_mov-presetBtn:hover {
  background: rgba(189, 168, 56, 0.16);
  box-shadow: 0 0 12px rgba(189, 168, 56, 0.3);
  transform: translateY(-1px);
}

.escuela_phys_mov-paramRow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.escuela_phys_mov-param {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.escuela_phys_mov-paramHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.escuela_phys_mov-paramLabel {
  font-size: 12.5px;
  letter-spacing: 0.4px;
  color: #BDA838;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.escuela_phys_mov-paramValue {
  width: 92px;
  flex: 0 0 auto;
  font-family: var(--escuela_phys_mov-mono);
  font-size: 13.5px;
  color: #BDA838;
  text-align: right;
  background: rgba(10, 14, 34, 0.85);
  border: 1px solid rgba(189, 168, 56, 0.35);
  border-radius: 8px;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.escuela_phys_mov-paramValue:focus {
  border-color: var(--escuela_phys_mov-gold);
  box-shadow: 0 0 10px rgba(189, 168, 56, 0.35);
}

/* Range sliders — gold thumb, ruby→blue fill driven by --escuela_phys_mov-fill */
.escuela_phys_mov-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  outline: none;
  cursor: pointer;
  --escuela_phys_mov-fill: 50%;
}

.escuela_phys_mov-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--escuela_phys_mov-ruby) 0%,
    var(--escuela_phys_mov-blue) var(--escuela_phys_mov-fill),
    rgba(88, 102, 168, 0.22) var(--escuela_phys_mov-fill),
    rgba(88, 102, 168, 0.22) 100%
  );
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
}

.escuela_phys_mov-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffefb3, var(--escuela_phys_mov-gold) 55%, #7a6a1e);
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 10px rgba(189, 168, 56, 0.85), 0 0 20px rgba(189, 168, 56, 0.4);
  cursor: pointer;
}

.escuela_phys_mov-slider::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(88, 102, 168, 0.22);
}

.escuela_phys_mov-slider::-moz-range-progress {
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--escuela_phys_mov-ruby), var(--escuela_phys_mov-blue));
}

.escuela_phys_mov-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #ffefb3, var(--escuela_phys_mov-gold) 55%, #7a6a1e);
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 10px rgba(189, 168, 56, 0.85), 0 0 20px rgba(189, 168, 56, 0.4);
  cursor: pointer;
}

/* Simulate / reset / telemetry row */
.escuela_phys_mov-simRow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.escuela_phys_mov-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #BDA838;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.escuela_phys_mov-btnIcon {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
}

.escuela_phys_mov-btnPlay {
  min-width: 172px;
  border: 1px solid rgba(189, 168, 56, 0.45);
  background: linear-gradient(135deg, var(--escuela_phys_mov-ruby) 0%, #5a0e86 52%, var(--escuela_phys_mov-blue) 100%);
  box-shadow: 0 6px 18px rgba(70, 20, 150, 0.45), inset 0 0 12px rgba(255, 255, 255, 0.06);
}

.escuela_phys_mov-btnPlay:hover {
  filter: brightness(1.22);
  box-shadow: 0 8px 24px rgba(90, 30, 190, 0.6), inset 0 0 12px rgba(255, 255, 255, 0.1);
}

.escuela_phys_mov-btnPlay:active {
  transform: translateY(1px) scale(0.99);
}

.escuela_phys_mov-btnReset {
  border: 1px solid rgba(189, 168, 56, 0.45);
  background: rgba(189, 168, 56, 0.06);
}

.escuela_phys_mov-btnReset:hover {
  background: rgba(189, 168, 56, 0.14);
  box-shadow: 0 0 14px rgba(189, 168, 56, 0.25);
}

/* Live telemetry readout */
.escuela_phys_mov-telemetry {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin-left: auto;
  border: 1px solid rgba(189, 168, 56, 0.3);
  border-radius: 12px;
  padding: 8px 4px;
  background: rgba(8, 11, 26, 0.6);
}

.escuela_phys_mov-teleItem {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 16px;
  border-left: 1px solid rgba(189, 168, 56, 0.22);
  min-width: 86px;
}

.escuela_phys_mov-teleItem:first-child {
  border-left: none;
}

.escuela_phys_mov-teleKey {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #BDA838;
}

.escuela_phys_mov-teleVal {
  font-family: var(--escuela_phys_mov-mono);
  font-size: 14.5px;
  font-weight: 700;
  color: #BDA838;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* 2x2 graph grid                                                      */
/* ------------------------------------------------------------------ */

.escuela_phys_mov-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.escuela_phys_mov-card {
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(var(--escuela_phys_mov-panel-bg), var(--escuela_phys_mov-panel-bg)) padding-box,
    linear-gradient(135deg, rgba(155, 17, 30, 0.75), rgba(28, 24, 150, 0.7), rgba(0, 0, 255, 0.75)) border-box;
  box-shadow: 0 12px 34px rgba(0, 0, 8, 0.5), 0 0 26px rgba(60, 40, 150, 0.12);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.escuela_phys_mov-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 8, 0.6), 0 0 34px rgba(90, 50, 180, 0.2);
}

.escuela_phys_mov-cardHead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 0 2px;
}

.escuela_phys_mov-cardEyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #BDA838;
}

.escuela_phys_mov-cardTitle {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #BDA838;
}

.escuela_phys_mov-cardFormula {
  margin: 4px 0 0;
  font-family: var(--escuela_phys_mov-mono);
  font-size: 12.5px;
  color: #BDA838;
}

.escuela_phys_mov-cardVal {
  font-family: var(--escuela_phys_mov-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #BDA838;
  background: rgba(189, 168, 56, 0.08);
  border: 1px solid rgba(189, 168, 56, 0.35);
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.escuela_phys_mov-canvasWrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(100, 120, 255, 0.22);
  height: 300px;
  box-shadow: inset 0 0 30px rgba(0, 0, 20, 0.7);
}

/* Faint CRT scanlines over each canvas — telemetry screen feel */
.escuela_phys_mov-canvasWrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
}

.escuela_phys_mov-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ------------------------------------------------------------------ */
/* Footer equation reference                                           */
/* ------------------------------------------------------------------ */

.escuela_phys_mov-footer {
  margin-top: 24px;
  padding: 14px 10px 0;
  border-top: 1px solid rgba(189, 168, 56, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 26px;
  font-family: var(--escuela_phys_mov-mono);
  font-size: 12.5px;
  color: #BDA838;
}

.escuela_phys_mov-footerEq {
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Accessibility + responsive behaviour                                */
/* ------------------------------------------------------------------ */

#escuela_phys_mov_app :focus-visible {
  outline: 2px solid var(--escuela_phys_mov-gold);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .escuela_phys_mov-paramRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .escuela_phys_mov-grid {
    grid-template-columns: 1fr;
  }

  .escuela_phys_mov-canvasWrap {
    height: 250px;
  }
}

@media (max-width: 700px) {
  .escuela_phys_mov-telemetry {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .escuela_phys_mov-teleItem {
    min-width: 0;
    padding: 2px 10px;
  }
}

@media (max-width: 560px) {
  .escuela_phys_mov-paramRow {
    grid-template-columns: 1fr;
  }

  .escuela_phys_mov-paramLabel {
    white-space: normal;
  }
}
