/* Approved purple homepage theme, gameplay screen states and media controls. */
html[data-hero-theme="purple"] #hb { --hb-bg: #090a0d; }
html[data-hero-theme="purple"] #hb .hb-bg {
  background: var(--linear-art) center / cover no-repeat #090a0d;
}
html[data-hero-theme="purple"] #hb .hb-halo { opacity: .26; }
html[data-hero-theme="purple"] #hb .hb-pool { opacity: .22; }
html[data-hero-theme="purple"] #hb .hb-vignette {
  background: linear-gradient(to top, var(--hb-end), transparent 110px),
    linear-gradient(to right, rgb(8 9 12 / .28), transparent 62%);
}
html[data-hero-theme="purple"] #hb { --hb-bg: #1f2021; --linear-art: url('/final/art/hero-bedroom/purple/07-miro-purple.svg?v=reference-grid-10'); }
html[data-hero-theme="purple"] #hb .hb-bg { background: #1f2021; }
html[data-hero-theme="purple"] #hb .hb-bg::after {
  content: ''; position: absolute;
  left: calc(var(--px) - 1.75 * var(--cw));
  top: calc(var(--base) - 2.4 * var(--cw));
  width: calc(3.5 * var(--cw)); height: calc(3.5 * var(--cw));
  background: url('/final/art/hero-bedroom/purple/07-miro-purple-stage.svg?v=reference-grid-10') center / contain no-repeat;
}
html[data-hero-theme="purple"] #hb .hb-halo { opacity: .1; }
html[data-hero-theme="purple"] #hb .hb-pool { opacity: .2; }
html[data-hero-theme="purple"] #hb .hb-vignette {
  background: linear-gradient(to top, var(--hb-end), transparent 85px);
}
/* A portrait composition keeps the lighting behind the console, with the copy above it. */
@media (max-aspect-ratio: 5/4) {
  html[data-hero-theme="purple"] #hb .hb-bg { background-position: 70% center; }
  html[data-hero-theme="purple"] #hb .hb-vignette {
    background: linear-gradient(to top, var(--hb-end), transparent 110px),
      linear-gradient(to bottom, rgb(8 9 12 / .35), transparent 38%);
  }
}
/* Mobile scene: console 18% larger; approved character sizes are preserved.
   Inset their visible artwork while keeping each entrance anchored to the screen. */
@media (max-width: 767px) {
  html[data-hero-theme="purple"] #hb {
    --console-cw: calc(1.18 * var(--cw));
    --console-base: calc(var(--base) + .18 * var(--ch));
    --sx: -.18172;
    --sy: -1.27183;
  }
  html[data-hero-theme="purple"] #hb .hb-tilt-in {
    left: calc(var(--px) - .5602 * var(--console-cw));
    width: calc(1.1203 * var(--console-cw));
  }
  html[data-hero-theme="purple"] #hb :is(.hb-pool, .hb-contact) { --base: var(--console-base); }
  html[data-hero-theme="purple"] #hb .hb-ch {
    --character-scale: .585808;
    --character-inset: calc((1 - var(--character-scale)) / 2);
    --character-edge: calc(1 - var(--character-inset));
    --character-width: calc(var(--w) * var(--cw));
    --character-height: calc(var(--w) * var(--ar) * var(--cw));
    --character-left: calc(clamp(calc(16px - var(--character-inset) * var(--character-width)), calc(var(--px) + var(--x) * var(--cw)), calc(100 * var(--u) - 16px - var(--character-edge) * var(--character-width))) + var(--character-shift-x, 0px));
    --character-top: min(calc(clamp(calc(var(--head-b) + 16px - var(--character-inset) * var(--character-height)), calc(var(--base) + var(--y) * var(--cw)), calc(100 * var(--v) - var(--cta-h) - 16px - var(--character-edge) * var(--character-height))) + var(--character-shift-y, 0px)), calc(100 * var(--v) - var(--cta-h) - 8px - var(--character-edge) * var(--character-height)));
    --fly-x: calc(var(--px) + var(--sx) * var(--cw) - var(--character-left) - var(--character-width) / 2);
    --fly-y: calc(var(--base) + var(--sy) * var(--cw) - var(--character-top) - var(--character-height) / 2);
    left: var(--character-left);
    top: var(--character-top);
  }
  html[data-hero-theme="purple"] #hb .hb-win--link .hb-ch {
    --character-scale: .7201152;
    --character-shift-y: calc(-.04 * var(--cw));
  }
  /* Match the horizontal centre of the console's rotated bounds. */
  html[data-hero-theme="purple"] #hb .hb-win--crash .hb-ch {
    --character-left: calc(var(--px) - .095 * var(--console-cw) - var(--character-width) / 2);
    --character-shift-y: calc(.08 * var(--cw) + .18 * var(--ch));
  }
  html[data-hero-theme="purple"] #hb .hb-ch__fx { transform: scale(var(--character-scale)); }
  html[data-hero-theme="purple"] #hb .hb-win--crash { display: block; }
}
/* Remove media play/pause controls throughout the page. Their hidden elements
   remain available to the existing animation/video state controllers. */
