#tutorialPanel {
  --tutorial-top: min(calc(clamp(76px, 7.5vw, 112px) + 16px), 35dvh);
  position: fixed;
  top: var(--tutorial-top);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1600;
  width: calc(100% - 24px);
  max-width: 720px;
  max-height: min(32dvh, calc(100dvh - var(--tutorial-top) - 12px));
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #5486a6;
  border-radius: 8px;
  background: linear-gradient(135deg, #1c2c3b, #121c25);
  box-shadow: inset 0 1px #ffffff12, 0 4px 12px #0005;
  color: #e4edf4;
  font-family: system-ui, sans-serif;
}
#tutorialPanel[data-tutorial-module="damage"] {
  top: max(0px, calc(var(--tutorial-top) - 12px));
}
.tutorialHeading,
.tutorialFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tutorialKicker {
  font-size: 10px;
  letter-spacing: 1px;
  color: #94bfd8;
}
#tutorialPanel .tutorialHeading {
  flex-wrap: wrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#tutorialPanel .tutorialHeading::before {
  content: "⠿";
  color: #94bfd880;
  font-size: 14px;
}
#tutorialPanel .tutorialHeading .tutorialKicker {
  flex: 1;
}
#tutorialPanel .tutorialHeading.tutorialDragging {
  cursor: grabbing;
}
#tutorialPanel .tutorialTitle {
  margin: 4px 0 6px;
  font-size: 16px;
  color: #e4edf4;
}
.tutorialText {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
}
.tutorialHint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #94bfd8;
}
.tutorialAction {
  flex: 1;
  color: #c0def0;
  font-size: 12px;
}
#tutorialPanel button {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid #5889a7;
  border-radius: 4px;
  background: #243e52;
  color: #e4edf4;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
#tutorialPanel button:hover {
  background: #355871;
}
#tutorialPanel button:disabled {
  opacity: .5;
  cursor: default;
}
[data-tutorial-locked="true"] {
  opacity: .5;
  cursor: default !important;
}
/* Read-only power explanation: keep the spotlighted menu contents legible. */
body:has(#tutorialPanel[data-tutorial-module="power"][data-tutorial-step="powerShortage"])
  #powerAllocPanel [data-tutorial-locked="true"] {
  opacity: 1;
}
#tutorialPanel button[hidden] {
  display: none;
}
#tutorialPanel .tutorialExit,
#tutorialPanel .tutorialSkip,
#tutorialPanel .tutorialBack,
#tutorialPanel .tutorialMenu {
  background: transparent;
  border-color: #ffffff35;
}
.tutorialSpotlight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1550;
  opacity: 0;
  transition: opacity 160ms ease-out;
}
.tutorialSpotlight,
.tutorialSpotlight * {
  pointer-events: none !important;
}
.tutorialSpotlight.visible {
  opacity: 1;
}
.tutorialSpotlightBorders {
  fill: none;
  stroke: #8ed7ff;
  stroke-width: 2;
  filter: drop-shadow(0 0 4px #52bfff);
}
@media (prefers-reduced-motion: reduce) {
  .tutorialSpotlight {
    transition: none;
  }
}
@media (max-width: 900px) {
  #tutorialPanel {
    padding: 10px;
    width: calc(100% - 16px);
  }
  .tutorialFooter {
    flex-wrap: wrap;
    gap: 6px;
  }
}
