/* Ehliyet Milyoner — Dark Blue & Gold Premium */

.em-game {
  /* Colors — Milyoner themed */
  --primary: #1a237e;
  --primary-dark: #0d1654;
  --primary-light: #3949ab;
  --primary-glow: rgba(26, 35, 126, 0.25);

  --gold: #ffd700;
  --gold-dark: #c9a800;
  --gold-light: #ffe44d;
  --gold-bg: rgba(255, 215, 0, 0.1);

  --success: #10b981;
  --success-light: #34d399;
  --success-bg: rgba(16, 185, 129, 0.1);

  --danger: #ef4444;
  --danger-light: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.1);

  --warning: #f59e0b;
  --warning-light: #fbbf24;

  --bg: #f8fafc;
  --bg-dark: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Effects */
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.em-game *, .em-game *::before, .em-game *::after { box-sizing: border-box; }

/* ============ SCREENS ============ */
.em-screen { display: none; flex-direction: column; }
.em-screen.em-active { display: flex; animation: emFadeIn 0.4s ease-out; }
@keyframes emFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============ LANDING CARD ============ */
.em-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}

.em-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--gold);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.em-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.2;
  color: var(--text);
}

.em-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0 0 32px;
  line-height: 1.6;
}

/* Rules */
.em-rules {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.em-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
}

.em-rule-icon {
  font-size: 13px;
  font-weight: 800;
  min-width: 42px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.em-rule-joker { background: rgba(26, 35, 126, 0.1); color: var(--primary); }
.em-rule-checkpoint { background: var(--gold-bg); color: var(--gold-dark); }
.em-rule-prize { background: var(--success-bg); color: var(--success); }

/* Prize Preview Ladder */
.em-prize-preview {
  margin-bottom: 28px;
}

.em-prize-preview h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
}

.em-prize-ladder-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.em-prize-step-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.em-prize-step-mini.em-checkpoint {
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-weight: 700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.em-prize-step-mini.em-top {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--gold);
  font-weight: 800;
}

.em-step-num {
  min-width: 24px;
}

.em-step-val {
  font-weight: 700;
}

/* Primary Button */
.em-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: inherit;
}

.em-btn-primary:hover { opacity: 0.9; }
.em-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* Leaderboard Preview */
.em-lb-preview {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.em-lb-preview h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.em-lb-list-static {
  list-style: none;
  margin: 0;
  padding: 0;
}

.em-lb-list-static li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}

.em-lb-rank { font-size: 18px; min-width: 32px; text-align: center; }
.em-lb-name { flex: 1; font-weight: 600; }
.em-lb-score { font-weight: 800; color: var(--primary); }

/* SEO */
.em-seo {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.em-seo h3, .em-seo h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--text);
}

.em-seo p, .em-seo li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.em-seo ul { padding-left: 20px; margin: 0; }

/* ============ PLAY SCREEN ============ */
.em-play-layout {
  display: flex;
  gap: 16px;
}

.em-play-sidebar {
  flex-shrink: 0;
  width: 160px;
}

.em-play-main {
  flex: 1;
  min-width: 0;
}

/* Prize Ladder */
.em-prize-ladder {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: sticky;
  top: 16px;
}

.em-prize-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.em-prize-step.em-checkpoint {
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.em-prize-step.em-passed {
  background: var(--success-bg);
  color: var(--success);
}

.em-prize-step.em-current {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--gold);
  font-weight: 700;
  box-shadow: 0 0 12px var(--primary-glow);
  animation: emPulse 2s ease-in-out infinite;
}

@keyframes emPulse {
  0%, 100% { box-shadow: 0 0 12px var(--primary-glow); }
  50% { box-shadow: 0 0 20px var(--primary-glow); }
}

/* Play Header */
.em-play-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Jokers */
.em-jokers {
  display: flex;
  gap: 8px;
}

.em-joker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.em-joker-btn:hover {
  border-color: var(--primary-light);
  background: var(--bg);
}

.em-joker-btn.em-joker-used {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: var(--border-light);
}

.em-joker-icon { font-size: 18px; line-height: 1; }
.em-joker-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* Quit Button */
.em-btn-quit {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.em-btn-quit:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-light); }

/* Question Container */
.em-question-container {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: 300px;
}

.em-question-exit { opacity: 0; }
.em-question-enter { animation: emFadeIn 0.3s ease-out; }

.em-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.em-q-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(26, 35, 126, 0.08);
  padding: 6px 12px;
  border-radius: 100px;
}

.em-q-prize {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-dark);
  background: var(--gold-bg);
  padding: 6px 12px;
  border-radius: 100px;
}

.em-q-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 220px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  margin-bottom: 16px;
}

.em-q-image img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.em-question-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
  padding: 8px 0;
  margin: 0 0 16px;
}

/* Answers */
.em-answers-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.em-answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: inherit;
}

.em-answer-btn:hover { border-color: var(--primary-light); background: var(--bg-dark); }
.em-answer-btn:disabled { cursor: default; }

