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

body {
  font-family: 'Arial', sans-serif;
  background: #000000;
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.timer-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#timer {
  font-size: 25vw;
  font-weight: bold;
  text-align: center;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  color: #00ff00;
  text-shadow: 0 0 60px currentColor;
}

#timer.warning {
  color: #ff9800;
  text-shadow: 0 0 60px currentColor;
  animation: pulse 1s infinite;
}

#timer.critical {
  color: #ff0000;
  text-shadow: 0 0 80px currentColor;
  animation: pulse 0.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.controls {
  display: flex;
  gap: 20px;
  margin: 40px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  padding: 20px 50px;
  font-size: 24px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-start {
  background: #4caf50;
  color: white;
}

.btn-start:hover {
  background: #45a049;
}

.btn-stop {
  background: #ff9800;
  color: white;
}

.btn-stop:hover {
  background: #e68900;
}

.btn-reset {
  background: #f44336;
  color: white;
}

.btn-reset:hover {
  background: #da190b;
}

.btn-settings {
  background: #607d8b;
  color: white;
  padding: 20px 30px;
  font-size: 28px;
}

.btn-settings:hover {
  background: #546e7a;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #1a1a1a;
  padding: 0;
  border-radius: 15px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
  border: 2px solid #333;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-header h2 {
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.close-btn:hover {
  transform: scale(1.2);
}

.sound-upload {
  padding: 30px;
}

.room-code-input {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.room-code-input input {
  width: 300px;
  padding: 15px;
  font-size: 24px;
  text-align: center;
  border: 2px solid #555;
  border-radius: 8px;
  background: #2a2a2a;
  color: white;
  font-family: 'Arial', sans-serif;
}

.room-code-input input:focus {
  outline: none;
  border-color: #4caf50;
}

.room-code-badge {
  position: fixed;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #4caf50;
  border-radius: 8px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.2em;
  color: #4caf50;
}

.sound-upload h3 {
  margin-bottom: 15px;
  text-align: center;
}

.upload-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  gap: 10px;
}

.upload-group label {
  font-weight: bold;
  min-width: 140px;
}

.sound-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.upload-group input[type="file"] {
  color: white;
  flex: 1;
}

.btn-test {
  padding: 8px 16px;
  font-size: 14px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-test:hover {
  background: #1976d2;
}

.btn-test:active {
  transform: scale(0.95);
}

.status {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  font-size: 14px;
}

.status.connected {
  background: rgba(76, 175, 80, 0.8);
}

.status.disconnected {
  background: rgba(244, 67, 54, 0.8);
}

@media (max-width: 768px) {
  #timer {
    font-size: 20vw;
  }
  
  .btn {
    padding: 15px 30px;
    font-size: 18px;
  }
}
