:root {
  --bg: #0a0e14;
  --surface: #111820;
  --card: #151d28;
  --border: rgba(110, 231, 183, 0.15);
  --text: #e6edf3;
  --text-soft: #b8c5d6;
  --muted: #8b9cb3;
  --green: #6ee7b7;
  --accent: #6ee7b7;
  --accent-dim: rgba(110, 231, 183, 0.35);
  --blue: #60a5fa;
  --purple: #a78bfa;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Segoe UI", system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", Consolas, monospace;
  --glow: 0 0 24px rgba(110, 231, 183, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Browser <button> defaults to dark text — force readable labels in tasks */
button.match-card,
button.order-block,
button.folder-card,
button.level-chip,
button.tree-item {
  font-family: inherit;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
}

.level-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(110, 231, 183, 0.12);
  flex-wrap: wrap;
}
.level-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.28);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.level-title { font-size: 1.15rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.quiz-intro { color: var(--text-soft); font-size: 0.9rem; margin-bottom: 1rem; }

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(110, 231, 183, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 231, 183, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* TOP BAR */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 14, 20, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.top-bar__brand { display: flex; align-items: center; gap: 0.75rem; }
.top-bar__icon { font-size: 1.5rem; }
.top-bar__title { font-size: 1rem; font-weight: 700; color: var(--green); }
.top-bar__tagline { font-size: 0.72rem; color: var(--muted); }

.reviewer-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--amber);
}
.reviewer-banner.hidden { display: none; }
.btn-review-skip {
  padding: 0.2rem 0.55rem;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 4px;
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-review-skip:hover { background: rgba(251, 191, 36, 0.3); }

.reviewer-key {
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--amber);
  line-height: 1.5;
}
.reviewer-key strong { color: #fde68a; }
.reviewer-key pre {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #fde68a;
  white-space: pre-wrap;
}

.answer-btn--review-hint {
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
}

.user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.user-stats strong { color: var(--green); }

.progress-wrap { flex: 1; min-width: 180px; max-width: 320px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 99px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(110, 231, 183, 0.4);
}

/* LAYOUT */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.game-area {
  padding: 1.25rem;
  min-height: calc(100vh - 60px);
  min-width: 0;
}

.terminal-panel {
  border-left: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  padding: 1rem;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
}

.terminal {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--glow);
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--border);
}
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }
.terminal__title { font-size: 0.7rem; color: var(--muted); margin-left: 0.5rem; font-family: var(--font-mono); }

.terminal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.terminal__line { margin-bottom: 0.35rem; color: var(--green); }
.terminal__line--dim { color: var(--muted); }
.terminal__line--success { color: var(--blue); }

/* SCREENS */
.screen { display: none; }
.screen--active { display: block; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--glow);
  max-width: 720px;
  margin: 0 auto;
}

.card--welcome { text-align: center; padding: 2rem; }
.card__badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.3);
  border-radius: 99px;
  font-size: 0.7rem;
  color: var(--green);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.screen__title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.screen__subtitle { color: var(--muted); margin-bottom: 1.25rem; font-size: 0.95rem; }

/* FORMS */
.welcome-form { text-align: left; }
.form-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}
.form-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.15);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}
.btn--primary:hover { box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4); }
.btn--secondary {
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn--hint {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.3);
  font-size: 0.8rem;
  padding: 0.5rem 0.85rem;
}
.btn--danger { color: var(--red); border-color: rgba(248, 113, 113, 0.3); }
.btn--admin-link { margin-top: 1rem; font-size: 0.8rem; }

.message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.message--error { background: rgba(248, 113, 113, 0.1); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.25); }
.message--success { background: rgba(110, 231, 183, 0.1); color: var(--green); border: 1px solid rgba(110, 231, 183, 0.25); }

/* DASHBOARD */
.dashboard { max-width: 640px; margin: 0 auto; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  text-align: center;
}
.stat-card__value { font-size: 1.25rem; font-weight: 700; color: var(--green); }
.stat-card__label { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; }

