:root {
  --vapor-pink: #ff71ce;
  --vapor-cyan: #01cdfe;
  --vapor-purple: #b967ff;
  --vapor-dark: #1a0a2e;
  --vapor-darker: #0d0221;
}

/* ============================================
           WINDOWS XP LOGIN LOADING OVERLAY
           ============================================ */

/* (Critical base styles live inline in index.html to prevent FOUC.) */
#xp-login-screen {
  opacity: 1;
  transform: translateZ(0);
  transition: opacity 420ms ease;
}

#xp-login-screen.xp-login--hiding {
  opacity: 0;
  pointer-events: none;
}

/* XP login overlay responsive overrides (inline CSS provides base, this prevents overflow on mobile) */
@media (max-width: 720px) {
  #xp-login-screen .xp-login-center {
    grid-template-columns: 1fr;
    grid-template-rows: auto 2px auto;
    padding: 0 6vw;
    gap: 18px;
  }

  #xp-login-screen .xp-login-divider {
    height: 2px;
    width: 100%;
  }

  #xp-login-screen .xp-login-right-panel {
    padding-left: 0;
  }

  #xp-login-screen .xp-login-logo {
    width: min(280px, 78vw);
    height: auto;
  }
}

@media (max-width: 420px) {
  #xp-login-screen {
    grid-template-rows: 56px 1fr 92px;
  }

  #xp-login-screen .xp-login-prompt {
    font-size: 18px;
  }
}

/* Help the overlay look crisp on some displays */
#xp-login-screen img {
  -webkit-user-drag: none;
  user-select: none;
}

/* ============================================
           VAPORWAVE OVERLAY EFFECTS
           ============================================ */

/* Shared overlay positioning */
.crt-overlay,
.vhs-overlay,
.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* CRT Scanlines */
.crt-overlay {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9998;
}

/* VHS Tracking Effect */
.vhs-overlay {
  z-index: 9997;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 113, 206, 0.03) 50%,
    transparent 100%
  );
  animation: vhsScroll 8s linear infinite;
}

@keyframes vhsScroll {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(100%);
  }
}

/* Vignette */
.vignette {
  z-index: 9995;
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
}

/* ============================================
           ANIMATED STARS BACKGROUND
           ============================================ */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* ============================================
           VAPORWAVE NAVBAR
           ============================================ */
/* Windows XP Navbar */
.xp-navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 68px;
  background: linear-gradient(180deg, #245dda 0%, #1f52c6 10%, #1941a5 100%);
  border-bottom: 2px solid #00368a;
  display: flex;
  align-items: center;
  padding: 0 5px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease-out;
}

.xp-navbar.navbar-hidden {
  transform: translateY(-100%);
}

.start-btn {
  height: 100%;
  background: linear-gradient(180deg, #3eae36 0%, #37952f 100%);
  border-radius: 0 15px 15px 0;
  padding: 0 15px 0 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: Tahoma, sans-serif;
  font-weight: bold;
  font-style: italic;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  box-shadow: inset 2px 2px 5px rgba(255, 255, 255, 0.3);
  margin-left: -5px;
  user-select: none;
}

.start-btn img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.xp-nav-links {
  margin-left: 16px;
  font-family: Tahoma, sans-serif;
  font-size: 16px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.xp-nav-links a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
}

.xp-nav-links a:hover {
  text-decoration: underline;
}

/* ============================================
           SECTIONS
           ============================================ */
section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;

  /* Soft, seamless section transitions: 80px fade to black at top and bottom */
  --section-fade-h: 80px;
}

section::before,
section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--section-fade-h);
  pointer-events: none;
  z-index: 10;
}

/* Top edge: black -> transparent into the section */
section::before {
  top: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* Bottom edge: transparent -> black out of the section */
section::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ============================================
           HERO SECTION
           ============================================ */
#hero {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    180deg,
    var(--vapor-darker) 0%,
    #16082c 30%,
    #2d1b4e 60%,
    #1a0a2e 100%
  );
}

/* Hero vaporwave clouds (subtle, behind content) */
.hero-clouds {
  position: absolute;
  inset: -12% -12% -12% -12%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: blur(0.6px) saturate(1.35);
  background-image:
    radial-gradient(
      closest-side at 18% 35%,
      rgba(255, 113, 206, 0.55),
      rgba(255, 113, 206, 0) 62%
    ),
    radial-gradient(
      closest-side at 32% 55%,
      rgba(185, 103, 255, 0.42),
      rgba(185, 103, 255, 0) 66%
    ),
    radial-gradient(
      closest-side at 68% 42%,
      rgba(185, 103, 255, 0.45),
      rgba(185, 103, 255, 0) 64%
    ),
    radial-gradient(
      closest-side at 78% 62%,
      rgba(255, 113, 206, 0.38),
      rgba(255, 113, 206, 0) 68%
    );
  animation: heroCloudDrift 18s linear infinite;
}

@keyframes heroCloudDrift {
  0% {
    transform: translate3d(-1.5%, -0.5%, 0) scale(1);
  }
  50% {
    transform: translate3d(1.5%, 0.8%, 0) scale(1.02);
  }
  100% {
    transform: translate3d(-1.5%, -0.5%, 0) scale(1);
  }
}

/* XP-ish error popup (auto disappears quickly) */
.hero-error-popup {
  position: absolute;
  width: 280px;
  pointer-events: none;
  z-index: 7;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow:
    inset 1px 1px 0 #dfdfdf,
    inset -1px -1px 0 #0a0a0a,
    8px 8px 18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.95);
  animation: heroErrorPopup 2200ms ease 1;
}

