/* ===================================================================
   lab.css — Robot Kodlama Laboratuvarı
   =================================================================== */

/* ---------- Lab Hero ---------- */
.lab-hero {
  position: relative;
  background: #1B2D5B;
  border-bottom: 3px solid var(--primary);
  color: #fff;
  padding: 64px 0 56px;
  min-height: 260px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#lab-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.lab-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
}
.lab-hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.lab-hero h1 i { margin-right: 10px; color: var(--primary); }
.lab-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.70);
  max-width: 540px;
  margin: 0 auto;
}

/* XP Bar in hero */
.hero-xp-wrap {
  max-width: 420px;
  margin: 20px auto 0;
}
.hero-xp-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 6px;
  font-weight: 600;
}
.hero-xp-bar {
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}
.hero-xp-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 20px;
  transition: width 0.8s ease;
}

/* ---------- Bölüm Grid ---------- */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ---------- Chapter Card ---------- */
.chapter-card {
  border-top: 3px solid var(--primary);
  border-radius: 16px;
  background: var(--dark-card);
  box-shadow: 0 4px 16px rgba(27,45,91,0.08);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--dark-border);
  border-top: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
}
.chapter-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(27,45,91,0.16);
}

.chapter-card-thumb {
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent, #FF9A40));
}

.chapter-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }

.chapter-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
  line-height: 1;
}

.chapter-card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
}

.chapter-card-desc {
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
}
body[data-theme="turuncu"] .chapter-card-desc,
body[data-theme="lacivert"] .chapter-card-desc { color: var(--text-muted); }

