/*
===================================================================
      ANGEL'S SWORD ARCADE - HIGH FIDELITY RETRO DESIGN SYSTEM
===================================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Outfit:wght@300;400;600;800&display=swap');

:root {
  /* Dynamic themes */
  --power-led-off: #3d0808;
  --power-led-on: #ff1a1a;
  --power-led-on-glow: rgba(255, 26, 26, 0.85);
  
  --crt-glow: rgba(180, 245, 255, 0.12);
  
  --font-pixel: 'Press Start 2P', monospace;
  --font-screen: 'VT323', monospace;
  --font-ui: 'Outfit', sans-serif;
  
  --console-body: #a3a6b5;
  --console-dark: #6e7180;
  --console-accent: #2e303d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

body {
  background-color: #070312;
  background-image: radial-gradient(circle at 50% 50%, #1a0e2e 0%, #070312 100%);
  font-family: var(--font-ui);
  color: #fff;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 16-Bit Cozy Room Container - Locked to reference image aspect ratio */
.room-container {
  position: relative;
  width: 95vw;
  max-width: 1024px;
  aspect-ratio: 1024 / 571;
  background-image: url('assets/background_empty.jpg');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 0 0 100px rgba(144, 113, 169, 0.15);
  border: 10px solid #1c182a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: filter 1.5s ease;
}

/* Day/Night ambient tint overlays */
.ambient-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 1.5s ease;
  background: rgba(14, 7, 34, 0.45);
}

[data-theme="night"] .ambient-glow {
  opacity: 1;
}

/* Header & Arcade Title */
.header {
  position: absolute;
  top: 4.3%;
  left: 3.9%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.header h1 {
  font-family: var(--font-pixel);
  font-size: clamp(0.7rem, 1.8vw, 1.25rem);
  text-shadow: 2px 2px 0px #e60067, -1px -1px 0px #00f3ff;
  color: #ffffff;
  animation: logo-glow 3s infinite ease-in-out;
}

.header p {
  font-family: var(--font-pixel);
  font-size: clamp(0.4rem, 0.9vw, 0.55rem);
  color: #cbbbe3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Volume Control HUD */
.volume-hud {
  position: absolute;
  top: 4.3%;
  right: 3.9%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.volume-hud label {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: #ff9068;
}

.volume-hud input[type="range"] {
  width: 60px;
  cursor: pointer;
  accent-color: #ff9068;
}

.sound-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.sound-toggle-btn:hover {
  transform: scale(1.15);
}

/* Window Hotspot (Starry Night toggle) */
.window-hotspot {
  position: absolute;
  top: 0;
  right: 0;
  width: 25.5%;
  height: 52%;
  z-index: 3;
  cursor: pointer;
}

/* Wall Poster Hotspot */
.poster-hotspot {
  position: absolute;
  top: 5.5%;
  left: 38.3%;
  width: 30%;
  height: 48%;
  z-index: 3;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.poster-hotspot:hover {
  transform: rotate(-0.5deg) scale(1.01);
}

/* Transparent Figure Sprites (Chroma-keyed from reference image) */
.figure {
  position: absolute;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 4;
  transform-origin: bottom center;
  filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.5));
}

.figure-fairy {
  left: 12.3%;
  top: 25.4%;
  width: 4.7%;
  height: 11.2%;
  background-image: url('assets/fairy_sprite.png');
}

.figure-orc {
  left: 19.8%;
  top: 22.3%;
  width: 8.5%;
  height: 14.9%;
  background-image: url('assets/orc_sprite.png');
}

.figure:hover {
  animation: figure-jump 0.5s ease-out 1;
}



/* Interactive TV Dial Hotspots */
.crt-dial-hotspot {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.crt-dial-hotspot:hover {
  background: rgba(255, 255, 255, 0.08);
}

#dial-v-hold {
  left: 5.6%;
  top: 84%;
  width: 2.2%;
  height: 3.8%;
}

#dial-contrast {
  left: 8.5%;
  top: 84%;
  width: 2.2%;
  height: 3.8%;
}

/* Console Power LED Overlay (Aligned over print) */
.console-led-box {
  position: absolute;
  left: 39.55%;
  top: 70.4%;
  width: 0.6%;
  height: 1.1%;
  z-index: 9;
  pointer-events: none;
}

.led-light {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--power-led-off);
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.8);
  transition: background 0.3s, box-shadow 0.3s;
}

