/* ═══ TERMINAL PAGE ═══ */
.terminal-page { background: var(--bg-deep); }

/* Status Bar */
.term-status-bar {
  position: sticky; top: 60px; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 24px;
  background: rgba(10, 10, 12, 0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: 13px;
}
.term-status-left { display: flex; align-items: center; gap: 16px; }
.term-status-right { display: flex; align-items: center; gap: 20px; }
.term-level { display: flex; align-items: center; gap: 8px; }
.term-level-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--terminal-green); color: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.term-level-name { color: var(--text-primary); font-weight: 500; }
.term-xp-mini { display: flex; align-items: center; gap: 8px; }
.term-xp-mini-bar {
  width: 120px; height: 6px; background: var(--bg-elevated);
  border-radius: 3px; overflow: hidden;
}
.term-xp-mini-fill {
  height: 100%; background: var(--terminal-green);
  border-radius: 3px; transition: width 0.5s ease;
  width: 0%;
}
.term-xp-mini span { color: var(--text-dim); font-size: 11px; }
.term-panke { color: var(--terminal-green); font-weight: 600; }
.term-panke small { font-weight: 400; opacity: 0.7; }
.term-streak { color: var(--text-secondary); }

/* Mission Select */
.term-mission-select { padding: 100px 40px 60px; max-width: 900px; margin: 0 auto; }
.term-mission-header { margin-bottom: 40px; }
.term-mission-header h1 {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 12px;
}
.term-mission-header p { color: var(--text-secondary); font-size: 15px; max-width: 500px; }
.term-mission-grid { display: flex; flex-direction: column; gap: 12px; }

.term-mission-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
}
.term-mission-card:hover { border-color: var(--terminal-green); transform: translateX(4px); }
.term-mission-card.locked { opacity: 0.4; cursor: not-allowed; }
.term-mission-card.locked:hover { border-color: var(--border-subtle); transform: none; }
.term-mission-card.completed { border-left: 3px solid var(--terminal-green); }

.term-mc-status {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.term-mc-status.complete { background: var(--terminal-green); color: var(--bg-deep); }
.term-mc-status.available { background: var(--bg-elevated); color: var(--terminal-green); border: 2px solid var(--terminal-green); }
.term-mc-status.locked-icon { background: var(--bg-elevated); color: var(--text-dim); }

.term-mc-info { flex: 1; }
.term-mc-info h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.term-mc-info span { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }
.term-mc-rewards { font-family: var(--font-mono); font-size: 12px; color: var(--terminal-green); text-align: right; }
.term-mc-rewards div { margin-bottom: 2px; }

/* Mission Active */
.term-mission-active { padding: 100px 40px 60px; max-width: 760px; margin: 0 auto; }

/* Briefing */
.term-briefing-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  color: var(--terminal-green); text-transform: uppercase; margin-bottom: 12px;
}
.term-briefing h1, .term-transmission h1 {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  color: var(--text-primary); margin-bottom: 16px;
}
.term-hook { font-size: 16px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; }
.term-objectives {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 20px; margin-bottom: 32px;
}
.term-objectives h4 {
  font-family: var(--font-mono); font-size: 12px; color: var(--terminal-green);
  letter-spacing: 1px; margin-bottom: 12px;
}
.term-objectives ul { list-style: none; padding: 0; margin: 0; }
.term-objectives li {
  padding: 6px 0; color: var(--text-secondary); font-size: 14px;
  padding-left: 20px; position: relative;
}
.term-objectives li::before { content: '→'; position: absolute; left: 0; color: var(--terminal-green); }

.btn-terminal {
  display: inline-block; padding: 12px 28px;
  background: transparent; border: 1px solid var(--terminal-green);
  color: var(--terminal-green); font-family: var(--font-mono);
  font-size: 14px; border-radius: 6px; cursor: pointer;
  transition: all 0.2s;
}
.btn-terminal:hover { background: var(--terminal-green); color: var(--bg-deep); }

/* Transmission */
.term-reading {
  color: var(--text-secondary); font-size: 15px; line-height: 1.8;
  margin-bottom: 32px;
}
.term-reading h2 { color: var(--text-primary); font-size: 20px; margin: 28px 0 12px; }
.term-reading h3 { color: var(--terminal-green); font-size: 16px; margin: 24px 0 8px; }
.term-reading blockquote {
  border-left: 3px solid var(--terminal-green); padding: 12px 16px;
  margin: 16px 0; background: var(--bg-card); border-radius: 0 8px 8px 0;
  font-style: italic;
}
.term-reading strong { color: var(--text-primary); }

/* Quiz */
.term-quiz { margin-bottom: 40px; }
.term-quiz-info { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; font-family: var(--font-mono); }

