:root {
  --bg-1: #0a0c1d;
  --bg-2: #141a3a;
  --accent: #4cc9f0;
  --accent-2: #80ed99;
  --text: #eef1ff;
  --muted: #9aa0c3;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
  background: linear-gradient(135deg, #141a3a, #0a0c1d, #1b1240);
  background-size: 200% 200%;
  animation: drift 18s ease infinite;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

@keyframes drift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app {
  width: min(680px, 100%);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.topbar h1 {
  font-size: 1.9rem;
  text-align: center;
  background: linear-gradient(90deg, #4cc9f0, #80ed99);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline { text-align: center; color: var(--muted); margin-top: 8px; font-size: 0.95rem; }

.hud { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }

.stat {
  flex: 1;
  min-width: 90px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.stat:hover { transform: translateY(-2px); border-color: rgba(76, 201, 240, 0.4); }

.stat-label { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 700; color: var(--accent-2); }

.stage { position: relative; }

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.message { min-height: 1.4em; text-align: center; margin-top: 14px; color: var(--accent-2); font-weight: 600; }

.controls { display: flex; gap: 12px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

.btn {
  background: linear-gradient(90deg, #4cc9f0, #80ed99);
  color: #06212b;
  border: none;
  border-radius: 14px;
  padding: 13px 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(76, 201, 240, 0.35);
  transition: transform 0.08s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(76, 201, 240, 0.5); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.field {
  flex: 1; min-width: 160px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 1rem; font-weight: 600;
  color: var(--text);
  outline: none;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: rgba(76, 201, 240, 0.5); }

.key {
  padding: 9px 14px;
  font-size: 0.95rem;
  border-radius: 10px;
  min-width: 44px;
}

.swatch {
  width: 46px; height: 46px; border-radius: 12px; border: 3px solid rgba(255,255,255,0.15);
  cursor: pointer; transition: transform 0.1s ease;
}
.swatch:hover { transform: translateY(-3px) scale(1.05); }
