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

:root {
  --crt-green: #33FF33;
  --crt-green-dim: #1a8a1a;
  --crt-amber: #FFB000;
  --crt-amber-dim: #8a6000;
  --crt-white: #CCCCCC;
  --crt-white-dim: #666666;
  --screen-bg: #0a0a0a;
  --monitor-beige: #c8b88a;
  --monitor-beige-dark: #a89868;
  --monitor-beige-light: #d8c89a;
}

body {
  background: #1a1a1a;
  background-image: 
    radial-gradient(ellipse at center, #2a2a2a 0%, #0d0d0d 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  overflow: hidden;
}

.monitor-frame {
  background: linear-gradient(160deg, var(--monitor-beige-light) 0%, var(--monitor-beige) 30%, var(--monitor-beige-dark) 100%);
  border-radius: 20px;
  padding: 28px 32px 40px 32px;
  box-shadow: 
    0 8px 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -2px 0 rgba(0,0,0,0.2),
    0 2px 4px rgba(0,0,0,0.3);
  position: relative;
  max-width: 900px;
  width: 95vw;
}

.monitor-frame::before {
  content: 'IBM';
  position: absolute;
  bottom: 12px;
  left: 40px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  color: #555;
  letter-spacing: 3px;
}

.monitor-frame::after {
  content: '';
  position: absolute;
  bottom: 14px;
  right: 40px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4a4;
  box-shadow: 0 0 4px #4a4;
}

.monitor-frame.powered-off::after {
  background: #333;
  box-shadow: none;
}

.screen-bezel {
  background: #111;
  border-radius: 12px;
  padding: 4px;
  box-shadow: 
    inset 0 2px 8px rgba(0,0,0,0.8),
    inset 0 0 20px rgba(0,0,0,0.5);
}

.crt-screen {
  background: var(--screen-bg);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  height: 520px;
  max-height: 60vh;
  cursor: text;
}

.crt-screen.green-phosphor {
  box-shadow: 
    inset 0 0 60px rgba(0,30,0,0.4),
    0 0 20px rgba(51,255,51,0.08);
}

.crt-screen.amber-phosphor {
  box-shadow: 
    inset 0 0 60px rgba(30,20,0,0.4),
    0 0 20px rgba(255,176,0,0.08);
}

.crt-screen.white-phosphor {
  box-shadow: 
    inset 0 0 60px rgba(10,10,10,0.4),
    0 0 20px rgba(200,200,200,0.05);
}

/* Scanlines overlay */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* Screen curvature */
.screen-curve {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 65%,
    rgba(0,0,0,0.35) 100%
  );
  pointer-events: none;
  z-index: 11;
}

/* Flicker effect */
.crt-flicker {
  animation: flicker 0.08s infinite alternate;
}

@keyframes flicker {
  0% { opacity: 0.985; }
  100% { opacity: 1; }
}

/* Screen content */
.screen-content {
  padding: 16px 20px;
  height: 100%;
  overflow-y: auto;
  position: relative;
  z-index: 5;
  scrollbar-width: none;
}

.screen-content::-webkit-scrollbar {
  display: none;
}

.screen-content.green-text {
  color: var(--crt-green);
  text-shadow: 0 0 5px rgba(51,255,51,0.4);
}

.screen-content.amber-text {
  color: var(--crt-amber);
  text-shadow: 0 0 5px rgba(255,176,0,0.4);
}

.screen-content.white-text {
  color: var(--crt-white);
  text-shadow: 0 0 3px rgba(200,200,200,0.3);
}

.screen-line {
  font-family: 'VT323', monospace;
  font-size: 18px;
  line-height: 1.3;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.3em;
}

/* Cursor blink */
.cursor-blink {
  animation: blink 1.06s step-end infinite;
}

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

/* Power off animation */
.power-off-anim {
  animation: powerOff 0.5s ease-in forwards;
}

@keyframes powerOff {
  0% { transform: scale(1,1); opacity: 1; filter: brightness(1); }
  40% { transform: scale(1, 0.01); opacity: 1; filter: brightness(2); }
  70% { transform: scale(0.1, 0.01); opacity: 0.8; filter: brightness(3); }
  100% { transform: scale(0, 0); opacity: 0; filter: brightness(0); }
}

.power-on-anim {
  animation: powerOn 0.4s ease-out forwards;
}

@keyframes powerOn {
  0% { transform: scale(0, 0); opacity: 0; }
  30% { transform: scale(0.1, 0.01); opacity: 0.5; filter: brightness(3); }
  60% { transform: scale(1, 0.01); opacity: 0.8; filter: brightness(2); }
  100% { transform: scale(1,1); opacity: 1; filter: brightness(1); }
}

/* Status bar */
.status-bar {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.status-btn {
  transition: all 0.15s ease;
}

.status-btn:hover {
  transform: scale(1.05);
}

/* Hidden input for capturing keyboard */
.hidden-input {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .monitor-frame {
    padding: 16px 12px 30px 12px;
    border-radius: 12px;
  }
  .crt-screen {
    height: 400px;
    max-height: 55vh;
  }
  .screen-line {
    font-size: 14px;
  }
  .screen-content {
    padding: 10px 12px;
  }
}

@media (max-width: 400px) {
  .crt-screen {
    height: 350px;
    max-height: 50vh;
  }
  .screen-line {
    font-size: 12px;
  }
}

/* Boot screen center text */
.boot-center {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100%;
}

/* Footer remix */
.remix-footer {
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: #555;
}

.remix-footer a {
  color: #777;
  text-decoration: none;
}

.remix-footer a:hover {
  color: #aaa;
  text-decoration: underline;
}