:root {
  --dos-blue: #0000AA;
  --dos-bright-blue: #0000FF;
  --dos-white: #FFFFFF;
  --dos-yellow: #FFFF55;
  --dos-gray: #AAAAAA;
  --dos-green: #55FF55;
  --dos-dark-gray: #555555;
  --dos-cyan: #55FFFF;
  --dos-red: #FF5555;
  --dos-black: #000000;
}

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

body {
  background: #000011;
  color: var(--dos-white);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanline overlay */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  z-index: 9999;
}

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

.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.97; }
  5% { opacity: 1; }
  10% { opacity: 0.98; }
  15% { opacity: 1; }
  100% { opacity: 1; }
}

.crt-flicker {
  animation: crt-flicker 4s infinite;
}

/* ASCII box borders */
.dos-box {
  position: relative;
  border: 2px solid var(--dos-gray);
  background: var(--dos-blue);
}

.dos-box::before {
  content: attr(data-title);
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--dos-blue);
  padding: 0 6px;
  color: var(--dos-yellow);
  font-size: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

/* Double border effect */
.dos-double-border {
  border: 3px double var(--dos-gray);
  background: var(--dos-blue);
}

/* CRT monitor effect */
.crt-monitor {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(0, 0, 170, 0.3),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
}

.crt-monitor::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

/* QBasic IDE code area */
.qbasic-ide {
  background: var(--dos-blue);
  color: var(--dos-yellow);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  border: 2px solid var(--dos-gray);
  padding: 0;
  overflow: auto;
  white-space: pre;
}

.qbasic-ide::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.qbasic-ide::-webkit-scrollbar-track {
  background: #000088;
}

.qbasic-ide::-webkit-scrollbar-thumb {
  background: var(--dos-gray);
  border: 1px solid #000088;
}

/* Progress bar */
@keyframes progress-fill {
  0% { width: 0%; }
  100% { width: 100%; }
}

.progress-bar-fill {
  background: var(--dos-green);
  height: 100%;
  transition: width 0.1s linear;
}

/* Drop zone */
.drop-zone {
  border: 3px dashed var(--dos-gray);
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--dos-yellow);
  background: rgba(85, 255, 85, 0.05);
}

/* DOS button */
.dos-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  border: 2px outset var(--dos-gray);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.05s;
  user-select: none;
}

.dos-btn:active {
  border-style: inset;
  transform: translate(1px, 1px);
}

/* Title bar for image preview */
.title-bar {
  background: linear-gradient(90deg, var(--dos-gray), var(--dos-dark-gray));
  padding: 2px 8px;
  font-size: 12px;
  color: var(--dos-black);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-bar-btn {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px outset var(--dos-white);
  background: var(--dos-gray);
  text-align: center;
  line-height: 12px;
  font-size: 10px;
  cursor: pointer;
  margin-left: 2px;
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--dos-dark-gray);
  border: 1px inset var(--dos-gray);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 20px;
  background: var(--dos-gray);
  border: 2px outset var(--dos-white);
  cursor: pointer;
}

/* Toggle / Radio styling */
.dos-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  padding: 3px 0;
}

.dos-radio-dot {
  width: 14px;
  height: 14px;
  border: 2px inset var(--dos-gray);
  background: var(--dos-black);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dos-radio-dot.active {
  background: var(--dos-black);
}

.dos-radio-dot.active::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--dos-green);
  border-radius: 0;
}

.dos-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

.dos-check-box {
  width: 14px;
  height: 14px;
  border: 2px inset var(--dos-gray);
  background: var(--dos-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--dos-green);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .qbasic-ide {
    font-size: 11px;
  }
}