@layer overlays {
  .surface-overlay {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #0d2b45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
  }

  .surface-overlay.surface-active {
    opacity: 1;
    pointer-events: auto;
    overscroll-behavior: none;
  }

  .surface-overlay.surface-flash {
    background: white;
    transition: background 0.3s ease;
  }

  .surface-overlay.surface-fade-out {
    background: #050505;
    transition: background 0.5s ease;
  }

  /* Pixel art canvas — upscale with nearest-neighbor */
  .surface-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
  }

  /* Reboot button */
  .surface-reboot {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 248, 231, 0.15);
    color: #1a1a2e;
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.4s ease, background 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 10000;
  }

  .surface-reboot.visible {
    opacity: 1;
  }

  .surface-reboot:hover {
    background: rgba(255, 248, 231, 0.35);
  }
}
