  * { margin: 0; padding: 0; box-sizing: border-box; }
    body { 
      background-color: #050d05; 
      color: #33ff33; 
      display: flex; 
      justify-content: center; 
      align-items: center; 
      height: 100vh; 
      height: 100dvh;
      overflow: hidden; 
      font-family: 'Courier New', Courier, monospace;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      user-select: none;
      touch-action: none;
    }
    
    /* Hide system cursor globally when game is active */
    body.game-running, html.game-running, body.game-running * {
      cursor: none !important;
    }
    
    /* CRT Scanline overlay — uses will-change for GPU compositing */
    body::after {
      content: " ";
      display: block;
      position: fixed;
      top: 0; left: 0; bottom: 0; right: 0;
      background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
      z-index: 999;
      background-size: 100% 4px, 3px 100%;
      pointer-events: none;
      will-change: transform;
    }

    canvas { 
      border: 0px none; 
      background-color: black; 
      image-rendering: pixelated;
      image-rendering: crisp-edges;
      cursor: none;
      /* GPU acceleration for canvas element */
      will-change: contents;
      transform: translateZ(0);
    }

    #start-screen {
      position: absolute; top: 0; left: 0; width: 100%; height: 100%;
      background: radial-gradient(ellipse at center, #0a1c0a 0%, #020702 100%);
      display: flex; flex-direction: column;
      justify-content: center; align-items: center;
      z-index: 100;
      padding: 20px;
      border: 4px solid #113311;
    }

    .terminal-container {
      width: 100%;
      max-width: 600px;
      border: 2px solid #33ff33;
      padding: 30px;
      background: rgba(5, 20, 5, 0.85);
      box-shadow: 0 0 15px rgba(51, 255, 51, 0.3);
      border-radius: 4px;
    }

    h1 {
      font-size: 24px;
      margin-bottom: 20px;
      text-align: center;
      text-shadow: 0 0 10px #33ff33;
      letter-spacing: 2px;
      border-bottom: 2px solid #33ff33;
      padding-bottom: 10px;
    }

    .status-text {
      font-size: 14px;
      margin-bottom: 25px;
      line-height: 1.6;
      min-height: 50px;
      text-shadow: 0 0 5px #33ff33;
    }

    /* Upload progress bar */
    #upload-progress {
      display: none;
      width: 100%;
      height: 20px;
      background: rgba(51, 255, 51, 0.1);
      border: 1px solid #33ff33;
      border-radius: 2px;
      margin-bottom: 15px;
      overflow: hidden;
    }
    #upload-progress-bar {
      height: 100%;
      width: 0%;
      background: #33ff33;
      transition: width 0.2s ease;
      box-shadow: 0 0 8px #33ff33;
    }

    /* Drag and Drop Zone */
    #upload-zone {
      border: 2px dashed #33ff33;
      padding: 40px 20px;
      text-align: center;
      cursor: pointer;
      background: rgba(51, 255, 51, 0.05);
      transition: all 0.3s ease;
      margin-bottom: 20px;
    }
    #upload-zone:hover, #upload-zone.dragover {
      background: rgba(51, 255, 51, 0.15);
      box-shadow: 0 0 15px rgba(51, 255, 51, 0.2);
    }
    #upload-zone p {
      font-size: 16px;
      font-weight: bold;
      margin-bottom: 10px;
    }
    #upload-zone span {
      font-size: 12px;
      color: #22aa22;
    }

    /* Hidden File Input */
    #file-input { display: none; }

    /* Launch Button */
    .btn {
      display: none;
      width: 100%;
      padding: 15px;
      background: #33ff33;
      color: #050d05;
      border: none;
      font-size: 18px;
      font-weight: bold;
      cursor: pointer;
      text-transform: uppercase;
      font-family: inherit;
      box-shadow: 0 0 10px #33ff33;
      transition: all 0.2s ease;
    }
    .btn:hover {
      background: #55ff55;
      box-shadow: 0 0 20px #55ff55;
    }
    .btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      box-shadow: none;
    }

    /* Reset Button */
    .btn-reset {
      display: none;
      width: 100%;
      padding: 12px;
      background: transparent;
      color: #ff3333;
      border: 2px solid #ff3333;
      font-size: 15px;
      font-weight: bold;
      cursor: pointer;
      text-transform: uppercase;
      font-family: inherit;
      margin-top: 15px;
      box-shadow: 0 0 5px rgba(255, 51, 51, 0.3);
      transition: all 0.2s ease;
    }
    .btn-reset:hover {
      background: rgba(255, 51, 51, 0.1);
      box-shadow: 0 0 15px rgba(255, 51, 51, 0.5);
    }

    /* Fullscreen re-entry banner */
    #fs-banner {
      display: none;
      position: fixed; bottom: 0; left: 0; width: 100%;
      background: rgba(51, 255, 51, 0.15);
      color: #33ff33; text-align: center;
      padding: 8px; font-size: 13px; z-index: 200;
      cursor: pointer; backdrop-filter: blur(4px);
      border-top: 1px solid rgba(51, 255, 51, 0.3);
      animation: fadeIn 0.3s;
    }
    #fs-banner:hover { background: rgba(51, 255, 51, 0.25); }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    /* Loading overlay during game boot */
    #loading-overlay {
      display: none;
      position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: rgba(5, 13, 5, 0.95);
      z-index: 500;
      justify-content: center; align-items: center;
      flex-direction: column;
      color: #33ff33;
      font-size: 18px;
    }
    #loading-overlay .spinner {
      width: 40px; height: 40px;
      border: 3px solid rgba(51, 255, 51, 0.2);
      border-top: 3px solid #33ff33;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      margin-bottom: 20px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    #mobile-controls {
      display: none;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 300;
      pointer-events: none;
      padding-bottom: env(safe-area-inset-bottom, 0px);
      padding-left: env(safe-area-inset-left, 0px);
      padding-right: env(safe-area-inset-right, 0px);
    }
    #mobile-controls.visible {
      display: block;
    }

    .mobile-bar {
      pointer-events: auto;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 4px;
      padding: 6px;
      background: rgba(5, 13, 5, 0.86);
      border-top: 1px solid rgba(51, 255, 51, 0.35);
      backdrop-filter: blur(4px);
    }
    .mobile-bar.collapsed {
      display: none;
    }

    .m-btn {
      background: rgba(51, 255, 51, 0.1);
      color: #33ff33;
      border: 1px solid rgba(51, 255, 51, 0.45);
      border-radius: 3px;
      font-family: inherit;
      font-size: 11px;
      font-weight: bold;
      padding: 7px 8px;
      min-width: 42px;
      min-height: 34px;
      line-height: 1;
      text-transform: uppercase;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }
    .m-btn.active {
      background: #33ff33;
      color: #050d05;
    }
    .m-btn-mouse {
      border-color: #ffaa00;
      color: #ffaa00;
      background: rgba(255, 170, 0, 0.12);
    }
    .m-btn-mouse.active {
      background: #ffaa00;
      color: #050d05;
    }
    .m-btn-accent {
      border-color: #33ff33;
      background: rgba(51, 255, 51, 0.22);
    }
    .m-btn-dim {
      opacity: 0.7;
    }

    .mobile-key-drawer {
      display: none;
      pointer-events: auto;
      max-height: 48dvh;
      overflow-y: auto;
      background: rgba(5, 13, 5, 0.94);
      border-top: 1px solid #33ff33;
      padding: 8px;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-y;
    }
    .mobile-key-drawer.open {
      display: block;
    }
    .mobile-key-group {
      margin-bottom: 8px;
    }
    .mobile-key-group:last-child {
      margin-bottom: 0;
    }
    .mobile-key-group-title {
      font-size: 10px;
      color: #ffaa00;
      letter-spacing: 1px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .mobile-key-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
      gap: 4px;
    }

    .mobile-restore-btn {
      display: none;
      pointer-events: auto;
      position: fixed;
      right: calc(8px + env(safe-area-inset-right, 0px));
      bottom: calc(8px + env(safe-area-inset-bottom, 0px));
      background: rgba(5, 13, 5, 0.8);
      color: #33ff33;
      border: 1px solid rgba(51, 255, 51, 0.5);
      border-radius: 3px;
      font-family: inherit;
      font-size: 11px;
      font-weight: bold;
      padding: 6px 10px;
      touch-action: manipulation;
    }
    .mobile-restore-btn.visible {
      display: block;
    }

    .mobile-hidden-input {
      position: fixed;
      left: -9999px;
      top: 0;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 600;
      background: rgba(2, 7, 2, 0.88);
      backdrop-filter: blur(4px);
      justify-content: center;
      align-items: center;
      padding: 20px;
      touch-action: auto;
    }
    .modal-overlay.open {
      display: flex;
    }
    .modal-dialog {
      max-width: 440px;
      width: 100%;
    }
    .modal-dialog h2 {
      font-size: 18px;
      text-align: center;
      text-shadow: 0 0 10px #33ff33;
      letter-spacing: 1.5px;
      border-bottom: 2px solid #33ff33;
      padding-bottom: 10px;
      margin-bottom: 14px;
    }
    .modal-subtitle {
      font-size: 13px;
      line-height: 1.5;
      margin-bottom: 16px;
      text-align: center;
      color: #a3ffa3;
    }
    .terminal-input {
      width: 100%;
      padding: 12px 14px;
      background: rgba(5, 13, 5, 0.95);
      color: #33ff33;
      border: 2px solid #33ff33;
      border-radius: 2px;
      font-family: inherit;
      font-size: 16px;
      letter-spacing: 2px;
      outline: none;
      -webkit-user-select: text;
      user-select: text;
      touch-action: manipulation;
    }
    .terminal-input:focus {
      box-shadow: 0 0 12px rgba(51, 255, 51, 0.45);
    }
    .auth-error {
      min-height: 20px;
      margin: 10px 0 14px;
      font-size: 12px;
      color: #ff4444;
      text-align: center;
      text-shadow: 0 0 6px rgba(255, 68, 68, 0.4);
    }
    .modal-actions {
      display: flex;
      gap: 10px;
    }
    .modal-btn {
      display: block;
      margin-top: 0;
      padding: 12px;
      font-size: 14px;
      touch-action: manipulation;
    }

    @media (max-width: 600px) {
      .terminal-container {
        padding: 18px;
      }
      h1 {
        font-size: 18px;
      }
    }
    @media (orientation: landscape) and (pointer: coarse) {
      .mobile-bar {
        padding: 4px;
        gap: 3px;
        background: rgba(5, 13, 5, 0.7);
      }
      .m-btn {
        font-size: 10px;
        padding: 5px 6px;
        min-width: 36px;
        min-height: 28px;
      }
    }