:root {
  --game-primary: #004d40;
  --game-primary-light: #00695c;
  --game-primary-bg: #e0f2f1;
  --game-accent: #d4af37;
  --game-correct: #10b981;
  --game-wrong: #ef4444;

  /* লাইট থিম ভেরিয়েবল */
  --g-card-bg: #ffffff;
  --g-section-bg: #f9fafb;
  --g-text-main: #1f2937;
  --g-text-muted: #6b7280;
  --g-border: rgba(0, 0, 0, 0.08);
  --g-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --g-option-bg: #ffffff;
  --g-option-hover: #f0fdf4;
}

/* ডার্ক মোড সাপোর্ট */
html.dark, html.dark-mode, html.dark-theme,
body.dark, body.dark-mode, body.dark-theme,
[data-theme="dark"] {
  --game-primary: #26a69a;
  --game-primary-light: #4db6ac;
  --game-primary-bg: rgba(38, 166, 154, 0.15);

  --g-card-bg: #1f2937;
  --g-section-bg: #111827;
  --g-text-main: #f9fafb;
  --g-text-muted: #9ca3af;
  --g-border: rgba(255, 255, 255, 0.1);
  --g-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --g-option-bg: #1f2937;
  --g-option-hover: rgba(38, 166, 154, 0.12);
}

/* গ্লোবাল হেডার ও ফুটার প্রোটেকশন */
#header, #footer {
  background-color: #004d40 !important;
  color: #ffffff;
}

body {
  font-family: 'Hind Siliguri', sans-serif;
  margin: 0;
  padding: 0;
}

.game-page-container {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.game-card {
  width: 100%;
  max-width: 480px;
  background: var(--g-card-bg);
  color: var(--g-text-main);
  border-radius: 24px;
  box-shadow: var(--g-shadow);
  padding: 24px 20px;
  border: 1px solid var(--g-border);
  position: relative;
  transition: all 0.3s ease;
}

/* গেম টপ বার ও কয়েন ব্যাজ */
.game-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  min-height: 40px;
}

.icon-btn {
  background: var(--g-section-bg);
  border: 1px solid var(--g-border);
  color: var(--g-text-main);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--game-primary-bg);
  color: var(--game-primary);
}

.coin-badge {
  margin-left: auto;
  background: var(--game-primary-bg);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: var(--game-primary);
}

.gold-coin {
  color: var(--game-accent);
  filter: drop-shadow(0 1px 3px rgba(212, 175, 55, 0.4));
}

/* ভিউ স্ক্রিন ট্রানজিশন */
.view-screen {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* হেডার সেকশন */
.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-header .badge {
  display: inline-block;
  background: var(--game-primary-bg);
  color: var(--game-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.game-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.game-header p {
  font-size: 14px;
  color: var(--g-text-muted);
}

/* লেভেল সিলেকশন কার্ডস */
.level-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-item-card {
  background: var(--g-section-bg);
  border: 1.5px solid var(--g-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.25s ease;
}

.level-item-card.unlocked:hover {
  border-color: var(--game-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 77, 64, 0.1);
}

.level-item-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.level-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.level-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--game-primary-bg);
  color: var(--game-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.level-info strong {
  display: block;
  font-size: 15.5px;
  margin-bottom: 3px;
}

.level-info span {
  font-size: 12.5px;
  color: var(--g-text-muted);
}

.level-status-icon {
  font-size: 18px;
  color: var(--g-text-muted);
}

.level-item-card.unlocked .level-status-icon {
  color: var(--game-primary);
}

/* কুইজ প্লেয়িং স্ক্রিন: প্রগ্রেস বার */
.quiz-status-header {
  margin-bottom: 18px;
}

.step-counter {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--game-primary);
  display: block;
  margin-bottom: 6px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--g-section-bg);
  border: 1px solid var(--g-border);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 20%;
  background: var(--game-primary);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* প্রশ্ন বক্স */
.question-container {
  min-height: 70px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.question-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--g-text-main);
}

/* অপশন বাটন সমূহ */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.option-btn {
  background: var(--g-option-bg);
  border: 1.5px solid var(--g-border);
  color: var(--g-text-main);
  padding: 14px 16px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
  background: var(--g-option-hover);
  border-color: var(--game-primary);
  transform: translateX(4px);
}

/* সঠিক ও ভুল অ্যানিমেশন স্টেট */
.option-btn.correct {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: var(--game-correct) !important;
  color: var(--game-correct) !important;
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: var(--game-wrong) !important;
  color: var(--game-wrong) !important;
}

/* শিক্ষণীয় রেফারেন্স কার্ড */
.explanation-box {
  background: var(--g-section-bg);
  border-left: 4px solid var(--game-accent);
  padding: 12px 16px;
  border-radius: 4px 12px 12px 4px;
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease;
}

.explanation-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--game-accent);
  margin-bottom: 4px;
}

.explanation-box p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--g-text-main);
  margin: 0;
}

/* প্রাইমারি ও সেকেন্ডারি বাটন */
.btn-primary {
  width: 100%;
  background: var(--game-primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--game-primary-light);
}

.btn-secondary {
  width: 100%;
  background: var(--g-section-bg);
  color: var(--g-text-main);
  border: 1.5px solid var(--g-border);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--game-primary);
}

/* ফলাফল স্ক্রিন স্টাইল */
.result-celebration {
  text-align: center;
  margin-bottom: 20px;
}

.result-icon-wrap {
  width: 70px;
  height: 70px;
  background: var(--game-primary-bg);
  color: var(--game-accent);
  font-size: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px auto;
  border: 2px dashed var(--game-accent);
}

.result-celebration h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-celebration p {
  font-size: 14px;
  color: var(--g-text-muted);
}

.result-stats-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--g-section-bg);
  border: 1px solid var(--g-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 22px;
  text-align: center;
}

.stat-item .label {
  font-size: 13px;
  color: var(--g-text-muted);
  display: block;
  margin-bottom: 4px;
}

.stat-item strong {
  font-size: 20px;
  font-weight: 700;
}

.text-gold {
  color: var(--game-accent);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-text {
  text-align: center;
  font-size: 14px;
  color: var(--g-text-muted);
  padding: 20px 0;
}