.hero-error-popup .titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 6px 8px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-error-popup .body {
  padding: 10px 10px 12px;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  color: #000;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.hero-error-popup .msg b {
  font-weight: 700;
}

.hero-error-popup .buttons {
  padding: 0 10px 10px;
  display: flex;
  justify-content: flex-end;
}

.hero-error-popup .btn {
  display: inline-block;
  min-width: 64px;
  text-align: center;
  padding: 4px 10px;
  background: #dfdfdf;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: inset 1px 1px 0 #ffffff;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
}

.hero-error-popup .icon {
  width: 22px;
  height: 22px;
  display: block;
  image-rendering: auto;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.18));
}

@keyframes heroErrorPopup {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  15% {
    opacity: 1;
    transform: scale(1);
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
  }
}

/* Subtle clouds for player section too */
#player-section .section-clouds {
  position: absolute;
  inset: -12% -12% -12% -12%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.12;
  mix-blend-mode: screen;
  filter: blur(0.8px) saturate(1.25);
  background-image:
    radial-gradient(
      closest-side at 25% 40%,
      rgba(185, 103, 255, 0.35),
      rgba(185, 103, 255, 0) 66%
    ),
    radial-gradient(
      closest-side at 70% 55%,
      rgba(255, 113, 206, 0.28),
      rgba(255, 113, 206, 0) 70%
    );
  animation: heroCloudDrift 22s linear infinite;
}

/* Foreground shadow to fade forward wireframes into black */
.hero-front-shadow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40vh;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

/* Retro Sun */
.retro-sun-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  overflow: hidden;
}

.retro-sun {
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: linear-gradient(
    to top,
    #ff00ff 0%,
    #ff6b6b 30%,
    #feca57 60%,
    #ff9ff3 100%
  );
  position: relative;
  margin-top: -50px;
  box-shadow:
    0 0 60px #ff00ff,
    0 0 120px rgba(255, 107, 107, 0.5),
    0 0 200px rgba(254, 202, 87, 0.3);
  will-change: transform;
  animation: sunPulse 4s ease-in-out infinite;

  /* Horizontal Lines */
  -webkit-mask-image: linear-gradient(
    to top,
    transparent 0%,
    black 0%,
    transparent 4%,
    black 4%,
    transparent 8%,
    black 8%,
    transparent 12%,
    black 12%,
    transparent 17%,
    black 17%,
    transparent 23%,
    black 23%,
    transparent 30%,
    black 30%,
    transparent 38%,
    black 38%,
    transparent 48%,
    black 48%,
    black 100%
  );
  mask-image: linear-gradient(
    to top,
    transparent 0%,
    black 0%,
    transparent 4%,
    black 4%,
    transparent 8%,
    black 8%,
    transparent 12%,
    black 12%,
    transparent 17%,
    black 17%,
    transparent 23%,
    black 23%,
    transparent 30%,
    black 30%,
    transparent 38%,
    black 38%,
    transparent 48%,
    black 48%,
    black 100%
  );
}

@keyframes sunPulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.02);
    filter: brightness(1.1);
  }
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Hero masked layer (hero model + pillars) */
#hero-model-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

#hero-model-reveal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* hidden by default */
  clip-path: inset(100% 0px 0px 0px);
  filter: drop-shadow(0 0 24px rgba(1, 205, 254, 0.14))
    drop-shadow(0 0 28px rgba(255, 113, 206, 0.12));
}

#hero-model-reveal::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -50%;
  bottom: -50%;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.07),
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px,
    transparent 5px
  );
  mix-blend-mode: screen;
  transform: translateY(0);
}

#hero-model-reveal.is-revealing::after {
  opacity: 0.5;
  animation: heroModelScan 900ms linear infinite;
}

@keyframes heroModelScan {
  0% {
    transform: translateY(-15%);
  }

  100% {
    transform: translateY(15%);
  }
}

#hero-model-reveal canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Hero Content */
.hero-content {
  z-index: 10;
  text-align: center;
  pointer-events: none;
  position: absolute;
  top: 35%;
  width: 100%;
  padding: 0 20px;
}

/* Glitch Text Effect */
.glitch-container {
  position: relative;
  display: inline-block;
}

.glitch-text {
  font-family: "Orbitron", sans-serif;
  font-size: 6rem;
  font-weight: 900;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 10px;
  background: linear-gradient(to bottom, #00ffff, #ff00cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 4px 4px 0px rgba(255, 0, 204, 0.5);
  will-change: transform;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.02);
    filter: brightness(1.3);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.japanese-title {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 2.5rem;
  color: var(--vapor-pink);
  margin-top: 10px;
  text-shadow:
    0 0 10px var(--vapor-pink),
    0 0 20px var(--vapor-pink),
    0 0 40px var(--vapor-pink);
  letter-spacing: 15px;
  animation: neonFlicker 2s infinite;
}

@keyframes neonFlicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    opacity: 1;
    text-shadow:
      0 0 10px var(--vapor-pink),
      0 0 20px var(--vapor-pink),
      0 0 40px var(--vapor-pink);
  }

  20%,
  24%,
  55% {
    opacity: 0.8;
    text-shadow: none;
  }
}

.subtitle {
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  color: var(--vapor-cyan);
  letter-spacing: 8px;
  margin-top: 20px;
  text-shadow: 0 0 10px var(--vapor-cyan);
}

