/* =========================
ROOT THEME VARIABLES
Change colors here only
========================= */

:root {
  --primary: #4f7cff;
  --primary-light: #6aa0ff;

  --inactive: #ccccc8;
  --inactive-light: #f5f5f0;

  --bg: #f4f6fb;
  --card-bg: white;

  --text: #222;
  --text-light: #666;

  --border: #cfd7e6;

  --correct: #28c76f;
  --incorrect: #ff4d4f;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card: 0 8px 25px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12);
  --shadow-btn: 0 4px 12px rgba(0, 0, 0, 0.15);

  --transition: 0.25s;
}

/* =========================
BASE LAYOUT
========================= */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  background: var(--bg);

  margin: 0;

  padding: 40px;

  color: var(--text);
}

.container {
  max-width: 1300px;

  margin: auto;

  padding: 0 20px;

  text-align: center;
}

/* =========================
TYPOGRAPHY
========================= */

h1 {
  font-size: 40px;

  margin-bottom: 10px;
}

h2 {
  margin-top: 40px;
}

p {
  color: var(--text-light);
}

/* =========================
HERO
========================= */

.hero {
  margin-bottom: 50px;
}

/* =========================
SUBJECT GRID
========================= */

.subject-grid {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 25px;

  margin-top: 30px;

  flex-grow: 1;
}

.subject-card {
  background: var(--card-bg);

  padding: 30px;

  border-radius: var(--radius-lg);

  width: 100%;

  max-width: 320px;

  box-shadow: var(--shadow-card);

  transition: var(--transition);

  display: flex;

  flex-direction: column;

  justify-content: space-between;
}

.subject-card:hover {
  transform: translateY(-6px);

  box-shadow: var(--shadow-hover);
}

.subject-icon {
  font-size: 42px;

  margin-bottom: 10px;
}

/* =========================
BUTTON SYSTEM
========================= */

.btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));

  color: white;

  border: none;

  padding: 14px 26px;

  font-size: 18px;

  border-radius: var(--radius-md);

  cursor: pointer;

  box-shadow: var(--shadow-btn);

  transition: 0.2s;
}

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

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

.btn-full {
  width: 100%;
}

.btn-small {
  width: auto;

  font-size: 16px;

  padding: 10px 22px;

  margin-top: 20px;
}

.btn-small:disabled {
  background: linear-gradient(135deg, var(--inactive), var(--inactive-light));
  color: rgb(255, 255, 255);
  cursor: not-allowed;
  transform: none;
}

.btn-disabled {
  background: #ccc;

  cursor: not-allowed;

  transform: none;
}

/* =========================
QUIZ AREA
========================= */

.question-area {
  margin: 40px 0;

  display: flex;

  justify-content: center;
}

/* NEW PROMPT CONTAINER */

#prompt-container {
  display: flex;

  justify-content: center;

  margin-bottom: 20px;

  align-items: center;

  justify-content: center;

  background: linear-gradient(135deg, var(--primary), var(--primary-light));

  color: white;

  padding: 24px;

  border-radius: var(--radius-lg);

  cursor: grab;

  min-height: 100px;

  max-width: 600px;

  width: 100%;

  margin: 0;

  box-shadow: var(--shadow-btn);

  transition: 0.2s;

  gap: 10px;
}

#prompt {
  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 12px;

  width: 100%;

  font-size: 20px;

  font-weight: 500;

  text-align: center;

  max-width: 600px;
}

.instruction-container {
  display: flex;

  justify-content: center;
}

#instruction-text {
  font-size: 16px;

  font-weight: 500;

  text-align: center;

  max-width: 600px;
}

.draggable-text {
  font-size: 20px;

  font-weight: 500;

  line-height: 1.4;
}

#interaction-area {
  display: flex;

  justify-content: center;

  min-height: 110px;
}

.answer {
  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  background: linear-gradient(135deg, var(--primary), var(--primary-light));

  color: white;

  padding: 24px;

  border-radius: var(--radius-lg);

  cursor: grab;

  min-height: 100px;

  max-width: 600px;

  width: 100%;

  margin: 0;

  box-shadow: var(--shadow-btn);

  transition: 0.2s;

  gap: 10px;
}

.answer.dragging {
  opacity: 0.6;

  transform: scale(1.05);

  cursor: grabbing;
}

.answer.hidden {
  display: none;
}

.answer.static {
  cursor: default;

  background: var(--inactive-light);

  color: var(--text);

  box-shadow: var(--shadow-card);
}

.answer.static:hover {
  transform: none;
}

/* quiz media */

.quiz-image {
  max-width: 220px;

  border-radius: var(--radius-sm);

  background: white;

  padding: 6px;

  box-shadow: var(--shadow-card);
}

.image-instruction {
  font-size: 16px;

  opacity: 0.9;
}

/* =========================
CATEGORY ZONES
========================= */

.categories {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 15px;

  margin-top: 30px;
}

.dropzone {
  padding: 20px;

  text-align: center;

  border: 2px dashed var(--border);

  border-radius: var(--radius-md);

  font-weight: 600;

  background: white;

  transition: 0.2s;

  max-width: 160px;

  min-width: 140px;
}

