:root {
  /* SIZING / LAYOUT TOKENS */
  --page-max: 780px;
  --ui-max: 780px;
  --text-max: 620px;

  --device-width: 620px;
  --beam-width: 760px;
  --card-width: 340px;
  --center-x: 50%;

  /* Projection layout tuning (RIGHT mode) */
  --proj-right: 6%;
  --card-right: 6%;
  --beam-nudge-x: 50px;
  --card-nudge-x: -140px;

  /* Safe area (iOS notch/home bar) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Background baseline */
  --bg-base: #0b0f14;
}

/* GLOBAL BOX MODEL + OVERFLOW GUARDS */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg-base);
  color: #e9eef2;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

/* SCENE + BACKGROUND */
.scene {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--bg-base);
}

.environment {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 60% 12%, rgba(90,140,170,0.12) 0%, rgba(10,14,18,0.78) 62%),
    url("../assets/images/backgrounds/fire.png");
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  filter: saturate(0.90) contrast(1.01);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.environment::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(7,10,14,0.15),
    rgba(7,10,14,0.35)
  );
}

/* PROJECTION CLUSTER - Desktop */
.projection-cluster {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}

.scene.has-device .projection-cluster { display: block; }
.scene.has-device .beam,
.scene.has-device .card { display: none; }

.scene.has-card .projection-cluster { display: block; }
.scene.has-card .beam,
.scene.has-card .card { display: block; }

.device,
.beam {
  position: absolute;
  transition: left 200ms ease, right 200ms ease, transform 200ms ease;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.device {
  bottom: 35%;
  width: var(--device-width);
  z-index: 4;
}

.beam {
  bottom: 16%;
  width: var(--beam-width);
  z-index: 2;
  opacity: 0.9;
  mix-blend-mode: screen;
  filter: blur(0.4px);
}

/* Center (default) */
#deviceImg:not([data-position]),
#deviceImg[data-position="center"],
#beamImg:not([data-position]),
#beamImg[data-position="center"] {
  left: var(--center-x);
  right: auto;
  transform: translateX(-50%) translateZ(0);
}

/* Right (aligned stack) */
#deviceImg[data-position="right"],
#beamImg[data-position="right"] {
  left: auto;
  right: var(--proj-right);
  transform: translateZ(0);
}

#beamImg[data-position="right"] {
  transform: translateX(var(--beam-nudge-x)) translateZ(0);
}

/* CARD (tarot) */
.card {
  position: absolute;
  bottom: 46%;
  width: var(--card-width);
  z-index: 3;
  opacity: 0.95;
  filter: drop-shadow(0 0 26px rgba(200,255,240,0.18));
  transition: left 200ms ease, right 200ms ease, transform 200ms ease;
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.85) 55%,
    rgba(0,0,0,0.55) 68%,
    rgba(0,0,0,0.25) 80%,
    rgba(0,0,0,0.08) 90%,
    rgba(0,0,0,0) 100%
  );
  mask-image: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.85) 55%,
    rgba(0,0,0,0.55) 68%,
    rgba(0,0,0,0.25) 80%,
    rgba(0,0,0,0.08) 90%,
    rgba(0,0,0,0) 100%
  );
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

#cardImg:not([data-position]),
#cardImg[data-position="center"] {
  left: var(--center-x);
  right: auto;
  transform: translateX(-50%) translateZ(0);
}

#cardImg[data-position="right"] {
  left: auto;
  right: var(--card-right);
  transform: translateX(var(--card-nudge-x)) translateZ(0);
}

/* PROJECTION STAGE - Hidden on desktop, visible on mobile */
.proj-stage {
  display: none;
}

/* UI - Desktop layout */
.ui {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  padding:
    calc(22px + var(--safe-top))
    16px
    calc(26px + var(--safe-bottom));
  background: linear-gradient(
    to top,
    rgba(7,10,14,0.94),
    rgba(7,10,14,0.55),
    rgba(7,10,14,0)
  );
  width: 100%;
  max-width: 100%;
}