.scroll-indicator {
  font-size: 1rem;
  color: var(--vapor-purple);
  margin-top: 50px;
  animation: bounce 2s infinite;
  opacity: 0.7;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

.section-title {
  font-family: "Orbitron", sans-serif;
  font-size: 2.5rem;
  background: linear-gradient(90deg, var(--vapor-pink), var(--vapor-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  margin-top: 80px;
  letter-spacing: 5px;
}

.section-subtitle {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--vapor-purple);
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

/* ============================================
           RETRO PAINT INTERFACE
           ============================================ */
.paint-window {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 20;
  width: min(100%, 630px);
  margin: 28px auto 0;
  max-width: 608px;
}

/* Draw the WinXP-style inset border ABOVE the content so scrollable children
   can't visually cover the bottom edge. */
.paint-window::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  box-shadow:
    inset 1px 1px 0 #dfdfdf,
    inset -1px -1px 0 #0a0a0a;
}

.paint-window > * {
  position: relative;
  z-index: 1;
}

/* ============================================
           GENERIC XP WINDOWS (Desktop)
           ============================================ */
.xp-window-wrapper {
  position: absolute;
  inset: 0;
  padding: 14px;
  padding-bottom: var(--xp-taskbar-h);
  width: 100%;
  height: 100%;
  z-index: 55;
  opacity: 0;
  transform: scale(0.86);
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.24s ease;
}

.xp-window-wrapper.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.xp-window-wrapper.is-hiding {
  opacity: 0;
  transform: scale(0.86);
  pointer-events: none;
}

.xp-window {
  width: min(100%, 520px);
  height: min(100%, 340px);
  margin: 0 auto;
  background: #ece9d8;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    6px 6px 16px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.xp-titlebar {
  background: linear-gradient(90deg, #0a246a, #3a6ea5);
  color: #fff;
  padding: 3px 6px;
  font-family: Tahoma, sans-serif;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.xp-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xp-title-icon {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
}

.xp-titlebar-buttons {
  display: flex;
  gap: 4px;
}

.xp-titlebar-btn {
  width: 18px;
  height: 16px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  color: #000;
  font-size: 10px;
  line-height: 10px;
  cursor: pointer;
  padding: 0;
}

.xp-titlebar-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
}

.xp-window-body {
  flex: 1;
  background: #fff;
  border-top: 1px solid #808080;
  padding: 10px;
  overflow: auto;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  color: #000;
}

.xp-window-placeholder {
  opacity: 0.85;
}

.paint-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: white;
  padding: 2px 4px;
  font-family: "VT323", monospace;
  font-size: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;

  span {
    display: flex;
    align-items: center;
  }
}

.titlebar-icon {
  width: 8px;
  height: 8px;
  vertical-align: middle;
  margin-right: 4px;
  image-rendering: pixelated;
}

.paint-titlebar-buttons {
  display: flex;
  gap: 3px;
}

.paint-titlebar-btn {
  width: 8px;
  height: 8px;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  font-size: 6px;
  line-height: 6px;
  text-align: center;
  cursor: pointer;
  font-family: "VT323", monospace;
}

.paint-titlebar-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
}

.paint-menubar {
  background: #c0c0c0;
  padding: 2px 2px;
  font-family: "VT323", monospace;
  font-size: 0.4rem;
  border-bottom: 1px solid #808080;
  display: flex;
  align-items: center;
  gap: 2px;
}

.paint-menubar span {
  padding: 2px 8px;
  cursor: pointer;
  color: #000;
}

/* Menubar CREATE button (small, special look) */
.paint-create-btn {
  margin-left: auto;
  height: 10px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #000;
  border-color: #ffffff #808080 #808080 #ffffff;
  background: linear-gradient(
    180deg,
    rgba(255, 113, 206, 0.95) 0%,
    rgba(1, 205, 254, 0.95) 100%
  );
  color: #0d0221;
  cursor: pointer;
  font-family: "VT323", monospace;
  font-size: 0.4rem;
  line-height: 1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(255, 113, 206, 0.35);
  animation: paintCreatePulse 1.6s ease-in-out infinite;
}

.paint-create-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
  transform: translateY(1px);
  animation: none;
}

.paint-create-btn-main {
  font-weight: 700;
}
@keyframes paintCreatePulse {
  0%,
  100% {
    filter: saturate(1);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 10px rgba(1, 205, 254, 0.25);
  }
  50% {
    filter: saturate(1.2);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.35),
      0 0 18px rgba(255, 113, 206, 0.55);
  }
}

.paint-menubar span.is-active:not(.paint-create-btn-main) {
  background: #000080;
  color: white;
}

.paint-menubar span:hover:not(.paint-create-btn-main) {
  background: #000080;
  color: white;
}

.paint-create-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 113, 206, 0.98) 25%,
    rgba(1, 205, 254, 0.98) 100%
  );
}

.paint-toolbar {
  background: #c0c0c0;
  padding: 2px;
  display: flex;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid #808080;
  flex-wrap: wrap;
}

/* Scrollable content area (toolbar + canvas) */
.paint-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.paint-tool-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.paint-tool-section-title {
  font-family: "VT323", monospace;
  font-size: 0.4rem;
  color: #000;
  text-align: center;
}

.paint-color-palette {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  gap: 1px;
  padding: 2px;
  background: #808080;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

.paint-color {
  width: 4px;
  height: 4px;
  cursor: pointer;
  border: 1px solid #000;
}

.paint-color:hover {
  border: 2px solid #fff;
}

.paint-color.selected {
  border: 2px solid #ff0;
  box-shadow: 0 0 4px #ff0;
}

.paint-stickers-panel {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  flex-wrap: wrap;
  max-width: 300px;
}

.paint-sticker {
  width: 12px;
  height: 12px;
  background: transparent;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.1s;
}

.paint-sticker:hover {
  transform: scale(1.1);
}

.paint-sticker:active,
.paint-sticker.selected {
  border-color: #808080 #ffffff #ffffff #808080;
  background: rgba(160, 160, 160, 0.3);
}

.paint-canvas-container {
  background: #808080;
  padding: 4px;
  margin: 4px;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  overflow: hidden;
  position: relative;
  width: 260px;
  height: 108px;
  min-height: 108px;
  margin-left: auto;
  margin-right: auto;
}

/* Stickers layer should cover the same area as the canvas (inside padding). */
#stickers-layer {
  position: absolute;
  inset: 4px;
  pointer-events: none;
}