.em-answer-label {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.em-answer-text {
  flex: 1;
  line-height: 1.5;
}

/* Answer States */
.em-answer-btn.em-answer-selected {
  background: rgba(26, 35, 126, 0.08);
  border-color: var(--primary);
  animation: emAnswerPulse 0.6s ease-in-out infinite;
}

@keyframes emAnswerPulse {
  0%, 100% { background: rgba(26, 35, 126, 0.08); }
  50% { background: rgba(26, 35, 126, 0.15); }
}

.em-answer-btn.em-answer-correct {
  background: var(--success-bg);
  border-color: var(--success);
  animation: none;
}

.em-answer-btn.em-answer-correct .em-answer-label {
  background: var(--success);
  color: #fff;
}

.em-answer-btn.em-answer-wrong {
  background: var(--danger-bg);
  border-color: var(--danger);
  animation: none;
}

.em-answer-btn.em-answer-wrong .em-answer-label {
  background: var(--danger);
  color: #fff;
}

.em-answer-btn.em-answer-eliminated {
  opacity: 0.25;
  pointer-events: none;
}

/* Hint */
.em-hint-text {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--gold-bg);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 600;
}

/* ============ RESULTS SCREEN ============ */
.em-results-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.em-results-emoji { font-size: 48px; margin-bottom: 8px; }

.em-results-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.em-results-prize {
  font-size: 56px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1;
}

.em-results-prize span {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.em-results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 28px 0;
}

.em-rs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.em-rs-val { font-size: 20px; font-weight: 800; color: var(--text); }
.em-rs-lbl { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* Name Form */
.em-results-name-form {
  margin: 24px 0;
  text-align: left;
}

.em-results-name-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.em-name-input-row {
  display: flex;
  gap: 12px;
}

.em-name-input-row input {
  flex: 1;
  padding: 14px 18px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.em-name-input-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }
.em-name-input-row input::placeholder { color: var(--text-muted); }
.em-name-input-row .em-btn-primary { width: auto; padding: 14px 24px; font-size: 14px; white-space: nowrap; }

.em-submit-success {
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
  padding: 16px;
  margin: 12px 0;
  background: var(--success-bg);
  border-radius: var(--radius-sm);
}

.em-submit-error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  padding: 16px;
  margin: 12px 0;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
}

/* Results Actions */
.em-results-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.em-results-actions .em-btn-primary { flex: 1; }

.em-btn-share {
  flex: 1;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  background: var(--bg);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.em-btn-share:hover { background: var(--bg-dark); }

/* Leaderboard */
.em-leaderboard-section {
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.em-leaderboard-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.em-lb-tabs { display: flex; gap: 8px; margin-bottom: 20px; }

.em-lb-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: none;
  color: var(--text-secondary);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.em-lb-tab:hover { color: var(--text); background: var(--bg-dark); }
.em-lb-tab.em-active { background: var(--primary); color: #fff; }

.em-lb-list { list-style: none; margin: 0; padding: 0; }

.em-lb-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 14px;
}

.em-lb-item .em-lb-rank { font-size: 18px; min-width: 32px; text-align: center; }
.em-lb-item .em-lb-name { flex: 1; font-weight: 600; }
.em-lb-item .em-lb-details { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.em-lb-item .em-lb-score { font-weight: 800; color: var(--primary); min-width: 60px; text-align: right; }
.em-lb-item.em-lb-top { background: var(--bg-dark); }
.em-lb-item.em-lb-top .em-lb-name { color: var(--primary); }

.em-lb-empty, .em-lb-error {
  font-size: 14px;
  color: var(--text-muted);
  padding: 32px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* Loading / Error */
.em-loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

.em-loading::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: emSpinner 0.8s linear infinite;
}

@keyframes emSpinner { to { transform: rotate(360deg); } }

.em-error {
  text-align: center;
  padding: 24px;
  color: var(--danger);
  font-weight: 600;
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
}

/* ============ MOBILE ============ */
@media (max-width: 600px) {
  .em-game { padding: 12px; }

  .em-play-layout { flex-direction: column-reverse; }

  .em-play-sidebar { width: 100%; }

  .em-prize-ladder {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    position: static;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .em-prize-step {
    flex-shrink: 0;
    min-width: 60px;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    font-size: 11px;
    text-align: center;
  }

  .em-card, .em-results-card { padding: 28px 20px; border-radius: 16px; }
  .em-title { font-size: 24px; }
  .em-rules { gap: 8px; }
  .em-rule { padding: 10px 14px; font-size: 13px; }
  .em-results-prize { font-size: 48px; }
  .em-results-actions { flex-direction: column; }
  .em-name-input-row { flex-direction: column; }
  .em-name-input-row .em-btn-primary { width: 100%; }
  .em-question-container { padding: 20px; border-radius: 16px; }
  .em-question-text { font-size: 15px; }
  .em-answer-btn { padding: 14px 16px; font-size: 14px; }
  .em-answer-label { min-width: 36px; height: 36px; font-size: 14px; }

  .em-joker-btn { padding: 8px 10px; }
  .em-joker-icon { font-size: 16px; }

  .em-play-header { flex-wrap: wrap; gap: 8px; }
  .em-jokers { gap: 6px; }

  .em-lb-tabs { flex-wrap: wrap; }
  .em-lb-tab { padding: 8px 14px; font-size: 12px; }

  .em-prize-ladder-mini { font-size: 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .em-game *, .em-game *::before, .em-game *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
