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

body {
  background-color: #1A1A1A;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(40, 30, 20, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(40, 30, 20, 0.2) 0%, transparent 50%),
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255,255,255,0.015) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255,255,255,0.015) 50px);
  color: #D4D4C8;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

#scp-header {
  text-align: center;
  padding: 12px 20px;
  border-bottom: 2px solid #CC3333;
  margin-bottom: 15px;
  width: 100%;
  max-width: 900px;
}

.scp-designation {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.scp-red {
  color: #CC3333;
}

.scp-safe {
  color: #4CAF50;
}

.scp-subtitle {
  font-size: 10px;
  color: #888;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

#main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 900px;
}

@media (min-width: 768px) {
  #main-content {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }
}

/* Console Wrapper */
#console-wrapper {
  flex-shrink: 0;
}

#console-frame {
  position: relative;
  width: 280px;
  padding: 28px 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, #E8740C 0%, #D4690A 40%, #C05E08 100%);
  box-shadow: 
    0 8px 30px rgba(0,0,0,0.6),
    inset 0 2px 4px rgba(255,200,100,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    0 0 60px rgba(232, 116, 12, 0.15);
  /* Noise texture simulation via multiple gradients */
  background-image:
    linear-gradient(145deg, #E8740C 0%, #D4690A 40%, #C05E08 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

.console-glow {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

#console-glow-top {
  top: -2px;
  left: 20%;
  right: 20%;
  height: 4px;
  background: radial-gradient(ellipse, rgba(100, 200, 80, 0.6) 0%, transparent 70%);
  border-radius: 50%;
}

#console-glow-bottom {
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 4px;
  background: radial-gradient(ellipse, rgba(200, 160, 40, 0.5) 0%, transparent 70%);
  border-radius: 50%;
}

#console-glow-left {
  left: -2px;
  top: 20%;
  bottom: 20%;
  width: 4px;
  background: radial-gradient(ellipse, rgba(100, 200, 80, 0.4) 0%, transparent 70%);
  border-radius: 50%;
}

#console-glow-right {
  right: -2px;
  top: 20%;
  bottom: 20%;
  width: 4px;
  background: radial-gradient(ellipse, rgba(200, 160, 40, 0.4) 0%, transparent 70%);
  border-radius: 50%;
}

#subliminal-msg {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  color: rgba(100, 200, 80, 0);
  font-family: 'IBM Plex Mono', monospace;
  white-space: nowrap;
  transition: color 3s ease;
  pointer-events: none;
  text-align: center;
}

#screen-bezel {
  position: relative;
  width: 240px;
  height: 320px;
  margin: 0 auto;
  border-radius: 6px;
  overflow: hidden;
  background: #0a0f04;
  box-shadow: 
    inset 0 2px 8px rgba(0,0,0,0.8),
    0 0 20px rgba(80, 150, 50, 0.08);
}

#canvas {
  width: 240px;
  height: 320px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

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

#screen-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(120, 180, 60, 0.04) 0%, transparent 70%);
  z-index: 3;
}

/* SCP Document Panel */
#scp-document-panel {
  width: 100%;
  max-width: 400px;
  background: rgba(20, 20, 18, 0.95);
  border: 1px solid #333;
  border-left: 3px solid #CC3333;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.5;
  max-height: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(30, 30, 28, 1);
  border-bottom: 1px solid #333;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.classified-stamp {
  color: #CC3333;
  font-weight: 700;
  font-size: 10px;
}

.doc-body {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
}

.doc-section {
  margin-bottom: 10px;
  color: #B8B8A8;
  font-size: 10px;
}

.doc-section strong {
  color: #D4D4C8;
}

#experiment-log {
  border-top: 1px solid #333;
  padding-top: 8px;
  margin-top: 8px;
}

.log-header {
  color: #CC3333;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  font-size: 10px;
}

.log-entry {
  padding: 4px 0;
  border-bottom: 1px solid rgba(60, 60, 50, 0.3);
  font-size: 9px;
  color: #999;
}

.log-entry:last-child {
  border-bottom: none;
}

/* Memetic Overlay */
#memetic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: memeticFlicker 0.15s ease 3;
}

#memetic-overlay.hidden {
  display: none;
}

@keyframes memeticFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.memetic-content {
  text-align: center;
  border: 2px solid #CC3333;
  padding: 30px 40px;
  background: rgba(30, 10, 10, 0.95);
  max-width: 400px;
}

.memetic-warning {
  font-size: 18px;
  font-weight: 700;
  color: #CC3333;
  margin-bottom: 15px;
  letter-spacing: 2px;
  animation: warningPulse 1s ease infinite;
}

@keyframes warningPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.memetic-content p {
  font-size: 13px;
  color: #D4D4C8;
  margin-bottom: 20px;
  line-height: 1.6;
}

.memetic-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.memetic-buttons button {
  padding: 8px 30px;
  background: #CC3333;
  color: #fff;
  border: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
}

.memetic-buttons button:hover {
  background: #ff4444;
}

/* Containment Bar */
#containment-bar {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 16px;
  margin-top: 15px;
  background: rgba(20, 20, 18, 0.9);
  border: 1px solid #2a2a2a;
  border-top: 2px solid #333;
  font-size: 9px;
  color: #777;
  letter-spacing: 0.5px;
}

#containment-bar span {
  white-space: nowrap;
}

/* Footer */
#site-footer {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  border-top: 1px solid #333;
  font-size: 9px;
  color: #555;
}

.footer-center {
  font-size: 8px;
  text-align: center;
  flex: 1;
}

.footer-right a {
  color: #CC3333;
  text-decoration: none;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}