#paint-canvas {
  display: block;
  width: 260px;
  height: 100px;
  cursor: crosshair;
  image-rendering: pixelated;
}

/* (Paint statusbar removed) */

/* Stickers on canvas */
.canvas-sticker {
  position: absolute;
  cursor: move;
  user-select: none;
  pointer-events: auto;
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
  transition: transform 0.1s;
  transform: translate(-50%, -50%);
}

.canvas-sticker img {
  display: block;
  pointer-events: none;
}

.canvas-sticker:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.canvas-sticker.dragging {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1.2);
}

/* ============================================
           CASSETTE GENERATOR BUTTON & CASSETTE
           ============================================ */
.paint-and-cassette-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  justify-content: center;
  padding: 18px 20px;
  margin: 0 auto;
}

/* Stage wrapper so the 3D cassette can slide out from behind Paint */
.paint-stage {
  position: relative;
  display: inline-block;
  overflow: visible;
  width: min(70vw, 592px);
  max-width: 100%;
}

/* 3D cassette canvas extends beyond the right edge */
#cassette-gen-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 240px);
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: none;
}

.generate-cassette-btn,
.generate-art-btn {
  background: linear-gradient(180deg, #c0c0c0 0%, #a0a0a0 100%);
  border: 3px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 4px 6px;
  font-family: "VT323", monospace;
  color: #000;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
  min-width: 84px;
}

.generate-cassette-btn:hover,
.generate-art-btn:hover {
  background: linear-gradient(180deg, #d0d0d0 0%, #b0b0b0 100%);
}

.generate-cassette-btn:active,
.generate-art-btn:active {
  border-color: #808080 #ffffff #ffffff #808080;
  transform: translateY(2px);
}

.generate-art-btn {
  background: linear-gradient(180deg, #d6d6ff 0%, #a9b0ff 100%);
  color: #090019;
  padding: 2px 4px;
  min-width: 64px;
  gap: 2px;
  font-size: 0.5rem;
}

.generate-art-btn:hover {
  background: linear-gradient(180deg, #e0e0ff 0%, #b7c0ff 100%);
}

.generate-cassette-btn .btn-icon,
.generate-art-btn .btn-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cassette-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  image-rendering: pixelated;
}

.generate-cassette-btn .btn-text,
.generate-art-btn .btn-text {
  text-align: center;
  line-height: 1.05;
}

/* (Old DOM cassette styles removed — cassette is now rendered in 3D) */

/* ============================================
           MACHINE BUILDING SCREEN
           ============================================ */
.machine-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow: hidden;
}

.machine-screen.shake {
  animation: machineShake 0.1s infinite;
}

@keyframes machineShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-1px, 1px);
  }
}

.machine-title {
  font-family: "VT323", monospace;
  font-size: 0.6rem;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  margin-bottom: 20px;
  animation: machineTextFlicker 0.3s infinite;
}

@keyframes machineTextFlicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
  75% {
    opacity: 0.95;
  }
}

.machine-progress {
  width: 80%;
  height: 30px;
  background: #222;
  border: 3px solid #444;
  position: relative;
  overflow: hidden;
}

.machine-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0f0, #0a0);
  width: 0%;
  transition: width 0.1s;
  box-shadow: 0 0 20px #0f0;
}

.machine-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "VT323", monospace;
  color: #fff;
  font-size: 0.6rem;
  text-shadow: 1px 1px 0 #000;
}

.machine-gears {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.machine-gear {
  width: 40px;
  height: 40px;
  border: 4px solid #666;
  border-radius: 50%;
  position: relative;
  animation: gearSpin 1s linear infinite;
}

.machine-gear::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  background: #444;
  border-radius: 50%;
}

.machine-gear:nth-child(2) {
  animation-direction: reverse;
  animation-duration: 0.8s;
}

.machine-gear:nth-child(3) {
  animation-duration: 1.2s;
}

@keyframes gearSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Pixel Smoke */
.smoke-container {
  position: absolute;
  top: -50px;
  left: 0;
  width: 100%;
  height: 60px;
  overflow: visible;
  pointer-events: none;
}

.smoke-pixel {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #888;
  animation: smokeRise 2s ease-out forwards;
  image-rendering: pixelated;
}

@keyframes smokeRise {
  0% {
    opacity: 0.8;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) translateX(var(--drift)) scale(2);
  }
}

/* (Paint cassette output slot removed — cassette now comes from the PC reader) */

/* ============================================
           PLAYER SECTION
           ============================================ */
#player-section {
  background: linear-gradient(
    180deg,
    var(--vapor-darker) 0%,
    #0a0015 50%,
    #000 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow 0.3s ease;
}

#player-section.drop-active {
  box-shadow:
    inset 0 0 100px rgba(1, 205, 254, 0.3),
    inset 0 0 200px rgba(255, 113, 206, 0.2);
}

#player-section.drop-active::before {
  content: "DROP CASSETTE HERE // カセットをここにドロップ";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "VT323", monospace;
  font-size: 2rem;
  color: var(--vapor-cyan);
  text-shadow: 0 0 20px var(--vapor-cyan);
  z-index: 20;
  pointer-events: none;
  animation: dropTextPulse 1s ease-in-out infinite;
}