.chapter-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Difficulty Badge ---------- */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.diff-1 { background: rgba(22,163,74,0.1);  color: #16a34a; border: 1px solid rgba(22,163,74,0.25); }
.diff-2 { background: rgba(234,179,8,0.1);  color: #ca8a04; border: 1px solid rgba(234,179,8,0.25); }
.diff-3 { background: rgba(244,120,32,0.1); color: var(--primary); border: 1px solid rgba(244,120,32,0.25); }
.diff-4 { background: rgba(220,38,38,0.1);  color: #dc2626; border: 1px solid rgba(220,38,38,0.25); }
.diff-5 { background: rgba(147,51,234,0.1); color: #9333ea; border: 1px solid rgba(147,51,234,0.25); }

/* ---------- Progress Bar ---------- */
.progress-bar-wrap {
  background: rgba(var(--primary-rgb),0.1);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar-fill {
  background: var(--primary);
  border-radius: 20px;
  height: 100%;
  transition: width 0.5s ease;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ---------- XP Bar ---------- */
.xp-bar-wrap {
  background: rgba(var(--success-rgb),0.1);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}
.xp-bar-fill {
  background: var(--success);
  border-radius: 20px;
  height: 100%;
  transition: width 0.5s ease;
}

/* ---------- Streak Chip ---------- */
.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(var(--primary-rgb),0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid rgba(var(--primary-rgb),0.2);
}
.streak-chip i { color: #f59e0b; }

/* ---------- Badge Grid ---------- */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--dark-border);
  background: var(--dark-card);
  transition: all 0.2s;
}
.badge-item.earned {
  box-shadow: 0 0 16px rgba(var(--primary-rgb),0.2);
  border-color: var(--primary);
}
.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.badge-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1;
}
.badge-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.3;
}
.badge-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- "Başla" Butonu ---------- */
.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  transition: opacity 0.2s;
  text-decoration: none;
}
.start-btn:hover { opacity: 0.88; }

/* ---------- Puzzle Layout ---------- */
.puzzle-layout {
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 20px;
  min-height: 500px;
  align-items: start;
}

.puzzle-info-panel,
.puzzle-sim-panel,
.puzzle-cmd-panel {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 20px;
}
.puzzle-info-panel { border-top: 3px solid var(--secondary); }
.puzzle-sim-panel  {
  border-top: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.puzzle-cmd-panel  { border-top: 3px solid var(--success); }

.puzzle-panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.puzzle-panel-title i { color: var(--primary); }

/* ---------- Simulator Grid ---------- */
.sim-grid {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  margin: 0 auto 16px;
}
.sim-cell {
  background: rgba(27,45,91,0.05);
  border: 1px solid rgba(27,45,91,0.1);
  border-radius: 6px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s;
}
body[data-theme="turuncu"] .sim-cell,
body[data-theme="lacivert"] .sim-cell {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.sim-cell.obstacle {
  background: #1B2D5B;
  border-color: #1B2D5B;
}
body[data-theme="turuncu"] .sim-cell.obstacle,
body[data-theme="lacivert"] .sim-cell.obstacle {
  background: rgba(91,155,213,0.35);
  border-color: rgba(91,155,213,0.5);
}
.sim-cell.target {
  border: 2px dashed var(--success);
  background: rgba(22,163,74,0.08);
}
.sim-cell.collected {
  background: rgba(22,163,74,0.15);
  border-color: var(--success);
  border-style: solid;
}
.sim-cell.trail {
  background: rgba(var(--primary-rgb),0.07);
}

.robot-icon {
  position: absolute;
  width: 70%;
  height: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  z-index: 2;
  line-height: 1;
}

/* ---------- Command Palette ---------- */
.cmd-palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.cmd-btn {
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--dark-border);
  background: transparent;
  color: var(--text-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.cmd-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb),0.06);
}
.cmd-btn i { font-size: 0.85rem; }

/* ---------- Command Queue ---------- */
.cmd-queue-wrap { margin-bottom: 14px; }
.cmd-queue-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cmd-queue {
  min-height: 100px;
  border: 1px dashed var(--dark-border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.queue-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(var(--primary-rgb),0.1);
  border: 1px solid rgba(var(--primary-rgb),0.2);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: default;
  transition: all 0.15s;
}
.queue-tag .rm {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.7rem;
  margin-left: 2px;
  line-height: 1;
}
.queue-tag .rm:hover { opacity: 1; }
.queue-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Run / Reset Buttons ---------- */
.sim-controls {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.run-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: var(--success);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: opacity 0.2s, transform 0.2s;
}
.run-btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.run-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.reset-btn {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.reset-btn:hover { background: rgba(var(--primary-rgb),0.08); }

/* ---------- Command Counter ---------- */
.cmd-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}
.cmd-count-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
}
.cmd-count-num.over { color: var(--danger, #dc2626); }

/* ---------- Result Panel ---------- */
.result-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-width: 320px;
  width: calc(100vw - 48px);
  z-index: 500;
  display: none;
}
.result-panel.open {
  display: block;
  animation: slideInUp 0.3s ease-out;
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-panel-close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem;
}

/* ---------- XP Toast ---------- */
.xp-toast {
  position: fixed;
  top: 80px;
  right: 24px;
  padding: 14px 20px;
  background: #16a34a;
  color: #fff;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 600;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(22,163,74,0.4);
  animation: fadeDown 0.35s ease-out;
}
.xp-toast.show {
  display: flex;
  animation: fadeDown 0.35s ease-out;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Badge Popup ---------- */
.badge-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: #1B2D5B;
  border: 1px solid rgba(var(--primary-rgb),0.3);
  border-radius: 20px;
  padding: 36px 40px;
  text-align: center;
  z-index: 700;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: none;
}
.badge-popup.show {
  display: block;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes popIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.badge-popup .bp-icon { font-size: 3.5rem; margin-bottom: 12px; }
.badge-popup .bp-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--primary); margin-bottom: 6px;
}
.badge-popup .bp-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem; font-weight: 700; color: #fff;
}
.badge-popup .bp-close {
  margin-top: 20px;
  padding: 9px 24px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ---------- Hint Collapse ---------- */
.hint-toggle {
  background: rgba(var(--primary-rgb),0.07);
  border: 1px solid rgba(var(--primary-rgb),0.15);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: background 0.2s;
}
.hint-toggle:hover { background: rgba(var(--primary-rgb),0.12); }
.hint-body {
  display: none;
  padding: 10px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.hint-body.open { display: block; }

/* ---------- Puzzle Breadcrumb ---------- */
.puzzle-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.puzzle-breadcrumb a { color: var(--primary); text-decoration: none; }
.puzzle-breadcrumb a:hover { text-decoration: underline; }
.puzzle-breadcrumb i { font-size: 0.6rem; }

/* ---------- Stat Chips ---------- */
.puzzle-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.stat-chip.xp { background: rgba(22,163,74,0.1); color: var(--success); border: 1px solid rgba(22,163,74,0.2); }
.stat-chip.attempts { background: rgba(var(--primary-rgb),0.1); color: var(--primary); border: 1px solid rgba(var(--primary-rgb),0.2); }
.stat-chip.best { background: rgba(var(--secondary-rgb),0.1); color: var(--text-heading); border: 1px solid var(--dark-border); }

/* ---------- Mobile Tabs ---------- */
.puzzle-tab-nav {
  display: none;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--dark-border);
  margin-bottom: 16px;
}
.puzzle-tab-btn {
  flex: 1;
  padding: 10px 8px;
  background: var(--dark-card);
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  border-right: 1px solid var(--dark-border);
  transition: all 0.2s;
}
.puzzle-tab-btn:last-child { border-right: none; }
.puzzle-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ---------- Leaderboard ---------- */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.lb-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--dark-border);
}
.lb-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--dark-border);
  color: var(--text-heading);
  vertical-align: middle;
}
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr:hover td { background: rgba(var(--primary-rgb),0.03); }

.lb-row-me td {
  background: rgba(var(--primary-rgb),0.08);
  border-left: 3px solid var(--primary);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
}
.rank-1 { background: rgba(251,191,36,0.2); color: #f59e0b; border: 1px solid rgba(251,191,36,0.4); }
.rank-2 { background: rgba(148,163,184,0.2); color: #94a3b8; border: 1px solid rgba(148,163,184,0.4); }
.rank-3 { background: rgba(180,123,67,0.2);  color: #b47b43; border: 1px solid rgba(180,123,67,0.4); }
.rank-n { background: rgba(var(--primary-rgb),0.07); color: var(--text-muted); border: 1px solid var(--dark-border); font-size: 0.75rem; }

/* ---------- Lab Section Tabs ---------- */
.lb-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}
.lb-tab-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--dark-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.2s;
}
.lb-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Profile Page ---------- */
.profile-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.chapter-progress-group { margin-bottom: 28px; }
.chapter-progress-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.puzzle-done-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.puzzle-done-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(22,163,74,0.07);
  border: 1px solid rgba(22,163,74,0.15);
  font-size: 0.85rem;
  color: var(--text-heading);
}
.puzzle-done-item .done-icon { color: var(--success); font-size: 0.9rem; }
.puzzle-done-item .done-xp  { font-size: 0.75rem; color: var(--success); font-weight: 700; }

