/**
 * PHM Tech — PHM DOS: Sistema Operacional On-line & Laboratório Didático de SO
 * Interface Retrô CRT Fiel · Fósforo Verde/Âmbar · Botões Físicos Ligar/Reset · Game GUIs · Defrag · ScanDisk · Debug · BBS
 * Prof. Paulo Henrique Maciel · PHM Tech
 */

:root {
  --dos-font: 'Fira Code', 'Courier New', Courier, monospace;
  --dos-bg: #0c1017;
  --dos-screen-bg: #05080c;
  --dos-green: #00ff66;
  --dos-green-glow: rgba(0, 255, 102, 0.45);
  --dos-amber: #ffb000;
  --dos-amber-glow: rgba(255, 176, 0, 0.45);
  --dos-white: #e2e8f0;
  --dos-white-glow: rgba(226, 232, 240, 0.35);
  --dos-cyan: #38bdf8;
  --dos-cyan-glow: rgba(56, 189, 248, 0.45);
  
  /* Tema ativo inicial (Fósforo Verde P1) */
  --dos-active-color: var(--dos-green);
  --dos-active-glow: var(--dos-green-glow);
}

/* ==========================================================================
   1. SELETOR DE 3 MODOS PRINCIPAIS NO OPEN SOURCE HUB (MESMA LINHA)
   ========================================================================== */

.os-mode-switcher-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: nowrap;
  margin-top: 1.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

@media (max-width: 900px) {
  .os-mode-switcher-bar {
    flex-wrap: wrap;
  }
}

.os-mode-btn {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--navy);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-pill, 9999px);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.os-mode-btn:hover {
  border-color: #0891b2;
  color: #0891b2;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.2);
}

.os-mode-btn.active {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  border-color: #0891b2;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(8, 145, 178, 0.35);
  transform: translateY(-1px);
}

.os-mode-btn.active svg {
  color: #ffffff;
}

/* ==========================================================================
   2. CONTÊINER PRINCIPAL DO PHM DOS
   ========================================================================== */

