* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #05080d;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Targeting Reticle */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 255, 204, 0.75);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
  transition: all 0.15s ease-out;
}

#crosshair.targeted {
  width: 22px;
  height: 22px;
  border-color: #ffaa00;
  box-shadow: 0 0 14px #ffaa00;
  background: rgba(255, 170, 0, 0.15);
}

/* Interaction Prompt (Tooltip) */
#interaction-prompt {
  position: absolute;
  top: calc(50% + 25px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 16, 26, 0.88);
  border: 1px solid rgba(0, 255, 204, 0.4);
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 11;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#interaction-prompt.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.prompt-icon {
  font-size: 18px;
  color: #00ffcc;
}

#prompt-target {
  font-size: 11px;
  font-family: 'Consolas', monospace;
  color: #94a3b8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#prompt-action {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.key-hint {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Consolas', monospace;
  font-weight: bold;
}

/* Terminal KVM Modal */
#terminal-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.75);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

#terminal-modal.hidden {
  display: none;
}

.terminal-window {
  width: 860px;
  max-width: 92vw;
  height: 560px;
  max-height: 85vh;
  background: #090e17;
  border: 1px solid #1e293b;
  border-top: 2px solid #00ffcc;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 204, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  height: 38px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.terminal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-actions button {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.terminal-actions button:hover {
  background: #334155;
  color: #ffffff;
}

#term-btn-close {
  font-size: 16px;
  padding: 0 8px;
  line-height: 20px;
}

.terminal-body {
  flex: 1;
  position: relative;
  background: #040810;
  padding: 14px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13.5px;
  line-height: 1.45;
  color: #cbd5e1;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  opacity: 0.3;
}

#terminal-output {
  white-space: pre-wrap;
  word-break: break-all;
}

.term-line {
  margin-bottom: 2px;
}

.term-line.banner {
  color: #38bdf8;
}

.term-prompt {
  color: #00ffcc;
  font-weight: bold;
}

.text-dim { color: #64748b; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }
.text-yellow { color: #f59e0b; }
.text-cyan { color: #00ffcc; }

.terminal-input-row {
  display: flex;
  align-items: center;
  margin-top: 6px;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Consolas', monospace;
  font-size: 14px;
  color: #ffffff;
  caret-color: #00ffcc;
  padding-left: 6px;
}

.terminal-footer {
  height: 28px;
  background: #0b1322;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  color: #64748b;
}

/* Manual Modal */
#manual-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(12px);
  z-index: 105;
  display: flex;
  align-items: center;
  justify-content: center;
}

#manual-modal.hidden {
  display: none;
}

.manual-window {
  width: 820px;
  max-width: 92vw;
  max-height: 85vh;
  background: #0b1322;
  border: 1px solid #0284c7;
  border-radius: 10px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(2, 132, 199, 0.25);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.manual-header {
  padding: 16px 20px;
  background: #0f1c33;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.manual-header h2 {
  font-size: 15px;
  letter-spacing: 1px;
  color: #38bdf8;
  font-family: 'Consolas', monospace;
}

#manual-btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.manual-content {
  padding: 20px;
}

.manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.manual-card {
  background: #060c17;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 14px;
}

.manual-card.span-2 {
  grid-column: span 2;
}

.manual-card h3 {
  font-size: 13px;
  color: #00ffcc;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.manual-card ul {
  list-style: none;
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
}

.manual-card ul li {
  margin-bottom: 6px;
}

.cli-table {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 8px 12px;
  font-size: 12px;
  font-family: 'Consolas', monospace;
}

.cli-table code {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

.cli-table span {
  color: #94a3b8;
  align-self: center;
}

/* Start Overlay */
#start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.9) 0%, rgba(3, 7, 18, 0.98) 100%);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#start-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-card {
  width: 660px;
  max-width: 90vw;
  background: #09101d;
  border: 1px solid rgba(0, 255, 204, 0.3);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 0 0 40px rgba(0, 255, 204, 0.15);
  border-radius: 12px;
  padding: 36px;
  text-align: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.start-logo {
  width: 105px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(0, 255, 204, 0.5));
  animation: logo-float 3s ease-in-out infinite alternate;
}

@keyframes logo-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

.start-badge {
  display: inline-block;
  font-size: 11px;
  font-family: 'Consolas', monospace;
  letter-spacing: 2px;
  color: #00ffcc;
  background: rgba(0, 255, 204, 0.1);
  border: 1px solid rgba(0, 255, 204, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.start-card h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffffff;
  margin-bottom: 4px;
}

.start-card h2 {
  font-size: 15px;
  font-family: 'Consolas', monospace;
  font-weight: 500;
  color: #38bdf8;
  letter-spacing: 2px;
  margin-bottom: 18px;
}

.start-card p {
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 24px;
}

.start-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}

.feat-item {
  background: #0f1a2e;
  border: 1px solid #1e293b;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-button {
  background: linear-gradient(135deg, #0284c7 0%, #00ffcc 100%);
  border: none;
  color: #040810;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 255, 204, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.pulse-button:hover {
  transform: scale(1.02);
  box-shadow: 0 0 35px rgba(0, 255, 204, 0.7);
}

.start-hint {
  margin-top: 16px;
  font-size: 11px;
  color: #64748b;
  font-family: 'Consolas', monospace;
}