/* Exam path — sequential areas */
.exam-path { margin-bottom: 1.25rem; }
.exam-path__lead {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.exam-path__steps {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.exam-step {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.85rem;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.exam-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.1rem;
}
.exam-step__num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.exam-step__line {
  flex: 1;
  width: 2px;
  min-height: 1.25rem;
  margin-top: 0.35rem;
  background: linear-gradient(180deg, var(--border), transparent);
  border-radius: 1px;
}
.exam-step:last-child .exam-step__line { display: none; }
.exam-step__body {
  flex: 1;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.exam-step:hover .exam-step__body {
  border-color: rgba(110, 231, 183, 0.35);
  box-shadow: var(--glow);
  transform: translateX(3px);
}
.exam-step:hover .exam-step__num {
  border-color: rgba(110, 231, 183, 0.5);
  color: var(--green);
}
.exam-step__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.exam-step__icon { font-size: 1.35rem; line-height: 1; }
.exam-step__title { font-weight: 700; font-size: 1rem; }
.exam-step__desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}
.exam-step__status {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(110, 231, 183, 0.08);
  color: var(--green);
}
.exam-step--next .exam-step__body {
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15), 0 0 24px rgba(167, 139, 250, 0.08);
}
.exam-step--next .exam-step__num {
  border-color: var(--accent);
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.25);
}
.exam-step--next .exam-step__status {
  background: rgba(167, 139, 250, 0.12);
  color: var(--accent);
}
.exam-step--done .exam-step__num {
  border-color: var(--green);
  background: rgba(110, 231, 183, 0.15);
  color: var(--green);
}
.exam-step--done .exam-step__num::after {
  content: "✓";
  font-size: 0.9rem;
}
.exam-step--done .exam-step__num {
  font-size: 0;
}
.exam-step--done .exam-step__body {
  opacity: 0.72;
  border-color: rgba(110, 231, 183, 0.2);
}
.exam-step--done .exam-step__status {
  background: rgba(110, 231, 183, 0.1);
  color: rgba(110, 231, 183, 0.85);
}
.exam-step--locked {
  pointer-events: none;
  cursor: default;
}
.exam-step--locked:hover .exam-step__body {
  transform: none;
  box-shadow: none;
}

.exam-path__submit {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(110, 231, 183, 0.18);
  text-align: center;
}

.exam-path__submit-note {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.exam-path__submit-done {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.3);
  border-radius: var(--radius);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.exam-submit-btn {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.05rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  box-shadow: 0 0 28px rgba(110, 231, 183, 0.22);
}

.exam-submit-btn--ready {
  animation: examSubmitPulse 2.2s ease-in-out infinite;
}

.exam-submit-btn--done {
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  box-shadow: none;
  background: rgba(110, 231, 183, 0.12);
  color: var(--green);
  border: 1px solid rgba(110, 231, 183, 0.35);
}

@keyframes examSubmitPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(110, 231, 183, 0.2); transform: scale(1); }
  50% { box-shadow: 0 0 36px rgba(110, 231, 183, 0.38); transform: scale(1.02); }
}

.result-actions .btn-next-exam-area { min-width: 14rem; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.mode-card:hover {
  border-color: rgba(110, 231, 183, 0.4);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.mode-card--featured { border-color: rgba(167, 139, 250, 0.35); }
.mode-card--progress { border-color: rgba(96, 165, 250, 0.35); }
.mode-card__icon { font-size: 1.75rem; }
.mode-card__title { font-weight: 700; font-size: 1rem; }
.mode-card__desc { font-size: 0.78rem; color: var(--muted); }
.mode-card__status { font-size: 0.72rem; color: var(--green); margin-top: 0.25rem; }
.mode-card--locked {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.35);
}
.exam-hints-summary {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  white-space: nowrap;
}

.dashboard-total { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }

/* QUIZ */
.card--question { max-width: 800px; }
.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.question-meta__left { display: flex; gap: 0.5rem; }
.tag {
  padding: 0.2rem 0.6rem;
  background: rgba(96, 165, 250, 0.12);
  border-radius: 99px;
  font-size: 0.7rem;
  color: var(--blue);
}
.tag--diff { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.question-number { font-size: 0.8rem; color: var(--muted); }
.question-text { font-size: 1.05rem; margin-bottom: 1.25rem; line-height: 1.6; }

.answers { display: flex; flex-direction: column; gap: 0.5rem; }
.answer-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}
.answer-btn:hover:not(:disabled) { border-color: var(--green); background: rgba(110, 231, 183, 0.05); }
.answer-btn--correct { border-color: var(--green); background: rgba(110, 231, 183, 0.12); }
.answer-btn--wrong { border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.06); }
.answer-btn--selected { border-color: var(--accent); background: rgba(167, 139, 250, 0.1); }
.exam-instructions {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(167, 139, 250, 0.06);
}
.exam-instructions__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--accent);
}
.exam-instructions__list { margin: 0; }
.answer-btn:disabled { cursor: default; }
.answer-btn__letter {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(110, 231, 183, 0.15);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
}

