@font-face {
  font-family: 'Mojangles';
  src: url('Minecraft.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #000;
  --text-color: #fff;
  --text-secondary-color: #aaa;
  --glow-color: rgba(0, 255, 13, 0.4);
  --user-text-color: #00aeff;
}

body.light-theme {
  --bg-color: #e5e5e5;
  --text-color: #1c1e21;
  --text-secondary-color: #65676b;
  --glow-color: rgba(0, 0, 0, 0.2);
  --user-text-color: #0056b3;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh; 
  overflow: hidden;
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.chat-container {
  width: 90%;
  max-width: 800px;
  height: 90%;
  display: flex;
  flex-direction: column;
  background-color: rgba(0,0,0,0.1);
  border: 1px solid var(--text-secondary-color);
  border-radius: 10px;
  padding: 20px;
}

h1 {
  /* EDITED: Added this line to apply the Mojangles font */
  font-family: 'Mojangles', sans-serif;
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
  text-transform: uppercase;
}

h1 sup {
  font-size: 14px;
  text-transform: lowercase;
}

#chat-window {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 10px;
  font-size: 13px;
}

.message {
  margin-bottom: 10px;
  line-height: 1.5;
  text-shadow: 0 0 5px var(--glow-color);
}

.ai-message::before {
  content: 'C.A.R.L.O.S> ';
  color: var(--text-secondary-color);
}

.user-message {
  color: var(--user-text-color);
}

.user-message::before {
  content: 'USER> ';
  color: var(--text-secondary-color);
}

#chat-form {
  display: flex;
  margin-top: 20px;
}

#chat-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--text-secondary-color);
  color: var(--text-color);
  font-size: 16px;
  font-family: inherit;
  padding: 10px;
  outline: none;
}

#chat-form button {
  background: none;
  border: none;
  color: var(--text-secondary-color);
  font-size: 24px;
  cursor: pointer;
  margin-left: 15px;
  transform: rotate(-20deg);
  transition: transform 0.3s ease, color 0.3s ease;
}

#chat-form button:hover {
  color: var(--text-color);
  transform: scale(1.2) rotate(0deg);
}

.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 16px;
    color: var(--text-secondary-color);
    text-decoration: none;
    z-index: 10;
}

.typing::after {
  content: '▋';
  animation: blink 1s step-end infinite;
  text-shadow: none;
}

@keyframes blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

#theme-switcher { position: fixed; top: 20px; right: 20px; width: 24px; height: 24px; cursor: pointer; z-index: 1001; }
.icon-sun, .icon-moon { width: 100%; height: 100%; position: absolute; transition: opacity 0.3s ease, transform 0.3s ease; }
.icon-sun { background-color: #FFD700; border-radius: 50%; box-shadow: 0 0 10px #FFD700; }
.icon-moon { width: 18px; height: 18px; border-radius: 50%; box-shadow: 4px -4px 0 0 #f0f0f0; }
body.light-theme .icon-moon { opacity: 0; transform: scale(0); }
body:not(.light-theme) .icon-sun { opacity: 0; transform: scale(0); }

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }
    #chat-window {
        font-size: 12px;
    }
    #chat-input {
        font-size: 14px;
    }
}
