:root {
  --bg-color: #050505;
  --card-bg: rgba(20, 20, 20, 0.7);
  --primary: #00f2ff;
  --primary-glow: rgba(0, 242, 255, 0.5);
  --secondary: #ff0055;
  --text-main: #ffffff;
  --text-dim: #a0a0a0;
  --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Background Animations */
.background-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.4;
}

.blob {
  position: absolute;
  border-radius: 50%;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: move 20s infinite alternate;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  bottom: -150px;
  right: -100px;
  animation: move 25s infinite alternate-reverse;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #7000ff;
  top: 40%;
  left: 50%;
  animation: move 15s infinite linear;
}

@keyframes move {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(100px, 100px);
  }
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 450px;
  padding: 20px;
  text-align: center;
}

header {
  margin-bottom: 30px;
}

.logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo span {
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

.subtitle {
  color: var(--text-dim);
  font-weight: 300;
}

/* Timer Card */
.timer-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.visualizer-container {
  height: 60px;
  margin-bottom: 20px;
  position: relative;
}

#visualizer {
  width: 100%;
  height: 100%;
}

.penalty-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  color: var(--secondary);
  font-size: 2.5rem;
  font-weight: 800;
  text-shadow: 0 0 20px rgba(255, 0, 85, 0.5);
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.penalty-overlay.active {
  transform: translate(-50%, -50%) scale(1.2);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    transform: translate(-55%, -50%) scale(1.1);
  }
  75% {
    transform: translate(-45%, -50%) scale(1.1);
  }
}

.timer-display {
  font-family: "JetBrains Mono", monospace;
  font-size: 5rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-main);
  letter-spacing: -2px;
}

.penalty-stats {
  margin-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary);
  text-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

.db-meter {
  margin-bottom: 30px;
}

.db-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.db-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.1s ease;
  box-shadow: 0 0 10px var(--primary-glow);
}

.db-info {
  font-size: 0.9rem;
  color: var(--text-dim);
}

#db-value {
  color: var(--text-main);
  font-weight: 600;
}

/* Controls */
.controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.btn {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: var(--secondary);
  color: white;
}

/* Settings */
.settings {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.input-group label {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.input-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  width: 70px;
  font-family: inherit;
  font-size: 1rem;
  text-align: center;
}

/* Footer */
.info-footer {
  margin-top: 30px;
}

.mic-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 15px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #ffaa00;
  border-radius: 50%;
}

.mic-active .status-indicator {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88;
}

.status-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
}

.warning {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-height: 700px) {
  .app-container {
    transform: scale(0.9);
  }
}