.live-stats {
  margin: 1rem 0;
  padding: 0.65rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--muted);
}
.live-stats strong { color: var(--green); }

.feedback { margin: 1rem 0; padding: 0.75rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.feedback--success { background: rgba(110, 231, 183, 0.1); color: var(--green); }
.feedback--learn { background: rgba(251, 191, 36, 0.08); color: var(--amber); }

.explanation-box {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: var(--radius-sm);
}
.explanation-box__label { font-size: 0.7rem; color: var(--blue); text-transform: uppercase; letter-spacing: 0.05em; }
.explanation-box p { color: var(--text); line-height: 1.55; }

/* GAME / POM LAYOUT */
.game-layout, .pom-layout, .framework-layout {
  display: grid;
  gap: 1.25rem;
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: start;
}
.game-layout.mode-shell,
.pom-layout.mode-shell--narrow {
  grid-template-columns: auto minmax(0, 1fr);
}
.pom-layout, .framework-layout { grid-template-columns: auto minmax(0, 1fr) 260px; }

.mode-main, .game-main, .pom-main, .framework-main {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.mode-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.level-nav-panel {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.65rem;
  background: rgba(21, 29, 40, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  backdrop-filter: blur(8px);
}
.level-nav-panel__title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}
.level-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}
.level-chip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.level-chip:hover:not(:disabled) {
  border-color: rgba(110, 231, 183, 0.4);
  color: var(--text-soft);
  transform: translateY(-1px);
}
.level-chip--active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(110, 231, 183, 0.1);
  box-shadow: var(--glow);
}
.level-chip--done { background: rgba(110, 231, 183, 0.14); color: var(--green); border-color: rgba(110, 231, 183, 0.35); }
.level-chip--answered { background: rgba(251, 191, 36, 0.14); color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }

.card--level {
  padding: 1.35rem 1.5rem 1.25rem;
  max-width: none;
  width: 100%;
  margin: 0;
}
.level-context {
  margin: 1rem 0 0.25rem;
}
.learn-box {
  margin-bottom: 0;
  padding: 0.85rem 1rem;
  background: rgba(167, 139, 250, 0.07);
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius-sm);
}
.learn-box__label {
  display: block;
  font-size: 0.68rem;
  color: var(--purple);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.learn-box p { color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }

.task-area { margin: 1.15rem 0 0.5rem; color: var(--text); width: 100%; }
.task-area .form-input,
#fw-task-area .form-input {
  position: relative;
  z-index: 1;
}
.level-footer .feedback,
.level-footer .explanation-box,
.card--level > .feedback,
.card--level > .explanation-box {
  margin-top: 0.75rem;
  margin-bottom: 0;
}
.task-area .task-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}
.task-area .answers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.task-area .answer-inline,
.task-inputs .answer-inline,
#fw-task-area .answer-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.task-area .answer-inline:hover,
.task-inputs .answer-inline:hover,
#fw-task-area .answer-inline:hover {
  border-color: rgba(110, 231, 183, 0.45);
  background: rgba(110, 231, 183, 0.04);
}
.task-area .answer-inline--picked,
.task-area .answer-inline:has(input:checked),
.task-inputs .answer-inline--picked,
.task-inputs .answer-inline:has(input:checked),
#fw-task-area .answer-inline--picked,
#fw-task-area .answer-inline:has(input:checked) {
  border-color: var(--green);
  background: rgba(110, 231, 183, 0.14);
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.35), inset 0 0 0 1px rgba(110, 231, 183, 0.08);
}
.task-area .answer-inline input[type="radio"],
.task-inputs .answer-inline input[type="radio"],
#fw-task-area .answer-inline input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 0.15rem;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.task-area .answer-inline input[type="radio"]:checked,
.task-inputs .answer-inline input[type="radio"]:checked,
#fw-task-area .answer-inline input[type="radio"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px rgba(21, 29, 40, 0.95);
}
.task-area .answer-inline input[type="radio"]:disabled,
.task-inputs .answer-inline input[type="radio"]:disabled,
#fw-task-area .answer-inline input[type="radio"]:disabled {
  cursor: default;
  opacity: 1;
}
.task-area .answer-inline--picked span,
.task-area .answer-inline:has(input:checked) span,
.task-inputs .answer-inline--picked span,
.task-inputs .answer-inline:has(input:checked) span,
#fw-task-area .answer-inline--picked span,
#fw-task-area .answer-inline:has(input:checked) span {
  color: var(--text);
  font-weight: 600;
}
.task-area .answer-inline span,
.task-inputs .answer-inline span,
#fw-task-area .answer-inline span {
  color: var(--text);
  flex: 1;
  line-height: 1.5;
  font-size: 0.9rem;
}
.task-area p { color: var(--text); margin-bottom: 0.65rem; }
.task-scenario { color: var(--text-soft); font-size: 0.9rem; }
.sub-question { margin: 1rem 0; }
.sub-question p { color: var(--text); }
.sub-question strong { color: var(--text-soft); }

