
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #edf8ff;
  background: #061526;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(
    ellipse at 70% 0%,
    #153b59,
    #061526 70%
  );
  min-height: 100vh;
}

.app {
  max-width: 1100px;
  margin: auto;
  padding: 28px 22px;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(26px, 4vw, 40px);
}

header p {
  color: #b5cedf;
  line-height: 1.6;
}

.lesson {
  margin-top: 25px;
  background: #0c253c;
  border: 1px solid #28536d;
  border-radius: 18px;
  padding: 24px;
}

.stage-header {
  margin-bottom: 15px;
}

#stepNumber {
  color: #28d9eb;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

h2 {
  margin: 9px 0;
  font-size: 25px;
}

svg {
  display: block;
  width: 100%;
  height: auto;
  background: #071b2e;
  border-radius: 12px;
}

.scene-label {
  fill: #d1e7f2;
  font-size: 20px;
}

.normal-label {
  fill: #9bb8c9;
  font-size: 16px;
}

.ray {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.incident {
  stroke: white;
  marker-end: url(#arrowWhite);
}

.reflected {
  stroke: #39d9ff;
  marker-end: url(#arrowCyan);
}

.transmitted {
  stroke: #94ef9b;
  marker-end: url(#arrowGreen);
}

.glow {
  fill: none;
  stroke: white;
  stroke-width: 15;
  opacity: .2;
  filter: url(#rayGlow);
}

.cyan-glow {
  stroke: #39d9ff;
}

.green-glow {
  stroke: #94ef9b;
}

.explanation {
  margin-top: 20px;
  background: #10334b;
  border-left: 4px solid #20d6e8;
  padding: 17px 20px;
  border-radius: 7px;
  min-height: 110px;
}

.concept {
  color: #35dceb;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

.explanation p {
  margin: 9px 0 0;
  color: #d6e8f1;
  line-height: 1.7;
  font-size: 16px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

button {
  background: #153c55;
  color: white;
  border: 1px solid #3c6980;
  border-radius: 9px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #1d536e;
}

button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

button.primary {
  background: #17cce1;
  color: #062337;
  border-color: #17cce1;
  margin-left: auto;
}

.progress {
  display: flex;
  gap: 7px;
  margin-top: 20px;
}

.progress span {
  flex: 1;
  height: 5px;
  background: #24475e;
  border-radius: 10px;
}

.progress span.active {
  background: #22d6e9;
}

.audio-status {
  color: #9fbccc;
  font-size: 12px;
  margin-top: 12px;
}

footer {
  margin-top: 25px;
  text-align: center;
  color: #7799ad;
  font-size: 12px;
}

@media (max-width: 600px) {
  .app {
    padding: 14px;
  }

  .lesson {
    padding: 14px;
  }

  h2 {
    font-size: 21px;
  }

  .controls button {
    flex: 1;
    padding: 11px 8px;
    font-size: 12px;
  }

  button.primary {
    margin-left: 0;
  }
}