@keyframes dropTextPulse {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

#player-canvas {
  width: 100%;
  height: 70vh;
  cursor: move;
  position: relative;
  z-index: 3;
}

.ui-overlay {
  position: absolute;
  bottom: 50px;
  display: flex;
  gap: 20px;
  z-index: 20;
}

.retro-btn {
  background: rgba(0, 0, 0, 0.8);
  color: var(--vapor-cyan);
  border: 2px solid var(--vapor-cyan);
  padding: 15px 30px;
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow:
    0 0 10px var(--vapor-cyan),
    inset 0 0 10px rgba(1, 205, 254, 0.2);
  transition: all 0.3s ease;
  letter-spacing: 2px;
}

.retro-btn:hover {
  background: var(--vapor-cyan);
  color: var(--vapor-darker);
  box-shadow:
    0 0 20px var(--vapor-cyan),
    0 0 40px var(--vapor-cyan);
}

#status-display {
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid var(--vapor-pink);
  padding: 15px 20px;
  color: var(--vapor-pink);
  font-family: "VT323", monospace;
  font-size: 1.3rem;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 0 10px rgba(255, 113, 206, 0.3);
}

/* Audio Visualizer */
#audio-visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  /* Visible by default as a background layer (like the hero sun) */
  opacity: 0.35;
  transition: opacity 220ms ease;
  mix-blend-mode: screen;
  filter: blur(0.2px) saturate(1.25);
}

#audio-visualizer.is-active {
  opacity: 0.85;
}

/* ============================================
           FOOTER
           ============================================ */
.vapor-footer {
  background: var(--vapor-darker);
  border-top: 1px solid var(--vapor-purple);
  padding: 40px 20px;
  text-align: center;
}

.footer-text {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--vapor-purple);
  font-size: 1rem;
  opacity: 0.7;
}

.footer-jp {
  font-family: "Noto Sans JP", sans-serif;
  color: var(--vapor-pink);
  font-size: 1.5rem;
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--vapor-pink);
}

/* ============================================
           RESPONSIVE
           ============================================ */
@media (max-width: 768px) {
  .glitch-text {
    font-size: 3rem;
    letter-spacing: 5px;
  }

  .japanese-title {
    font-size: 1.5rem;
    letter-spacing: 8px;
  }

  .subtitle {
    font-size: 1rem;
    letter-spacing: 4px;
  }

  .retro-sun {
    width: 300px;
    height: 300px;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .ui-overlay {
    flex-direction: column;
    gap: 10px;
  }
}

/* Tablet layout tuning */
@media (max-width: 1024px) {
  .xp-navbar {
    height: 62px;
  }

  .xp-nav-links {
    font-size: 15px;
    gap: 14px;
  }

  #pc-section {
    min-height: 130vh;
    padding-top: 62px;
  }

  #pc-container {
    width: 700px;
    max-width: 92vw;
  }

  #player-canvas {
    height: 64vh;
  }

  .ui-overlay {
    bottom: 32px;
    gap: 14px;
  }

  #floating-cassette-3d {
    width: 360px;
    height: 260px;
  }
}

/* Phone layout tuning */
@media (max-width: 480px) {
  .xp-navbar {
    height: 56px;
  }

  .start-btn {
    padding: 0 12px 0 8px;
  }

  .start-btn img {
    width: 28px;
    height: 28px;
  }

  .xp-nav-links {
    margin-left: 10px;
    font-size: 14px;
    gap: 10px;
  }

  #pc-section {
    min-height: 120vh;
    padding-top: 56px;
  }

  #pc-container {
    width: 360px;
    max-width: 94vw;

    /* Slightly tweak the screen mapping for smaller images */
    --pc-screen-y: 28.5%;
    --pc-screen-w: 37.5%;
    --pc-screen-h: 31.5%;

    --pc-power-size: 32px;
  }

  .pc-power-btn .power-btn-label,
  .pc-power-btn .power-btn-hint {
    display: none;
  }

  #player-canvas {
    height: 58vh;
  }

  .ui-overlay {
    left: 50%;
    transform: translateX(-50%);
    bottom: max(16px, env(safe-area-inset-bottom));
    width: min(92vw, 340px);
    justify-content: center;
    align-items: stretch;
    gap: 10px;
  }

  .retro-btn {
    width: 100%;
    font-size: 1.2rem;
    padding: 12px 16px;
  }

  #status-display {
    width: 100%;
    min-width: 0;
    font-size: 1.1rem;
    padding: 12px 14px;
  }

  #floating-cassette-3d {
    width: 260px;
    height: 180px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus states */
a:focus,
button:focus {
  outline: 2px solid var(--vapor-cyan);
  outline-offset: 3px;
}

/* ============================================
           PC SECTION - INTERACTIVE DESKTOP
           ============================================ */
#pc-section {
  position: relative;
  min-height: 140vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 68px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(
    circle at 50% 40%,
    rgba(185, 103, 255, 0.15) 0%,
    rgba(1, 205, 254, 0.08) 25%,
    rgba(0, 0, 0, 0.95) 60%,
    #000 100%
  );
}

/* PC Section background FX canvas (shooting stars + particle clouds) */
#pc-bg-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.95;
  mix-blend-mode: screen;
}

/* Glowing nested vaporwave triangle behind the PC (static + centered) */
.pc-vapor-triangles {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(108vw, 1040px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
  opacity: 0.85;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 20px rgba(1, 205, 254, 0.25))
    drop-shadow(0 0 30px rgba(255, 113, 206, 0.18));
}