/* ---------- Login CTA Banner ---------- */
.login-cta-banner {
  background: rgba(var(--primary-rgb),0.07);
  border: 1px solid rgba(var(--primary-rgb),0.2);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.login-cta-banner p { font-size: 0.88rem; color: var(--text-muted); }
.login-cta-banner a {
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.login-cta-banner a:hover { opacity: 0.88; }

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Admin Stat Cards ---------- */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card-mini {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-top: 3px solid var(--primary);
  border-radius: 14px;
  padding: 18px 20px;
}
.stat-card-mini .sc-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1;
}
.stat-card-mini .sc-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- CSS Level Bar Chart ---------- */
.level-chart { display: flex; flex-direction: column; gap: 10px; }
.level-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.level-bar-label { width: 60px; color: var(--text-muted); font-weight: 600; text-align: right; flex-shrink: 0; }
.level-bar-track {
  flex: 1;
  height: 20px;
  background: rgba(var(--primary-rgb),0.08);
  border-radius: 4px;
  overflow: hidden;
}
.level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent, #FF9A40));
  border-radius: 4px;
  transition: width 0.6s ease;
}
.level-bar-count { width: 36px; font-weight: 700; color: var(--text-heading); font-size: 0.8rem; }

/* ---------- Dark Theme Overrides ---------- */
body[data-theme="turuncu"] .chapter-card,
body[data-theme="lacivert"] .chapter-card {
  background: rgba(15,23,42,0.85);
  border-color: rgba(var(--primary-rgb),0.15);
}
body[data-theme="turuncu"] .puzzle-info-panel,
body[data-theme="turuncu"] .puzzle-sim-panel,
body[data-theme="turuncu"] .puzzle-cmd-panel,
body[data-theme="lacivert"] .puzzle-info-panel,
body[data-theme="lacivert"] .puzzle-sim-panel,
body[data-theme="lacivert"] .puzzle-cmd-panel {
  background: rgba(13,27,53,0.9);
}
body[data-theme="turuncu"] .badge-item,
body[data-theme="lacivert"] .badge-item {
  background: rgba(13,27,53,0.85);
}
body[data-theme="turuncu"] .stat-card-mini,
body[data-theme="lacivert"] .stat-card-mini {
  background: rgba(13,27,53,0.85);
}
body[data-theme="turuncu"] .lb-table td,
body[data-theme="lacivert"] .lb-table td {
  color: #e2e8f0;
}
body[data-theme="turuncu"] .result-panel,
body[data-theme="lacivert"] .result-panel {
  background: #0d1b35;
}
body[data-theme="turuncu"] .cmd-queue,
body[data-theme="lacivert"] .cmd-queue {
  border-color: rgba(var(--primary-rgb),0.2);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .puzzle-layout {
    grid-template-columns: 260px 1fr 240px;
  }
}

@media (max-width: 768px) {
  .lab-hero h1 { font-size: 1.8rem; }
  .chapter-grid { grid-template-columns: 1fr; }

  .puzzle-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .puzzle-tab-nav { display: flex; }

  .puzzle-info-panel,
  .puzzle-sim-panel,
  .puzzle-cmd-panel {
    display: none;
  }
  .puzzle-info-panel.tab-active,
  .puzzle-sim-panel.tab-active,
  .puzzle-cmd-panel.tab-active {
    display: flex;
    flex-direction: column;
  }
  .puzzle-sim-panel.tab-active { align-items: center; }

  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  .login-cta-banner { flex-direction: column; align-items: flex-start; }

  .stat-cards-row { grid-template-columns: 1fr 1fr; }

  .lb-table th:nth-child(4),
  .lb-table td:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .lab-hero { padding: 40px 0; min-height: 200px; }
  .lab-hero h1 { font-size: 1.4rem; }
  .stat-cards-row { grid-template-columns: 1fr; }
}


/* ============================================================
   lab/profilim.html — profil sayfa stilleri
   ============================================================ */

.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.chapter-progress-group { margin-bottom: 16px; }
.chapter-progress-title {
  font-weight: 700;
  color: var(--text-heading);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.puzzle-done-list { display: flex; flex-direction: column; gap: 6px; }
.puzzle-done-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(var(--primary-rgb),0.04);
  border: 1px solid var(--dark-border);
  font-size: 0.82rem;
  color: var(--text-heading);
}
.done-icon { color: var(--success); font-size: 0.85rem; }
.done-xp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: #f59e0b;
  font-weight: 700;
}
@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
}