.console-led-box.on .led-light {
  background: var(--power-led-on);
  box-shadow: 0 0 8px var(--power-led-on-glow), 0 0 3px var(--power-led-on);
}

/* Console Power Switch Overlay (Covers print on console) */
.console-power-box {
  position: absolute;
  left: 41.21%;
  top: 78.29%;
  width: 4.69%;
  height: 2.45%;
  z-index: 9;
  cursor: pointer;
}

.power-switch-track {
  width: 100%;
  height: 100%;
  position: relative;
  background: transparent;
}

.power-switch-knob {
  width: 52%;
  height: 96%;
  position: absolute;
  top: 2%;
  left: 0;
  background: 
    linear-gradient(90deg, 
      transparent 35%, 
      #28292f 35%, #28292f 40%, 
      transparent 40%, transparent 48%, 
      #28292f 48%, #28292f 53%, 
      transparent 53%, transparent 61%, 
      #28292f 61%, #28292f 66%, 
      transparent 66%
    ),
    linear-gradient(180deg, #8a8d9a 0%, #5a5d6a 100%);
  border-radius: 1.5px;
  border: 1px solid #202126;
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.6),
    inset 0 0.5px 0 rgba(255,255,255,0.2);
  transition: transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  transform: translateX(0);
}

.power-switch-track.on .power-switch-knob {
  transform: translateX(92%);
}

/* Console Reset Button Overlay (Covers print on horizontal bar) */
.console-reset-box {
  position: absolute;
  left: 48.93%;
  top: 84.76%;
  width: 5.96%;
  height: 8.93%;
  z-index: 9;
}

.reset-btn {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #00c3ff 0%, #0088cc 100%);
  border: 2px solid #202126;
  border-radius: 2px;
  box-shadow: 
    0 2px 4px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.3);
  cursor: pointer;
  outline: none;
  transition: transform 0.1s ease, background 0.1s;
}

.reset-btn:hover {
  background: linear-gradient(180deg, #00d3ff 0%, #0099dd 100%);
}

.reset-btn:active {
  transform: scale(0.93) translateY(1px);
  background: linear-gradient(180deg, #0099cc 0%, #006699 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ===================================================================
      SEGA CD JUKEBOX PLAYER OVERLAYS
   =================================================================== */

/* CD Lid Circular/Oval Hotspot */
.cd-lid-hotspot {
  position: absolute;
  left: 71.78%;
  top: 66.37%;
  width: 15.43%;
  height: 11.91%;
  z-index: 9;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s, box-shadow 0.2s;
}

.cd-lid-hotspot:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15), inset 0 0 8px rgba(255, 255, 255, 0.1);
}

.cd-lid-hotspot:active {
  transform: scale(0.98);
}

/* Navigation Buttons (Left & Right) */
.cd-btn-hotspot {
  position: absolute;
  z-index: 9;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0);
  transition: background 0.15s, box-shadow 0.15s;
}

.cd-btn-hotspot:hover {
  background: rgba(0, 255, 102, 0.08);
  box-shadow: 0 0 8px rgba(0, 255, 102, 0.3);
}

.cd-btn-hotspot:active {
  transform: scale(0.9);
}

.cd-btn-left {
  left: 72.07%;
  top: 78.63%;
  width: 3.22%;
  height: 4.55%;
}

.cd-btn-right {
  left: 87.5%;
  top: 77.06%;
  width: 3.32%;
  height: 4.73%;
}

/* LCD screen window */
.cd-lcd-screen {
  position: absolute;
  left: 75.78%;
  top: 78.46%;
  width: 11.04%;
  height: 5.25%;
  z-index: 9;
  border-radius: 1px;
  border: 1px solid #1a1a24;
  overflow: hidden;
  background: #09090c;
}

.lcd-marquee-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
  position: relative;
}

.lcd-marquee-text {
  display: inline-block;
  padding-left: 100%;
  color: #00ff55; /* Retro green LCD glow */
  font-family: var(--font-pixel);
  font-size: 0.45rem; /* Retro chunky pixel typography */
  font-weight: bold;
  text-shadow: 0 0 3px rgba(0, 255, 85, 0.8);
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform;
}

/* Standard scrolling animation applied via JS when song is active */
.lcd-marquee-text.scrolling {
  animation: lcd-scroll 12s linear infinite;
}

@keyframes lcd-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* Top-Loading Console Cartridge Slot (Covers print) */
.console-slot-container {
  position: absolute;
  left: 40.23%;
  top: 60.25%;
  width: 19.24%;
  height: 6.30%;
  z-index: 6;
  cursor: pointer;
  background: transparent;
}

