body {
  background: #0d0f14;
  color: #cad3df;
  font-family: ui-monospace, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 0px;
  margin: 0;
}

h1 {
  font-size: 1.15rem;
  margin: 0 0 16px;
  letter-spacing: 0.08em;
  color: #e6edf3;
}

/* CRT Chassis & Bezel */
.viewport {
  position: relative;
  background: #706deb;
  border-radius: 0px;
  padding: 0px;
  border: 0px solid #000;
  box-shadow: 
    0 0 0 2px #111317,
    0 20px 50px rgba(0, 0, 0, 0.95),
    inset 0 0 12px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

/* Canvas Display with Phosphor Glow */
canvas {
  image-rendering: pixelated;
  display: block;
  width: 100vw;
  aspect-ratio: 32 / 20;
  background: #000;
  border-radius: 0px;
  filter: contrast(1.08) brightness(1.1) drop-shadow(0 0 1.5px rgba(127, 125, 244, 0.35));
}

/* CRT Optical Mask: Scanlines, Vignette, and Curved Shadow */
.viewport::after {
  content: " ";
  position: absolute;
  inset: 0px; /* Aligns over the canvas inside the bezel padding */
  border-radius: 0px;
  pointer-events: none;
  background: 
    linear-gradient(
      rgba(18, 16, 16, 0) 50%, 
      rgba(0, 0, 0, 0.42) 50%
    ),
    linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.03),
      rgba(0, 255, 0, 0.01),
      rgba(0, 0, 255, 0.03)
    ),
radial-gradient(
  circle at center,
  transparent 60%,
  rgba(0, 0, 0, 0.15) 85%,
  rgba(0, 0, 0, 0.4) 100%
);
  background-size: 100% 3px, 6px 100%, 100% 100%;
}

.c64-scope-panel {
  margin-top: 18px;
  background: #111317;
  border: 3px solid #706deb;
  padding: 10px 14px 14px;
  box-shadow: 
    0 0 0 2px #000,
    0 12px 30px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 932px;
}

.c64-scope-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #a9ff9f;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.c64-scope-viewport {
  position: relative;
  width: 100%;
  height: 96px;
  background: #000000;
  border: 2px solid #2e2c9b;
  overflow: hidden;
}

#scope {
  image-rendering: pixelated;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  filter: contrast(1.15) brightness(1.2) drop-shadow(0 0 3px rgba(117, 206, 200, 0.45));
}

.c64-scope-viewport::after {
  content: " ";
  position: absolute;
  inset: 0px;
  pointer-events: none;
  background: 
    linear-gradient(
      rgba(18, 16, 16, 0) 50%, 
      rgba(0, 0, 0, 0.45) 50%
    ),
    radial-gradient(
      circle at center,
      transparent 65%,
      rgba(0, 0, 0, 0.45) 100%
    );
  background-size: 100% 4px, 100% 100%;
}