/* TermForge Retro CRT Theme & Scanlines */

:root {
  --crt-green: #33ff66;
  --crt-amber: #ffb000;
  --crt-cyan: #00ffff;
  --crt-pink: #df80ff;
  --crt-red: #ff5555;
  --bg-color: #0d1117;
  --terminal-bg: #050805;
}

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

body {
  background-color: var(--bg-color);
  color: var(--crt-green);
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 20px 10px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  user-select: none;
}

/* Outer Monitor Frame */
.crt-container {
  position: relative;
  width: 95vw;
  max-width: 1000px;
  height: 70vh;
  max-height: 600px;
  background-color: #1a1e24;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 
    0 0 50px rgba(0, 0, 0, 0.9),
    inset 0 0 20px rgba(0, 0, 0, 0.8),
    inset 0 0 5px rgba(255, 255, 255, 0.1);
  border: 4px solid #2d333b;
  display: flex;
  flex-direction: column;
}

.crt-bezel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #30363d;
  font-size: 13px;
  letter-spacing: 2px;
  color: #8b949e;
}

.brand-badge {
  font-weight: bold;
  color: var(--crt-green);
  text-shadow: 0 0 8px rgba(51, 255, 102, 0.6);
}

/* CRT Screen Screen Area */
.crt-screen {
  position: relative;
  flex: 1;
  background-color: var(--terminal-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.95);
  margin-top: 10px;
}

/* Phosphor Glow on text */
#terminal-container {
  width: 100%;
  height: 100%;
  text-shadow: 0 0 4px rgba(51, 255, 102, 0.4);
}

/* Scanline Effect */
.crt-screen::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
  background-size: 100% 4px;
  z-index: 10;
  pointer-events: none;
  opacity: 0.85;
}

/* Glass Curve Reflection & Vignette */
.crt-screen::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.6) 100%);
  z-index: 11;
  pointer-events: none;
}

/* Mobile Virtual Controls */
.touch-controls {
  display: none;
  width: 100%;
  max-width: 1000px;
  margin-top: 15px;
  justify-content: space-between;
  padding: 0 10px;
}

@media (max-width: 768px) {
  .touch-controls {
    display: flex;
  }
  .crt-container {
    height: 52vh;
    padding: 12px;
  }
}

.touch-btn {
  background: #21262d;
  border: 2px solid #30363d;
  color: var(--crt-green);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}

.touch-btn:active {
  background: #30363d;
  transform: translateY(2px);
}

/* In-Page Controls Cheat Sheet Card */
.controls-cheat-sheet {
  width: 95vw;
  max-width: 1000px;
  margin-top: 16px;
  background: #161b22;
  border: 2px solid #30363d;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.cheat-sheet-header {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #8b949e;
  border-bottom: 1px solid #30363d;
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cheat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.cheat-column {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 12px 14px;
}

.col-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed #30363d;
  padding-bottom: 6px;
}

.key-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #c9d1d9;
}

.key-badge {
  display: inline-block;
  background: #21262d;
  border: 1px solid #484f58;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  min-width: 32px;
  text-align: center;
  margin-right: 8px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

.badge-thrust { border-color: var(--crt-amber); color: var(--crt-amber); }
.badge-brake  { border-color: var(--crt-red); color: var(--crt-red); }
.badge-combat { border-color: var(--crt-cyan); color: var(--crt-cyan); }
.badge-bomb   { border-color: var(--crt-pink); color: var(--crt-pink); }
.badge-sys    { border-color: #8b949e; color: #8b949e; }

.key-desc {
  flex: 1;
}

.key-desc span {
  color: #8b949e;
  font-size: 11px;
  margin-left: 4px;
}
