:root {
  color-scheme: dark;
  --bg: #071016;
  --panel: rgba(8, 12, 18, 0.68);
  --panel-strong: rgba(7, 10, 14, 0.82);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f6f7fb;
  --muted: #a7b1be;
  --accent: #ffb347;
  --accent-2: #7be0a8;
  --danger: #ff7676;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(65, 95, 138, 0.22), transparent 32%),
    linear-gradient(180deg, #081017, #03070b 62%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow: hidden;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #0b1016;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hud-panel {
  position: absolute;
  padding: 12px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.76), rgba(7, 10, 14, 0.64));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
  font-size: 14px;
  line-height: 1.45;
}

.hud-panel.left {
  top: 18px;
  left: 18px;
  min-width: 272px;
}

.hud-panel.right {
  top: 18px;
  right: 18px;
  text-align: right;
  color: var(--muted);
}

.hud-panel.settings {
  top: 182px;
  right: 18px;
  width: min(320px, calc(100vw - 36px));
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

body.show-settings .hud-panel.settings {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.label {
  color: var(--muted);
  display: inline-block;
  min-width: 86px;
}

.meter {
  width: 100%;
  height: 10px;
  margin: 8px 0 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#power-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7be0a8, #ffe27d, #ff9d57);
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.24);
}

.settings-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setting-row {
  display: grid;
  grid-template-columns: 66px 1fr 54px;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.setting-row strong {
  text-align: right;
  font-size: 13px;
}

.setting-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  margin: 0;
  accent-color: var(--accent);
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
  box-shadow: none;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 999px;
}

#crosshair::before {
  left: 13px;
  top: 2px;
  width: 2px;
  height: 24px;
}

#crosshair::after {
  top: 13px;
  left: 2px;
  width: 24px;
  height: 2px;
}

#message {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  max-width: min(90vw, 880px);
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  text-align: center;
  font-size: 14px;
}

body.locked #message {
  opacity: 0.88;
}

body.scored #message {
  border-color: rgba(123, 224, 168, 0.42);
}

body.missed #message {
  border-color: rgba(255, 118, 118, 0.36);
}

body.mode-finished #message {
  border-color: rgba(255, 179, 71, 0.42);
}

@media (max-width: 980px) {
  .hud-panel.right {
    top: auto;
    bottom: 18px;
    right: 18px;
  }

  .hud-panel.settings {
    top: 18px;
    right: auto;
    left: 18px;
    width: min(360px, calc(100vw - 36px));
    transform: translateY(calc(100% + 16px));
  }
}

.wide-check {
  grid-template-columns: 18px 1fr;
  align-items: start;
}

.wide-check span {
  line-height: 1.3;
}

body.hide-crosshair #crosshair {
  display: none;
}