.level-footer {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(110, 231, 183, 0.12);
}
.level-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.card--level > .level-actions {
  margin-top: 0.5rem;
}
.level-actions .btn--hint { margin-right: auto; }
.level-actions .btn--primary { min-width: 9.5rem; }

.btn--pulse {
  animation: btn-pulse-soft 2.2s ease-in-out infinite;
}

@keyframes btn-pulse-soft {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(110, 231, 183, 0.45);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(110, 231, 183, 0);
    transform: scale(1.02);
  }
}

.framework-main { min-width: 0; }

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.folder-card {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
}

.folder-card:hover { border-color: var(--accent-dim); }

.folder-card--active {
  border-color: var(--accent);
  background: rgba(63, 185, 80, 0.12);
  color: var(--accent);
}

.task-note {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}

.order-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}


#btn-pom-next:not(.hidden) {
  display: inline-flex !important;
  box-shadow: 0 0 0 2px rgba(63, 185, 80, 0.35);
}

.code-snippet, .complete-code {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #79c0ff;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 0.75rem 0;
}

.scenario-box {
  padding: 1rem 1.1rem;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.scenario-box::before {
  content: "Scenarij";
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  margin-bottom: 0.4rem;
}

/* Expected vs Actual */
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.match-box {
  min-height: 100px;
  padding: 1rem;
  border: 2px dashed rgba(110, 231, 183, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  color: var(--text);
}
.match-box__title {
  font-size: 0.75rem;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#match-expected,
#match-actual,
.match-box__content {
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.55;
  min-height: 1.25rem;
}
.match-box--filled { border-style: solid; border-color: var(--green); }
.match-cards { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.match-card {
  display: block;
  width: 100%;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.match-card:hover {
  border-color: var(--blue);
  background: rgba(96, 165, 250, 0.08);
}
.match-card--used { opacity: 0.45; pointer-events: none; }

/* Order blocks */
.order-selected {
  min-height: 48px;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  color: var(--text);
}
.order-chip {
  display: block;
  padding: 0.35rem 0.5rem;
  margin: 0.25rem 0;
  background: rgba(110, 231, 183, 0.1);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.45;
}
.order-options { display: flex; flex-direction: column; gap: 0.35rem; }
.order-block {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.order-block:hover {
  border-color: var(--green);
  background: rgba(110, 231, 183, 0.06);
}
.order-block--selected {
  border-color: var(--purple);
  background: rgba(167, 139, 250, 0.12);
  color: var(--text);
}

/* Table sim */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}
.data-table th, .data-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
.data-table th { background: rgba(0,0,0,0.3); color: var(--text-soft); }
.data-table td { color: var(--text); }

/* POM CODE EDITOR */
.code-editor {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  color: #c9d1d9;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.code-editor .blank-select, .code-editor .blank-input {
  display: inline-block;
  min-width: 120px;
  padding: 0.15rem 0.35rem;
  background: rgba(110, 231, 183, 0.1);
  border: 1px dashed var(--green);
  border-radius: 4px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.code-editor .blank-input {
  min-width: 100px;
  background: rgba(96, 165, 250, 0.1);
  border-color: var(--blue);
  color: var(--blue);
}

.task-inputs { margin: 1rem 0; color: var(--text); }
.task-inputs label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--text-soft); }
.task-inputs select, .task-inputs input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.task-inputs select option {
  background: var(--card);
  color: var(--text);
}

.hints-counter {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.65rem;
  text-align: right;
}

/* PROJECT PREVIEW */
.project-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 80px;
}
.project-preview__header {
  padding: 0.6rem 0.85rem;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}
.project-tree { padding: 0.65rem; overflow-y: auto; flex: 1; max-height: 200px; }
.tree-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.3rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  cursor: pointer;
  border-radius: 4px;
}
.tree-item:hover { background: rgba(110, 231, 183, 0.08); }
.tree-item--indent-1 { padding-left: 1rem; }
.tree-item--indent-2 { padding-left: 1.75rem; }
.tree-empty { font-size: 0.72rem; color: var(--muted); font-style: italic; padding: 0.5rem; }

.project-file-view { border-top: 1px solid var(--border); padding: 0.65rem; overflow: auto; max-height: 280px; }
.project-file-path { font-size: 0.68rem; color: var(--blue); margin-bottom: 0.5rem; font-family: var(--font-mono); }
.project-file-code { font-family: var(--font-mono); font-size: 0.65rem; color: #79c0ff; white-space: pre-wrap; }

/* RESULTS */
.card--result { text-align: center; max-width: 560px; }
.result-animate { animation: resultPop 0.5s ease; }
@keyframes resultPop { from { transform: scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
.result-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.result__title { margin-bottom: 1rem; }
.result-details { text-align: left; margin: 1rem 0; font-size: 0.9rem; }
.result-details p { margin: 0.35rem 0; }
.result-badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(110,231,183,0.15), rgba(96,165,250,0.15));
  border: 1px solid var(--border);
  border-radius: 99px;
  font-weight: 700;
  color: var(--green);
  margin: 0.75rem 0;
}
.result-message { color: var(--muted); font-size: 0.9rem; margin: 1rem 0; line-height: 1.6; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; }

.copy-fallback {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.copy-status { font-size: 0.8rem; color: var(--green); margin-top: 0.5rem; }

.intro-list { text-align: left; margin: 1rem 0 1.5rem; padding-left: 1.25rem; color: var(--muted); font-size: 0.9rem; }
.intro-list li { margin: 0.35rem 0; }
.intro-highlight { margin-bottom: 1rem; color: var(--purple); }

.intro-highlight--url a {
  color: var(--accent);
  word-break: break-all;
}

.pom-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pom-page-ref {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--accent-dim);
  background: rgba(63, 185, 80, 0.06);
}

.pom-page-ref__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pom-page-ref__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.pom-page-ref__hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.pom-page-ref__details summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--purple);
  margin-bottom: 0.5rem;
}

.pom-page-ref__html {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  max-height: 180px;
  overflow: auto;
}

.pom-page-ref__note {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.pom-page-ref__note code {
  color: var(--warn);
  font-size: 0.76rem;
}

.btn--sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.admin-sync-status {
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sync-ok { color: var(--accent); font-weight: 600; }
.sync-off { color: var(--warn); font-weight: 600; }

.admin-activity-log {
  max-height: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

.activity-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
}

.activity-tag--login { color: var(--accent); border-color: var(--accent-dim); }
.activity-tag--logout { color: var(--muted); }
.activity-tag--mod-start { color: #60a5fa; }
.activity-tag--mod-complete { color: var(--purple); }

/* PROGRESS */
.progress-summary { margin-bottom: 1.5rem; }
.section-title { font-size: 1rem; margin: 1.25rem 0 0.75rem; color: var(--muted); }
.badge-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.badge-item {
  padding: 0.4rem 0.85rem;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--purple);
}

/* TABLES */
.attempts-table-wrap {
  margin-bottom: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}
.data-table-admin {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  table-layout: fixed;
}
.data-table-admin th, .data-table-admin td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  text-align: left;
}
.data-table-admin th { background: rgba(0,0,0,0.35); color: var(--muted); }
.data-table-admin tr:hover td { background: rgba(110, 231, 183, 0.03); }
.data-table-admin--students th,
.data-table-admin--students td {
  font-size: 0.72rem;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  padding: 0.4rem 0.35rem;
  line-height: 1.35;
}
.data-table-admin--students th:nth-child(1),
.data-table-admin--students td:nth-child(1) { width: 9%; }
.data-table-admin--students th:nth-child(2),
.data-table-admin--students td:nth-child(2) { width: 11%; word-break: break-all; }
.data-table-admin--students th:nth-child(3),
.data-table-admin--students td:nth-child(3) { width: 8%; }
.data-table-admin--students th:nth-child(4),
.data-table-admin--students td:nth-child(4),
.data-table-admin--students th:nth-child(5),
.data-table-admin--students td:nth-child(5),
.data-table-admin--students th:nth-child(6),
.data-table-admin--students td:nth-child(6),
.data-table-admin--students th:nth-child(7),
.data-table-admin--students td:nth-child(7),
.data-table-admin--students th:nth-child(8),
.data-table-admin--students td:nth-child(8),
.data-table-admin--students th:nth-child(9),
.data-table-admin--students td:nth-child(9) { width: 6%; text-align: center; }
.data-table-admin--students th:nth-child(10),
.data-table-admin--students td:nth-child(10) { width: 7%; text-align: center; }
.data-table-admin--students th:nth-child(11),
.data-table-admin--students td:nth-child(11) { width: 4%; text-align: center; }
.data-table-admin--students th:nth-child(12),
.data-table-admin--students td:nth-child(12) { width: 4%; text-align: center; }
.data-table-admin--students th:nth-child(13),
.data-table-admin--students td:nth-child(13) { width: 6%; text-align: center; }
.data-table-admin--students th:nth-child(14),
.data-table-admin--students td:nth-child(14) { width: 5%; text-align: center; }
.data-table-admin--students .exam-status {
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  white-space: normal;
  line-height: 1.25;
}
.data-table-admin--submissions {
  table-layout: auto;
}
.data-table-admin--submissions th,
.data-table-admin--submissions td {
  font-size: 0.75rem;
  white-space: normal;
  word-break: break-word;
  vertical-align: top;
  padding: 0.4rem 0.45rem;
}

.exam-status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.exam-status--pass { color: var(--green); background: rgba(110, 231, 183, 0.12); border-color: rgba(110, 231, 183, 0.35); }
.exam-status--fail { color: var(--red); background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); }
.exam-status--progress { color: var(--amber); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.exam-status--idle { color: var(--muted); background: rgba(0, 0, 0, 0.2); border-color: var(--border); }

.section-title__note {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.admin-submission-modal.arena-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.admin-submission-modal .arena-modal__backdrop {
  background: rgba(4, 8, 14, 0.94);
}

.admin-submission-modal__panel {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.5rem 1.25rem;
  animation: none;
  box-shadow: none;
}

.admin-submission-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.admin-submission-modal__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.admin-submission-modal__title {
  text-align: left;
  margin: 0;
  font-size: 1.2rem;
}

.admin-submission-modal__body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding-right: 0.25rem;
}

.submission-detail__header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(110, 231, 183, 0.12);
  font-size: 0.9rem;
}

.submission-detail__mode {
  margin-bottom: 1.5rem;
}

.submission-detail__mode h4 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.submission-detail__table-wrap {
  overflow-x: hidden;
}

.submission-detail__table {
  width: 100%;
  font-size: 0.88rem;
  table-layout: fixed;
}

.submission-detail__table th,
.submission-detail__table td {
  vertical-align: top;
  line-height: 1.45;
  padding: 0.55rem 0.65rem;
}

.submission-detail__table th:nth-child(1),
.submission-detail__table td:nth-child(1) { width: 2.5rem; text-align: center; }
.submission-detail__table th:nth-child(2),
.submission-detail__table td:nth-child(2) { width: 10%; }
.submission-detail__table th:nth-child(3),
.submission-detail__table td:nth-child(3) { width: 26%; }
.submission-detail__table th:nth-child(4),
.submission-detail__table td:nth-child(4) { width: 30%; }
.submission-detail__table th:nth-child(5),
.submission-detail__table td:nth-child(5) { width: 28%; }
.submission-detail__table th:nth-child(6),
.submission-detail__table td:nth-child(6) { width: 2.5rem; text-align: center; }

.submission-detail__table .detail-q,
.submission-detail__table .detail-picked,
.submission-detail__table .detail-correct {
  white-space: normal;
  word-break: break-word;
  max-width: none;
  min-width: 0;
}

.detail-row--ok td { background: rgba(110, 231, 183, 0.06); }
.detail-row--bad td { background: rgba(248, 113, 113, 0.06); }

.detail-mark {
  font-weight: 700;
  text-align: center;
}

.data-table-admin--submissions td { font-size: 0.75rem; }

.btn--danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}
.btn--danger:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
}

