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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Animations de fond */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(147, 51, 234, 0.1) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, -20px); }
}

/* Particules */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.particles::before,
.particles::after {
  content: '✨';
  position: absolute;
  font-size: 20px;
  animation: sparkle 3s linear infinite;
  opacity: 0;
}

.particles::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.particles::after {
  top: 60%;
  right: 15%;
  animation-delay: 1.5s;
}

@keyframes sparkle {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-100px) rotate(360deg); }
}

/* Container principal */
.container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 30px;
  animation: fadeInDown 1s ease-out;
}

.title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4, #ffd700);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.sparkle {
  display: inline-block;
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  letter-spacing: 1px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

/* Instructions panel */
.instructions-panel {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  animation: fadeIn 1s ease-out 0.3s both;
}

.instruction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 10px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.instruction-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.key {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 5px 12px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.desc {
  font-size: 0.9rem;
  opacity: 0.9;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Main screen */
.main-screen {
  animation: fadeIn 1s ease-out 0.5s both;
}

/* Camera container */
.camera-container {
  position: relative;
  max-width: 640px;
  margin: 0 auto 30px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 215, 0, 0.3);
  background: #000;
}

#video {
  width: 100%;
  height: auto;
  display: block;
  transition: filter 0.3s ease;
}

#canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Compte à rebours */
.countdown {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.countdown-number {
  font-size: 120px;
  font-weight: bold;
  color: #ffd700;
  animation: countdownPulse 1s ease-in-out;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

@keyframes countdownPulse {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Indicateur de filtre */
.filter-indicator {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  border-radius: 25px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Filtres panel */
.filters-panel {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filter-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
}

.filter-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.filter-item.active {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.filter-preview {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.filter-preview.normal {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.filter-preview.grayscale {
  background: linear-gradient(135deg, #555, #888);
  filter: grayscale(100%);
}

.filter-preview.sepia {
  background: linear-gradient(135deg, #8b7355, #d4a574);
  filter: sepia(90%);
}

.filter-preview.contrast {
  background: linear-gradient(135deg, #000, #fff);
  filter: contrast(180%);
}

.filter-preview.vibrant {
  background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #ffd700);
  filter: saturate(200%) hue-rotate(45deg);
}

.filter-preview.newyear {
  background: linear-gradient(135deg, #FFD700, #FF6B6B, #4ECDC4);
  position: relative;
  overflow: hidden;
}

.filter-preview.newyear::before {
  content: "2026";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.filter-item span {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}

/* Action hint */
.action-hint {
  text-align: center;
  margin-top: 20px;
}

.pulse-button {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
  }
}

/* Validation screen */
.validation-screen {
  animation: fadeIn 0.5s ease-out;
  text-align: center;
}

.validation-title {
  font-size: 2rem;
  margin-bottom: 30px;
  background: linear-gradient(45deg, #ffd700, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.photo-preview-container {
  max-width: 640px;
  margin: 0 auto 30px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 215, 0, 0.3);
}

#photoPreview {
  width: 100%;
  height: auto;
  display: block;
}

.validation-buttons {
  display: flex;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
}

.validation-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.validation-key {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.validation-key.accept {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  animation: pulse 2s ease-in-out infinite;
}

.validation-key.reject {
  background: linear-gradient(135deg, #eb3349, #f45c43);
  animation: pulse 2s ease-in-out infinite 1s;
}

.validation-key:hover {
  transform: scale(1.1);
}

.validation-option p {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Email screen */
.email-screen {
  animation: fadeIn 0.5s ease-out;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.email-title {
  font-size: 2rem;
  margin-bottom: 40px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.email-form {
  margin-bottom: 30px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

#emailInput {
  width: 100%;
  padding: 20px;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  color: white;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#emailInput:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

#emailInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.input-underline {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

#emailInput:focus + .input-underline {
  width: 100%;
}

.email-hint {
  font-size: 1rem;
  opacity: 0.8;
}

.back-button {
  padding: 12px 25px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-5px);
}

/* Loading screen */
.loading-screen {
  animation: fadeIn 0.5s ease-out;
  text-align: center;
  padding: 60px 20px;
}

.loader {
  width: 80px;
  height: 80px;
  border: 8px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffd700;
  border-radius: 50%;
  margin: 0 auto 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.3rem;
  opacity: 0.9;
}

/* Success screen */
.success-screen {
  animation: fadeIn 0.5s ease-out;
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  background: linear-gradient(135deg, #11998e, #38ef7d);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  animation: scaleIn 0.5s ease-out;
  box-shadow: 0 20px 60px rgba(17, 153, 142, 0.4);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.success-screen h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  color: #38ef7d;
}

.success-screen p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 10px;
}

.restart-hint {
  margin-top: 30px;
  font-size: 1rem;
  opacity: 0.7;
}

#restartCounter {
  font-weight: bold;
  color: #ffd700;
  font-size: 1.3rem;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .title {
    font-size: 2rem;
  }
  
  .instructions-panel {
    gap: 10px;
  }
  
  .instruction-item {
    padding: 8px 12px;
  }
  
  .filters-panel {
    gap: 10px;
  }
  
  .filter-item {
    min-width: 80px;
    padding: 10px;
  }
  
  .filter-preview {
    width: 50px;
    height: 50px;
  }
  
  .validation-buttons {
    gap: 30px;
  }
  
  .validation-key {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}