.pc-vapor-triangles svg {
  width: 100%;
  height: 100%;
  display: block;
}

.pc-vapor-triangles .tri {
  stroke-linejoin: round;
}

/* David image on the left with neon lighting overlays */
.pc-david-wrap {
  position: absolute;
  left: clamp(14px, 5vw, 84px);
  top: 50%;
  transform: translateY(-46%);
  width: min(32vw, 420px);
  z-index: 4;
  pointer-events: none;
  opacity: 0.98;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.55));
}

.pc-david-wrap::before,
.pc-david-wrap::after {
  content: "";
  position: absolute;
  inset: -6% -10% -10% -10%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.pc-david-wrap::before {
  background:
    radial-gradient(
      closest-side at 38% 28%,
      rgba(1, 205, 254, 0.65),
      rgba(1, 205, 254, 0) 62%
    ),
    radial-gradient(
      closest-side at 66% 42%,
      rgba(255, 113, 206, 0.55),
      rgba(255, 113, 206, 0) 66%
    );
  filter: blur(0.7px);
  opacity: 0.9;
}

.pc-david-wrap img {
  width: 100%;
  height: auto;
  display: block;
  /* Feather all edges to transparent */
  -webkit-mask-image: radial-gradient(
    120% 115% at 50% 42%,
    rgba(0, 0, 0, 1) 58%,
    rgba(0, 0, 0, 0.88) 70%,
    rgba(0, 0, 0, 0.25) 86%,
    transparent 100%
  );
  mask-image: radial-gradient(
    120% 115% at 50% 42%,
    rgba(0, 0, 0, 1) 58%,
    rgba(0, 0, 0, 0.88) 70%,
    rgba(0, 0, 0, 0.25) 86%,
    transparent 100%
  );
  filter: saturate(1.7) contrast(1.18) brightness(1.06) hue-rotate(285deg)
    drop-shadow(0 0 16px rgba(1, 205, 254, 0.32))
    drop-shadow(0 0 22px rgba(255, 113, 206, 0.24));
}

@media (max-width: 900px) {
  .pc-david-wrap {
    width: min(34vw, 320px);
    transform: translateY(-46%) translateX(-6px);
    opacity: 0.9;
  }

  .pc-vapor-triangles {
    width: min(86vw, 740px);
    opacity: 0.75;
  }
}

@media (max-width: 600px) {
  .pc-david-wrap {
    display: none;
  }

  .pc-vapor-triangles {
    width: min(96vw, 720px);
    transform: translate(-50%, -50%);
    opacity: 0.62;
  }
}

#pc-container {
  position: relative;
  width: min(90vw, 800px);
  max-width: 800px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  transform-origin: center center;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 5;

  /* JS-driven zoom-to-screen variables */
  --pc-zoom-scale: 1;
  --pc-zoom-tx: 0px;
  --pc-zoom-ty: 0px;

  /* Screen position variables */
  --pc-screen-x: 50%;
  --pc-screen-y: 28%;
  --pc-screen-w: 36.5%;
  --pc-screen-h: 31%;
  --pc-screen-radius: 12px;

  /* Power button placement (tweak these to align with the PC photo) */
  --pc-power-x: 67.5%;
  --pc-power-y: 48%;
  --pc-power-size: 36px;

  /* Cassette reader anchor */
  --pc-reader-x: 63%;
  --pc-reader-y: 62%;
  --pc-reader-w: 16%;
  --pc-reader-h: 6%;
}

#pc-container.pc-zoomed {
  /* Transform origin 0,0 makes zoom math stable across resizes */
  transform-origin: 0 0;
  transform: translate(var(--pc-zoom-tx), var(--pc-zoom-ty))
    scale(var(--pc-zoom-scale));
}

/* When scroll is driving the zoom variables, keep it responsive (no big easing lag). */
#pc-container.pc-zoomed.pc-zoomed--scrolling {
  transition: transform 120ms linear;
}

#pc-container.pc-zoomed--no-transition {
  transition: none !important;
}

#pc-container.pc-zoomed-out {
  transform: none;
}

/* PC Boot image */
.pc-boot-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Above the screen so transparency reveals content */
  z-index: 6;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 60px rgba(1, 205, 254, 0.15))
    drop-shadow(0 0 30px rgba(185, 103, 255, 0.1));
  user-select: none;
  pointer-events: none;
}

/* Power button overlay */
.pc-power-btn {
  position: absolute;
  left: var(--pc-power-x);
  top: var(--pc-power-y);
  transform: translate(-50%, -50%);
  z-index: 12;
  width: var(--pc-power-size);
  height: var(--pc-power-size);
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(
    circle at 35% 30%,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 32%,
    rgba(0, 0, 0, 0.72) 70%,
    rgba(0, 0, 0, 0.9) 100%
  );
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.16),
    inset 0 -10px 18px rgba(0, 0, 0, 0.55),
    0 16px 32px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(1, 205, 254, 0.25),
    0 0 40px rgba(1, 205, 254, 0.22);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 240ms ease,
    filter 240ms ease;
  font-family: Tahoma, sans-serif;
  color: #fff;
  filter: saturate(1.15);
  user-select: none;
}

.pc-power-btn:hover {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.18),
    inset 0 -10px 18px rgba(0, 0, 0, 0.55),
    0 18px 38px rgba(0, 0, 0, 0.7),
    0 0 0 3px rgba(255, 113, 206, 0.32),
    0 0 55px rgba(255, 113, 206, 0.25);
}

