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

body {
  font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
  background: linear-gradient(135deg, #FFF5E1 0%, #FFE5CC 50%, #FFD4E5 100%);
  min-height: 100vh;
  padding: 30px;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 50px;
  padding: 40px 0;
}

h1 {
  font-size: 54px;
  color: #E8684A;
  margin-bottom: 15px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

.subtitle {
  font-size: 26px;
  color: #D97C7C;
}

.exercise-card {
  background: white;
  border-radius: 30px;
  padding: 50px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border: 6px solid #FFC4D4;
}

.exercise-title {
  font-size: 38px;
  color: #E8684A;
  margin-bottom: 30px;
  text-align: center;
  font-weight: bold;
}

.exercise-text {
  font-size: 24px;
  line-height: 1.9;
  background: linear-gradient(135deg, #FFFEF9 0%, #FFF5E1 100%);
  padding: 35px;
  border-left: 8px solid #FFB347;
  border-radius: 20px;
  margin-bottom: 45px;
  color: #2C2C2C;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Question styling */
.question-group {
  margin-bottom: 40px;
}

.question-label {
  display: block;
  font-size: 22px;
  font-weight: bold;
  color: #E8684A;
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

/* Multiple choice styling */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.choice-label {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #FFF9F5;
  border: 3px solid #FFD9E8;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  font-weight: 500;
}

.choice-label:hover {
  background: #FFE8F5;
  border-color: #FFB347;
  transform: translateX(5px);
}

.choice-input {
  cursor: pointer;
  margin-right: 15px;
  width: 20px;
  height: 20px;
  accent-color: #FF7675;
}

.choice-text {
  flex: 1;
  color: #333;
}

.choice-label:has(.choice-input:checked) {
  background: #C8F7F0;
  border-color: #26C485;
  box-shadow: 0 4px 12px rgba(38, 196, 133, 0.2);
}

/* Open answer styling */
.answer-input {
  width: 100%;
  font-size: 20px;
  padding: 20px;
  border: 4px solid #FFC4D4;
  border-radius: 20px;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
  transition: all 0.3s ease;
}

.answer-input:focus {
  outline: none;
  border-color: #FFB347;
  background-color: #FFFEF9;
  box-shadow: 0 0 15px rgba(255, 179, 71, 0.2);
}

/* Submit button */
.submit-btn {
  width: 100%;
  font-size: 28px;
  padding: 28px;
  background: linear-gradient(135deg, #FF9F43 0%, #FF7675 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 30px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(255, 118, 117, 0.3);
}

.submit-btn::before {
  content: '✨ ';
}

.submit-btn::after {
  content: ' ✨';
}

.submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFB347 0%, #FF8C7B 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(255, 118, 117, 0.4);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

/* Evaluation styling */
.evaluation-card {
  background: white;
  border-radius: 30px;
  padding: 50px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border: 6px solid #FFC4D4;
}

.score-banner {
  background: linear-gradient(135deg, #FFE5CC 0%, #FFF5E1 100%);
  border: 5px solid #FFB347;
  border-radius: 25px;
  padding: 40px;
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.score-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.score-number {
  font-size: 72px;
  font-weight: bold;
  color: #FF7675;
  line-height: 1;
}

.score-emoji {
  font-size: 80px;
  animation: bounce-twinkle 0.8s ease-in-out infinite;
}

.score-text h2 {
  font-size: 42px;
  color: #E8684A;
  margin-bottom: 15px;
}

.score-text .compliment {
  font-size: 24px;
  color: #D97C7C;
  font-style: italic;
  font-weight: 600;
}

/* Feedback section */
.feedback-section {
  margin-bottom: 40px;
}

.feedback-section h3 {
  font-size: 28px;
  color: #E8684A;
  margin-bottom: 25px;
  text-align: center;
}

.feedback-item {
  background: #FFF9F5;
  border: 3px solid #FFD9E8;
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.feedback-item.feedback-correct {
  border-color: #26C485;
  background: linear-gradient(135deg, #F0FDF9 0%, #E8F8F4 100%);
}

.feedback-item.feedback-incorrect {
  border-color: #FFB347;
  background: linear-gradient(135deg, #FFFEF9 0%, #FFF5E1 100%);
}

.feedback-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.feedback-status {
  font-size: 32px;
  line-height: 1;
}

.feedback-question {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  flex: 1;
}

.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-answer {
  background: white;
  padding: 15px;
  border-radius: 12px;
  border-left: 4px solid #FFB347;
  font-size: 18px;
  color: #333;
}

.feedback-answer strong {
  color: #E8684A;
}

.feedback-message {
  font-size: 18px;
  color: #555;
  padding: 12px 0;
  line-height: 1.6;
}

.feedback-hint {
  background: #FFF9E6;
  padding: 12px 15px;
  border-radius: 10px;
  border-left: 4px solid #FFB347;
  font-size: 16px;
  color: #8B5A00;
  font-style: italic;
}

/* Reset button */
.reset-btn {
  width: 100%;
  font-size: 24px;
  padding: 20px 50px;
  background: linear-gradient(135deg, #9F7AEA 0%, #B07DF0 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(159, 122, 234, 0.3);
  margin-top: 30px;
}

.reset-btn::before {
  content: '🎯 ';
}

.reset-btn::after {
  content: ' 🎯';
}

.reset-btn:hover {
  background: linear-gradient(135deg, #B07DF0 0%, #C99FE8 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(159, 122, 234, 0.4);
}

.reset-btn:active {
  transform: translateY(-1px);
}

/* Messages */
.message {
  text-align: center;
  font-size: 24px;
  color: #D2691E;
  padding: 40px;
}

.error-message {
  background: linear-gradient(135deg, #FFE5E5 0%, #FFC4D4 100%);
  border: 4px solid #FF9FB8;
  padding: 35px;
  border-radius: 25px;
  font-size: 24px;
  color: #E8684A;
  text-align: center;
  margin: 30px 0;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(232, 104, 74, 0.2);
}

/* Animations */
@keyframes bounce-twinkle {
  0%, 100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.25) translateY(-15px);
  }
}

/* Header buttons */
.version {
  font-size: 20px;
  color: #FFB347;
  font-weight: normal;
  margin-left: 10px;
}

.header-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.header-btn {
  padding: 15px 30px;
  font-size: 18px;
  border: none;
  border-radius: 20px;
  background: white;
  color: #E8684A;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 3px solid #FFC4D4;
}

.header-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.header-btn.active {
  background: linear-gradient(135deg, #FFB347 0%, #FF9F43 100%);
  color: white;
  border-color: #FF7675;
  box-shadow: 0 8px 20px rgba(255, 118, 117, 0.3);
}

/* Story input screen */
.story-input-card {
  background: white;
  border-radius: 30px;
  padding: 50px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border: 6px solid #FFC4D4;
  max-width: 700px;
  margin: 0 auto;
}

.story-input-card h2 {
  font-size: 38px;
  color: #E8684A;
  text-align: center;
  margin-bottom: 15px;
}

.story-input-subtitle {
  font-size: 24px;
  color: #D97C7C;
  text-align: center;
  margin-bottom: 35px;
  font-weight: 500;
}

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

.story-input-field {
  width: 100%;
  font-size: 18px;
  padding: 20px;
  border: 3px solid #FFC4D4;
  border-radius: 20px;
  font-family: inherit;
  min-height: 200px;
  resize: vertical;
  transition: all 0.3s ease;
  background: #FFFEF9;
  color: #333;
}

.story-input-field::placeholder {
  color: #B8A5A5;
  font-style: italic;
}

.story-input-field:focus {
  outline: none;
  border-color: #FFB347;
  background-color: white;
  box-shadow: 0 0 15px rgba(255, 179, 71, 0.2);
}

.char-count {
  font-size: 14px;
  color: #999;
  margin-top: 8px;
  text-align: right;
}

.generate-btn {
  width: 100%;
  font-size: 28px;
  padding: 28px;
  background: linear-gradient(135deg, #FF9F43 0%, #FF7675 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 20px rgba(255, 118, 117, 0.3);
}

.generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFB347 0%, #FF8C7B 100%);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(255, 118, 117, 0.4);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.generate-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.generate-btn.loading {
  animation: pulse-loading 1.5s ease-in-out infinite;
}

.story-input-help {
  text-align: center;
  color: #999;
  margin-top: 15px;
  font-size: 16px;
  font-style: italic;
}

.evaluation-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.evaluation-buttons .reset-btn {
  flex: 1;
  min-width: 250px;
  margin-top: 0;
}

.reset-btn.secondary {
  background: linear-gradient(135deg, #FFB347 0%, #FF9F43 100%);
  box-shadow: 0 8px 20px rgba(255, 159, 67, 0.3);
}

.reset-btn.secondary::before {
  content: '✨ ';
}

.reset-btn.secondary::after {
  content: ' ✨';
}

.reset-btn.secondary:hover {
  background: linear-gradient(135deg, #FFC470 0%, #FFB35A 100%);
  box-shadow: 0 12px 25px rgba(255, 159, 67, 0.4);
}

/* Pulse animation for loading */
@keyframes pulse-loading {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Footer */
footer {
  text-align: center;
  margin-top: 60px;
  font-size: 22px;
  color: #D97C7C;
  font-weight: 500;
}

/* Responsive design */
@media (max-width: 600px) {
  h1 {
    font-size: 42px;
  }

  .exercise-card {
    padding: 35px;
    border-radius: 25px;
  }

  .exercise-title {
    font-size: 32px;
    margin-bottom: 25px;
  }

  .exercise-text {
    font-size: 20px;
    padding: 25px;
    border-radius: 15px;
  }

  .question-label {
    font-size: 20px;
  }

  .answer-input {
    font-size: 18px;
    padding: 18px;
    min-height: 90px;
  }

  .choice-label {
    font-size: 16px;
    padding: 14px 16px;
  }

  .submit-btn {
    font-size: 24px;
    padding: 24px;
  }

  .evaluation-card {
    padding: 35px;
    border-radius: 25px;
  }

  .score-banner {
    flex-direction: column;
    gap: 25px;
    padding: 30px;
  }

  .score-number {
    font-size: 56px;
  }

  .score-emoji {
    font-size: 64px;
  }

  .score-text h2 {
    font-size: 32px;
  }

  .score-text .compliment {
    font-size: 20px;
  }

  .feedback-section h3 {
    font-size: 24px;
  }

  .feedback-item {
    padding: 20px;
  }

  .feedback-question {
    font-size: 18px;
  }

  .reset-btn {
    font-size: 20px;
    padding: 18px 40px;
  }

  .feedback-answer {
    font-size: 16px;
  }

  .feedback-message {
    font-size: 16px;
  }

  .feedback-hint {
    font-size: 14px;
  }
}
