/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff1c1, #ffd6e8);
  font-family: "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
}

.task-screen {
  width: 100%;
  max-width: 640px;
  padding: 24px;
}

.task {
  background: #ffffff;
  border-radius: 32px;
  padding: 32px 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  text-align: center;
  animation: task-enter 0.35s ease-out;
}

@keyframes task-enter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.task__prompt {
  font-size: 2rem;
  color: #4a3b6b;
  margin: 0 0 24px;
}

.task__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.task__option {
  border: 4px solid #e4d7ff;
  background: #faf7ff;
  border-radius: 24px;
  padding: 16px;
  font-size: 1.25rem;
  color: #4a3b6b;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.task__option:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.03);
  border-color: #c9b6ff;
}

.task__option:active:not(:disabled) {
  transform: scale(0.97);
}

.task__option:disabled {
  cursor: default;
}

.task__option-image {
  width: 100%;
  max-width: 160px;
  border-radius: 16px;
}

.task__option-emoji {
  font-size: 3.5rem;
  line-height: 1;
}

.task__option--selected {
  animation: option-pulse 0.4s ease;
}

@keyframes option-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.task__option--correct {
  border-color: #5fd68a;
  background: #e9fff1;
  animation: option-correct 0.5s ease;
}

@keyframes option-correct {
  0%, 100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.12) rotate(-2deg);
  }
  60% {
    transform: scale(1.12) rotate(2deg);
  }
}

.task__option--incorrect {
  border-color: #ff9b9b;
  background: #fff1f1;
  animation: option-shake 0.4s ease;
}

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

.task__feedback {
  min-height: 1.5rem;
  margin-top: 20px;
  font-size: 1.5rem;
}

.task--correct .task__feedback {
  color: #2f9e5c;
}

.task--incorrect .task__feedback {
  color: #d9534f;
}

.task__next {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 28px;
  border-radius: 999px;
  background: #7c5cff;
  color: #ffffff;
  font-size: 1.1rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.task__next:hover {
  transform: scale(1.05);
}
