:root {
  --ink: #1a2a2a;
  --panel: rgba(250, 248, 240, 0.84);
  --panel-border: rgba(42, 157, 143, 0.22);
  --accent: #2a9d8f;
  --accent-soft: rgba(42, 157, 143, 0.16);
  --muted: #5c6b6b;
  --shadow: 0 10px 30px rgba(20, 40, 40, 0.14);
  --radius: 14px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: #0b1a2e;
}

#app {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  gap: 12px;
}

.hud-title {
  flex: 0 0 auto;
}

.controls {
  margin-top: auto;
}

.status {
  flex: 0 0 auto;
}

.hud-title {
  align-self: flex-start;
  pointer-events: none;
  color: #f7f3ea;
  text-shadow: 0 2px 12px rgba(0, 20, 30, 0.45);
  flex: 0 0 auto;
}

.hud-title h1 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.hud-title p {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.88;
  font-weight: 400;
}

.panel {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

.controls {
  align-self: stretch;
  width: min(520px, 100%);
  display: grid;
  gap: 10px;
  padding: 14px 16px 14px;
  margin-top: auto;
}

.ctl {
  display: grid;
  grid-template-columns: 44px 1fr 56px;
  align-items: center;
  gap: 10px;
}

.ctl-name {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}

.ctl-val {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), rgba(42, 157, 143, 0.35));
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #f7f3ea;
  box-shadow: 0 1px 4px rgba(0, 40, 40, 0.25);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #f7f3ea;
  box-shadow: 0 1px 4px rgba(0, 40, 40, 0.25);
  cursor: grab;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.btn {
  pointer-events: auto;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #f7f3ea;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(42, 157, 143, 0.28);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  border: 1px solid rgba(26, 42, 42, 0.08);
}

.btn.ghost.active {
  background: var(--accent-soft);
  border-color: rgba(42, 157, 143, 0.35);
  color: var(--accent);
}

.btn.on {
  background: #c45c6a;
  box-shadow: 0 4px 14px rgba(196, 92, 106, 0.3);
}

.status {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--muted);
  max-width: min(520px, 100%);
}

.status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.8;
}

#mode-label {
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 640px) {
  .hud { padding: 12px; }
  .hud-title h1 { font-size: 15px; }
  .controls { width: 100%; }
  .btn { padding: 8px 12px; font-size: 12px; }
}
