@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap");

:root {
  --screen-bg: #000000;
  --text-default: #ffffff;
  --text-system: #6eccff;
  --text-narrator: #ffcc5f;
  --text-tag: #00ffcc;
  --chrome-border: #00ffcc;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family:
    "Roboto Mono", "Cascadia Mono", "Ubuntu Mono", Consolas, "Courier New",
    monospace;
  color: var(--text-default);
  background: var(--screen-bg);
  font-variant-ligatures: none;
  font-feature-settings:
    "liga" 0,
    "calt" 0;
  display: grid;
  grid-template-columns: 270px 1fr;
  height: 100vh;
}

/* ASIDE */

.aside-bar {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 20px;
  padding: 15px;
  background: #111;
  border-right: 1px solid var(--chrome-border);
  min-height: 0;
  overflow: hidden;
}

.aside-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
}

.aside-main main {
  flex: 1;
  min-height: 0;
}

.icon{
  display: flex;
  margin: 0 auto;
  font-size: 10px;
  color: var(--text-tag);
}

.aside-help {
  background: #0c0c0c;
  border: 1px solid var(--chrome-border);
  padding: 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
}

.aside-help ul {
  list-style: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-tag) transparent;
}

.aside-help ul li {
  font-size: 0.88rem;
  color: var(--text-system);
  word-break: break-word;
  line-height: 1.4;
  padding: 0.28rem 0;
  border-bottom: 1px dashed #242424;
}

.aside-help ul li span {
  display: block;
  font-size: 0.82rem;
  color: #ffffff;
  margin-top: 0.12rem;
}

.aside-help ul li::before{
  content: "- ";
}

.aside-help ul li:last-child {
  border-bottom: none;
}

h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-tag);
  text-align: center;
  
}

/* MAIN */

main {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
}

.page_terminal {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.fenetre_terminal {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* TERMINAL */

.header_terminal {
  background: linear-gradient(180deg, #04070f, #01040a);
  border-bottom: 1px solid #0a1320;
  padding: 0.55rem 0.9rem;
  display: flex;
  gap: 5px;
}

.titre_terminal {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.corps_terminal {
  flex: 1;
  min-height: 0;
  background: var(--screen-bg);
  padding: 1rem;
  overflow-y: auto;
}

.ligne {
  margin: 0 0 0.35rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.ligne_ascii {
  display: block;
  font-family:
    "Roboto Mono", "Cascadia Mono", "Ubuntu Mono", Consolas, "Courier New",
    monospace;
  white-space: pre;
  line-height: 1.15;
}

.ligne_commande {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ligne_systeme {
  color: var(--text-system);
}

.ligne_narrateur {
  color: var(--text-narrator);
}

.ligne_perso {
  color: var(--text-default);
}

.ligne_wait {
  color: var(--text-system);
}

.wait-dots {
  display: inline-flex;
  gap: 0.12rem;
  letter-spacing: 0;
}

.wait-dots-inline {
  margin: 0 0.05rem;
}

.wait-dot {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.12;
  animation: waitBlink 900ms infinite steps(1, end);
}

.ligne_systeme .wait-dot{
  color: var(--text-system);
}

.ligne_narrateur .wait-dot{
  color: var(--text-narrator);
}

@keyframes waitBlink {
  0%, 19% { opacity: 0.12; }
  20%, 45% { opacity: 1; }
  46%, 100% { opacity: 0.12; }
}

.invite_terminal {
  color: #f2f2f2;
  font-weight: 700;
  margin-right: 0.45rem;
}

.horodatage {
  color: #aaaaaa;
  margin-right: 0.6rem;
}

.etiquette {
  color: var(--text-tag);
  margin-right: 0.55rem;
}

#commandInput {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-default);
  font: inherit;
  font-size: 1rem;
}

#commandInput::placeholder {
  color: #7d7d7d;
}

#commandInput:focus {
  caret-color: #ffffff;
}

.typing-challenge {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 100;
    padding: 2rem;
}

.typing-challenge.hidden {
    display: none;
}

.typing-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-tag);
}

.typing-timer.danger {
    color: #ff4444;
}

.typing-words {
    font-size: 1.1rem;
    line-height: 2;
    max-width: 800px;
    text-align: center;
    letter-spacing: 0.05em;
}

.typing-words .word {
    display: inline-block;
    margin: 0 0.3rem;
}

.typing-words .letter {
    color: #555;
}

.typing-words .letter.correct {
    color: var(--text-tag);
}

.typing-words .letter.incorrect {
    color: #ff4444;
}

.typing-words .letter.current {
    border-bottom: 2px solid #ffffff;
}

.typing-words .word.done .letter {
    border-bottom: none;
}

#typingInput {
    width: 500px;
    max-width: 90%;
    background: #111;
    border: 1px solid var(--chrome-border);
    color: var(--text-default);
    font: inherit;
    font-size: 1rem;
    padding: 0.6rem 1rem;
    outline: none;
    caret-color: var(--text-tag);
}