/* 3D Masking Front Lip Casing - Simulates slot mouth to slide cart *inside* */
.console-slot-front-lip {
  position: absolute;
  left: calc(40.23% - 2px);
  top: calc(66.55% - 8px);
  width: calc(19.24% + 4px);
  height: 12px;
  background: linear-gradient(180deg, #a3a6b5 50%, #6e7180 100%);
  border: 2px solid #2e303d;
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 8; /* Mask above the cartridge! */
  pointer-events: none;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3);
}

/* Slot dust flaps pushed back inside */
.console-slot-flap {
  position: absolute;
  top: 0;
  width: 46%;
  height: 100%;
  background: #1a1b22;
  border: 1px solid #111216;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.6);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: center top;
  z-index: 2;
}

.flap-left {
  left: 3%;
  border-radius: 3px 0 0 3px;
}

.flap-right {
  right: 3%;
  border-radius: 0 3px 3px 0;
}

.console-slot-container.has-cartridge .flap-left {
  transform: rotateX(85deg) translateY(-1px);
  background: #09090b;
  opacity: 0.7;
}

.console-slot-container.has-cartridge .flap-right {
  transform: rotateX(85deg) translateY(-1px);
  background: #09090b;
  opacity: 0.7;
}

/* Slotted Cartridge visual layout (Standing upright - positioned relative to room!) */
.cartridge.inserted {
  position: absolute !important;
  left: 42.92% !important;
  top: calc(66.55% - 16.38% + 10px) !important;
  width: 13.85% !important;
  height: 16.38% !important;
  bottom: auto !important;
  z-index: 6 !important; /* Behind the console slot front lip sibling (z-index 8) but above flaps */
  transform: rotateX(8deg) scale(0.98) !important;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4) !important;
  cursor: pointer;
  animation: slot-down 0.45s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  clip-path: inset(0 0 18% 0); /* Crop the bottom 18% (plastic lip) when inserted! */
}

.cartridges-stack-zone {
  position: absolute;
  bottom: 12.5%;
  left: 5.86%;
  width: 23.4%;
  height: 20%;
  z-index: 7;
  pointer-events: none;
}

.cartridge {
  position: absolute;
  width: 13.57%;
  height: 16.6%;
  background: linear-gradient(135deg, #4b4c54 0%, #303138 100%);
  border: 2px solid #1c1d22;
  border-radius: 4px;
  box-shadow: 
    0 3px 8px rgba(0, 0, 0, 0.6),
    inset 0 2px 0 rgba(255,255,255,0.1);
  cursor: grab;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  touch-action: none;
}

/* Dedicated smooth return slide-back transition when dropped */
.cartridge.returning {
  transition: 
    left 0.28s cubic-bezier(0.25, 1, 0.5, 1),
    top 0.28s cubic-bezier(0.25, 1, 0.5, 1),
    bottom 0.28s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
    box-shadow 0.28s !important;
  bottom: auto !important;
}

/* Full bleed cartridge art support with realistic plastic bottom lip */
.cartridge.full-art {
  background-size: 100% 82%; /* Cover art only covers top 82% */
  background-repeat: no-repeat;
  background-position: top center;
  background-color: #24252b; /* Solid dark grey plastic bottom */
  padding: 0; /* Removes inner padding for full bleed */
  position: absolute;
  overflow: hidden;
}

.cartridge.full-art .cart-label-container,
.cartridge.full-art .cart-grip-grooves {
  display: none;
}

/* Realistic cartridge bottom ridges/grip lines */
.cartridge.full-art::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 18%; /* Takes up the bottom 18% */
  background: 
    linear-gradient(90deg, 
      transparent 15%, 
      rgba(0,0,0,0.5) 15%, rgba(0,0,0,0.5) 20%, 
      transparent 20%, transparent 28%, 
      rgba(0,0,0,0.5) 28%, rgba(0,0,0,0.5) 33%, 
      transparent 33%, transparent 41%, 
      rgba(0,0,0,0.5) 41%, rgba(0,0,0,0.5) 46%, 
      transparent 46%, transparent 54%, 
      rgba(0,0,0,0.5) 54%, rgba(0,0,0,0.5) 59%, 
      transparent 59%, transparent 67%, 
      rgba(0,0,0,0.5) 67%, rgba(0,0,0,0.5) 72%, 
      transparent 72%, transparent 80%, 
      rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.5) 85%, 
      transparent 85%
    ),
    linear-gradient(180deg, #303138 0%, #1c1d22 100%);
  border-top: 2px solid #14151a; /* Plastic seam separating label from bottom */
  border-radius: 0 0 2px 2px;
  pointer-events: none;
  z-index: 10;
}

