/* ============================================
   Game Edukasi - Game Stylesheet
   Colorful, fun, anak-anak!
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

.ekq-wrap {
  font-family: 'Nunito', sans-serif;
  max-width: 700px;
  margin: 20px auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  overflow: hidden;
  position: relative;
}

.ekq-screen { display: none; padding: 24px; }
.ekq-screen.active { display: block; }

/* ============ HEADER ============ */
.ekq-header {
  background: linear-gradient(135deg, #7c8ef7 0%, #9d6ec7 100%);
  margin: -24px -24px 24px;
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ekq-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}
.ekq-stars { font-size: 20px; letter-spacing: 4px; margin-bottom: 8px; }
.ekq-title {
  color: #fff; font-size: 26px; font-weight: 900;
  margin: 0 0 6px; text-shadow: 0 2px 12px rgba(0,0,0,.5), 0 0 30px rgba(255,255,255,.15);
}
.ekq-subtitle { color: #fff; font-size: 15px; margin: 0; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.4); letter-spacing: .02em; }

/* ============ KELAS GRID ============ */
.ekq-kelas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.ekq-kelas-btn {
  background: var(--kelas-color);
  border: none; border-radius: 18px;
  padding: 20px 12px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.ekq-kelas-btn:hover { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.ekq-kelas-btn:active { transform: scale(.97); }
.ekq-kelas-emoji { font-size: 32px; }
.ekq-kelas-num { color: #fff; font-size: 15px; font-weight: 800; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ekq-kelas-sd  { color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600; }

/* ============ LIVE BAR ============ */
.ekq-live-bar {
  display: flex; align-items: center; gap: 8px;
  background: #f0f9ff; border-radius: 12px;
  padding: 10px 16px; font-size: 13px;
  color: #0369a1; font-weight: 600;
}
.ekq-live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

/* ============ BACK BTN ============ */
.ekq-back-btn {
  background: #f1f5f9; border: none; border-radius: 10px;
  padding: 8px 16px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #64748b;
  margin-bottom: 16px; font-family: 'Nunito', sans-serif;
  transition: background .2s;
}
.ekq-back-btn:hover { background: #e2e8f0; }

/* ============ MAPEL GRID ============ */
.ekq-mapel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.ekq-mapel-btn {
  border: none; border-radius: 16px;
  padding: 18px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  background: #f8faff;
  border: 2px solid #e2e8f0;
  transition: all .2s; font-family: 'Nunito', sans-serif;
  text-align: left;
}
.ekq-mapel-btn:hover {
  border-color: var(--mapel-color, #3b82f6);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.ekq-mapel-ikon { font-size: 28px; }
.ekq-mapel-info { flex: 1; }
.ekq-mapel-nama { font-size: 15px; font-weight: 800; color: #1e293b; display: block; }
.ekq-mapel-jml  { font-size: 12px; color: #94a3b8; font-weight: 600; }

/* ============ LEVEL GRID ============ */
.ekq-level-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.ekq-level-btn {
  border: none; border-radius: 20px;
  padding: 22px 12px; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s;
  font-family: 'Nunito', sans-serif;
}
.ekq-level-btn.easy   { background: linear-gradient(135deg, #84fab0, #4ade80); }
.ekq-level-btn.medium { background: linear-gradient(135deg, #ffeaa7, #f59e0b); }
.ekq-level-btn.hard   { background: linear-gradient(135deg, #fd79a8, #ef4444); }
.ekq-level-btn:hover  { transform: translateY(-4px) scale(1.04); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.ekq-level-emoji  { font-size: 32px; }
.ekq-level-name   { font-size: 16px; font-weight: 900; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.ekq-level-desc   { font-size: 12px; color: rgba(255,255,255,.9); font-weight: 600; text-align: center; }
.ekq-level-stars  { font-size: 14px; }

/* ============ GURU INFO ============ */
.ekq-guru-info {
  display: flex; align-items: center; gap: 12px;
  background: #f8faff; border-radius: 14px;
  padding: 12px 16px; margin-bottom: 16px;
}
.ekq-guru-foto {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; border: 3px solid #e2e8f0;
}
.ekq-guru-foto-placeholder {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.ekq-guru-nama  { font-size: 14px; font-weight: 800; color: #1e293b; display: block; }
.ekq-guru-label { font-size: 11px; color: #94a3b8; font-weight: 600; }

/* ============ NAMA INPUT ============ */
.ekq-nama-wrap { text-align: center; padding: 10px 0; }
.ekq-avatar-big { font-size: 60px; margin-bottom: 12px; animation: bounce 1s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.ekq-nama-input {
  width: 100%; padding: 16px 20px;
  border: 3px solid #e2e8f0; border-radius: 16px;
  font-size: 18px; font-weight: 700; font-family: 'Nunito', sans-serif;
  text-align: center; outline: none;
  transition: border-color .2s;
  margin: 16px 0;
}
.ekq-nama-input:focus { border-color: #667eea; box-shadow: 0 0 0 4px rgba(102,126,234,.15); }
.ekq-start-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff; border: none; border-radius: 16px;
  padding: 16px 40px; font-size: 18px; font-weight: 900;
  cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(102,126,234,.4);
  width: 100%;
}
.ekq-start-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(102,126,234,.5); }

/* ============ GAME HEADER ============ */
.ekq-game-header {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  margin: -24px -24px 16px; padding: 14px 20px;
}
.ekq-game-info { display: flex; flex-direction: column; gap: 2px; }
.ekq-game-mapel { color: rgba(255,255,255,.8); font-size: 12px; font-weight: 700; }
.ekq-game-level { color: #fff; font-size: 14px; font-weight: 800; }
.ekq-game-stats { display: flex; gap: 16px; }
.ekq-stat-item {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.2); border-radius: 10px;
  padding: 6px 10px; color: #fff; font-size: 14px; font-weight: 800;
}
.ekq-stat-icon { font-size: 14px; }
/* Tombol mute */
.ekq-mute-btn {
  background: rgba(255,255,255,.15);
  border: none; border-radius: 8px;
  width: 34px; height: 34px;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.ekq-mute-btn:hover { background: rgba(255,255,255,.28); }

.ekq-timer-wrap { transition: background .3s; }
.ekq-timer-wrap.danger { background: rgba(255,100,100,.4) !important; animation: timerPulse .5s infinite alternate; }
@keyframes timerPulse { from { background: rgba(255,100,100,.4); } to { background: rgba(255,0,0,.6); } }

/* ============ PROGRESS ============ */
.ekq-progress-bar {
  background: #e2e8f0; border-radius: 100px;
  height: 10px; margin-bottom: 20px; overflow: hidden;
}
.ekq-progress-fill {
  height: 100%; border-radius: 100px; width: 0%;
  background: linear-gradient(90deg, #667eea, #a855f7);
  transition: width .4s ease;
}

/* ============ SOAL BOX ============ */
.ekq-soal-box {
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border-radius: 20px; padding: 24px;
  margin-bottom: 20px;
  border: 2px solid #e0e7ff;
  min-height: 120px;
}
.ekq-soal-num {
  font-size: 12px; font-weight: 800; color: #667eea;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px;
}
.ekq-soal-text {
  font-size: 18px; font-weight: 800; color: #1e293b;
  line-height: 1.5; margin: 0;
}

/* ============ OPSI GRID ============ */
.ekq-opsi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.ekq-opsi {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid #e2e8f0;
  border-radius: 14px; padding: 14px 16px;
  cursor: pointer; font-family: 'Nunito', sans-serif;
  transition: all .15s; text-align: left;
}
.ekq-opsi:hover:not(:disabled) {
  border-color: #667eea; background: #f0f4ff;
  transform: scale(1.02);
}
.ekq-opsi:disabled { cursor: not-allowed; }
.ekq-opsi-label {
  width: 32px; height: 32px; border-radius: 8px;
  background: #667eea; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; flex-shrink: 0;
}
.ekq-opsi-text { font-size: 14px; font-weight: 700; color: #334155; }

.ekq-opsi.benar  { background: #d1fae5 !important; border-color: #22c55e !important; }
.ekq-opsi.benar .ekq-opsi-label { background: #22c55e; }
.ekq-opsi.salah  { background: #fee2e2 !important; border-color: #ef4444 !important; }
.ekq-opsi.salah .ekq-opsi-label { background: #ef4444; }

/* ============ FEEDBACK ============ */
.ekq-feedback {
  text-align: center; font-size: 20px; font-weight: 800;
  min-height: 32px; transition: all .3s;
}
.ekq-feedback.benar { color: #16a34a; }
.ekq-feedback.salah { color: #dc2626; }

/* ============ HASIL ============ */
.ekq-hasil-wrap { text-align: center; padding: 16px 0; }
.ekq-hasil-emoji { font-size: 72px; animation: celebrate 1s ease; }
@keyframes celebrate {
  0% { transform: scale(0) rotate(-20deg); }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.ekq-skor-besar {
  font-size: 72px; font-weight: 900;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin: 8px 0;
}
.ekq-rank-badge {
  display: inline-block; background: linear-gradient(135deg, #ffd700, #ffa500);
  border-radius: 100px; padding: 8px 20px;
  font-size: 16px; font-weight: 900; color: #7c2d12;
  margin: 12px 0; min-height: 20px;
}
.ekq-hasil-actions { display: flex; gap: 12px; margin-top: 20px; }
.ekq-btn-ulang, .ekq-btn-lb {
  flex: 1; padding: 14px; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: transform .15s;
}
.ekq-btn-ulang { background: linear-gradient(135deg, #84fab0, #4ade80); color: #166534; }
.ekq-btn-lb    { background: linear-gradient(135deg, #ffd700, #ffa500); color: #7c2d12; }
.ekq-btn-ulang:hover, .ekq-btn-lb:hover { transform: translateY(-2px); }
.ekq-btn-home {
  width: 100%; padding: 12px; border: 2px solid #e2e8f0;
  border-radius: 14px; background: #fff;
  font-size: 14px; font-weight: 800; color: #64748b;
  cursor: pointer; font-family: 'Nunito', sans-serif;
  margin-top: 10px; transition: all .2s;
}
.ekq-btn-home:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }

/* ============ LEADERBOARD ============ */
.ekq-lb-filter {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.ekq-lb-filter select {
  flex: 1; padding: 8px 12px; border: 2px solid #e2e8f0;
  border-radius: 10px; font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; outline: none;
}
.ekq-btn-sm {
  background: #667eea; color: #fff; border: none;
  border-radius: 10px; padding: 8px 14px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif;
}
.ekq-lb-list { display: flex; flex-direction: column; gap: 8px; }
.ekq-lb-item {
  display: flex; align-items: center; gap: 12px;
  background: #f8faff; border-radius: 14px;
  padding: 12px 16px; border: 2px solid #e2e8f0;
}
.ekq-lb-rank { font-size: 22px; width: 36px; text-align: center; }
.ekq-lb-info { flex: 1; }
.ekq-lb-nama  { font-size: 15px; font-weight: 800; color: #1e293b; }
.ekq-lb-meta  { font-size: 12px; color: #94a3b8; font-weight: 600; }
.ekq-lb-skor  { font-size: 22px; font-weight: 900; color: #667eea; }

/* ============ BADGE LEVEL ============ */
.ekq-badge {
  display: inline-block; border-radius: 6px;
  padding: 2px 8px; font-size: 11px; font-weight: 800;
}
.ekq-easy   { background: #d1fae5; color: #166534; }
.ekq-medium { background: #fef3c7; color: #92400e; }
.ekq-hard   { background: #fee2e2; color: #991b1b; }

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
  .ekq-kelas-grid { grid-template-columns: repeat(2,1fr); }
  .ekq-level-grid { grid-template-columns: 1fr; }
  .ekq-opsi-grid  { grid-template-columns: 1fr; }
  .ekq-game-stats { gap: 8px; }
  .ekq-stat-item  { padding: 6px 8px; font-size: 12px; }
  .ekq-soal-text  { font-size: 15px; }
}

/* ============ ADMIN CSS ============ */
.ekq-stats-row { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.ekq-stat-card {
  flex: 1; min-width: 140px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 20px; text-align: center;
}
.ekq-stat-card .icon { font-size: 28px; display: block; margin-bottom: 8px; }
.ekq-stat-card .num  { font-size: 32px; font-weight: 900; color: #667eea; display: block; }
.ekq-stat-card .lbl  { font-size: 13px; color: #64748b; font-weight: 600; }
.ekq-shortcode-box { background: #f0f4ff; border-radius: 12px; padding: 20px; margin: 20px 0; }
.ekq-shortcode-box code { background: #fff; padding: 4px 10px; border-radius: 6px; font-size: 16px; border: 1px solid #c7d2fe; }
.ekq-import-info { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; padding: 20px; margin-bottom: 24px; }

/* Title & subtitle spesifik di header game */
.ekq-header h2.ekq-title,
.ekq-header p.ekq-subtitle {
  color: #fff;
}

/* Tombol leaderboard di menu utama */
.ekq-btn-lb-home {
  width: 100%;
  margin-top: 16px;
  margin-bottom: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #ffd700, #ffa500);
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  color: #7c2d12;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(255,165,0,.3);
}
.ekq-btn-lb-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,165,0,.4);
}

/* Live bar di screen game */
.ekq-live-bar--game {
  margin-top: 12px;
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border: 1px solid #e0e7ff;
  font-size: 12px;
  animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: #e0e7ff; }
  50%       { border-color: #818cf8; }
}
