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

body {
  /* font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; */
  font-family: "Eczar", serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  /* padding: 5px;
  min-height: 100vh;
  display: flex;
  justify-content: center; */
  /* align-items: center; */
  height: 100vh;
  overflow: hidden;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.quizWrapper {
  padding: 5px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  /* align-items: center; */
  height: 100vh;
  position: relative;
  overflow: hidden;
}
.container {
  max-width: 500px;
  width: 100%;
}

.quiz-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 30px;
  border: 3px solid #e0e0e0;
  position: relative;
  overflow: hidden;
}

.quiz-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff9a56, #ffad56);
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.quiz-title {
  text-align: left;
  font-size: 20px;
  font-weight: 700;
  /* margin-bottom: 12px; */
  color: #333;
  /* background: linear-gradient(135deg, #667eea, #764ba2); */
    background: linear-gradient(135deg,#0056b3, #007bff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.question-item {
  border: 2px dashed #ddd;
  border-radius: 6px;
  padding: 5px;
  margin-bottom: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
}

.question-item:hover {
  background: #f0f8ff;
  border-color: #4caf50;
  transform: translateY(-2px);
}

.question-item.drag-over {
  background: #e8f5e8;
  border-color: #4caf50;
  border-style: solid;
  animation: pulse 0.5s ease-in-out;
}

.question-item.correct {
  background: linear-gradient(135deg, #c8e6c9, #e8f5e8);
  border-color: #4caf50;
  border-style: solid;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.question-content {
  flex: 1;
}

.question-number {
  font-size: 10px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.question-text {
  font-size: 12px;
  color: #000;
  line-height: 1.4;
  font-weight: 500;
}

.correct-answer {
  /* position: absolute;
            top: 10px;
            right: 15px;
            background: #4CAF50;
            color: white;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600; */

  position: absolute;
  top: 5px;
  right: 5px;
  background: #4caf50;
  color: white;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 600;
}

.answers-section {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 2px solid #e0e0e0;
}

.answers-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.answers-grid {
  display: flex;
  flex-wrap: wrap;
  /* gap: 12px; */
  gap: 5px;
  /* min-height: 100px; */
  padding: 15px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 6px;
  border: 2px dashed #ddd;
}

.answer-option {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 5px 10px;
  font-size: 10px;
  border-radius: 8px;
  /* font-size: 14px; */
  font-weight: 500;
  cursor: move;
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  touch-action: none;
}

.answer-option:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.answer-option.dragging {
  opacity: 0.7;
  transform: rotate(5deg) scale(1.05);
}

.drag-hint {
  color: #ff0044;
  font-size: 11px;
  font-style: italic;
  text-align: center;
  margin-top: 10px;
  font-weight: 500;
}

.warning-message {
  position: fixed;
  top: 20px;
  right: 10px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  animation:
    slideInRight 0.3s ease,
    fadeOut 0.3s ease 2.7s;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.success-message {
  position: fixed;
  top: 20px;
  right: 10px;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  animation:
    slideInRight 0.3s ease,
    fadeOut 0.3s ease 2.7s;
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.control-panel {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  justify-content: space-between;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

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

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #45a049);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

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

  50% {
    transform: scale(1.02);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .quiz-card {
    padding: 20px;
  }

  .answers-grid {
    padding: 10px;
  }

  .answer-option {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 5px;
  }

  .quiz-card {
    padding: 10px;
  }
  .quiz-header {
    margin-bottom: 10px;
  }

  .quiz-title {
    font-size: 20px;
    font-weight: 700;
  }
}

.question-item.active-question {
  border-color: #007bff;
  background: #e6f0ff;
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

@media (max-width: 360px) and (max-height: 640px) {
  .quiz-header {
    margin-bottom: 8px;
  }

  .quiz-title {
    font-size: 18px;
  }

  .progress-bar {
    height: 6px;
    margin-bottom: 12px;
  }

  .question-number {
    font-size: 8px;
  }

  .question-text {
    font-size: 10px;
  }

  .answers-title {
    font-size: 10px;
  }

  .answers-section {
    margin-top: 12px;
  }

  .answer-option {
    font-size: 10px;
    padding: 4px 8px;
  }

  .drag-hint {
    font-size: 9px;
  }

  .btn {
    padding: 10px 22px;
    font-size: 10px;
  }
}


/* ---------- TOAST BASE ---------- */
.toast {
  position: fixed;
  top: 20px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 150px;
  max-width: 340px;

  padding: 8px 10px;
  border-radius: 8px;

  font-size: 12px;
  font-weight: 600;
  color: #fff;

  z-index: 9999;

  backdrop-filter: blur(10px);
  animation: toastSlideIn 0.35s ease, toastFadeOut 0.35s ease 2.7s;

  box-shadow:
    0 10px 30px rgba(0,0,0,0.18),
    inset 0 1px rgba(255,255,255,0.15);
}

/* ---------- ICON ---------- */
.toast-icon {
  font-size: 12px;
  display: flex;
  align-items: center;
}

/* ---------- TEXT ---------- */
.toast-text {
  flex: 1;
  line-height: 1.3;
}

/* ---------- TYPES ---------- */

.toast-success {
  background: linear-gradient(135deg, #43a047, #2e7d32);
}

.toast-warning {
  background: linear-gradient(135deg, #ff6b6b, #e53935);
}

.toast-info {
  background: linear-gradient(135deg, #2196f3, #1976d2);
}

.toast-congrats {
  background: linear-gradient(135deg, #7b1fa2, #512da8);
}

/* ---------- ANIMATION ---------- */
@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}