.ui .wrap {
  max-width: var(--ui-max);
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* NARRATIVE */
.narrative {
  display: block;
  margin: 0;
  max-width: var(--text-max);
  align-self: center;
  max-height: min(56svh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 18px;
  line-height: 1.65;
  font-size: 16px;
  background: rgba(10, 14, 20, 0.33);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  scrollbar-gutter: stable;
  white-space: pre-wrap;
  position: relative;
  transform: translateZ(0);
}

.narrative::before {
  content: "";
  position: absolute;
  inset: -10px -12px;
  border-radius: 14px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(6, 8, 12, 0.59),
    rgba(6, 8, 12, 0.416)
  );
}

.narrative::-webkit-scrollbar { width: 10px; }
.narrative::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}
.narrative::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 8px;
}
.narrative::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.40);
}

/* READING PANEL */
.reading {
  display: none;
  margin: 0;
  max-width: var(--text-max);
  align-self: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(8, 10, 14, 0.557);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 14px 34px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  line-height: 1.6;
  font-size: 15px;
  color: rgba(233,238,242,0.94);
  white-space: pre-wrap;
  transform: translateZ(0);
}

#reading::before {
  content: "The projection suggests: " attr(data-card-name);
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
  margin-bottom: 6px;
}

#reading:not([data-card-name])::before {
  content: "The projection suggests";
}

.scene.has-card .reading { display: block; }

/* CHOICES */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: var(--text-max);
  align-self: center;
}

.btn {
  appearance: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.22);
  color: inherit;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover { border-color: rgba(255,255,255,0.38); }

.choice-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

/* TITLE CARD */
.title-card {
  position: absolute;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  background:
    radial-gradient(
      ellipse at center,
      rgba(10,14,18,0.35) 0%,
      rgba(5,8,12,0.75) 70%,
      rgba(5,8,12,0.92) 100%
    ),
    url("../assets/images/title/observatory_splash.png");
  background-size: cover;
  background-position: bottom;
  background-repeat: no-repeat;
}

.title-card.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 800ms ease;
}

.title-inner {
  text-align: center;
  padding: 32px;
  max-width: var(--page-max);
}

.title {
  font-size: clamp(32px, 7vw, 64px);
  letter-spacing: 0.12em;
  font-weight: 500;
  color: #f4efe8;
  text-transform: uppercase;
  text-shadow:
    0 2px 10px rgba(0,0,0,0.65),
    0 0 22px rgba(255,200,140,0.15),
    0 0 42px rgba(255,180,100,0.08);
}

.title-plate {
  padding: 28px 36px 32px;
  border-radius: 24px;
  background:
    radial-gradient(
      ellipse at center,
      rgba(15,20,24,0.62) 0%,
      rgba(10,14,18,0.82) 100%
    );
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-bottom: 28px;
}

.subtitle {
  opacity: 0.75;
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.begin-btn {
  font-size: 15px;
  padding: 12px 22px;
  border-color: rgba(255,210,160,0.35);
}

.begin-btn:hover { border-color: rgba(255,210,160,0.65); }

/* NAV DRAWER */
.nav-btn {
  position: fixed;
  top: calc(14px + var(--safe-top));
  left: 14px;
  z-index: 50;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.35);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(340px, 88vw);
  z-index: 60;
  transform: translateX(-110%);
  transition: transform 180ms ease;
  background: rgba(10,10,12,0.92);
  color: white;
  border-right: 1px solid rgba(255,255,255,0.12);
  padding: calc(14px + var(--safe-top)) 14px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-drawer.open { transform: translateX(0); }

.nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.nav-title { font-weight: 700; letter-spacing: 0.3px; }

.nav-close {
  border: 0;
  background: transparent;
  color: white;
  font-size: 22px;
  cursor: pointer;
}

.nav-section { margin-top: 12px; }
.nav-label { opacity: 0.75; font-size: 12px; margin: 8px 0; }

.nav-item {
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: white;
  cursor: pointer;
  margin-bottom: 8px;
  text-transform: lowercase;
}

.nav-item.current {
  border-color: rgba(255,255,255,0.25);
  text-transform: capitalize;
}

.nav-item::first-letter { text-transform: uppercase; }

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 70;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 92vw);
  z-index: 80;
  background: rgba(16,16,18,0.96);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.modal .btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}