.dos-section-wrapper {
  padding: 2rem 0 4rem 0;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.dos-main-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

/* ==========================================================================
   3. CHASSI DO MONITOR CRT & TELA DE FÓSFORO
   ========================================================================== */

.dos-crt-chassis {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 4px solid #334155;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Modo Tela Cheia Imersivo */
.dos-crt-chassis.is-fullscreen {
  position: fixed !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
  padding: 1.25rem !important;
  height: 100vh !important;
  max-height: 100vh !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  border: none !important;
}

.dos-crt-chassis.is-fullscreen .dos-crt-bezel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dos-crt-chassis.is-fullscreen .dos-crt-screen-wrapper {
  flex: 1;
  max-height: none !important;
  min-height: calc(100vh - 160px) !important;
  height: calc(100vh - 160px) !important;
}

.dos-crt-chassis.is-fullscreen .dos-crt-screen {
  flex: 1;
  max-height: none !important;
  min-height: calc(100vh - 160px) !important;
  height: 100% !important;
}

.dos-crt-bezel {
  background: #020617;
  border: 3px solid #1e293b;
  border-radius: 14px;
  padding: 0.5rem;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

/* Barra Superior de Controles Retrô */
.dos-top-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.55rem 0.85rem;
  border-radius: 10px 10px 0 0;
  font-family: var(--dos-font);
  font-size: 0.76rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dos-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.dos-led-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  animation: ledPulse 2s infinite ease-in-out;
}

@keyframes ledPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.dos-quick-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Separador Visual de Botões */
.dos-tool-sep {
  width: 1px;
  height: 18px;
  background: #334155;
  margin: 0 0.35rem;
  display: inline-block;
}

.dos-tool-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--dos-font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.dos-tool-btn:hover {
  background: #334155;
  color: #ffffff;
  border-color: #64748b;
}

.dos-tool-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

/* CONTAINER VIEWPORT FIXO DO MONITOR CRT */
.dos-crt-screen-wrapper {
  position: relative;
  width: 100%;
  min-height: 560px;
  max-height: 720px;
  height: 640px;
  background: var(--dos-screen-bg);
  overflow: hidden;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

/* A TELA CRT SCROLLÁVEL DO TERMINAL */
.dos-crt-screen {
  background: var(--dos-screen-bg);
  width: 100%;
  height: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  font-family: var(--dos-font);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--dos-active-color);
  text-shadow: 0 0 6px var(--dos-active-glow);
  position: relative;
  box-sizing: border-box;
  scroll-behavior: smooth;
  transition: filter 0.2s ease, border-color 0.2s ease, background 0.3s ease;
}

/* ESTADO DESLIGADO DO MONITOR */
.dos-crt-screen.power-off {
  background: #010204 !important;
  color: #475569 !important;
  text-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.dos-power-off-card {
  max-width: 440px;
  padding: 2rem 1.5rem;
  border: 1px dashed #334155;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Drag-and-Drop Highlight */
.dos-crt-screen.drag-over {
  border: 2px dashed #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
}

/* Animação de Reinício CRT */
.dos-crt-screen.crt-rebooting {
  animation: crtTurnOff 0.45s ease-out forwards;
}

@keyframes crtTurnOff {
  0% { transform: scale(1); filter: brightness(1.5); }
  40% { transform: scale(1, 0.005); filter: brightness(2.5); background: #ffffff; }
  80% { transform: scale(0.005, 0.005); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* Efeito Scanlines CRT */
.dos-crt-screen.scanlines::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 2;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
}

/* Temas de Fósforo & Modos de Vídeo */
.dos-crt-screen.theme-green {
  --dos-active-color: var(--dos-green);
  --dos-active-glow: var(--dos-green-glow);
}

.dos-crt-screen.theme-amber {
  --dos-active-color: var(--dos-amber);
  --dos-active-glow: var(--dos-amber-glow);
}

.dos-crt-screen.theme-white {
  --dos-active-color: var(--dos-white);
  --dos-active-glow: var(--dos-white-glow);
}

.dos-crt-screen.theme-cyan {
  --dos-active-color: var(--dos-cyan);
  --dos-active-glow: var(--dos-cyan-glow);
}

.dos-crt-screen.mode-40 {
  font-size: 1.35rem;
  letter-spacing: 2px;
}

.dos-crt-screen.mode-cga {
  --dos-active-color: #55ffff;
  --dos-active-glow: rgba(85, 255, 255, 0.5);
}

.dos-crt-screen.mode-ega {
  --dos-active-color: #ff55ff;
  --dos-active-glow: rgba(255, 85, 255, 0.5);
}

/* Linha de Prompt e Entrada */
.dos-output-area {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.dos-input-line {
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
  position: relative;
  z-index: 3;
}

.dos-prompt-label {
  color: var(--dos-active-color);
  font-weight: 700;
  margin-right: 0.25rem;
  user-select: none;
  white-space: nowrap;
}

.dos-command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--dos-font);
  font-size: 0.95rem;
  color: var(--dos-active-color);
  text-shadow: 0 0 6px var(--dos-active-glow);
  padding: 0;
  margin: 0;
  caret-color: var(--dos-active-color);
}

/* Oculta cursor solto na ponta direita */
.dos-cursor {
  display: none;
}

/* ==========================================================================
   4. PAINEL INFERIOR DO MONITOR CRT: BOTÕES FÍSICOS (LIGAR & RESET)
   ========================================================================== */

.dos-chassis-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #0f172a, #0b1120);
  border-top: 2px solid #1e293b;
  padding: 0.65rem 1rem;
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dos-power-btn {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #475569;
  color: #f1f5f9;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-family: var(--dos-font);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.15s ease;
  user-select: none;
}

.dos-power-btn:hover {
  border-color: #22c55e;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(34, 197, 94, 0.25);
}

.dos-power-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.dos-power-btn.is-on {
  border-color: #22c55e;
  background: linear-gradient(145deg, #064e3b, #022c22);
  color: #86efac;
}

.dos-power-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
  display: inline-block;
  transition: all 0.3s ease;
}

.dos-power-btn.is-on .dos-power-led {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: ledPulse 2s infinite ease-in-out;
}

.dos-chassis-badge {
  font-family: var(--dos-font);
  font-size: 0.72rem;
  letter-spacing: 1px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  user-select: none;
}

.dos-reset-btn {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #ef4444;
  color: #fca5a5;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-family: var(--dos-font);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
  user-select: none;
}

.dos-reset-btn:hover {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.dos-reset-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   5. INTERFACES GRÁFICAS DOS JOGOS E SIMULADORES (FULL OVERLAY NA TELA)
   ========================================================================== */

.dos-game-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: #05080c;
  color: var(--dos-active-color);
  font-family: var(--dos-font);
  z-index: 50;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.dos-print-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(1, 4, 9, 0.85);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

.dos-game-window {
  background: #090d16;
  border: 2px solid var(--dos-active-color);
  box-shadow: 0 0 15px var(--dos-active-glow);
  border-radius: 8px;
  max-width: 620px;
  margin: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.dos-game-header {
  background: var(--dos-active-color);
  color: #000000;
  padding: 0.35rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  user-select: none;
}

.dos-game-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Tabuleiro Jogo da Velha */
.dos-ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 75px);
  grid-template-rows: repeat(3, 75px);
  gap: 6px;
}

.dos-ttt-cell {
  background: #0f172a;
  border: 2px solid var(--dos-active-color);
  color: var(--dos-active-color);
  font-family: var(--dos-font);
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.dos-ttt-cell:hover:not(.filled) {
  background: rgba(56, 189, 248, 0.2);
  transform: scale(1.04);
}

.dos-ttt-cell.filled {
  cursor: not-allowed;
}

/* Jogo da Forca */
.dos-hangman-canvas {
  font-family: var(--dos-font);
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: pre;
  color: var(--dos-active-color);
  text-shadow: 0 0 6px var(--dos-active-glow);
}

.dos-hangman-word {
  font-size: 1.6rem;
  letter-spacing: 0.5rem;
  font-weight: 800;
  color: var(--dos-active-color);
}

.dos-hangman-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  max-width: 480px;
}

.dos-hang-key {
  width: 32px;
  height: 32px;
  background: #0f172a;
  border: 1px solid var(--dos-active-color);
  color: var(--dos-active-color);
  font-family: var(--dos-font);
  font-weight: 800;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.dos-hang-key:hover:not(:disabled) {
  background: var(--dos-active-color);
  color: #000000;
}

.dos-hang-key:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Jogo da Cobrinha (Snake) */
.dos-snake-grid {
  background: #000000;
  border: 2px solid var(--dos-active-color);
  font-family: var(--dos-font);
  line-height: 1;
  letter-spacing: 2px;
  font-size: 0.9rem;
  white-space: pre;
  padding: 0.5rem;
  user-select: none;
}

.dos-dpad-controls {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 42px);
  gap: 4px;
  margin-top: 0.5rem;
}

.dos-dpad-btn {
  background: #1e293b;
  border: 1.5px solid var(--dos-active-color);
  color: var(--dos-active-color);
  font-family: var(--dos-font);
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.dos-dpad-btn:hover {
  background: var(--dos-active-color);
  color: #000000;
}

/* DEFRAG CLUSTER GRID */
.dos-defrag-map {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  gap: 2px;
  background: #000000;
  padding: 8px;
  border: 2px solid var(--dos-active-color);
  width: 100%;
  box-sizing: border-box;
}

.dos-cluster-block {
  height: 14px;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 1px;
  user-select: none;
}

.dos-cluster-block.allocated {
  background: #0284c7;
  color: #ffffff;
}

.dos-cluster-block.fragmented {
  background: #eab308;
  color: #000000;
  animation: pulseFrag 0.6s infinite alternate;
}

.dos-cluster-block.moving {
  background: #22c55e;
  color: #ffffff;
  transform: scale(1.15);
}

.dos-cluster-block.free {
  background: #1e293b;
  color: #475569;
}

@keyframes pulseFrag {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* MEMVIEW SEGMENT MAP */
.dos-memview-bar {
  display: flex;
  width: 100%;
  height: 28px;
  border: 2px solid var(--dos-active-color);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.dos-memview-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #000;
}

/* DEBUG ASSEMBLY REGISTERS */
.dos-debug-regs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: #000000;
  border: 1px solid var(--dos-active-color);
  padding: 0.5rem;
  width: 100%;
  font-size: 0.8rem;
}

/* Botões de Ação do Jogo/Simulador */
.dos-game-btn {
  background: #1e293b;
  border: 1.5px solid var(--dos-active-color);
  color: var(--dos-active-color);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-family: var(--dos-font);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dos-game-btn:hover {
  background: var(--dos-active-color);
  color: #000000;
}

.dos-game-status-line {
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

/* ==========================================================================
   6. EDITOR FULLSCREEN PHM EDIT (ESTILO MS-DOS EDIT / TURBO PASCAL)
   ========================================================================== */

.dos-edit-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0000a8;
  color: #ffffff;
  font-family: var(--dos-font);
  z-index: 50;
  display: none;
  flex-direction: column;
}

.dos-edit-menu-bar {
  background: #aaaaaa;
  color: #000000;
  padding: 0.2rem 0.5rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  user-select: none;
}

.dos-edit-menu-item {
  cursor: pointer;
  padding: 0 0.4rem;
}

.dos-edit-menu-item:hover {
  background: #000000;
  color: #ffffff;
}

.dos-edit-title-bar {
  background: #0000a8;
  color: #ffffff;
  text-align: center;
  border-bottom: 1px solid #5555ff;
  padding: 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.dos-edit-textarea {
  flex: 1;
  background: #0000a8;
  color: #ffffff;
  border: none;
  outline: none;
  font-family: var(--dos-font);
  font-size: 0.92rem;
  line-height: 1.4;
  padding: 0.75rem;
  resize: none;
  white-space: pre;
  overflow: auto;
}

.dos-edit-status-bar {
  background: #aaaaaa;
  color: #000000;
  padding: 0.25rem 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  user-select: none;
}

/* ==========================================================================
   7. SEÇÃO INFERIOR: COMANDOS E DESAFIOS DE SO LADO A LADO NA HORIZONTAL
   ========================================================================== */

.dos-lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (max-width: 960px) {
  .dos-lower-grid {
    grid-template-columns: 1fr;
  }
}

.dos-lower-panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dos-lower-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-bottom: 1.5px solid var(--line);
  background: var(--surface-soft);
}

.dos-lower-panel-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.dos-lower-panel-title svg {
  color: #0891b2;
}

.dos-panel-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(8, 145, 178, 0.1);
  color: #0891b2;
  border: 1px solid rgba(8, 145, 178, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.dos-lower-panel-body {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 480px;
}

/* Busca de Comandos */
.dos-cmd-search-input {
  width: 100%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  color: var(--navy);
  margin-bottom: 1rem;
  outline: none;
  font-family: inherit;
}

.dos-cmd-search-input:focus {
  border-color: #0891b2;
}

.dos-cmd-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dos-cmd-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.dos-cmd-item:hover {
  border-color: #0891b2;
  box-shadow: var(--shadow-xs);
}

.dos-cmd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.dos-cmd-name {
  font-family: var(--dos-font);
  font-weight: 800;
  font-size: 0.88rem;
  color: #0284c7;
}

.dos-cmd-exec-btn {
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #0284c7;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dos-cmd-exec-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

.dos-cmd-desc {
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0 0 0.35rem 0;
}

.dos-cmd-syntax {
  font-family: var(--dos-font);
  font-size: 0.74rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.25rem 0.45rem;
  border-radius: 4px;
  color: var(--navy);
  display: block;
}

/* Painel de Desafios & Quests */
.dos-quest-card {
  background: var(--surface-soft);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  position: relative;
  transition: all 0.2s ease;
}

.dos-quest-card.completed {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.dos-quest-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.35rem 0;
}

.dos-quest-desc {
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0 0 0.5rem 0;
}

.dos-quest-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 800;
  text-transform: uppercase;
}

.dos-quest-badge.pending {
  background: rgba(234, 179, 8, 0.15);
  color: #ca8a04;
}

.dos-quest-badge.done {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

/* ==========================================================================
   LABORATÓRIO DE SISTEMAS OPERACIONAIS — COMPONENTES VISUAIS RETRÔ
   ========================================================================== */

.dos-so-window {
  max-width: 680px;
  width: 100%;
  max-height: 92%;
  display: flex;
  flex-direction: column;
}

.dos-so-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dos-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
  border-bottom: 1px solid var(--dos-active-color);
  padding-bottom: 0.5rem;
}

.dos-tab-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #94a3b8;
  font-family: var(--dos-font);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dos-tab-btn:hover {
  background: #1e293b;
  color: #f1f5f9;
  border-color: var(--dos-active-color);
}

.dos-tab-btn.active {
  background: var(--dos-active-color);
  color: #000000;
  border-color: var(--dos-active-color);
  box-shadow: 0 0 8px var(--dos-active-glow);
}

/* Diagrama de Gantt */
.dos-gantt-wrapper {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.dos-gantt-chart {
  display: flex;
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--dos-active-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.dos-gantt-block {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--dos-font);
  font-size: 0.78rem;
  font-weight: 900;
  color: #000000;
  border-right: 1px solid #000000;
  transition: all 0.2s ease;
  position: relative;
}

.dos-gantt-block:last-child {
  border-right: none;
}

.dos-gantt-timeline {
  display: flex;
  justify-content: space-between;
  font-family: var(--dos-font);
  font-size: 0.72rem;
  color: #64748b;
  width: 100%;
}

/* Tabela Retrô de Métricas */
.dos-table-retro {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--dos-font);
  font-size: 0.75rem;
  text-align: center;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 4px;
}

.dos-table-retro th {
  background: #0f172a;
  color: var(--dos-active-color);
  padding: 0.45rem 0.5rem;
  border: 1px solid #334155;
  font-weight: 800;
}

.dos-table-retro td {
  padding: 0.4rem 0.5rem;
  border: 1px solid #1e293b;
  color: #cbd5e1;
}

.dos-table-retro tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.4);
}

/* Caixa de Log Passo a Passo */
.dos-step-log {
  background: #020617;
  border: 1px solid #334155;
  border-left: 3px solid var(--dos-active-color);
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  font-family: var(--dos-font);
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  text-align: left;
}

.dos-step-log strong {
  color: var(--dos-active-color);
}

/* Matriz de Páginas e Frames */
.dos-page-matrix-wrap {
  overflow-x: auto;
  width: 100%;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 0.5rem;
  box-sizing: border-box;
}

.dos-page-cell-fault {
  color: #ef4444 !important;
  font-weight: 900;
}

.dos-page-cell-hit {
  color: #22c55e !important;
  font-weight: 900;
}

/* Mapa de Memória Particionada */
.dos-mem-map {
  display: flex;
  gap: 4px;
  width: 100%;
  background: #020617;
  padding: 0.5rem;
  border: 1px solid #1e293b;
  border-radius: 6px;
  box-sizing: border-box;
}

.dos-mem-part {
  flex: 1;
  background: #0f172a;
  border: 1.5px solid #334155;
  border-radius: 4px;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-family: var(--dos-font);
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dos-mem-part.allocated {
  border-color: var(--dos-active-color);
  background: rgba(34, 197, 94, 0.1);
}

/* Trilho de Disco Rigido */
.dos-disk-track {
  width: 100%;
  height: 24px;
  background: #020617;
  border: 1px solid #334155;
  border-radius: 4px;
  position: relative;
  margin: 0.5rem 0;
}

.dos-disk-head {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 32px;
  background: #ef4444;
  border-radius: 2px;
  box-shadow: 0 0 8px #ef4444;
  transition: left 0.3s ease;
  transform: translateX(-50%);
}

.dos-disk-req {
  position: absolute;
  top: 4px;
  width: 6px;
  height: 16px;
  background: var(--dos-active-color);
  border-radius: 2px;
  transform: translateX(-50%);
}

