* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "SF Mono", "Cascadia Code", Consolas, "DejaVu Sans Mono", Menlo, monospace;
  background: #0a0d0f;
  color: #d2e0d8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Barre titre */
#titlebar {
  display: flex; align-items: center; gap: 10px;
  background: #151a1d; border-bottom: 1px solid #232a2e;
  padding: 8px 14px; font-size: 12px; color: #8a9aa0;
  flex-shrink: 0; user-select: none;
}
#titlebar .brand { display: flex; align-items: center; gap: 8px; font-weight: bold; color: #7be382; letter-spacing: .5px; }
#titlebar .dots { display: flex; gap: 6px; }
#titlebar .dots span { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
#titlebar .title { flex: 1; text-align: center; opacity: .8; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#titlebar .clock { font-variant-numeric: tabular-nums; }

/* Panneau de contrôle masquable */
#panel {
  flex-shrink: 0; background: #10151a; border-bottom: 1px solid #232a2e;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 14px; font-size: 12px;
}
#panel.hidden { display: none; }
#panel label { color: #7a8b92; }
select, #panel button {
  font-family: inherit; font-size: 12px;
  background: #1a2228; color: #cfe3da; border: 1px solid #2c363d;
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
}
select:hover, #panel button:hover { border-color: #3f98d1; }
#panel button { background: #1e3a4d; }
.hint { margin-left: auto; color: #5a6a70; font-size: 11px; }
kbd {
  background: #1a2228; border: 1px solid #2c363d; border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; font-size: 10px; color: #9ab;
}

/* Terminal */
#term {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-all;
  scrollbar-width: thin; scrollbar-color: #2c363d transparent;
}
#term::-webkit-scrollbar { width: 8px; }
#term::-webkit-scrollbar-thumb { background: #2c363d; }
.t-ok   { color: #7be382; }
.t-info { color: #8fc7ff; }
.t-warn { color: #ffd166; }
.t-err  { color: #ff6b6b; }
.t-dim  { color: #6a7a80; }
.t-bold { color: #e8f2ec; font-weight: bold; }
.t-acc  { color: #b48eff; }
.t-matrix { color: #2fd66b; text-shadow: 0 0 4px rgba(47,214,107,.4); }

/* Ligne de commande interactive */
#prompt {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  background: #0d1114; border-top: 1px solid #232a2e;
  padding: 8px 16px; font-size: 13px;
}
#prompt.hidden { display: none; }
#prompt .ps1 { color: #7be382; white-space: nowrap; }
#prompt input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #d2e0d8; font-family: inherit; font-size: 13px; caret-color: #2fd66b;
}

/* Barre d'état*/
#statusbar {
  flex-shrink: 0; display: flex; gap: 18px; padding: 6px 14px;
  background: #151a1d; border-top: 1px solid #232a2e;
  font-size: 11px; color: #7a8b92; user-select: none;
}
#statusbar .prog { color: #7be382; }
#statusbar .spacer { flex: 1; }
#statusbar .blink { animation: blink 1.1s steps(1) infinite; color: #ffd166; }
@keyframes blink { 50% { opacity: 0; } }

/* Toast */
#toast {
  position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%);
  background: #16202a; border: 1px solid #2fd66b; color: #7be382;
  padding: 6px 14px; border-radius: 6px; font-size: 12px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
#toast.show { opacity: 1; }

/* Crédits */
#credits {
  position: fixed; inset: 0; background: rgba(4, 6, 8, .82);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
#credits.open { display: flex; }
#creditsBox {
  max-width: 460px; background: #10151a; border: 1px solid #2fd66b;
  border-radius: 10px; padding: 24px 28px; font-size: 13px; line-height: 1.6;
  color: #c4d4ca;
}
#creditsBox h2 { color: #7be382; margin-bottom: 4px; font-size: 18px; }
#creditsBox h2 small { color: #6a7a80; font-weight: normal; }
#creditsBox i { color: #8fc7ff; }
#creditsBox .lic { color: #7a8b92; font-size: 12px; margin-top: 10px; }
#creditsBox button {
  margin-top: 14px; font-family: inherit; font-size: 12px;
  background: #1e3a4d; color: #cfe3da; border: 1px solid #2c363d;
  padding: 6px 16px; border-radius: 5px; cursor: pointer;
}

/* Plein écran - que le terminal */
:fullscreen #titlebar,
:fullscreen #panel,
:fullscreen #statusbar,
:fullscreen #toast { display: none !important; }
:fullscreen #term {
  padding: 22px 28px;
  font-size: 14px;
  line-height: 1.5;
}