* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
}
body {
  background: radial-gradient(circle at top, #1a1a2e, #162447);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.5s;
}
.header {
  background: linear-gradient(135deg, #6a0dad, #1e90ff);
  color: #fff;
  padding: 20px 40px;
  text-align: center;
  border-radius: 0 0 30px 30px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}
.header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #00fff5, #ff6aff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glowText 3s ease-in-out infinite alternate;
  position: relative;
}
.header::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(0, 255, 245, 0.2) 0%,
    transparent 60%
  );
  animation: rotateBg 10s linear infinite;
  pointer-events: none;
}
.panel {
  text-align: center;
  margin: 50px auto;
}
.btn {
  padding: 16px 40px;
  font-size: 1.2rem;
  background: linear-gradient(to right, #ff6aff, #1e90ff);
  color: #fff;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn:hover {
  background: linear-gradient(to right, #ff92f0, #00fff5);
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0, 255, 245, 0.7);
}
.keyboard-container {
  display: none;
  justify-content: center;
  align-items: center;
  margin: 30px auto;
  padding: 20px;
  background: rgba(30, 40, 70, 0.8);
  border-radius: 20px;
  overflow-x: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
.keyboard-container svg {
  width: 100%;
  height: auto;
}
.white,
.black {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
}
.white {
  fill: #fefefe;
  stroke: #ccc;
  stroke-width: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}
.white:hover,
.white.active {
  fill: #a7ffeb;
  transform: translateY(4px);
  filter: drop-shadow(0 8px 10px #00fff5);
}
.white:active,
.white.active {
  fill: #a7ffeb;
  transform: translateY(4px) scale(1.05);
  filter: drop-shadow(0 0 12px #00fff5);
  box-shadow: 0 0 15px #00fff5;
}
.black {
  fill: #222;
  stroke: #555;
  stroke-width: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.black:hover,
.black.active {
  fill: #ff6aff;
  transform: translateY(3px);
  filter: drop-shadow(0 6px 10px #ff6aff);
}
.black:active,
.black.active {
  fill: #ff6aff;
  transform: translateY(3px) scale(1.05);
  filter: drop-shadow(0 0 12px #ff6aff);
  box-shadow: 0 0 15px #ff6aff;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  max-width: 1000px;
  margin: 30px auto;
  justify-content: center;
}
.control-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.control-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(0, 255, 245, 0.6);
}
.control-card label {
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  color: #00fff5;
  text-shadow: 1px 1px 3px #000;
}
input[type="range"] {
  cursor: pointer;
  width: 100%;
  accent-color: #ff6aff;
}
.small-btn {
  padding: 7px 16px;
  margin: 0 5px;
  border: none;
  background-color: #ff6aff;
  color: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.small-btn:hover {
  background-color: #ff92f0;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 15px #ff6aff;
}
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 28px;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5);
}
.toggle:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}
input:checked + .toggle {
  background-color: #ff6aff;
}
input:checked + .toggle:before {
  transform: translateX(24px);
  background-color: #00fff5;
}
@keyframes glowText {
  0% {
    text-shadow:
      0 0 8px #00fff5,
      0 0 20px #ff6aff;
  }
  50% {
    text-shadow:
      0 0 12px #00fff5,
      0 0 25px #ff92f0;
  }
  100% {
    text-shadow:
      0 0 8px #00fff5,
      0 0 20px #ff6aff;
  }
}
@keyframes rotateBg {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== MEDIA QUERIES ===== */

@media (max-width: 1023px) {
  #mainScreen {
    margin: auto 15px;
  }
  .header h1 {
    font-size: 2.2rem;
  }
  .keyboard-container {
    padding: 15px;
  }
  .controls {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
  }
  .control-card {
    flex: 1 1 220px;
    min-width: 180px;
  }
}
@media (max-width: 767px) {
  .controls {
    gap: 15px;
  }
  .header h1 {
    font-size: 2rem;
  }
  .keyboard-container {
    padding: 12px;
  }
  .control-card {
    width: 100%;
    max-width: 400px;
  }
}
@media (max-width: 480px) {
  .header h1 {
    font-size: 1.6rem;
  }
  .btn {
    font-size: 1rem;
    padding: 12px 28px;
  }
  .control-card {
    padding: 14px;
  }
  .keyboard-container svg {
    transform: scale(0.9);
  }
}