.pc-power-btn::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(1, 205, 254, 0.18) 0%,
    rgba(185, 103, 255, 0.12) 38%,
    transparent 72%
  );
  opacity: 0.85;
  filter: blur(0.2px);
  animation: pcPowerPulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pcPowerPulse {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.65;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.pc-power-btn .power-btn-core {
  width: calc(var(--pc-power-size) * 0.66);
  height: calc(var(--pc-power-size) * 0.66);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(
    180deg,
    rgba(35, 35, 35, 0.95),
    rgba(0, 0, 0, 0.85)
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -10px 16px rgba(0, 0, 0, 0.55);
}

.pc-power-btn .power-btn-icon {
  font-size: 18px;
  color: var(--vapor-cyan);
  text-shadow: 0 0 18px rgba(1, 205, 254, 0.85);
  transform: translateY(-4px);
}

.pc-power-btn:hover .power-btn-icon {
  color: var(--vapor-pink);
  text-shadow: 0 0 18px rgba(255, 113, 206, 0.8);
}

.pc-power-btn .power-btn-label {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.95);
}

.pc-power-btn .power-btn-hint {
  position: absolute;
  top: calc(100% + 26px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.95);
  white-space: nowrap;
  opacity: 0.95;
}

#pc-container.pc-booting .pc-power-btn,
#pc-container.pc-on .pc-power-btn {
  display: none;
}

/* Screen mask */
.pc-screen-mask {
  position: absolute;
  left: var(--pc-screen-x);
  top: var(--pc-screen-y);
  width: var(--pc-screen-w);
  height: var(--pc-screen-h);
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: var(--pc-screen-radius);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.65),
    0 10px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 40px rgba(0, 0, 0, 0.4);
  background: #020007;
  /* Behind the transparent PC image */
  z-index: 2;
  pointer-events: auto;
  isolation: isolate;
}

/* Screen content layers */
.screen-content {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.screen-content.active {
  opacity: 1;
  visibility: visible;
}

/* No Signal Screen */
#no-signal-screen {
  background: #000;
}

/* XP Boot Screen */
#xp-boot-screen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BIOS / POST */
#bios-boot-screen {
  background: #000;
  color: rgba(255, 255, 255, 0.92);
  font-family: "Lucida Console", "Courier New", monospace;
}

.bios-boot {
  position: absolute;
  inset: 0;
  padding: clamp(6px, 0.9vw, 10px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
}

.bios-boot-header,
.bios-boot-footer {
  font-size: clamp(6px, 0.9vw, 9px);
  opacity: 0.95;
}

.bios-boot-text {
  margin: 0;
  font-size: clamp(6px, 0.9vw, 9px);
  line-height: 1.2;
  white-space: pre-wrap;
  color: rgba(199, 255, 199, 0.95);
  text-shadow: 0 0 10px rgba(0, 255, 0, 0.06);
}

/* XP splash */
.xp-splash {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  justify-items: center;
  padding: 10% 10% 9% 10%;
}

.xp-splash-logo {
  align-self: center;
  width: clamp(160px, 42%, 340px);
  max-width: 100%;
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}

.xp-splash-bar {
  width: clamp(160px, 56%, 320px);
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.xp-splash-indicator {
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, #0b4b1f 0%, #22b455 50%, #0b4b1f 100%);
  background-size: 48px 100%;
  animation: xpSplashSlide 1.15s linear infinite;
}

@keyframes xpSplashSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.xp-splash-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: Tahoma, sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.68);
  letter-spacing: 0.2px;
  margin-top: 14px;
}

.xp-splash-ms {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
}

/* XP Desktop */
#xp-desktop {
  background: linear-gradient(180deg, #245edb 0%, #3a7bd5 50%, #1e3a6e 100%);
  display: flex;
  flex-direction: column;
  --xp-taskbar-h: 22px;
}

.desktop-icons {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  height: 20px;
  padding: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.2);
}

.desktop-icon:active,
.desktop-icon.selected {
  background: rgba(0, 100, 200, 0.5);
}

.desktop-icon img {
  width: 14px;
  height: 14px;
  image-rendering: pixelated;
  margin-bottom: 2px;
}