.typing-result {
    font-size: 1rem;
    color: var(--text-system);
    text-align: center;
}

.typing-retry {
    background: transparent;
    border: 1px solid var(--chrome-border);
    color: var(--text-tag);
    font: inherit;
    font-size: 0.95rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
}

.typing-retry:hover {
    background: var(--chrome-border);
    color: #000;
}

.typing-retry.hidden {
    display: none;
}

.guess-word {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.guess-word.hidden {
    display: none;
}

.guess-word-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 700px;
    width: 90%;
}

.guess-word-ascii {
    font-family: "Roboto Mono", monospace;
    color: var(--text-default);
    white-space: pre;
    text-align: center;
    line-height: 1.15;
    border: 1px solid var(--chrome-border);
    padding: 1rem 2rem;
}

.guess-word-ascii.hidden {
    display: none;
}

#guessWordInput {
    width: 400px;
    max-width: 90%;
    background: #111;
    border: 1px solid var(--chrome-border);
    color: var(--text-default);
    font: inherit;
    font-size: 1rem;
    padding: 0.6rem 1rem;
    outline: none;
    caret-color: var(--text-tag);
    text-align: center;
}

.guess-word-feedback {
    font-size: 0.95rem;
    min-height: 1.4rem;
    color: transparent;
}

.guess-word-feedback.incorrect {
    color: #ff4444;
}

.guess-word-buttons {
    display: flex;
    gap: 1rem;
}

.guess-word-btn {
    background: transparent;
    border: 1px solid var(--chrome-border);
    color: var(--text-tag);
    font: inherit;
    font-size: 0.95rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
}

.guess-word-btn:hover {
    background: var(--chrome-border);
    color: #000;
}

.guess-word-reopen {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: transparent;
    border: 1px solid var(--chrome-border);
    color: var(--text-tag);
    font: inherit;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 50;
}

.guess-word-reopen.hidden {
    display: none;
}

.guess-word-reopen:hover {
    background: var(--chrome-border);
    color: #000;
}

/* KILL VIRUS */

.kill-virus {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.kill-virus.hidden {
    display: none;
}

.kill-virus-inner {
    border: 2px solid #00ff00;
    background: #000;
    width: 600px;
    max-width: 90%;
    font-family: "Roboto Mono", monospace;
}

.kill-virus-header {
    background: #00ff00;
    color: #000;
    padding: 0.4rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.kill-virus-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.kill-virus-ascii {
    color: #00ff00;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
}

.kill-virus-text {
    color: #00ff00;
    font-size: 0.95rem;
    align-self: flex-start;
}

.kill-virus-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    font: inherit;
    font-size: 1rem;
    padding: 0.4rem 2rem;
    cursor: pointer;
    margin-top: 1rem;
}

.kill-virus-btn:hover {
    background: #00ff00;
    color: #000;
}

/* FOOTER */

footer {
	height: 50px;
  background: #0c0c0c;
  border-top: 1px solid var(--chrome-border);
}

footer p {
  color: #ffffff;
  font-size: 0.85rem;
  text-align: center;
  padding: 15px;
}