.modal .btn.danger {
  border-color: rgba(255,120,120,0.35);
  background: rgba(255,80,80,0.18);
}

/* INVENTORY */
.inv-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.inv-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inv-title {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
  font-weight: 700;
}

.inv-subtitle {
  font-size: 12px;
  opacity: 0.7;
}

.inv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.inv-empty {
  font-size: 13px;
  opacity: 0.65;
  padding: 10px 0;
}

.inv-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.inv-item:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.32);
}

.inv-icon {
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
}

.inv-label {
  font-size: 13px;
  opacity: 0.92;
}

.inv-modal.hidden { display: none; }

.inv-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.inv-modal .modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.60);
}

.inv-modal .modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 92vw);
  max-height: 82vh;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10,12,14,0.95);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.inv-modal .modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.inv-modal .modal__title {
  font-size: 16px;
  margin: 0;
  opacity: 0.95;
  font-weight: 700;
}

.inv-modal .modal__close {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.85;
}

.inv-modal .modal__body {
  padding: 14px 16px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 14px;
  opacity: 0.95;
}

.inv-modal .modal__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* DISSONANCE "STUTTER" */
.narrative.dissonance-pulse {
  filter: blur(1.6px);
  opacity: 0.9;
  animation: dissonance-jitter 160ms linear 1;
  transition: filter 120ms ease, opacity 120ms ease;
}

@keyframes dissonance-jitter {
  0% { transform: translate(0, 0); }
  20% { transform: translate(0.25px, -0.15px); }
  40% { transform: translate(-0.2px, 0.2px); }
  60% { transform: translate(0.15px, -0.1px); }
  80% { transform: translate(-0.1px, 0.15px); }
  100% { transform: translate(0, 0); }
}

/* AUDIO TOGGLE */
.audio-toggle {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 12px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: inherit;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.audio-toggle:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* DEBUG */
.topbar {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 10px;
  z-index: 6;
  display: flex;
  gap: 8px;
}

.chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  opacity: 0.85;
}

.debug-hud {
  position: fixed;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;
  background: rgba(10,14,18,0.78);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: min(320px, calc(100vw - 24px));
  white-space: pre;
}

.debug-hud strong { font-weight: 700; }

/* ===============================
   MOBILE LAYOUT
   =============================== */

@media (max-width: 700px) {
  :root {
    --device-width: min(480px, 85vw);
    --beam-width: min(520px, 90vw);
    --card-width: min(260px, 60vw);
    --page-max: 92vw;
    --text-max: 92vw;
  }

  /* Switch UI to top-aligned column layout */
  .ui {
    position: relative;
    top: auto;
    bottom: auto;
    inset: auto;
    padding: calc(12px + var(--safe-top)) 14px 14px;
    background: none;
  }

  .ui .wrap {
    padding: 0 10px;
    gap: 14px;
  }

  /* Show projection stage on mobile */
  .proj-stage {
    display: block;
    width: 100%;
    max-width: var(--text-max);
    align-self: center;
    height: clamp(300px, 48svh, 520px);
    position: relative;
    overflow: visible;
    background: transparent;
  }

  /* Glass frame effect without clipping */
  .proj-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    background: rgba(10,14,20,0.20);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* Hide frame when showing device only */
  .scene.has-device:not(.has-card) .proj-stage::before {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Only show stage when there's a card */
  .scene:not(.has-card) .proj-stage {
    display: none;
  }

  .proj-stage > * {
    position: relative;
    z-index: 1;
  }

  /* Reposition projection cluster for mobile stage */
  .proj-stage .projection-cluster {
    position: absolute;
    inset: 12px;
    display: none;
  }

  .scene.has-card .proj-stage .projection-cluster {
    display: block;
  }

  .proj-stage .device {
    bottom: 2%;
    left: 50%;
    right: auto;
    width: min(var(--device-width), 92%);
    transform: translateX(-50%);
  }

  .proj-stage .beam {
    bottom: 2%;
    left: 50%;
    right: auto;
    width: min(var(--beam-width), 100%);
    transform: translateX(-50%);
    opacity: 0.95;
  }

  .proj-stage .card {
    bottom: 10%;
    left: 50%;
    right: auto;
    width: min(var(--card-width), 74%);
    transform: translateX(-50%);
  }

  /* Narrative adjustments */
  .narrative {
    max-width: var(--text-max);
    font-size: 15px;
    line-height: 1.7;
    max-height: min(62svh, 520px);
    background: rgba(10,14,20,0.70);
  }

  /* Add top margin when no card is shown */
  .scene:not(.has-card) .narrative {
    margin-top: min(50vh, 400px);
  }

  .reading {
    max-width: var(--text-max);
    font-size: 14px;
  }

  #reading::before {
    font-size: 11px;
    opacity: 0.80;
  }

  .choices {
    max-width: var(--text-max);
    gap: 8px;
    padding-bottom: calc(10px + var(--safe-bottom));
  }

  .btn {
    font-size: 14px;
    padding: 9px 13px;
  }

  /* Adjust nav and audio buttons */
  .nav-btn {
    top: calc(10px + var(--safe-top));
    left: 10px;
  }

  .audio-toggle {
    top: calc(10px + var(--safe-top));
    right: 10px;
  }
}