.dropzone:hover {
  border-color: var(--primary);

  background: #e2e6f3;

  transform: scale(1.03);
}

.dropzone.dragover {
  border-color: var(--primary);

  background: #dfe7ff;

  transform: scale(1.05);

  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.dropzone.correct {
  border-color: var(--correct);

  background: #eafff3;
}

.dropzone.incorrect {
  border-color: var(--incorrect);

  background: #ffecec;
}

/* =========================
PROGRESS
========================= */

.progress-container {
  width: 100%;

  height: 10px;

  background: #e2e6f3;

  border-radius: 10px;

  overflow: hidden;

  margin-bottom: 30px;
}

#progress-bar {
  height: 100%;

  width: 0%;

  background: linear-gradient(135deg, var(--primary), var(--primary-light));

  transition: 0.5s;
}

/* =========================
FEEDBACK
========================= */

#feedback {
  margin-top: 15px;

  font-size: 18px;

  font-weight: 600;

  opacity: 0;

  transition: 0.3s;

  min-height: 24px;
}

#feedback.show {
  opacity: 1;

  transform: scale(1.05);
}

/* =========================
SCORE
========================= */

.score {
  margin-top: 15px;

  font-size: 18px;

  font-weight: 600;
}

/* =========================
FINAL SCREEN
========================= */

#final-screen {
  margin-top: 40px;
}

#final-screen h2 {
  font-size: 28px;
}

#final-screen p {
  font-size: 22px;

  font-weight: 600;
}

/* =========================
FOOTER
========================= */

footer {
  margin-top: 60px;

  color: #777;
}

/* =========================
MOBILE
========================= */

@media (max-width: 600px) {
  body {
    padding: 20px;
  }

  h1 {
    font-size: 30px;
  }

  .answer {
    font-size: 18px;

    padding: 18px;

    min-height: 90px;
  }

  .quiz-image {
    max-width: 180px;
  }

  .btn {
    font-size: 16px;

    padding: 12px;
  }

  .categories {
    gap: 10px;
  }

  .dropzone {
    min-width: 120px;

    padding: 16px;
  }
}

.dropzone.dragover {
  border-color: var(--primary);

  background: linear-gradient(135deg, #e8edff, #dfe7ff);

  transform: scale(1.06);

  box-shadow: 0 10px 22px rgba(79, 124, 255, 0.25);
}

.mc-option {
  display: block;

  width: 100%;

  max-width: 520px;

  margin: 10px auto;

  padding: 18px;

  font-size: 18px;

  background: white;

  border: 2px solid var(--border);

  border-radius: var(--radius-md);

  cursor: pointer;

  transition: 0.2s;

  box-shadow: var(--shadow-card);
}

.mc-option:hover {
  border-color: var(--primary);

  background: #eef2ff;

  transform: scale(1.03);
}

.mc-option.correct {
  border-color: var(--correct);

  background: #eafff3;
}

.mc-option.incorrect {
  border-color: var(--incorrect);

  background: #ffecec;
}

/* =========================
SCIENCE LOADING SCREEN
========================= */

#loading-screen {
  position: fixed;

  top: 0;

  left: 0;

  width: 100%;

  height: 100%;

  background: var(--bg);

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  z-index: 999;

  transition: 0.45s ease;
}

/* fade out */

#loading-screen.hidden {
  opacity: 0;

  pointer-events: none;
}

/* loader container */

.science-loader {
  position: relative;

  width: 90px;

  height: 90px;

  margin-bottom: 25px;

  display: flex;

  align-items: center;

  justify-content: center;
}

/* spinner ring */

.loader-ring {
  position: absolute;

  width: 90px;

  height: 90px;

  border-radius: 50%;

  border: 6px solid #e2e6f3;

  border-top: 6px solid var(--primary);

  border-right: 6px solid var(--primary-light);

  animation: spin 1.4s linear infinite;

  box-shadow: 0 0 18px rgba(79, 124, 255, 0.15),
    inset 0 0 12px rgba(79, 124, 255, 0.08);
}

/* center emoji */

.science-emoji {
  font-size: 40px;

  z-index: 2;

  animation: float 1.8s ease-in-out infinite, glow 2s ease-in-out infinite;
}

/* loading text */

.loading-text {
  font-size: 18px;

  color: var(--text-light);

  font-weight: 500;

  letter-spacing: 0.3px;

  animation: fadePulse 2.2s ease-in-out infinite;
}

/* =========================
ANIMATIONS
========================= */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* gentle float */

@keyframes float {
  0% {
    transform: translateY(0px);
  }

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

  100% {
    transform: translateY(0px);
  }
}

/* glow pulse */

@keyframes glow {
  0% {
    transform: scale(0.95);

    text-shadow: 0 0 0px transparent;
  }

  50% {
    transform: scale(1.12);

    text-shadow: 0 0 22px rgba(79, 124, 255, 0.55),
      0 0 42px rgba(79, 124, 255, 0.25);
  }

  100% {
    transform: scale(0.95);

    text-shadow: 0 0 0px transparent;
  }
}

/* text breathing */

@keyframes fadePulse {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}
