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

body {
  background: #0b0e14;
  color: #e8ecf3;
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

.app { display: flex; height: 100vh; }

/* ---------- panel ---------- */
.panel {
  width: 260px;
  min-width: 260px;
  background: #12161f;
  border-right: 1px solid #232a38;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.panel h1 { font-size: 22px; letter-spacing: .5px; }
.sub { font-size: 12px; color: #8b94a7; margin-top: -8px; }

.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #aab3c5; }
.field b { color: #fff; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 6px;
  background: #232a38;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #3bc8ff;
  cursor: pointer;
  box-shadow: 0 0 8px #3bc8ff88;
}

.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.sw {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--c);
  cursor: pointer;
  transition: transform .15s;
}
.sw:hover { transform: scale(1.15); }
.sw.active { border-color: #fff; box-shadow: 0 0 10px var(--c); }

input[type="color"] {
  width: 100%; height: 30px;
  background: #1a1f2b;
  border: 1px solid #2a3242;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
}

.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1;
  padding: 7px 0;
  background: #1a1f2b;
  border: 1px solid #2a3242;
  color: #aab3c5;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: .15s;
}
.seg-btn.active { background: #3bc8ff; border-color: #3bc8ff; color: #06202e; font-weight: 700; }

.start {
  padding: 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #3bff8f, #17c964);
  color: #05230f;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s, filter .12s;
}
.start:hover { transform: translateY(-2px); filter: brightness(1.1); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stat {
  background: #1a1f2b;
  border: 1px solid #232a38;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat span { font-size: 10px; color: #8b94a7; text-transform: uppercase; }
.stat b { font-size: 17px; color: #fff; }

.hint { font-size: 11px; color: #6d768a; line-height: 1.5; margin-top: auto; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mode-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px;
  background: #1a1f2b;
  border: 1px solid #2a3242;
  border-radius: 8px;
  color: #aab3c5;
  font-size: 11px;
  cursor: pointer;
  transition: .15s;
  text-align: left;
}
.mode-btn i { font-style: normal; font-size: 14px; }
.mode-btn:hover { border-color: #3bc8ff; color: #fff; }
.mode-btn.active { background: #3bc8ff; border-color: #3bc8ff; color: #06202e; font-weight: 700; }

/* ---------- stage ---------- */
.stage { flex: 1; position: relative; }
canvas { display: block; width: 100%; height: 100%; cursor: none; }

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, .78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .25s;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.card {
  background: #12161f;
  border: 1px solid #2a3242;
  border-radius: 14px;
  padding: 30px 40px;
  text-align: center;
  max-width: 380px;
  box-shadow: 0 20px 60px #000a;
}
.card h2 { font-size: 26px; margin-bottom: 10px; }
.card p { font-size: 14px; color: #8b94a7; line-height: 1.5; margin-bottom: 18px; }
.card button {
  padding: 11px 34px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #3bc8ff, #1789ff);
  color: #04202e;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.card button:hover { filter: brightness(1.12); }
