/* style.css — v2.8.1 (keywords top-left; out of the way of the terminal popout) */
@font-face {
  font-family: 'SourceCodePro';
  src: url('fonts/SourceCodePro-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

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

body {
  background-color: #000;
  color: #40c3ff;
  font-family: 'SourceCodePro', 'Noto Sans JP', 'Meiryo', monospace;
  font-size: 1rem;
  padding: 1rem;
  height: 100vh;
  overflow-x: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
}

a { color: #40c3ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.underline { text-decoration: underline; }

.prompt { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.prompt-text { flex-shrink: 0; }
.countdown-text { font-weight: bold; }

.blinker::after { content: '_'; animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.line { margin-bottom: 0.25rem; }
.footer { margin-top: 2rem; font-size: 0.9rem; }

.terminal {
  max-width: 800px; width: 100%;
  white-space: pre-wrap; line-height: 1.4; word-break: break-word;
}

.terminal-output {
  background-color: #000; color: #40c3ff;
  border: 1px solid #40c3ff; padding: 1rem; margin-top: 1rem;
  min-height: 150px; font-size: 0.85rem; white-space: pre-wrap; line-height: 1.2;
}

.terminal .line { font-size: 0.85rem; }

.terminal-image {
  max-width: 100%; height: auto; margin-top: 0.5rem;
  border: 1px solid #40c3ff; display: block;
}

/* INPUT STYLING */
.dos-input {
  background-color: #000; border: 1px solid #40c3ff; color: #40c3ff;
  font-family: 'SourceCodePro', monospace; padding: 0.2rem; width: 100%; max-width: 600px; margin-top: 0.5rem;
}
.wide { width: 100%; }

/* POPOUT WINDOWS */
.webplayer, .terminal-popout {
  position: fixed; top: 1rem; right: 1rem; width: 50%; max-width: 500px;
  background-color: #000; color: #40c3ff; padding: 1rem; border: 1px solid #40c3ff;
  z-index: 1000; overflow-y: auto; max-height: 90vh;
  animation: glitchIn 0.3s ease-out;
  will-change: transform, opacity; /* perf hint for open/close */
}

/* ===== KEYWORD LIST (anchor at top-left of viewport) ===== */
.keyword-list {
  position: fixed;
  top: 6rem;
  left: 21rem;
  color: red;
  font-size: 0.85rem;
  line-height: 1.4;
  z-index: 2000;          /* above main content and popouts */
  pointer-events: none;   /* never blocks clicks */
  opacity: 0;
  display: none;
}

/* visible + animated when JS adds the class */
.keyword-list.glitch-flicker {
  display: block;
  opacity: 1;
  animation: glitch-flicker 0.3s steps(2, start) infinite alternate;
}

@keyframes glitch-flicker {
  0%   { text-shadow: 2px 0 red, -2px 0 blue; transform: translateX(-1px); }
  20%  { text-shadow: -2px 0 red, 2px 0 blue; transform: translateX(1px); }
  40%  { text-shadow: 1px 0 red, -1px 0 blue; transform: translateX(-1px); }
  60%  { text-shadow: -2px 0 red, 1px 0 blue; transform: translateX(1px); }
  80%  { text-shadow: 0 0 red, 0 0 blue; transform: translateX(0); }
  100% { text-shadow: 2px 0 red, -2px 0 blue; transform: translateX(-1px); }
}

/* OPEN/CLOSE animations for popouts */
@keyframes glitchIn {
  0%   { transform: scale(0.95) rotateX(90deg); opacity: 0; }
  100% { transform: scale(1) rotateX(0deg);   opacity: 1; }
}
@keyframes glitchOut {
  0%   { transform: scale(1) rotateX(0deg);   opacity: 1; }
  100% { transform: scale(0.95) rotateX(90deg); opacity: 0; }
}
.closing { animation: glitchOut 0.25s ease-in forwards !important; }

.hidden { display: none; }

.popout-header {
  display: flex; justify-content: space-between; align-items: center; font-weight: bold;
  border-bottom: 1px solid #40c3ff; margin-bottom: 1rem; padding-bottom: 0.5rem;
}
.close-button { background: none; border: none; color: #40c3ff; font-size: 1rem; cursor: pointer; }

/* WEBPLAYER STYLES */
.webplayer .line { margin-bottom: 0.4rem; }
.webplayer a { display: block; color: #40c3ff; text-decoration: none; margin: 0.25rem 0; }
.webplayer a:hover { text-decoration: underline; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .webplayer, .terminal-popout {
    width: 95%; right: 2.5%; left: 2.5%; max-width: none;
  }

  /* On mobile, put the keywords under the header for readability */
  .keyword-list {
    position: static;
    margin: 0.5rem 0 0 0;
    opacity: 0;
    display: none;
  }
  .keyword-list.glitch-flicker { display: block; opacity: 1; }

  body { padding: 0.5rem; font-size: 0.9rem; }
  .dos-input { font-size: 0.9rem; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  .webplayer, .terminal-popout { animation: none; }
  .closing { animation: none; opacity: 0; }
}

