* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
  color: #e5e7eb;
  font-family: system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ====== MAIN CONTAINER ====== */
#main-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

/* ====== BACK BUTTON ====== */
.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(56, 189, 248, 0.15);
  border: 2px solid #38bdf8;
  border-radius: 8px;
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 100;
}

.back-button:hover {
  background: #38bdf8;
  color: #020617;
  transform: translateX(-4px);
}

.back-button svg {
  transition: transform 0.2s ease;
}

.back-button:hover svg {
  transform: translateX(-4px);
}

/* ====== GAME CONTAINER ====== */
#game {
  background: #020617;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 560px;
  text-align: center;
}

h1 {
  margin-bottom: 5px;
  color: #38bdf8;
}

h3 {
  margin-top: 0;
  margin-bottom: 20px;
  opacity: 0.7;
  font-weight: normal;
}

#game img#photo {
  width: 100%;
  max-width: 520px;
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
}

#game img#photo:hover {
  transform: scale(1.02);
}

input {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #1e293b;
  color: #e5e7eb;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

input::placeholder {
  color: rgba(229, 231, 235, 0.5);
}

button {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: #38bdf8;
  color: #020617;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  background: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

button:active {
  transform: translateY(0);
}

#result {
  margin-top: 15px;
  font-size: 18px;
  min-height: 1.5em;
  font-weight: 500;
  transition: all 0.3s ease;
}

#result.correct {
  color: #4ade80;
  animation: bounceIn 0.5s ease;
}

#result.wrong {
  color: #f87171;
  animation: shake 0.4s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

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

#score {
  margin-top: 10px;
  opacity: 0.8;
}

.hint-text {
  margin-top: 15px;
  font-size: 12px;
  opacity: 0.5;
  font-style: italic;
}

/* ====== PUNISHMENT IMAGES ====== */
.punishment-img {
  width: 200px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  flex-shrink: 0;
}

.punishment-left {
  transform: scale(0.8) translateX(-30px);
}

.punishment-right {
  transform: scale(0.8) translateX(30px);
}

.punishment-img.visible {
  opacity: 1;
  transform: scale(1) translateX(0);
  pointer-events: auto;
}

.punishment-img.visible:hover {
  transform: scale(1.05);
}

/* Shake animation for when punishment appears */
@keyframes punishmentShake {
  0%, 100% { transform: translateX(0) scale(1); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px) scale(1); }
  20%, 40%, 60%, 80% { transform: translateX(5px) scale(1); }
}

.punishment-img.shake {
  animation: punishmentShake 0.6s ease-in-out;
}

/* ====== MOBILE ====== */
@media (max-width: 900px) {
  #main-container {
    flex-direction: column;
    gap: 20px;
  }

  .punishment-left {
    transform: scale(0.8) translateY(-20px);
    order: 2;
  }

  .punishment-right {
    transform: scale(0.8) translateY(-20px);
    order: 3;
  }

  #game {
    order: 1;
  }

  .punishment-img.visible {
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 500px) {
  .back-button {
    top: 10px;
    left: 10px;
    padding: 8px 12px;
  }
  
  .back-button span {
    display: none;
  }
  
  #game {
    padding: 20px;
  }

  .punishment-img {
    width: 150px;
  }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