.desktop-icon span {
  font-family: Tahoma, sans-serif;
  font-size: 0.3rem;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

/* XP Taskbar */
.xp-taskbar {
  height: var(--xp-taskbar-h);
  background: linear-gradient(180deg, #245edb 0%, #1941a5 100%);
  border-top: 1px solid #3a7bd5;
  display: flex;
  align-items: center;
  padding: 12px 8px 15px 2px;
}

.xp-start-btn {
  height: 18px;
  background: linear-gradient(180deg, #3eae36 0%, #37952f 100%);
  border-radius: 0 10px 10px 0;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-family: Tahoma, sans-serif;
  font-size: 8px;
  font-weight: bold;
  font-style: italic;
  color: white;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.xp-start-btn img {
  width: 12px;
  height: 12px;
}

.xp-taskbar-items {
  flex: 1;
}

.xp-system-tray {
  font-family: Tahoma, sans-serif;
  font-size: 8px;
  color: white;
  padding: 0 5px;
  background: linear-gradient(180deg, #1a8cd8 0%, #0b5fa5 100%);
  height: 100%;
  display: flex;
  align-items: center;
}

/* Paint Window in Desktop */
.paint-window-wrapper {
  position: absolute;
  inset: 0;
  padding: 10px;
  padding-bottom: var(--xp-taskbar-h);
  width: 100%;
  height: 100%;
  z-index: 50;
  transform: scale(0.92);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
}

.paint-window-wrapper.hidden {
  transform: scale(0.86);
  opacity: 0;
  pointer-events: none;
}

.paint-window-wrapper.visible {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.paint-window-wrapper .paint-window {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  max-width: none;
}

.paint-window-wrapper .paint-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/* When Paint is inside the PC screen, make its UI denser so it fits */
.paint-window-wrapper .paint-titlebar {
  font-size: 0.5rem;
  padding: 2px 4px;
}

.paint-window-wrapper .paint-titlebar-btn {
  width: 8px;
  height: 8px;
  font-size: 6px;
  line-height: 6px;
}

.paint-window-wrapper .paint-menubar {
  font-size: 0.4rem;
  padding: 2px 2px;
}

.paint-window-wrapper .paint-toolbar {
  padding: 2px;
  gap: 4px;
}

.paint-window-wrapper .paint-color-palette {
  grid-template-columns: repeat(14, 12px);
}

.paint-window-wrapper .paint-color {
  width: 12px;
  height: 12px;
}

.paint-window-wrapper .paint-sticker {
  width: 18px;
  height: 18px;
  font-size: 12px;
}

.paint-window-wrapper #paint-canvas {
  display: block;
}

/* CRT Filter */
.crt-filter {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  border-radius: inherit;
  overflow: hidden;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 101;
}

.crt-glow {
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 60px rgba(0, 255, 0, 0.03),
    inset 0 0 30px rgba(255, 255, 255, 0.02);
  pointer-events: none;
  z-index: 102;
}

.crt-flicker {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 16, 0);
  pointer-events: none;
  z-index: 103;
  animation: crtFlicker 0.08s infinite;
}

@keyframes crtFlicker {
  0% {
    opacity: 0.27861;
  }
  10% {
    opacity: 0.34769;
  }
  20% {
    opacity: 0.23604;
  }
  30% {
    opacity: 0.65583;
  }
  40% {
    opacity: 0.26559;
  }
  50% {
    opacity: 0.84693;
  }
  60% {
    opacity: 0.20313;
  }
  70% {
    opacity: 0.53455;
  }
  80% {
    opacity: 0.71428;
  }
  90% {
    opacity: 0.7003;
  }
  100% {
    opacity: 0.24387;
  }
}

.crt-rgb-shift {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 104;
  background: linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.02) 0%,
    transparent 10%,
    transparent 90%,
    rgba(0, 255, 255, 0.02) 100%
  );
}

.crt-filter::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 105;
  animation: crtInterlace 0.5s linear infinite;
  pointer-events: none;
}

@keyframes crtInterlace {
  0% {
    top: 0%;
  }
  100% {
    top: 100%;
  }
}

/* TV Color Bars */
.tv-color-bars {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.tv-color-bar {
  flex: 1;
  height: 100%;
}

.tv-color-bar:nth-child(1) {
  background: #ffffff;
}
.tv-color-bar:nth-child(2) {
  background: #ffff00;
}
.tv-color-bar:nth-child(3) {
  background: #00ffff;
}
.tv-color-bar:nth-child(4) {
  background: #00ff00;
}
.tv-color-bar:nth-child(5) {
  background: #ff00ff;
}
.tv-color-bar:nth-child(6) {
  background: #ff0000;
}
.tv-color-bar:nth-child(7) {
  background: #0000ff;
}
.tv-color-bar:nth-child(8) {
  background: #000000;
}

.tv-static-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 2px,
    transparent 2px,
    transparent 4px
  );
  pointer-events: none;
  z-index: 2;
}

.tv-static-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 3;
}

.tv-static-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  color: white;
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000;
  z-index: 4;
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
}

/* Cassette reader */
#pc-cassette-reader {
  position: absolute;
  left: var(--pc-reader-x);
  top: var(--pc-reader-y);
  width: var(--pc-reader-w);
  height: var(--pc-reader-h);
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 260ms ease;
}

#pc-container.cassette-ejecting #pc-cassette-reader {
  opacity: 1;
}

/* ============================================
           VAPORWAVE CHECKERBOARD FLOOR
           ============================================ */
.vaporwave-floor {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) perspective(320px) rotateX(50deg) translateY(18vh)
    scale(1.35);
  width: 420%;
  height: 130%;
  overflow: hidden;
  background-color: #000;
  /* Animated black/white checkerboard (no stars/reflections/sweep).
     Use a crisp-edge SVG tile to avoid 1px seams during transforms/animation. */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='160'%20shape-rendering='crispEdges'%3E%3Crect%20width='80'%20height='80'%20fill='%23fff'/%3E%3Crect%20x='80'%20y='80'%20width='80'%20height='80'%20fill='%23fff'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  background-position: 0 0;
  background-repeat: repeat;
  z-index: 1;
  transform-origin: center bottom;
  pointer-events: none;
  filter: none;
  animation: floorMoveForward 2.6s linear infinite;
  will-change: background-position;

  /* Fade the far end (top) into transparency */
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.25) 12%,
    rgba(0, 0, 0, 0.9) 34%,
    #000 55%,
    #000 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.25) 12%,
    rgba(0, 0, 0, 0.9) 34%,
    #000 55%,
    #000 100%
  );
}

@keyframes floorMoveForward {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 160px;
  }
}

/* Floating 3D cassette - draggable sticky cassette */
#floating-cassette-3d {
  position: fixed;
  width: 420px;
  height: 300px;
  opacity: 0;
  z-index: 15000;
  pointer-events: none;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
  transition: opacity 400ms ease;
  cursor: grab;
  will-change: transform, opacity;
}

#floating-cassette-3d.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#floating-cassette-3d.is-dragging {
  cursor: grabbing;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.7));
  transition: none;
}

#floating-cassette-3d.is-inserting {
  pointer-events: none;
  transition: all 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-reduced-motion: reduce) {
  #floating-cassette-3d {
    transition: opacity 200ms ease;
  }
}