.quiz-question {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.quiz-question h4 {
  font-size: 14px; color: var(--text-primary); margin-bottom: 12px; line-height: 1.5;
}
.quiz-question .quiz-type {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.quiz-option {
  display: block; padding: 10px 14px; margin: 6px 0;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: 6px; color: var(--text-secondary); font-size: 14px;
  cursor: pointer; transition: all 0.2s;
}
.quiz-option:hover { border-color: var(--terminal-green); color: var(--text-primary); }
.quiz-option.selected { border-color: var(--terminal-green); color: var(--terminal-green); background: rgba(0,255,136,0.05); }
.quiz-option.correct { border-color: #22c55e; background: rgba(34,197,94,0.1); color: #22c55e; }
.quiz-option.wrong { border-color: #ef4444; background: rgba(239,68,68,0.1); color: #ef4444; }

.quiz-fill-input {
  width: 100%; padding: 10px 14px; background: var(--bg-elevated);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-primary); font-family: var(--font-mono); font-size: 14px;
}
.quiz-fill-input:focus { border-color: var(--terminal-green); outline: none; }

.quiz-feedback {
  margin-top: 10px; padding: 10px 14px; border-radius: 6px;
  font-size: 13px; line-height: 1.5; display: none;
}
.quiz-feedback.correct { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.quiz-feedback.wrong { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

#quizResult {
  margin-top: 20px; padding: 20px; border-radius: 10px;
  text-align: center; font-size: 18px; font-weight: 600;
}
#quizResult.pass { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
#quizResult.fail { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* Live Terminal */
.term-liveterminal { margin-bottom: 40px; }
.term-challenge-info {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.term-challenge-info h3 { font-size: 16px; color: var(--text-primary); margin-bottom: 8px; }
.term-challenge-info .challenge-objective {
  font-family: var(--font-mono); font-size: 13px; color: var(--terminal-green);
  margin-bottom: 6px;
}
.term-challenge-info .challenge-scenario { color: var(--text-secondary); font-size: 14px; }
.term-challenge-progress {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.term-challenge-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
}
.term-challenge-dot.done { background: var(--terminal-green); border-color: var(--terminal-green); }
.term-challenge-dot.active { border-color: var(--terminal-green); box-shadow: 0 0 8px var(--terminal-green-glow); }

.term-xterm-wrap {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
#xtermContainer { height: 300px; background: #0a0a0c; }
.term-challenge-controls {
  display: flex; justify-content: space-between; align-items: center;
}
.term-timer { font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); }

/* Hint popup */
.term-hint {
  background: var(--bg-card); border: 1px solid var(--terminal-green);
  border-radius: 8px; padding: 14px 18px; margin-top: 12px;
  font-size: 13px; color: var(--text-secondary);
  animation: fadeIn 0.3s ease;
}

/* After Action Report */
.term-aar { margin-bottom: 40px; }
.term-aar-reflection {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 20px; margin-bottom: 16px;
}
.term-aar-reflection label { display: block; color: var(--text-primary); font-size: 14px; margin-bottom: 10px; }
.term-aar-reflection textarea {
  width: 100%; min-height: 80px; padding: 12px; background: var(--bg-elevated);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-primary); font-family: var(--font-mono); font-size: 13px;
  resize: vertical;
}
.term-aar-reflection textarea:focus { border-color: var(--terminal-green); outline: none; }
.term-aar-nextstep {
  padding: 16px 20px; background: rgba(0,255,136,0.05);
  border: 1px solid rgba(0,255,136,0.15); border-radius: 10px;
  color: var(--text-secondary); font-size: 14px; margin-bottom: 16px;
}
.term-aar-nextstep strong { color: var(--terminal-green); }

/* Mission Complete */
.term-complete { text-align: center; padding: 60px 0; }
.term-complete-inner { max-width: 500px; margin: 0 auto; }
.term-complete-badge {
  font-size: 64px; margin-bottom: 16px;
  animation: badgePop 0.5s ease;
}
.term-complete h1 {
  font-family: var(--font-mono); font-size: 28px; color: var(--terminal-green);
  letter-spacing: 3px; margin-bottom: 24px;
}
.term-complete-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 32px;
}
.term-stat-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 16px;
}
.term-stat-card .term-stat-value {
  font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  color: var(--terminal-green);
}
.term-stat-card .term-stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.term-complete-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* Back button */
.term-back-btn {
  position: fixed; bottom: 24px; left: 24px;
  padding: 8px 16px; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: 6px;
  color: var(--text-dim); font-family: var(--font-mono); font-size: 12px;
  cursor: pointer; z-index: 50; transition: all 0.2s;
}
.term-back-btn:hover { border-color: var(--terminal-green); color: var(--terminal-green); }

/* Success flash */
.term-success-flash {
  position: fixed; inset: 0; background: rgba(0,255,136,0.08);
  pointer-events: none; z-index: 999;
  animation: successFlash 0.6s ease-out forwards;
}

/* Mobile */
@media (max-width: 640px) {
  .term-status-bar { padding: 8px 16px; font-size: 11px; }
  .term-xp-mini-bar { width: 60px; }
  .term-mission-select, .term-mission-active { padding: 80px 16px 40px; }
  .term-mission-header h1 { font-size: 24px; }
  #xtermContainer { height: 220px; }
  .term-complete-stats { grid-template-columns: 1fr; }
}

/* Mobile command suggestions */
.term-mobile-cmds {
  display: none; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px; background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
}
@media (max-width: 640px) {
  .term-mobile-cmds { display: flex; }
}
.term-mobile-cmd {
  padding: 6px 12px; background: var(--bg-elevated);
  border: 1px solid var(--border-subtle); border-radius: 4px;
  color: var(--terminal-green); font-family: var(--font-mono);
  font-size: 12px; cursor: pointer;
}

/* Animations */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes badgePop { 0% { transform:scale(0); } 60% { transform:scale(1.3); } 100% { transform:scale(1); } }
@keyframes successFlash { 0% { opacity:1; } 100% { opacity:0; } }
