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

body {
  background: #0a0a0f;
  color: #c0c0c0;
  font-family: 'Share Tech Mono', 'Courier Prime', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

#scp-header {
  background: #111;
  border-bottom: 3px solid #8b0000;
  padding: 10px 20px;
  position: relative;
  z-index: 10;
}

#header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

#gear-icon {
  font-size: 28px;
  color: #B8860B;
  animation: spin 4s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#header-text {
  flex: 1;
}

#title {
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

#subtitle {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

#clearance-badge {
  background: #8b0000;
  color: #fff;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border: 1px solid #aa2222;
  line-height: 1.3;
}

#clearance-badge span {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1px;
}

#game-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

#canvas-container {
  position: relative;
  width: 100%;
  background: #050510;
  border: 3px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

#canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
}

#scanline-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  z-index: 5;
}

#controls {
  margin-top: 8px;
}

#control-panel {
  background: linear-gradient(180deg, #2a2218 0%, #1a150e 100%);
  border: 2px solid #5a4a2a;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

#control-panel::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 4px;
  pointer-events: none;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.switch-label {
  font-size: 9px;
  color: #B8860B;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#start-btn {
  background: linear-gradient(180deg, #cc2222, #880000);
  color: #fff;
  border: 3px solid #444;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6), inset 0 2px 4px rgba(255,255,255,0.15);
  transition: all 0.1s;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

#start-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.8), inset 0 2px 4px rgba(0,0,0,0.3);
}

#start-btn:hover {
  background: linear-gradient(180deg, #dd3333, #990000);
}

#difficulty-switches {
  display: flex;
  gap: 4px;
}

.diff-btn {
  background: #1a1a1a;
  border: 1px solid #555;
  color: #777;
  padding: 6px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.diff-btn.active {
  background: #B8860B;
  color: #000;
  border-color: #daa520;
  box-shadow: 0 0 8px rgba(184, 134, 11, 0.4);
}

.diff-btn:hover:not(.active) {
  border-color: #B8860B;
  color: #B8860B;
}

#sfx-toggle {
  background: #1a3a1a;
  border: 1px solid #2a5a2a;
  color: #4a4;
  padding: 6px 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  cursor: pointer;
}

#sfx-toggle.toggle-off {
  background: #3a1a1a;
  border-color: #5a2a2a;
  color: #a44;
}

.telemetry {
  flex: 1;
  min-width: 200px;
}

#telemetry-readout {
  background: #0a0a0a;
  border: 1px solid #333;
  padding: 6px 10px;
  font-size: 10px;
  border-radius: 3px;
}

.telem-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}

.telem-label {
  color: #666;
}

.telem-row span:last-child {
  color: #7FFF00;
  font-weight: 700;
}

#scp-doc-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #1a1a1a;
  border: 1px solid #555;
  border-right: none;
  padding: 10px 8px;
  font-size: 10px;
  color: #B8860B;
  cursor: pointer;
  writing-mode: vertical-rl;
  letter-spacing: 2px;
  z-index: 20;
  font-family: 'Share Tech Mono', monospace;
}

#scp-doc-toggle:hover {
  background: #2a2a2a;
}

#scp-doc-panel {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 60px;
  width: 340px;
  background: linear-gradient(180deg, #f5f0e0, #e8e0c8);
  border-left: 3px solid #8b0000;
  color: #222;
  padding: 20px;
  overflow-y: auto;
  z-index: 15;
  transition: transform 0.3s ease;
  font-family: 'Courier Prime', monospace;
  font-size: 12px;
  line-height: 1.6;
}

#scp-doc-panel.collapsed {
  transform: translateX(100%);
}

#scp-doc-panel h3 {
  color: #8b0000;
  font-size: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid #aaa;
  padding-bottom: 6px;
}

.redacted {
  background: #111;
  color: #111;
  padding: 0 4px;
  border-radius: 2px;
  user-select: none;
}

#scp-footer {
  background: #111;
  border-top: 2px solid #333;
  padding: 12px 20px;
  text-align: center;
}

#footer-inner p {
  font-size: 10px;
  color: #555;
  margin: 4px 0;
}

.footer-link a {
  color: #333;
  text-decoration: none;
  background: #222;
  padding: 2px 6px;
  border-radius: 2px;
  transition: all 0.3s;
}

.footer-link a:hover {
  color: #B8860B;
  background: #1a1a1a;
}

@media (max-width: 768px) {
  #title { font-size: 12px; }
  #subtitle { font-size: 9px; }
  #clearance-badge { padding: 4px 8px; font-size: 9px; }
  #control-panel { flex-direction: column; padding: 10px; }
  #start-btn { width: 60px; height: 60px; font-size: 8px; }
  #scp-doc-panel { width: 280px; }
  .telemetry { min-width: 150px; }
}