/* =========================================================================
 * Spektrirobot — stiilid
 * ========================================================================= */
:root {
  --bg: #070912;
  --panel: rgba(20, 24, 40, 0.9);
  --line: rgba(120, 140, 200, 0.18);
  --accent: #7fffd4;
  --text: #e8ecf7;
  --muted: #97a0bd;
}

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

html, body {
  height: 100%;
  background: radial-gradient(1200px 800px at 50% -10%, #14182b, #070912 70%);
  color: var(--text);
  font-family: "Rubik", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px;
  gap: 12px;
}

/* ---------- HUD ---------- */
#hud {
  width: 100%;
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-bot { font-size: 26px; filter: drop-shadow(0 0 8px rgba(127,255,212,.5)); }
.logo-text {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 17px;
}
.logo-text b { color: var(--accent); }

.collection { display: flex; gap: 8px; }
.slot {
  width: 22px; height: 22px; border-radius: 50%;
  background: #1a1f33;
  border: 2px solid var(--c);
  opacity: 0.4;
  transition: all .35s ease;
  position: relative;
}
.slot.on {
  opacity: 1;
  background: var(--c);
  box-shadow: 0 0 14px var(--c);
  transform: scale(1.12);
}
.slot.inv {
  background-image: repeating-linear-gradient(45deg, var(--c), var(--c) 3px, #1a1f33 3px, #1a1f33 6px);
}
.slot.inv.on { background: var(--c); }

.hud-right { display: flex; gap: 18px; }
.stat { text-align: right; line-height: 1.1; }
.stat-label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-family: "Orbitron", sans-serif; font-size: 18px; font-weight: 700; }

/* ---------- Stage ---------- */
#stage {
  position: relative;
  width: 100%;
  max-width: 1000px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
#game {
  width: 100%;
  max-width: 960px;
  height: auto;
  aspect-ratio: 960 / 600;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0,0,0,.55), inset 0 0 60px rgba(0,0,0,.4);
  cursor: crosshair;
}

/* ---------- Info panel ---------- */
.panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 320px;
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.96); opacity: 0; } }
.panel-swatch {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
}
.panel-body h2 { font-size: 19px; margin-bottom: 8px; }
.panel-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chip {
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(127,255,212,.12);
  color: var(--accent);
  border: 1px solid rgba(127,255,212,.25);
}
.panel-fact { font-size: 13px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.panel-action {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.action-icon { font-size: 16px; }
.panel-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer;
}
.panel-close:hover { color: var(--text); }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 18, 0.78);
  backdrop-filter: blur(6px);
  border-radius: 18px;
  z-index: 5;
}
.overlay-card {
  text-align: center;
  max-width: 460px;
  padding: 34px 36px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  position: relative;
  z-index: 2;
}
.overlay-icon { font-size: 54px; margin-bottom: 8px; }
.overlay-card h1 {
  font-family: "Orbitron", sans-serif;
  font-size: 30px; font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff3b30, #ff9500, #ffd60a, #34c759, #32ade6, #0a84ff, #af52de);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.lead { color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.lead b { color: var(--text); }
.controls-help {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 22px;
}
kbd {
  display: inline-block;
  padding: 2px 7px; margin: 0 1px;
  background: #1c2238; border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-family: "Rubik"; font-size: 12px; color: var(--text);
}

.win-colors { color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.win-time { font-family: "Orbitron"; font-size: 22px; margin-bottom: 20px; }

/* ---------- Level transition ---------- */
.level-overlay { background: rgba(6, 8, 18, 0.55); }
.level-card {
  text-align: center;
  padding: 30px 50px;
  animation: levelIn .5s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes levelIn {
  from { transform: scale(.6) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.level-badge {
  display: inline-block;
  font-family: "Orbitron", sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: 3px;
  color: var(--accent);
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(127,255,212,.4);
  margin-bottom: 14px;
}
.level-card h2 {
  font-family: "Orbitron", sans-serif; font-weight: 900;
  font-size: 42px; letter-spacing: 1px;
  background: linear-gradient(90deg, #ff3b30, #ffd60a, #34c759, #32ade6, #af52de);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.level-card p { color: var(--muted); font-size: 15px; }
.win-card { z-index: 2; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; border-radius: 18px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: "Rubik"; font-weight: 600; font-size: 15px;
  border: none; border-radius: 12px; cursor: pointer;
  padding: 13px 24px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-flag {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #042b14;
  box-shadow: 0 10px 28px rgba(46,204,113,.4);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-flag:hover { box-shadow: 0 12px 34px rgba(46,204,113,.55); }
.flag { font-size: 18px; }
.btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px 16px; font-size: 13px;
}
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-ghost.off { opacity: .55; }

/* ---------- Toolbar ---------- */
#toolbar {
  width: 100%; max-width: 1000px;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.hint { margin-left: auto; color: var(--muted); font-size: 13px; }
.hint b { color: var(--accent); }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .logo-text { font-size: 13px; }
  .panel { width: calc(100% - 28px); }
  .hint { display: none; }
  .hud-right { gap: 12px; }
}
