:root {
  --bg: rgba(10,12,20,0.65);
  --panel: rgba(255,255,255,0.06);
  --accent-2: #8aa7ff;
  --text: #eaf2ff;
  --muted: #a9b2c6;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  background: transparent;
  font-family: inherit;
}

/* === MAIN OVERLAY === */
.ks-overlay {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999;
  user-select: none;
  width: 220px;
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  transition: transform 0.12s ease;
  background: transparent !important; /* <- przezroczyste, tło oddzielone */
}

/* === BACKGROUND PANEL (toggle-on/off) === */
.ks-overlay .ks-bg {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
  backdrop-filter: blur(6px) saturate(120%);
  background: linear-gradient(180deg, var(--bg), rgba(8,10,18,0.55));
  box-shadow: 0 8px 24px rgba(3,6,18,0.6);
  opacity: 1;
  transition: opacity 0.2s ease;
}

/* Wszystkie elementy treści są nad tłem */
.ks-overlay > * {
  position: relative;
  z-index: 1;
}

/* === TITLE === */
.ks-title {
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}

/* === WASD Layout === */
.ks-wasd {
  display: grid;
  grid-template-areas:
    ". W ."
    "A S D";
  grid-template-columns: 48px 48px 48px;
  grid-template-rows: 48px 48px;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.key {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  box-shadow: inset 0 -6px 18px rgba(0,0,0,0.35);
  transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}

.key.pressed {
  color: var(--text);
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 6px 18px rgba(124,245,201,0.12);
  background: linear-gradient(180deg, rgba(124,245,201,0.08), rgba(138,167,255,0.03));
}

#keyW { grid-area: W; justify-self: center; }
#keyA { grid-area: A; }
#keyS { grid-area: S; }
#keyD { grid-area: D; }

/* === MOUSE SECTION === */
.ks-mouse {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mouse-btn {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.03));
  border: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mouse-ico {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.mouse-pressed .mouse-ico {
  background: rgba(124,245,201,0.08);
  color: var(--text);
}

.mouse-title {
  font-size: 12px;
  color: var(--muted);
}

.mouse-cps {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
}

.mouse-bar {
  height: 6px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  width: 80%;
  margin-top: 6px;
  overflow: hidden;
}

.mouse-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.12s linear;
}

/* === FOOTER === */
.ks-footer {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
}
