:root {
  color-scheme: dark;
  font-family: "Arial Narrow", "Yu Gothic", "Hiragino Kaku Gothic ProN", monospace;
  background: #030609;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030609;
}

body { cursor: none; }
body.debugging { cursor: crosshair; }

#stage {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

.boot,
.hint,
.debug {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.18em;
}

.boot {
  inset: 0;
  display: grid;
  place-items: center;
  color: #d9d4c6;
  background: #030609;
  font-size: clamp(11px, 1vw, 18px);
  transition: opacity 700ms ease;
}

.boot.ready { opacity: 0; }

.hint {
  right: 2.5vw;
  bottom: 2.2vh;
  color: rgba(235, 228, 208, 0.36);
  font-size: clamp(8px, 0.62vw, 12px);
  animation: hint-out 8s both;
}

.debug {
  left: 18px;
  top: 18px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 14px 16px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(2, 5, 8, 0.82);
  color: rgba(235, 228, 208, 0.72);
  font-size: 10px;
  line-height: 1.5;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.debug strong { color: #f3b55d; }
.hidden { display: none; }

.debug__header,
.debug__status,
.debug__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.debug__status {
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(235, 228, 208, 0.48);
}

.debug__control {
  display: grid;
  grid-template-columns: 108px minmax(100px, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.debug__control input[type="range"] {
  width: 100%;
  accent-color: #f2a94e;
}

.debug__control output {
  text-align: right;
  color: #f0e7d2;
  font-variant-numeric: tabular-nums;
}

.debug__control select {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  color: #f0e7d2;
  background: #11171b;
  font: inherit;
}

.debug__check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f0e7d2;
}

.debug__check input { accent-color: #f2a94e; }

.debug__group {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(242, 169, 78, 0.22);
  background: rgba(242, 169, 78, 0.045);
}

.debug__licenses {
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug__licenses summary { cursor: pointer; color: #8fd7dc; }
.debug__licenses dl { display: grid; gap: 6px; margin: 10px 0 0; }
.debug__licenses dl div { display: grid; grid-template-columns: 1fr 1.35fr; gap: 12px; }
.debug__licenses dt,
.debug__licenses dd { margin: 0; }
.debug__licenses dd { color: rgba(235, 228, 208, 0.48); text-align: right; }

.debug__footer {
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(235, 228, 208, 0.42);
}

@keyframes hint-out {
  0%, 60% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hint { animation: none; }
}
