html,
body {
  margin: 0;
  min-height: 100%;
  background: #f1f4f5;
  color: #1f252c;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
  padding: 20px;
}

.app-shell {
  margin: 0 auto;
  max-width: 1100px;
}

.app-header {
  margin-bottom: 18px;
}

.app-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  letter-spacing: 0.01em;
}

.app-header p {
  margin: 0;
  max-width: 62ch;
  color: #4b5963;
}

.app-header__reading-line {
  margin-top: 12px;
  font-size: 0.96rem;
  color: #56636c;
}

.app-explanation {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #c6d0d5;
  border-radius: 14px;
  background: #fbfcfc;
  box-shadow: 0 8px 24px rgba(17, 30, 39, 0.05);
}

.app-explanation h2 {
  margin: 0 0 8px;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
}

.app-explanation ul {
  margin: 0 0 10px 18px;
  padding: 0;
  font-size: 0.96rem;
  color: #30424f;
}

.app-explanation li {
  margin: 3px 0;
}

.app-explanation p {
  margin: 0;
  font-size: 0.96rem;
  color: #4b5963;
}

.replay-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #c6d0d5;
  border-radius: 14px;
  background: #fbfcfc;
  box-shadow: 0 8px 24px rgba(17, 30, 39, 0.05);
}

.replay-controls__group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.replay-controls__timeline {
  min-width: 0;
}

.replay-controls__timeline-input {
  width: min(100%, 520px);
  min-width: 0;
  margin: 0;
  accent-color: #356888;
}

.replay-controls__frame-label {
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: #4b5963;
  white-space: nowrap;
}

.replay-controls__layers {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.replay-controls__button {
  border: 1px solid #bfcad1;
  border-radius: 999px;
  background: #f8fafb;
  color: #1f252c;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.replay-controls__button:hover {
  background: #eef3f5;
}

.replay-controls__button:focus-visible {
  outline: 2px solid #356888;
  outline-offset: 2px;
}

.replay-controls__play {
  min-width: 74px;
}

.replay-controls__layer[aria-pressed="false"] {
  background: #e9eff2;
  border-color: #aebdc6;
  color: #6d7981;
}

.replay-controls__button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.app-stage,
.app-stage {
  border: 1px solid #c6d0d5;
  background: #fbfcfc;
}

.app-stage {
  padding: 10px;
  box-shadow: 0 10px 30px rgba(17, 30, 39, 0.05);
}

.app-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #edf1f3;
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .replay-controls {
    grid-template-columns: 1fr;
  }

  .replay-controls__group {
    width: 100%;
  }

  .replay-controls__timeline {
    flex-wrap: wrap;
  }

  .replay-controls__timeline-input {
    width: 100%;
  }

  .replay-controls__layers {
    justify-content: flex-start;
  }

  .app-stage {
    padding: 8px;
  }
}