/* ===============================
   DESKTOP: Center the Device
   =============================== */

@media (min-width: 701px) {
  .scene.has-device .device {
    left: 85%;
    right: auto;
    transform: translateX(-50%);
    top: 60%;
  }

  .scene.has-device .beam {
    left: 85%;
    right: auto;
    transform: translateX(-50%);
    top: 20%;
  }

  /* Only show beam when there is a card */
  .scene:not(.has-card) .beam {
    display: none;
  }
}

/* Default: hide both clusters until a breakpoint turns one on */
[data-role="projection-desktop"],
.proj-stage {
  display: none;
}

/* Mobile: show the proj-stage (which contains the mobile cluster) */
@media (max-width: 900px) {
  .proj-stage {
    display: block;
  }
  [data-role="projection-desktop"] {
    display: none !important;
  }
}

/* Desktop: show the desktop cluster, hide the mobile proj-stage */
@media (min-width: 901px) {
  [data-role="projection-desktop"] {
    display: block;
  }
  .proj-stage {
    display: none !important;
  }
}

/* DESKTOP: projection sits behind the narrative, centered */
@media (min-width: 901px) {
  [data-role="projection-desktop"]{
    position: fixed;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    width: min(960px, 92vw);
    height: min(720px, 92vh);
    z-index: 2;          /* behind UI */
    pointer-events: none;
    display: block;
  }

  /* keep the UI above it */
  .ui{
    position: fixed;
    z-index: 4;
  }

  /* if your environment needs to be behind everything */
  .environment{
    position: fixed;
    inset: 0;
    z-index: 1;
  }
}

@media (min-width: 901px) {
  /* Stage: slightly higher so card is fully behind the narrative */
  [data-role="projection-desktop"]{
    position: fixed;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: min(1100px, 92vw);
    height: min(760px, 92vh);
    z-index: 2;
    pointer-events: none;
  }

  /* Center all projection assets */
  [data-role="projection-desktop"] .beam,
  [data-role="projection-desktop"] .card,
  [data-role="projection-desktop"] .device{
    position: absolute;
    left: 85%;
    transform: translateX(-50%);
    height: auto;
    max-width: 100%;
  }

  /* Card: move up + slightly smaller so it reads behind the text */
  [data-role="projection-desktop"] .card{
    top: 0%;
    width: min(380px, 30vw);
    opacity: 0.95;
  }

  /* Beam: higher and softer so it doesn’t dominate */
  [data-role="projection-desktop"] .beam{
    top: 50%;
    width: min(900px, 78vw);
    opacity: 0.55;
    left: 85%
  }

  /* Device: lift it so it’s not clipping at the bottom */
  [data-role="projection-desktop"] .device{
    top: 70%;
    width: min(560px, 48vw);
    opacity: 0.95;
    left: 85%
  }

  /* UI stack stays above projection */
  .ui{
    position: fixed;
    z-index: 4;
  }

  /* Reduce the amount we push the wrap down (so card isn't hidden) */
  .ui .wrap{
    padding-top: 180px;
  }
}