html[data-hero-theme="purple"] :is(.hb-toggle, .sr-play__toggle, .sr-play__glyph, .pp-pause),
html[data-hero-theme="purple"] .sr-play__cap {
  display: none !important;
}
/* Preserve each new gameplay still's aspect ratio inside the console glass. */
html[data-hero-theme="purple"] #hb .hb-scr-game--still img { object-fit: contain; }
/* Keep PRESS START until the same state that triggers the character burst. */
html[data-hero-theme="purple"] #hb:not(.is-burst) .hb-scr-games {
  display: none; opacity: 0; animation: none;
}
html[data-hero-theme="purple"] #hb:not(.is-burst) .hb-scr-off {
  opacity: 1; animation: none;
}
html[data-hero-theme="purple"] #hb:not(.is-burst) .hb-scr-press {
  opacity: 1; animation: none;
}
html[data-hero-theme="purple"] #hb.is-burst .hb-scr-games { opacity: 1; animation: none; }
html[data-hero-theme="purple"] #hb.is-burst .hb-scr-off { opacity: 1; animation: none; }
html[data-hero-theme="purple"] #hb.is-burst .hb-scr-press { opacity: 0; animation: none; }
html[data-hero-theme="purple"] #hb.is-boot-logo .hb-scr-press { opacity: 0; animation: none; }
@media (prefers-reduced-motion: no-preference) {
  html.hb-motion[data-hero-theme="purple"] #hb:not(.is-burst) .hb-scr-press {
    animation: hb-blink .9s steps(1, end) infinite;
  }
  html.hb-motion[data-hero-theme="purple"] #hb.is-boot-logo .hb-scr-press {
    opacity: 0; animation: none;
  }
}

/* Independent pixel accents: originate at the console screen, then settle. */
html[data-hero-theme="purple"] #hb .hb-scene-pixels { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
html[data-hero-theme="purple"] #hb .hb-scene-pixel {
  --pixel-left: clamp(20px, calc(var(--px) + var(--pixel-x) * var(--cw)), calc(100 * var(--u) - 20px));
  --pixel-top: clamp(calc(var(--head-b) + 20px), calc(var(--base) + var(--pixel-y) * var(--cw)), calc(100 * var(--v) - var(--cta-h) - 20px));
  position: absolute; left: var(--pixel-left); top: var(--pixel-top);
  display: block; width: var(--pixel-size); height: var(--pixel-size);
  background: #986bdb; opacity: var(--pixel-opacity);
}
@media (prefers-reduced-motion: no-preference) {
  html.hb-motion[data-hero-theme="purple"] #hb:not(.is-burst) .hb-scene-pixel { visibility: hidden; }
  html.hb-motion[data-hero-theme="purple"] #hb.is-burst .hb-scene-pixel {
    animation: hb-scene-pixel-arrive var(--pixel-duration, 1100ms) var(--hb-ease-out) var(--pixel-delay) both;
  }
  html.hb-lite[data-hero-theme="purple"] #hb.is-burst .hb-scene-pixel { animation: none; }
}
@keyframes hb-scene-pixel-arrive {
  from { opacity: 0; transform: translate(calc(var(--px) + var(--sx) * var(--cw) - var(--pixel-left) + var(--pixel-ox, 0px)), calc(var(--base) + var(--sy) * var(--cw) - var(--pixel-top) + var(--pixel-oy, 0px))) scale(.95); }
  20% { opacity: var(--pixel-opacity); }
  to { opacity: var(--pixel-opacity); transform: none; }
}

/* Fit the complete detailed background across the phone rather than cropping its sides. */
@media (max-width: 767px) {
  html[data-hero-theme="purple"] #hb .hb-bg::after {
    left: 0;
    top: calc(var(--base) - 73 * var(--u));
    width: calc(100 * var(--u));
    height: calc(100 * var(--u));
    background-image: url("/final/art/hero-bedroom/purple/mobile-detailed-background.webp"), url("/final/art/hero-bedroom/purple/07-miro-purple-stage.svg?v=reference-grid-10");
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
  }
}

/* Place accents across the hero, behind the copy on every screen size. */
html[data-hero-theme="purple"] #hb .hb-scene-pixel {
  --pixel-left: clamp(12px, calc(var(--pixel-vx) * 100 * var(--u)), calc(100 * var(--u) - 12px));
  --pixel-top: clamp(16px, calc((8 + var(--pixel-vy) * 84) * var(--v)), calc(100 * var(--v) - 16px));
}