/* ADMIN */
.admin-dashboard { max-width: 100%; margin: 0 auto; width: 100%; }
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}
.admin-filters select {
  padding: 0.4rem 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  margin-left: 0.35rem;
}

.leaderboard { margin-bottom: 1.5rem; }
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.leaderboard-rank { font-size: 1.25rem; font-weight: 700; color: var(--amber); min-width: 2rem; }
.leaderboard-name { flex: 1; font-weight: 600; }
.leaderboard-score { color: var(--green); font-weight: 700; }

.answer-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.answer-inline:hover { border-color: var(--green); }
.answer-inline--picked,
.answer-inline:has(input:checked) {
  border-color: var(--green);
  background: rgba(110, 231, 183, 0.12);
  box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.3);
}
.answer-inline input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 0.2rem;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  border: 2px solid var(--muted);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.answer-inline input[type="radio"]:checked {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 3px rgba(21, 29, 40, 0.95);
}
.answer-inline span { color: var(--text); flex: 1; line-height: 1.45; }
.answer-inline--picked span,
.answer-inline:has(input:checked) span { font-weight: 600; }
.answer-code { color: #c9d1d9; }

.shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .terminal-panel {
    position: relative;
    top: 0;
    height: 200px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .pom-layout, .framework-layout { grid-template-columns: 1fr; }
  .project-preview { position: relative; top: 0; max-height: none; }
  .game-layout.mode-shell,
  .pom-layout.mode-shell--narrow { grid-template-columns: 1fr; }
  .level-nav-panel {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 0.65rem 0.85rem;
    width: 100%;
  }
  .level-nav-panel__title {
    margin-bottom: 0;
    padding-right: 0.5rem;
    border-right: 1px solid var(--border);
    min-width: 3.5rem;
  }
  .level-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex: 1;
  }
}

