/* IMPORT FONTS AUTOMATICALLY */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&family=Nunito:wght@400;700&display=swap');

:root {
  /* FUN PALETTE */
  --bg: #2e0249;        /* Deep Purple */
  --card: #570a57;      /* Bright Purple/Pinkish */
  --text: #ffffff;      /* Pure White */
  --muted: #fbc7ff;     /* Light Pink for secondary text */
  --accent: #ffcc00;    /* Superhero Yellow */
  --border-color: #a91079;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* Fun Pattern Background */
  background-color: var(--bg);
  background-image: radial-gradient(#a91079 1px, transparent 1px);
  background-size: 30px 30px; /* Polka dot effect */
  color: var(--text);
  font-family: 'Nunito', sans-serif; /* Rounded readable font */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
  overflow-x: hidden;
}

/* ===== Hamburger Menu ===== */
.hamburger {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 2000;
  background: var(--accent);
  border: 3px solid #000;
  color: #000;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: 4px 4px 0px #000;
  transition: transform 0.1s ease;
}
.hamburger:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0px #000; }

.slide-menu {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: #fff;
  z-index: 2001;
  padding: 80px 30px;
  box-shadow: 10px 0 30px rgba(0,0,0,0.5);
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 4px solid #000;
}
.slide-menu.open { left: 0; }

.menu-item {
  text-decoration: none;
  color: #333;
  font-family: 'Fredoka', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px dashed #ccc;
  transition: 0.2s;
}
.menu-item:hover {
  background: var(--accent);
  color: #000;
  border-color: #000;
  transform: rotate(-2deg);
}

.close-menu {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: #000;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 2, 73, 0.8);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.menu-overlay.active { opacity: 1; pointer-events: all; }

/* ===== Top Right Info ===== */
.top-wrapper {
  position: fixed;
  top: 18px;
  right: 20px;
  display: flex;
  gap: 14px;
  z-index: 1000;
}

.top-info {
  background: rgba(0,0,0,0.6);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  min-width: 170px;
  text-align: right;
  border: 2px solid var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.location-text {
    font-family: 'Fredoka', sans-serif;
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}
.region img {
  width: 24px;
  height: 16px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
  border: 1px solid #fff;
}
.time { font-weight: 700; margin-top: 4px; color: #fff; }
.date { color: #ddd; font-size: 0.75rem; }
.weather { margin-top: 6px; font-size: 0.9rem; color: #fff; font-weight: bold; }

/* ===== Main Card ===== */
.card {
  max-width: 900px;
  width: 100%;
  background: var(--card);
  border-radius: 30px;
  border: 4px solid #fff;
  box-shadow: 10px 10px 0px rgba(0,0,0,0.3); 
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  animation: fadeUp 1.2s ease-out;
  margin-top: 100px;
  margin-bottom: 140px;
}

.content {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.eyebrow { 
    text-transform: uppercase; 
    letter-spacing: 0.12em; 
    font-size: 0.9rem; 
    color: var(--accent); 
    font-weight: bold;
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 20px;
    align-self: flex-start;
}

h1 { 
    font-family: 'Fredoka', sans-serif; 
    font-size: clamp(2.5rem, 5vw, 3.5rem); 
    margin: 0; 
    line-height: 1.1; 
    text-shadow: 2px 2px 0px #000;
}

p { 
    margin: 0; 
    font-size: 1.2rem; 
    color: var(--muted); 
    max-width: 420px; 
    line-height: 1.6;
}

.image-panel { 
    position: relative; 
    background: var(--bg); 
    overflow: visible; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-panel img { 
    width: 90%; 
    height: 90%; 
    object-fit: cover; 
    border-radius: 20px;
    border: 4px solid #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transform: rotate(3deg);
    transition: transform 0.3s ease;
}
.image-panel img:hover {
    transform: rotate(0deg) scale(1.02);
}
.image-panel::after { display: none; }

.credit { 
    position: absolute; 
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #000;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem; 
    z-index: 2; 
    box-shadow: 2px 2px 0px #000;
    white-space: nowrap;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== FIXED FLAGS BAR ===== */
.flags-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px; 
  background: transparent; 
  overflow: hidden;
  display: flex;
  align-items: flex-end; 
  z-index: 999;
  pointer-events: none; 
}

.flags-bar::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px; 
    background: #000;
    border-top: 4px solid var(--accent);
    z-index: -1;
}

.flags-track { 
    display: flex; 
    gap: 20px; 
    animation: moveFlags 500s linear infinite; 
    height: 80px; 
    align-items: center;
    pointer-events: auto; 
}
.flags-track.paused { animation-play-state: paused; }

.flag { position: relative; width: 48px; height: 32px; flex-shrink: 0; cursor: pointer; transition: transform 0.2s;}
.flag:hover { transform: scale(1.2); }

.flag img { width: 100%; height: 100%; border-radius: 6px; border: 2px solid #fff; }

.flag span {
  position: absolute; 
  bottom: 50px; 
  left: 50%; 
  transform: translateX(-50%);
  background: var(--accent); 
  color: #000; 
  font-weight: bold;
  padding: 6px 10px; 
  border-radius: 8px;
  font-size: 0.9rem; 
  white-space: nowrap; 
  opacity: 0; 
  pointer-events: none; 
  transition: opacity 0.2s ease; 
  z-index: 1000;
  box-shadow: 2px 2px 0px #000;
}
.flag.show span { opacity: 1; }
@keyframes moveFlags { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ===== MOBILE FIXES ===== */
@media (max-width: 800px) {
  .top-wrapper { position: relative; top: auto; right: auto; justify-content: center; margin-bottom: 15px; gap: 10px; margin-top: 60px; }
  .card { grid-template-columns: 1fr; margin-top: 0; }
  .content { padding: 36px 28px; text-align: center; align-items: center; }
  .eyebrow { align-self: center; }
  .image-panel { height: 350px; }
}
@media (max-width: 500px) {
  .top-info { min-width: 140px; }
  .card { display: flex; flex-direction: column; }
  .image-panel, .content { width: 100%; }
  .image-panel img { height: auto; width: 85%; }
  .image-panel + .comment-container { margin-top: 16px; }
  .comment-container input { max-width: 90%; }
}

/* ===== COMMENT BOX ===== */
.comment-container { margin-top: 24px; display: flex; gap: 12px; width: 100%; max-width: 500px; }

.comment-container input { 
    flex: 1; 
    padding: 12px 15px; 
    font-size: 1rem; 
    border-radius: 15px; 
    border: 2px solid #fff; 
    color: #333; 
    font-family: 'Nunito', sans-serif;
}
.comment-container input::placeholder { color: #999; }

.comment-container button { 
    padding: 10px 20px; 
    border-radius: 12px; 
    border: 2px solid #000; 
    background: var(--accent); 
    color: #000; 
    font-weight: 800; 
    font-family: 'Fredoka', sans-serif;
    cursor: pointer; 
    box-shadow: 4px 4px 0px #000; 
    transition: transform 0.1s;
}
.comment-container button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}


@media (min-width: 501px) { .comment-container { justify-content: center; margin-left: auto; margin-right: auto; } }

/* ===== STYLISH THEME BUTTONS ===== */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.theme-btn {
    padding: 12px 24px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 12px;
    border: 3px solid #000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 5px 5px 0px #000;
}

/* Primary Button (Yellow) */
.btn-primary {
    background: var(--accent);
    color: #000;
}

/* Secondary Button (Pink/Border color) */
.btn-secondary {
    background: var(--border-color);
    color: #fff;
}

.theme-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px #000;
}

.theme-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

/* ===== THEMED PDF VIEWER CONTAINER ===== */
.pdf-container {
    width: 100%;
    max-width: 850px;
    margin: 40px auto;
    background: #fff; /* White background for the "paper" feel */
    border: 6px solid #fff;
    border-radius: 20px;
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

/* Header bar for the PDF viewer */
.pdf-header {
    background: var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #000;
}

.pdf-title {
    font-family: 'Fredoka', sans-serif;
    color: #fff;
    font-size: 1rem;
    margin: 0;
}

.pdf-viewer {
    width: 100%;
    height: 600px; /* Adjust height as needed */
    border: none;
    display: block;
}

/* Mobile adjustments for PDF */
@media (max-width: 600px) {
    .pdf-viewer { height: 400px; }
    .pdf-container { border-width: 3px; }
}

/* ===== ADVENTURE BUTTON STYLE ===== */
.external-btn-wrap {
  display: flex;
  justify-content: center;
  margin: -90px 0 160px 0; /* Space below the card */
  z-index: 10;
}

.adventure-btn {
  text-decoration: none;
  background: var(--accent); /* Yellow */
  color: #000;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  padding: 18px 45px;
  border-radius: 50px;
  text-transform: uppercase;
  border: 4px solid #fff;
  box-shadow: 6px 6px 0px #000; /* Comic book shadow */
  transition: all 0.2s ease;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.adventure-btn:hover {
  transform: scale(1.05) rotate(-1deg);
  box-shadow: 8px 8px 0px #000;
  background: #fff;
  color: var(--card);
}

.adventure-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0px #000;
}

/* The Shine Effect */
.adventure-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 20%;
  height: 200%;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(30deg);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { left: -60%; }
  15% { left: 120%; }
  100% { left: 120%; }
}

/* ===== CHAT SYSTEM STYLES ===== */
.chat-portal {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--accent);
  display: flex;
  flex-direction: column;
  height: 400px; /* Fixed height for the chat area */
}

#chatNameSection {
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

#chatBox {
  display: none; /* Hidden until user joins */
  flex-direction: column;
  height: 100%;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
}

/* Message Bubbles */
.msg {
  align-self: flex-start;
  background: #fff;
  color: #000;
  padding: 10px 15px;
  border-radius: 15px 15px 15px 0;
  max-width: 80%;
  font-size: 0.95rem;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
}

.msg.me {
  align-self: flex-end;
  background: var(--accent); /* Your Superhero Yellow */
  border-radius: 15px 15px 0 15px;
}

.ts {
  display: block;
  font-size: 0.7rem;
  margin-top: 5px;
  opacity: 0.6;
}

/* Chat Inputs & Buttons */
.chat-input {
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
}

.chat-btn {
  background: var(--accent);
  border: 2px solid #000;
  color: #000;
  font-family: 'Fredoka', sans-serif;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 3px 3px 0px #000;
}

.chat-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px #000; }

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ===== STORIES & PDF VIEWER STYLES ===== */
.trip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: -100px 0 160px 0; /* Positioned similarly to your adventure button */
  width: 100%;
  max-width: 900px;
  z-index: 10;
}

.trip-btn {
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: 15px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 6px 6px 0px #000;
  color: white;
  min-width: 250px;
}

.trip-btn:hover {
  transform: translateY(-5px) scale(1.02);
  background: var(--accent);
  color: #000;
}

.btn-id {
  background: #fff;
  color: #000;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.btn-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}

/* PDF Viewer Window */
#pdfViewerSection {
  display: none; /* Hidden by default */
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  height: 80vh;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 4px solid var(--accent);
  margin-top: 100px;
  margin-bottom: 140px;
}

.pdf-controls {
  background: #111827;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent);
}

#pdfFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.back-btn {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

@media (max-width: 800px) {
  .trip-container { margin-top: 0; padding: 0 20px; }
  #pdfViewerSection { height: 70vh; margin-top: 20px; }
}


/* Update the container to allow for a wider inner PDF section */
.view-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Updated PDF Viewer Window */
#pdfViewerSection {
  display: none; /* Hidden by default */
  flex-direction: column;
  width: 95%;          /* Use more of the screen width */
  max-width: 1200px;   /* Increased from 900px to 1200px for desktop */
  height: 85vh;        /* Slightly taller for better viewing */
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  border: 4px solid var(--accent);
  margin-top: 100px;
  margin-bottom: 140px;
}

/* Ensure the iframe fills the wider container */
#pdfFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Mobile adjustments for PDF */
@media (max-width: 800px) {
  .trip-container { margin-top: 0; padding: 0 20px; }
  #pdfViewerSection { 
    height: 70vh; 
    margin-top: 20px; 
    width: 98%; /* Almost full width on small screens */
  }
}

/* ===== MATH HERO ACADEMY SPECIFIC STYLES ===== */

.learning-card {
  max-width: 900px;
  width: 95%;
  background: var(--card);
  border-radius: 30px;
  border: 4px solid #fff;
  box-shadow: 10px 10px 0px rgba(0,0,0,0.3);
  padding: 40px;
  margin-top: 120px;
  margin-bottom: 20px;
  animation: fadeUp 0.8s ease-out;
}

/* 5x2 Flashcard Grid */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.card-item {
  background: rgba(255,255,255,0.1);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 15px 5px;
  text-align: center;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1.1rem;
}

.card-item.flipped {
  background: var(--accent);
  color: #000;
  transform: scale(1.05);
}

/* Challenge Zone Styling */
.challenge-zone {
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  border: 2px dashed var(--muted);
}

.math-question {
  font-size: 4rem;
  font-weight: 900;
  margin: 10px 0;
  font-family: 'Fredoka', sans-serif;
}

.math-timer {
  font-size: 3rem;
  color: var(--accent);
  font-weight: 900;
}

.quiz-input {
  background: #fff;
  border: 4px solid var(--accent);
  border-radius: 15px;
  padding: 15px;
  font-size: 2rem;
  width: 150px;
  text-align: center;
  margin-bottom: 20px;
  color: #000;
}

.btn-math {
  background: var(--accent);
  color: #000;
  border: 3px solid #000;
  padding: 15px 30px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 4px 4px 0px #000;
}

/* Dots Display */
.dots-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
}

.dot.active { background: var(--accent); transform: scale(1.3); }
.dot.green { background: #4ade80; }
.dot.red { background: #ff4d4d; }

/* Scoreboard Overlay */
.scoreboard {
  position: fixed;
  top: 140px;
  left: 20px;
  width: 200px;
  background: rgba(0,0,0,0.8);
  border: 2px solid var(--accent);
  border-radius: 15px;
  padding: 15px;
  z-index: 500;
  backdrop-filter: blur(5px);
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-btn {
  background: none; 
  border: none; 
  color: var(--muted); 
  font-size: 0.6rem; 
  cursor: pointer; 
  width: 100%; 
  margin-top: 10px;
}

/* Responsive Math Grid */
@media (max-width: 700px) {
  .flashcard-grid { grid-template-columns: repeat(2, 1fr); }
  .scoreboard { position: relative; top: 0; left: 0; width: 100%; margin-top: 20px; }
  .learning-card { margin-top: 20px; }
  .math-question { font-size: 2.5rem; }
}

/* --- FIXED LEADERBOARD (Now strictly Top-Right) --- */
.scoreboard {
  position: fixed;
  top: 20px;
  right: 20px;        /* Moves it to the right */
  left: auto;         /* Ensures it's not pulled to the left */
  width: 200px;
  background: rgba(0, 0, 0, 0.9);
  border: 3px solid var(--accent);
  border-radius: 15px;
  padding: 12px;
  z-index: 1500;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- FLASHY MULTIPLE CHOICE BUTTONS --- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px; /* Keeps it compact for mobile */
  margin: 15px auto;
}

.option-btn {
  /* Flashy Superhero Gradient */
  background: linear-gradient(145deg, #ffcc00, #ff9900);
  border: 3px solid #000;
  border-radius: 12px;
  padding: 12px;
  font-size: 1.6rem; /* Slightly smaller for mobile friendliness */
  font-weight: 900;
  color: #000;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 4px 4px 0px #000;
  text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}

.option-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(145deg, #fff, var(--accent));
  box-shadow: 6px 6px 0px #000;
}

.option-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px #000;
}

/* Hide leaderboard on very small screens during the game to save space */
@media (max-width: 600px) {
  .scoreboard {
    position: relative;
    top: 0;
    right: 0;
    width: 100%;
    margin-bottom: 20px;
  }
}

/* --- FIXED LEADERBOARD (Top-Right) --- */
.scoreboard {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto !important; /* Forces it to the right */
  width: 200px;
  background: rgba(0, 0, 0, 0.9);
  border: 3px solid var(--accent);
  border-radius: 15px;
  padding: 12px;
  z-index: 1500;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* --- HERO RANK BADGE --- */
.rank-badge {
  background: var(--accent);
  color: #000;
  padding: 10px 25px;
  border-radius: 50px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  margin-bottom: 15px;
  border: 4px solid #000;
  box-shadow: 4px 4px 0px #000;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- SHAKE ANIMATION FOR WRONG ANSWERS --- */
.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* --- FLASHY BUTTONS (Mobile Friendly) --- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 320px;
  margin: 15px auto;
}

.option-btn {
  background: linear-gradient(145deg, #ffcc00, #ff9900);
  border: 3px solid #000;
  border-radius: 12px;
  padding: 12px;
  font-size: 1.6rem;
  font-weight: 900;
  color: #000;
  cursor: pointer;
  font-family: 'Fredoka', sans-serif;
  transition: transform 0.1s;
  box-shadow: 4px 4px 0px #000;
}

.option-btn:hover { transform: scale(1.05); background: #fff; }
.option-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0px #000; }

/* Hide leaderboard on mobile to keep screen clear */
@media (max-width: 800px) {
  .scoreboard { position: relative; top: 0; right: 0; width: 100%; margin-bottom: 20px; }
}