.cartridge:active {
  cursor: grabbing;
  z-index: 100 !important;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.cartridge[data-game="astra"] { bottom: 12.5%; left: 8.2%; transform: rotate(-3deg); z-index: 10; background-image: url('assets/cart_astra.jpg'); }
.cartridge[data-game="miranda"] { bottom: calc(12.5% + 8px); left: 11.5%; transform: rotate(3deg); z-index: 11; background-image: url('assets/cart_miranda.jpeg'); }
.cartridge[data-game="neon"] { bottom: calc(12.5% + 15px); left: 13%; transform: rotate(2deg); z-index: 12; }
.cartridge[data-game="bunny"] { bottom: calc(12.5% + 22px); left: 9.5%; transform: rotate(-1.5deg); z-index: 13; }

.cartridge:hover:not(.dragged):not(.inserted) {
  transform: translateY(-6px) scale(1.05) rotate(0deg);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
  z-index: 20 !important;
}

/* Label styling inside cartridge */
.cart-label-container {
  width: 100%;
  height: 60%;
  background: #111;
  border-radius: 2px;
  border: 1px solid #222;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px;
}

.cartridge[data-game="astra"] .cart-label-container { background: linear-gradient(135deg, #0e1c3f 0%, #15092a 100%); border-color: #2c3e6b; }
.cartridge[data-game="neon"] .cart-label-container { background: linear-gradient(135deg, #3d0526 0%, #0d0426 100%); border-color: #d11b7d; }
.cartridge[data-game="bunny"] .cart-label-container { background: linear-gradient(135deg, #593108 0%, #2b082d 100%); border-color: #d18d1b; }

.cart-label-art {
  width: 100%;
  height: 75%;
  background-size: cover;
  background-position: center;
  border-radius: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cartridge[data-game="astra"] .cart-label-art { background-image: radial-gradient(circle at 70% 30%, #ff80df 10%, transparent 40%), linear-gradient(0deg, #18224b, #2b0c47); }
.cartridge[data-game="neon"] .cart-label-art { background-image: linear-gradient(90deg, #ff007f 0%, #00f3ff 100%); }
.cartridge[data-game="bunny"] .cart-label-art { background-image: radial-gradient(circle at 30% 40%, #ffcc00 15%, transparent 60%), linear-gradient(135deg, #d11b7d, #3c096c); }

.cart-title {
  font-family: var(--font-pixel);
  font-size: 0.28rem;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 1px 1px 0px #000;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.cart-grip-grooves {
  width: 80%;
  height: 15%;
  display: flex;
  gap: 2px;
  margin-top: 2px;
  justify-content: center;
}

.cart-grip-groove {
  width: 3px;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0.5px;
}

.cartridge.dragged {
  pointer-events: auto;
  opacity: 0.95;
  z-index: 999;
  transition: none !important; /* Disable transition during active drag to prevent lag/snaps! */
  bottom: auto !important;
}

/* Interactive Gamepad Overlay (Seamlessly covers print) */
.retro-controller {
  position: absolute;
  left: 69.34%;
  top: 75.3%;
  width: 20%;
  height: 14%;
  background-image: url('assets/gamepad_sprite.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 8;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s;
}

.retro-controller:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
}

/* Gamepad interactive hotspots */
.gamepad-hotspot {
  position: absolute;
  cursor: pointer;
  border-radius: 50%;
  background: rgba(0, 243, 255, 0);
  transition: background 0.15s, box-shadow 0.15s;
}

/* Subtle glowing hover indicators for gamepad buttons */
.gamepad-hotspot:hover {
  background: rgba(0, 243, 255, 0.12);
  box-shadow: 0 0 6px rgba(0, 243, 255, 0.4);
}

.gamepad-hotspot:active {
  transform: scale(0.9);
}

/* Hotspots matching controller graphics */
.ctrl-dpad-hotspot {
  left: 10%;
  top: 25%;
  width: 17%;
  height: 45%;
  border-radius: 4px;
}

.ctrl-btn-y { left: 66.5%; top: 34%; width: 9%; height: 23%; }
.ctrl-btn-x { left: 75%; top: 16%; width: 9%; height: 23%; }
.ctrl-btn-b { left: 75%; top: 51%; width: 9%; height: 23%; }
.ctrl-btn-a { left: 83.5%; top: 34%; width: 9%; height: 23%; }

.ctrl-select-hotspot {
  left: 37.5%;
  top: 50%;
  width: 8.5%;
  height: 11%;
  border-radius: 3px;
  transform: rotate(-25deg);
}

.ctrl-start-hotspot {
  left: 47.5%;
  top: 50%;
  width: 8.5%;
  height: 11%;
  border-radius: 3px;
  transform: rotate(-25deg);
}

/* Floor panel styling */
.room-floor {
  width: 100%;
  height: 6vh;
  min-height: 40px;
  background: #080312;
  border-top: 4px solid #140d24;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.arcade-hud {
  font-family: var(--font-pixel);
  font-size: clamp(0.45rem, 1.2vw, 0.6rem);
  color: #928ca1;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  gap: clamp(10px, 3vw, 40px);
  text-shadow: 1px 1px 0px #000;
  animation: pulse-text 2s infinite alternate ease-in-out;
}

.hud-item span {
  color: #ff9068;
}

/* Diagnostics HUD Overlay */
.overlay-instructions {
  position: absolute;
  top: 4.5%;
  left: 38.3%;
  width: 30%;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #ff9068;
  border-radius: 8px;
  padding: 12px;
  z-index: 10;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.overlay-instructions.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.overlay-instructions h3 {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: #ff9068;
  margin-bottom: 6px;
}

.overlay-instructions ul {
  list-style: none;
  font-size: 0.75rem;
  color: #e2dbee;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overlay-instructions li {
  position: relative;
  padding-left: 10px;
}

.overlay-instructions li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: #00ffcc;
  font-size: 0.5rem;
  top: 1px;
}

/* Animations */
@keyframes logo-glow {
  0%, 100% { text-shadow: 2px 2px 0px #e60067, -1px -1px 0px #00f3ff; }
  50% { text-shadow: 2px 2px 8px #e60067, -1px -1px 8px #00f3ff; }
}

@keyframes figure-jump {
  0%, 100% { transform: translateY(0) scaleY(1); }
  35% { transform: translateY(-12px) scaleY(1.05); }
  50% { transform: translateY(-16px) scaleY(1); }
  65% { transform: translateY(-12px) scaleY(0.95); }
  90% { transform: translateY(0) scaleY(0.9); }
}

@keyframes slot-down {
  0% { transform: rotateX(10deg) translateY(-25px) scale(0.98); opacity: 0.3; }
  100% { transform: rotateX(10deg) translateY(-5.5px) scale(0.98); opacity: 1; }
}

@keyframes pulse-text {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

@keyframes screen-flicker {
  0% { opacity: 0.08; }
  50% { opacity: 0.03; }
  100% { opacity: 0.07; }
}

/* CRT Screen Power Animation Loops */
@keyframes tv-turn-on {
  0% {
    transform: scale(1, 0.01) translate3d(0, 0, 0);
    filter: brightness(3);
    opacity: 1;
  }
  30% {
    transform: scale(1, 1) translate3d(0, 0, 0);
    filter: brightness(2);
    opacity: 1;
  }
  100% {
    transform: scale(1, 1) translate3d(0, 0, 0);
    filter: brightness(1);
    opacity: 1;
  }
}

@keyframes tv-turn-off {
  0% {
    transform: scale(1, 1) translate3d(0, 0, 0);
    filter: brightness(1);
    opacity: 1;
  }
  40% {
    transform: scale(1, 0.01) translate3d(0, 0, 0);
    filter: brightness(3);
    opacity: 1;
  }
  80% {
    transform: scale(0, 0) translate3d(0, 0, 0);
    filter: brightness(10);
    opacity: 1;
  }
  100% {
    transform: scale(0, 0) translate3d(0, 0, 0);
    opacity: 0;
  }
}

/* Utility to strip transforms globally during dynamic JS measurements */
.no-transforms {
  transform: none !important;
  transition: none !important;
}

/* Mobile Media Queries */
@media (max-width: 768px) {
  body {
    overflow: auto;
    padding: 10px 0;
  }
  
  .room-container {
    width: 98vw;
    border-width: 4px;
    border-radius: 6px;
  }
  
  .header {
    top: 3%;
    left: 3%;
  }
  
  .volume-hud {
    display: none; /* Hide volume slider on mobile to avoid cluttering */
  }
  
  .overlay-instructions {
    width: 90%;
    left: 5%;
    top: 15%;
  }
}
