* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #87ceeb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#ui {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 1rem;
  pointer-events: none;
}

#ui .panel {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.9rem 1.1rem;
  border-radius: 0.6rem;
  backdrop-filter: blur(4px);
  max-width: 26rem;
  pointer-events: auto;
}

#ui h1 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

#ui p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: #d8ecff;
}

#ui kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
  margin: 0 0.1rem;
  font-size: 0.75rem;
}

#ui .row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

#ui input {
  width: 8rem;
  padding: 0.25rem 0.4rem;
  border: none;
  border-radius: 0.25rem;
}

#ui button {
  padding: 0.3rem 0.7rem;
  border: none;
  border-radius: 0.25rem;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
}

#ui button:hover {
  background: #2563eb;
}

#stats {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: #bae6fd;
  line-height: 1.4;
}

#blocker {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#blocker.hidden {
  display: none;
}

#blocker .prompt {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-size: 1.2rem;
}

.debug-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.debug-toggle:hover {
  background: rgba(0, 0, 0, 0.75);
}

.debug-panel {
  position: absolute;
  top: 3.6rem;
  right: 1rem;
  z-index: 30;
  width: 20rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  backdrop-filter: blur(6px);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
}

.debug-panel.open {
  transform: translateX(0);
  opacity: 1;
}

.debug-panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.3rem;
}

.debug-section {
  margin-bottom: 0.8rem;
}

.debug-section label {
  display: block;
  font-size: 0.78rem;
  margin: 0.4rem 0 0.15rem;
  color: #d8ecff;
}

.debug-section input[type="range"] {
  width: 100%;
  margin-bottom: 0.2rem;
}

.debug-section select {
  width: 100%;
  padding: 0.25rem;
  border-radius: 0.25rem;
  border: none;
  margin-bottom: 0.4rem;
}

.debug-section input[type="checkbox"] {
  margin-right: 0.35rem;
}

.debug-actions {
  display: flex;
  justify-content: flex-end;
}

.debug-actions button {
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.debug-actions button:hover {
  background: #2563eb;
}
