* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #050d1a;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
}

/* Compact Samsung Tab / iPad Viewport */
.tablet-frame {
  width: 100%;
  max-width: 960px;
  background-color: #0a192f; /* Dark Blue */
  color: #ffffff;            /* White Font */
  border: 6px solid #1e3a5f;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #1e3a5f;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: #173459;
  color: #ffd700;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coin-wallet {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid #ffd700;
  color: #ffd700; /* Golden */
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  transition: transform 0.2s;
}

.coin-wallet.pulse {
  transform: scale(1.15);
}

.progress-pill {
  background: #132c4e;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.category-bar, .level-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cat-btn, .tab-btn {
  background: #132c4e;
  color: #ffffff;
  border: 1px solid #254b7c;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.cat-btn.active, .tab-btn.active {
  background: #1e4d8c;
  border-color: #ffd700;
  font-weight: bold;
}

.tab-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 2-Column Compact Grid matching your layout sketch */
.questions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 680px) {
  .questions-grid {
    grid-template-columns: 1fr;
  }
}

.question-card {
  background: #112645;
  border: 1px solid #224473;
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.question-card.solved {
  border-color: #16a34a;
  background: #0f2c3d;
}

/* Sequential Question Number at top of Answer Block */
.q-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.98rem;
  font-weight: 600;
}

.q-number {
  background: #ffd700;
  color: #0a192f;
  font-weight: 800;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.answer-row {
  display: flex;
  gap: 8px;
}

.answer-input {
  flex: 1;
  background: #081426;
  border: 1px solid #2d568c;
  color: #ffffff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
}

.answer-input:focus {
  border-color: #ffd700;
}

.answer-input.shake {
  animation: shake 0.35s;
  border-color: #ef4444;
}

/* Green Answer Button with White Text */
.btn-green {
  background-color: #16a34a;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
}

.btn-green:hover {
  background-color: #15803d;
}

.btn-green:disabled {
  background-color: #1f5c38;
  cursor: default;
}

.btn-gold {
  background-color: #ffd700;
  color: #0a192f;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 1px solid #3b699e;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Flying Golden Coin Animation */
.flying-coin {
  position: fixed;
  width: 24px;
  height: 24px;
  background: radial-gradient(circle at 30% 30%, #fff3a1, #ffd700 60%, #b8860b);
  border: 2px solid #fff8dc;
  border-radius: 50%;
  color: #7a5200;
  font-weight: bold;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.8s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Modals & 3D Trophy */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 9, 20, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: #0f2342;
  border: 2px solid #ffd700;
  border-radius: 18px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-card input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2d568c;
  background: #081426;
  color: #fff;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.emoji-burst {
  font-size: 3rem;
}

.bonus-text {
  color: #ffd700;
  font-weight: bold;
  font-size: 1.1rem;
}

#trophy-3d-container {
  width: 100%;
  height: 220px;
  margin: 0 auto;
}