@media (max-width: 600px) {
  .match-grid { grid-template-columns: 1fr; }
  .top-bar__title { font-size: 0.85rem; }
  .card { padding: 1rem; }
}

.card--journey { max-width: 920px; }

.student-exam-review {
  text-align: left;
  max-height: min(58vh, 640px);
  overflow: auto;
  margin: 1rem 0;
  padding-right: 0.25rem;
}

.student-review-mode {
  margin-bottom: 1.25rem;
}

.student-review-mode__title {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(110, 231, 183, 0.15);
  padding-bottom: 0.35rem;
}

.student-review-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.student-review-item {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.student-review-item__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.student-review-item__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.student-review-item__tag {
  font-size: 0.72rem;
  color: var(--green);
}

.student-review-item__q {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.student-review-item__a {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text);
}

.student-review-item__label {
  color: var(--muted);
  font-weight: 600;
}

/* ARENA MODAL */
body.arena-modal-open { overflow: hidden; }

.arena-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.arena-modal.hidden { display: none; }

.arena-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
}

.arena-modal__panel {
  position: relative;
  width: min(100%, 420px);
  padding: 1.75rem 1.5rem 1.5rem;
  background: linear-gradient(165deg, #182230 0%, #121a24 100%);
  border: 1px solid rgba(110, 231, 183, 0.22);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), var(--glow);
  text-align: center;
  animation: arenaModalIn 0.22s ease-out;
}

@keyframes arenaModalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.arena-modal__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(110, 231, 183, 0.1);
  border: 1px solid rgba(110, 231, 183, 0.25);
  border-radius: 50%;
}

.arena-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.65rem;
}

.arena-modal__message {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
}

.arena-modal__detail {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.arena-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.35rem;
}

.arena-modal__actions .btn {
  min-width: 7.5rem;
}

/* Admin — pregled predanog ispita (puni ekran, nadjačava .arena-modal__panel 420px) */
.admin-submission-modal.arena-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.admin-submission-modal .arena-modal__panel,
.admin-submission-modal__panel.arena-modal__panel {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 1rem 2rem 1.5rem;
  animation: none;
  box-shadow: none;
}

.admin-submission-modal__body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding-right: 0.5rem;
}

.submission-detail__header {
  font-size: 0.95rem;
}

.submission-detail__mode h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
