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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a1018;
  font-family: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", "Fira Code",
    Consolas, "SF Mono", "Roboto Mono", monospace;
  color: #e8efe6;
  text-transform: uppercase;
  user-select: none;
}

button { text-transform: uppercase; }

#scene { position: fixed; inset: 0; display: block; }

/* ---------- start overlay ---------- */
#overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 12, 10, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 30;
  transition: opacity 1.4s ease, visibility 1.4s;
}
#overlay.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.overlay-inner { text-align: center; padding: 2rem; }

.title {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #dfe9da;
}
.title span { color: #7fc97f; font-weight: 400; }

.subtitle {
  margin-top: 0.4rem;
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: #9db8a0;
}

.overlay-credit {
  margin-top: 2.2rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: #6e8a72;
}

#startBtn {
  margin-top: 2.6rem;
  padding: 0.9rem 3rem;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: #dfe9da;
  background: rgba(127, 201, 127, 0.12);
  border: 1px solid rgba(160, 220, 160, 0.45);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
#startBtn:hover { background: rgba(127, 201, 127, 0.28); transform: scale(1.04); }

.overlay-msg {
  margin-top: 1.6rem;
  font-size: 0.8rem;
  color: #8aa08c;
  max-width: 30rem;
}

/* ---------- in-game ui ---------- */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 20; transition: opacity 0.5s; }
#ui.zen { opacity: 0; }
#ui.hidden-until-start { opacity: 0; }

.panel {
  position: absolute;
  top: 16px; left: 16px;
  width: 240px;
  background: rgba(10, 18, 14, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(160, 200, 160, 0.16);
  border-radius: 14px;
  pointer-events: auto;
  overflow: hidden;
}

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  cursor: pointer;
}
.panel-title { font-size: 0.85rem; letter-spacing: 0.18em; color: #b9d6b3; }
.panel-toggle { color: #7e9a80; font-size: 0.9rem; }

.panel-body { padding: 4px 14px 14px; }
.panel.collapsed .panel-body { display: none; }

.row { margin-bottom: 9px; }
.row label {
  display: flex; justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #a9c2a6;
  margin-bottom: 3px;
}
.row .val { color: #e4f0dd; }

.checkbox-row {
  display: flex; justify-content: space-between; align-items: center;
}
.checkbox-row label { margin: 0; }
.checkbox-row input { accent-color: #7fc97f; cursor: pointer; }

input[type="range"] {
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(160, 200, 160, 0.22);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #9fd49a;
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #9fd49a;
  border: none;
}

.sep { height: 1px; background: rgba(160, 200, 160, 0.14); margin: 11px 0; }

.wide-btn {
  width: 100%;
  padding: 7px 0;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #d6e8d0;
  background: rgba(127, 201, 127, 0.12);
  border: 1px solid rgba(160, 220, 160, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.wide-btn:hover { background: rgba(127, 201, 127, 0.25); }
.wide-btn.active {
  color: #10180f;
  background: #e8c95a;
  border-color: #e8c95a;
}
#stormBtn { margin-bottom: 9px; }

.btn-pair { display: flex; gap: 6px; }

.quality-row label { margin-bottom: 5px; }
.seg { display: flex; gap: 5px; }
.seg-4 button { font-size: 0.6rem; padding: 5px 1px; }
.seg button {
  flex: 1;
  padding: 5px 0;
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: #a9c2a6;
  background: rgba(160, 200, 160, 0.08);
  border: 1px solid rgba(160, 200, 160, 0.18);
  border-radius: 7px;
  cursor: pointer;
}
.seg button.active {
  color: #10180f;
  background: #9fd49a;
  border-color: #9fd49a;
}

#fps {
  position: absolute;
  top: 16px; right: 16px;
  padding: 5px 11px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #b9d6b3;
  background: rgba(10, 18, 14, 0.55);
  border: 1px solid rgba(160, 200, 160, 0.14);
  border-radius: 999px;
}

#hint {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: rgba(190, 215, 185, 0.55);
  white-space: nowrap;
}

#credit {
  position: absolute;
  bottom: 14px; right: 16px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(190, 215, 185, 0.45);
  white-space: nowrap;
}
