    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      background: #050505;
      display: flex; flex-direction: column; align-items: center;
      padding: 14px 14px 30px;
      font-family: 'Courier New', monospace;
      color: #666; min-height: 100vh;
    }

    #wrap { position: relative; width: 100%; max-width: 1200px; }

    #crt-outer {
      position: relative; border-radius: 18px; overflow: hidden;
      box-shadow: inset 0 0 80px rgba(0,0,0,0.9), 0 0 40px rgba(0,0,0,0.8), 0 0 8px rgba(40,80,40,0.3);
      background: #000;
    }

    canvas { display: block; width: 100%; border-radius: 16px; }

    #crt-outer::after {
      content: ''; position: absolute; inset: 0;
      background:
        radial-gradient(ellipse 80% 70% at 50% 40%, rgba(60,120,60,0.04) 0%, transparent 70%),
        radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0,0,0,0.5) 100%);
      pointer-events: none; border-radius: 16px; z-index: 6;
    }

    #glass {
      position: absolute; inset: 0;
      background:
        radial-gradient(ellipse 50% 40% at 25% 20%, rgba(255,255,255,0.035) 0%, transparent 60%),
        radial-gradient(ellipse 30% 20% at 75% 80%, rgba(255,255,255,0.015) 0%, transparent 50%);
      pointer-events: none; border-radius: 16px; z-index: 10;
    }

    #dropzone {
      position: absolute; inset: 0;
      display: flex; align-items: center; justify-content: center;
      flex-direction: column; gap: 14px;
      background: rgba(0,0,0,0.82);
      color: #3a5a3a; font-size: 12px; letter-spacing: 2px;
      transition: opacity 0.3s;
      text-transform: uppercase; border-radius: 16px; z-index: 5;
    }

    #dropzone.hidden { opacity: 0; pointer-events: none; }
    #dropzone .dz-icon { font-size: 28px; opacity: 0.35; }
    #dropzone .dz-hint { opacity: 0.5; font-size: 11px; }
    #dropzone .dz-btns { display: flex; gap: 10px; margin-top: 4px; }
    #wrap.dragover #dropzone { color: #6a9a6a; background: rgba(5,15,5,0.9); }

    .dz-btn {
      background: rgba(30,50,30,0.8); border: 1px solid #2a4a2a; color: #5a9a5a;
      font-family: 'Courier New', monospace; font-size: 11px;
      padding: 7px 16px; cursor: pointer; border-radius: 4px;
      letter-spacing: 1px; text-transform: uppercase;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .dz-btn:hover { background: rgba(50,80,50,0.9); border-color: #4a8a4a; color: #8aca8a; }

    #scanline-css {
      position: absolute; inset: 0; pointer-events: none; z-index: 4;
      border-radius: 16px;
      background: repeating-linear-gradient(
        to bottom, transparent 0px, transparent 1px,
        rgba(0,0,0,0.18) 1px, rgba(0,0,0,0.18) 2px
      );
    }

    
    #toolbar {
      display: flex; align-items: center; justify-content: space-between;
      width: 100%; max-width: 1200px; padding: 6px 2px 2px; gap: 8px;
    }
    #toolbar-left  { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    #toolbar-right { display: flex; align-items: center; gap: 6px; }

    .tb-btn {
      background: #0e0e0e; border: 1px solid #222; color: #555;
      font-family: 'Courier New', monospace; font-size: 10px;
      padding: 5px 11px; cursor: pointer; border-radius: 4px;
      letter-spacing: 0.5px; text-transform: uppercase;
      transition: all 0.15s; white-space: nowrap;
    }
    .tb-btn:hover { background: #181818; color: #888; border-color: #333; }
    .tb-btn.rec-active {
      background: #1a0a0a; color: #e55; border-color: #622;
      animation: recpulse 1s ease-in-out infinite;
    }

    @keyframes recpulse {
      0%,100% { border-color: #622; box-shadow: none; }
      50%      { border-color: #c44; box-shadow: 0 0 6px rgba(200,60,60,0.3); }
    }

    #rec-timer {
      font-family: 'Courier New', monospace; font-size: 10px;
      color: #c44; letter-spacing: 1px; min-width: 42px; display: none;
    }
    #rec-timer.visible { display: inline; }

    
    #bar {
      display: flex; align-items: center; justify-content: space-between;
      width: 100%; max-width: 1200px;
      padding: 3px 2px; font-size: 10px; color: #333;
    }

    
    #controls {
      display: flex; flex-wrap: wrap; gap: 8px;
      padding: 8px 2px 4px; font-size: 10px;
      width: 100%; max-width: 1200px;
    }
    .ctrl { display: flex; align-items: center; gap: 6px; }
    .ctrl label { min-width: 68px; color: #444; font-size: 10px; }
    .ctrl input[type=range]    { width: 80px; accent-color: #3a5a3a; cursor: pointer; }
    .ctrl input[type=checkbox] { accent-color: #3a5a3a; cursor: pointer; }

    
    #presets {
      display: flex; align-items: center; gap: 6px;
      width: 100%; max-width: 1200px; padding: 2px 2px 6px; flex-wrap: wrap;
    }
    #presets .pre-label {
      font-size: 10px; color: #333; letter-spacing: 1px;
      text-transform: uppercase; margin-right: 4px;
    }
    .preset-slot { display: flex; }
    .preset-slot button {
      background: #0c0c0c; border: 1px solid #1e1e1e; color: #3a5a3a;
      font-family: 'Courier New', monospace; font-size: 10px;
      padding: 4px 8px; cursor: pointer; letter-spacing: 0.5px; transition: all 0.15s;
    }
    .preset-slot button:first-child { border-radius: 3px 0 0 3px; border-right: none; }
    .preset-slot button:last-child  { border-radius: 0 3px 3px 0; background: #080808; color: #2a3a2a; }
    .preset-slot button:first-child:hover { background: #151515; color: #6aaa6a; }
    .preset-slot button:last-child:hover  { background: #120c0c; color: #855; }
    .preset-slot button.has-data          { color: #5a8a5a; border-color: #253525; }
    .preset-slot button.has-data:last-child { color: #6a3a3a; }

    
    #vid-controls {
      display: none; gap: 8px; align-items: center;
      width: 100%; max-width: 1200px; padding: 4px 2px 0;
    }
    #vid-controls.visible { display: flex; }
    #vid-controls button {
      background: #0e0e0e; border: 1px solid #222; color: #555;
      font-family: 'Courier New', monospace; font-size: 10px;
      padding: 4px 10px; cursor: pointer; border-radius: 4px; transition: all 0.15s;
    }
    #vid-controls button:hover { background: #181818; color: #888; }
    #vid-seek { flex: 1; accent-color: #3a5a3a; cursor: pointer; }
    #vid-time { font-size: 10px; color: #333; min-width: 78px; }

    
    #crt-outer.mode43 { aspect-ratio: 4/3; }
    #crt-outer.mode43 canvas { height: 100%; width: 100%; object-fit: fill; }
    .tb-btn.active43 { background: #0a1a0a; color: #5a9a5a; border-color: #2a5a2a; }

    
    #timepanel {
      display: none; align-items: center; gap: 8px; flex-wrap: wrap;
      width: 100%; max-width: 1200px; padding: 4px 2px 2px;
      font-size: 10px; color: #444;
    }
    #timepanel.visible { display: flex; }
    #timepanel input[type=text] {
      background: #0c0c0c; border: 1px solid #252525; color: #6a9a6a;
      font-family: 'Courier New', monospace; font-size: 10px;
      padding: 4px 8px; border-radius: 3px; width: 148px; letter-spacing: 0.5px;
    }
    #timepanel input[type=text]::placeholder { color: #333; }
    #timepanel button {
      background: #0e0e0e; border: 1px solid #222; color: #555;
      font-family: 'Courier New', monospace; font-size: 10px;
      padding: 4px 10px; cursor: pointer; border-radius: 3px; transition: all 0.15s;
    }
    #timepanel button:hover { background: #181818; color: #888; }
    #timepanel .tp-hint { color: #2a3a2a; font-size: 9px; letter-spacing: 0.5px; }
    #timepanel .tp-active { color: #5a8a5a; }

    
    :fullscreen #crt-outer,
    :-webkit-full-screen #crt-outer {
      border-radius: 0; width: 100vw; height: 100vh;
      display: flex; align-items: center; justify-content: center;
    }
    :fullscreen canvas,
    :-webkit-full-screen canvas {
      width: auto !important; height: 100vh !important;
      max-width: 100vw; border-radius: 0;
    }
    :fullscreen #crt-outer::after,
    :-webkit-full-screen #crt-outer::after { opacity: 0.2; }
    :fullscreen #scanline-css,
    :-webkit-full-screen #scanline-css { border-radius: 0; }
