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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

.main-control {
  width: 100%;
  max-width: 500px;
  background: white;
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

#timer-display {
  font-size: 72px;
  font-weight: 700;
  color: #333;
  margin-bottom: 40px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1;
}

#record-button {
  width: 100%;
  min-height: 80px;
  font-size: 24px;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#record-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(76, 175, 80, 0.5);
}

#record-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#record-button:disabled {
  background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

#record-button.recording {
  background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
  box-shadow: 0 8px 20px rgba(244, 67, 54, 0.4);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0%, 100% {
    box-shadow: 0 8px 20px rgba(244, 67, 54, 0.4);
  }
  50% {
    box-shadow: 0 8px 28px rgba(244, 67, 54, 0.7);
  }
}

#messages {
  margin-top: 24px;
  text-align: left;
}

.downloads-link {
  display: block;
  margin-top: 24px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.downloads-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.downloads-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.msg {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.msg.info {
  background: #e3f2fd;
  border-left: 4px solid #2196F3;
  color: #1565C0;
}

.msg.error {
  background: #ffebee;
  border-left: 4px solid #f44336;
  color: #c62828;
  font-weight: 500;
}

/* Mobile optimizations */
@media (max-width: 600px) {
  body {
    padding: 15px;
  }

  .main-control {
    padding: 30px 20px;
    border-radius: 20px;
  }

  #timer-display {
    font-size: 56px;
    margin-bottom: 30px;
  }

  #record-button {
    min-height: 70px;
    font-size: 20px;
  }

  .msg {
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  #timer-display {
    font-size: 48px;
  }

  #record-button {
    min-height: 65px;
    font-size: 18px;
  }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    padding: 10px;
  }

  .main-control {
    padding: 20px 25px;
  }

  #timer-display {
    font-size: 42px;
    margin-bottom: 20px;
  }

  #record-button {
    min-height: 60px;
    font-size: 18px;
  }
}

/* Prevent text selection on button */
#record-button {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

