/* chikeezeh.dev — terminal theme */

body[data-theme="green"] { --fg: #33ff66; --bright: #d6ffe0; --dim: #1e6b38; --accent: #ffb000; --bg: #050705; }
body[data-theme="amber"]  { --fg: #ffb000; --bright: #ffe9c4; --dim: #7a5200; --accent: #33ff66; --bg: #0a0703; }
body[data-theme="ice"]    { --fg: #7dd3fc; --bright: #e8f7ff; --dim: #2b5a76; --accent: #ffb000; --bg: #04070b; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: background 0.3s, color 0.3s;
}

/* subtle CRT scanlines */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  z-index: 50;
}

.window {
  width: 100%;
  max-width: 920px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid var(--dim);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8), 0 0 120px -30px var(--dim);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--dim);
  user-select: none;
}

.dots { display: flex; gap: 8px; }
.dots span {
  width: 12px; height: 12px; border-radius: 50%; display: block;
}
.dots span:nth-child(1) { background: #ff5f57; }
.dots span:nth-child(2) { background: #febc2e; }
.dots span:nth-child(3) { background: #28c840; }

.title {
  font-size: 13px;
  color: var(--fg);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spacer { flex: 1; }

.terminal {
  height: 60vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--dim) transparent;
}

.terminal::-webkit-scrollbar { width: 8px; }
.terminal::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 4px; }

.line { white-space: pre-wrap; word-break: break-word; margin: 1px 0; }
.line:empty { height: 1.2em; }

.prompt { color: var(--accent); font-weight: bold; }
.bright { color: var(--bright); font-weight: bold; }
.dim { opacity: 0.55; }
.ok { color: var(--fg); }
a { color: var(--bright); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.prompt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--dim);
  background: rgba(255, 255, 255, 0.02);
}

.prompt-row .prompt { flex-shrink: 0; }

#cmdline {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--bright);
  font: inherit;
  caret-color: var(--fg);
  min-width: 0;
}

.hintbar {
  padding: 8px 20px 12px;
  font-size: 12.5px;
  opacity: 0.5;
}

.key {
  border: 1px solid var(--dim);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
}

.site-footer {
  margin-top: 14px;
  font-size: 12.5px;
  opacity: 0.45;
  text-align: center;
}

/* matrix rain overlay (the `agent` command) */
.matrix-rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: #000;
  cursor: pointer;
}
.matrix-rain[hidden] { display: none; }

/* tuxnake overlay (the `snake` command) */
.snake-arena {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  overflow-y: auto;
}
.snake-arena[hidden] { display: none; }
.snake-hud { color: var(--fg); font-size: 14px; }
.snake-prompt {
  color: var(--bright);
  font-weight: bold;
  font-size: 15px;
  text-align: center;
  max-width: 640px;
}
.snake-msg { min-height: 1.5em; font-size: 14px; text-align: center; max-width: 640px; }
.snake-msg.msg-good { color: var(--fg); }
.snake-msg.msg-bad { color: #ff5f57; }
.snake-board {
  margin: 0;
  border: 1px solid var(--dim);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.35;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.45);
  user-select: none;
}
.snake-board .sf { color: var(--accent); font-weight: bold; }
.snake-board .ss { color: var(--fg); font-weight: bold; }
.snake-controls { color: var(--dim); font-size: 12.5px; }
.snake-paused {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: 8px;
  padding: 14px 26px;
  color: var(--bright);
  font-weight: bold;
  z-index: 101;
}
.snake-paused[hidden] { display: none; }
.snake-over {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: 10px;
  padding: 26px 40px;
  text-align: center;
  z-index: 101;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}
.snake-over[hidden] { display: none; }
.snake-over-title {
  color: #ff5f57;
  font-weight: bold;
  font-size: 20px;
  letter-spacing: 4px;
  margin-bottom: 12px;
}
.snake-over-keys { margin-top: 14px; color: var(--dim); font-size: 13px; }
.snake-welcome {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  border: 1px solid var(--dim);
  border-radius: 10px;
  padding: 26px 40px;
  text-align: center;
  z-index: 101;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  max-width: min(560px, 92vw);
}
.snake-welcome[hidden] { display: none; }
.snake-welcome-title {
  color: var(--bright);
  font-weight: bold;
  font-size: 22px;
  letter-spacing: 6px;
  margin-bottom: 12px;
}
.snake-welcome p { color: var(--fg); font-size: 14px; margin: 6px 0; }
.snake-welcome-how {
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.7;
  text-align: left;
  display: inline-block;
  margin: 8px 0;
}
.snake-welcome-controls { color: var(--dim); font-size: 12.5px; margin-top: 10px; }
.snake-welcome-best { color: var(--fg); font-size: 13px; margin-top: 8px; }
.snake-welcome-keys {
  margin-top: 16px;
  color: var(--bright);
  font-size: 15px;
  font-weight: bold;
  animation: blink 1.2s steps(1) infinite;
}

/* blinking block cursor while booting */
.cursor::after {  content: "▊";
  animation: blink 0.9s steps(1) infinite;
  color: var(--fg);
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 600px) {
  body { font-size: 14px; padding: 8px; }
  .terminal { padding: 14px; height: 62vh; }
  #cmdline { font-size: 16px; } /* prevents iOS zoom */
  .title { display: none; }
  .snake-board { font-size: 12px; }
  .snake-prompt { font-size: 13px; }
}
