/* ============================================
   POUSSIN - Interface Enfant (3 ans)
   Design: gros boutons, couleurs vives, simple
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

:root {
  --primary: #FF6B6B;
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --success: #95E1D3;
  --bg: #FFF5E4;
  --bg-dark: #FFE8CC;
  --text: #2D3436;
  --shadow: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 24px;
  --radius-lg: 36px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Screens ---- */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.5s ease;
}
.screen.active {
  display: flex;
}

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

/* ---- Welcome Screen ---- */
.welcome-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.logo {
  font-size: min(25vw, 160px);
  animation: bounce 2s infinite ease-in-out;
}

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

.welcome-content h1 {
  font-size: min(7vw, 48px);
  color: var(--primary);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* ---- Buttons ---- */
.btn-primary, .btn-next, .btn-secondary {
  border: none;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow), 0 6px 0 rgba(0,0,0,0.1);
  position: relative;
  top: 0;
}

.btn-primary:active, .btn-next:active, .btn-secondary:active {
  top: 4px;
  box-shadow: var(--shadow), 0 2px 0 rgba(0,0,0,0.1);
}

.btn-primary {
  background: var(--primary);
  color: white;
  font-size: min(6vw, 36px);
  padding: 20px 48px;
}

.btn-next {
  background: var(--secondary);
  color: white;
  font-size: min(7vw, 42px);
  padding: 24px 64px;
  margin-top: 16px;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  font-size: min(5vw, 30px);
  padding: 16px 40px;
  border: 3px solid var(--primary);
}

/* ---- Weather Screen ---- */
.weather-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 600px;
}

.weather-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 48px;
  box-shadow: var(--shadow);
  width: 100%;
}

.weather-icon-large {
  font-size: min(20vw, 120px);
  line-height: 1;
}

.weather-temp {
  font-size: min(15vw, 90px);
  font-weight: bold;
  color: var(--primary);
}

.weather-description {
  font-size: min(6vw, 40px);
  font-weight: bold;
  color: var(--text);
  background: white;
  border-radius: var(--radius);
  padding: 20px 32px;
  box-shadow: var(--shadow);
  width: 100%;
}

.weather-voice-btn {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 16px 40px;
  font-size: min(5vw, 32px);
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
  font-family: inherit;
  border: none;
}

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

.weather-voice-btn.speaking {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ---- Game Screen ---- */
.game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 800px;
}

.game-instruction {
  font-size: min(6vw, 38px);
  font-weight: bold;
  color: var(--primary);
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.drop-zone {
  width: min(50vw, 280px);
  height: min(50vw, 280px);
  border: 8px dashed var(--secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(78, 205, 196, 0.1);
  transition: all 0.3s ease;
  position: relative;
}

.drop-zone.drag-over {
  border-color: var(--success);
  background: rgba(149, 225, 211, 0.3);
  transform: scale(1.05);
}

.drop-zone.correct {
  border-color: var(--success);
  background: rgba(149, 225, 211, 0.4);
  border-style: solid;
  animation: celebrate 0.5s ease;
}

.drop-zone.wrong {
  border-color: var(--primary);
  background: rgba(255, 107, 107, 0.2);
  animation: shake 0.5s ease;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-15px); }
  75% { transform: translateX(15px); }
}

.drop-zone-text {
  font-size: min(4vw, 24px);
  color: var(--secondary);
  font-weight: bold;
}

.drop-zone .dropped-symbol {
  font-size: min(30vw, 180px);
  line-height: 1;
}

/* ---- Symbols Container ---- */
.symbols-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.symbol-btn {
  width: min(22vw, 130px);
  height: min(22vw, 130px);
  border-radius: var(--radius);
  border: 4px solid rgba(0,0,0,0.1);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
  touch-action: none;
}

.symbol-btn:active {
  cursor: grabbing;
  transform: scale(1.1);
}

.symbol-btn.dragging {
  opacity: 0.6;
  transform: scale(1.15);
  z-index: 100;
}

.symbol-btn .symbol-emoji {
  font-size: min(12vw, 70px);
  line-height: 1;
}

.symbol-btn .symbol-label {
  font-size: min(3vw, 16px);
  font-weight: bold;
  margin-top: 4px;
  color: var(--text);
}

/* ---- Success Screen ---- */
.success-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.success-icon {
  font-size: min(30vw, 180px);
  animation: celebrate 1s infinite ease-in-out;
}

.success-content h2 {
  font-size: min(10vw, 64px);
  color: var(--secondary);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.success-content p {
  font-size: min(5vw, 32px);
  color: var(--text);
}

/* ---- Confetti Animation ---- */
.confetti {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  animation: confettiFall linear forwards;
  pointer-events: none;
  z-index: 1000;
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- Floating ghost (drag) ---- */
.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: min(15vw, 90px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

/* ---- Responsive for tablet ---- */
@media (min-width: 768px) {
  .weather-header {
    padding: 40px 56px;
  }
  .symbols-container {
    gap: 24px;
  }
}

/* ---- Orientation hint ---- */
@media (orientation: portrait) {
  .game-content {
    gap: 20px;
  }
  .drop-zone {
    width: min(60vw, 240px);
    height: min(60vw, 240px);
  }
}
