/* games/doodle-jump.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: linear-gradient(to bottom, #bae6fd 0%, #e0f2fe 40%, #dbeafe 70%, #e0e7ff 100%);
  background-attachment: fixed;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
  padding: 16px;
}

#game-wrapper {
  display: flex;
  flex-direction: row;
  align-items: stretch;   /* panel stretches to canvas height */
  gap: 20px;
}

#game-mount {
  flex-shrink: 0;
}

#game-mount canvas {
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.18), 0 2px 12px rgba(0,0,0,0.10);
}

/* ── Question Panel ───────────────────────────────────────── */
#question-panel {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.panel-section {
  background: linear-gradient(155deg, #f0f9ff 0%, #e0e7ff 30%, #ede9fe 62%, #faf5ff 100%);
  border: 2px solid rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  padding: 18px 16px;
  color: #1e293b;
  box-shadow: 0 4px 32px rgba(99, 102, 241, 0.13), 0 1px 4px rgba(0,0,0,0.06);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Idle state ───────────────────────────────────────────── */
#panel-idle {
  gap: 0;
}

.panel-idle-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 12px 14px;
  border-radius: 16px;
  background: radial-gradient(ellipse 90% 120% at 50% 35%, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.05) 60%, transparent 80%);
}

.panel-idle-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-idle-icon {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 0 12px rgba(245, 200, 30, 0.7));
  animation: idle-pulse 2.4s ease-in-out infinite;
}

@keyframes idle-pulse {
  0%, 100% { transform: scale(1);   filter: drop-shadow(0 0 10px rgba(245, 200, 30, 0.55)); }
  50%       { transform: scale(1.12); filter: drop-shadow(0 0 22px rgba(245, 200, 30, 1)); }
}

.idle-sparkle {
  font-size: 20px;
  display: inline-block;
  animation: sparkle-dance 2.2s ease-in-out infinite;
}
.idle-sparkle-l { animation-delay: 0s; }
.idle-sparkle-r { animation-delay: 1.1s; }

@keyframes sparkle-dance {
  0%, 100% { transform: scale(0.9) rotate(-15deg); opacity: 0.6; }
  50%       { transform: scale(1.25) rotate(15deg); opacity: 1; }
}

.panel-idle-text {
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.panel-idle-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #8b5cf6;
  text-align: center;
}

.panel-divider {
  height: 1.5px;
  background: linear-gradient(to right, transparent, rgba(99, 102, 241, 0.40), rgba(139, 92, 246, 0.35), transparent);
  margin: 4px 0 10px;
  flex-shrink: 0;
}

/* ── Rotating fact card ───────────────────────────────────── */
#panel-fact {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  padding: 12px;
  border: 2px solid rgba(99, 102, 241, 0.20);
  transition: border-color 0.5s ease;
  overflow: hidden;
}


#fact-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  align-self: flex-start;
  border: 2px solid;
}

.badge-emoji {
  font-size: 14px;
  line-height: 1;
}

#fact-title {
  font-family: 'Fredoka One', cursive;
  font-size: 22px;
  font-weight: 400;
  color: #1e1b4b;
  line-height: 1.2;
  letter-spacing: 0.01em;
  transition: color 0.5s ease;
}

#fact-body {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  flex: 0 0 auto;
  border-radius: 10px;
  padding: 10px 12px;
  /* background, border-left and color are set per-category by JS */
}

#fact-next {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #a5b4c8;
  text-align: right;
  letter-spacing: 0.03em;
  margin-top: auto;
}

/* ── Question panel ───────────────────────────────────────── */
#panel-question {
  display: none;
  border-color: rgba(99, 102, 241, 0.50);
}

#panel-countdown-badge {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(245, 158, 11, 0.10);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #92400e;
  line-height: 1.4;
  flex-shrink: 0;
}

#panel-countdown-badge .badge-icon { font-size: 16px; }

#countdown-badge-num {
  font-family: 'Fredoka One', cursive;
  font-size: 32px;
  font-weight: 400;
  color: #d97706;
  font-variant-numeric: tabular-nums;
}

.panel-cp-label {
  font-family: 'Fredoka One', cursive;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #6366f1;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#question-text {
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
  margin-bottom: 10px;
  flex-shrink: 0;
}

#options-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.52);
  border: 2px solid;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
}

.option-label {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 16px;
  color: #fff;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  body { align-items: flex-start; padding: 12px; }
  #game-wrapper {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  #question-panel {
    width: 100%;
    max-width: 700px;
  }
  .panel-section {
    flex: unset;
  }
  #panel-fact {
    min-height: 140px;
  }
}
