/* Reference artwork provides the scene; live DOM values sit over its readouts. */
:root {
  --bg: #031323;
  --panel: #08263d;
  --green: #13e5ff;
  --green-soft: #99cddd;
  --green-dim: rgb(19 229 255 / 24%);
  --title: #dbf7ff;
  --border: #135576;
  --container: 540px;
}
body { background: radial-gradient(ellipse at 50% 18%, #092b43, #020a13 65%); }
.app-shell { background: var(--bg); container-type: inline-size; }
.app-shell:not(.results-mode) {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 76px);
  padding-bottom: 0;
}
.app-shell:not(.results-mode) > .hero { display: none; }
.scanner {
  width: 100%;
  aspect-ratio: 720 / 610;
  margin: 0;
  padding: 0;
  background: url('assets/scanner-reference.jpg') center top / 100% auto no-repeat;
  container-type: inline-size;
  text-shadow: 0 0 8px #13e5ff66;
  flex: 0 0 auto;
}
.scanner::before, .scanner::after { display: none; }
.scanner .scanner-title {
  position: absolute;
  left: 36.5%; top: 86.5%; width: 28%; height: 4.2%;
  background: #073047;
  box-shadow: 0 0 4px 3px #073047;
  border-radius: 3px;
  font: 600 2.25cqw/1.5 Arial, sans-serif;
  justify-content: center;
}
.scanner .chevrons { display: none; }
.scanner .segments {
  position: absolute; left: 37%; top: 91.5%; width: 26.5%; height: 3.2%;
  margin: 0; gap: 2px; background: #073147;
}
.scanner .segment { height: 100%; background: #0b4258; transition: background 200ms; }
.scanner .segment.active { background: #17edff; box-shadow: 0 0 7px #17edff80; }
.hud-value {
  position: absolute; display: flex; align-items: center; justify-content: center;
  color: #5df3ff; background: #073047;
  box-shadow: 0 0 5px 3px #073047;
  border-radius: 4px;
  font: 600 3.8cqw/1 Arial, sans-serif;
  height: 5.5%; font-variant-numeric: tabular-nums;
}
.hud-rtp { left: 20.7%; top: 54.6%; width: 13%; }
.hud-trend { left: 67%; top: 54.6%; width: 10%; }
.hud-score { left: 68.4%; top: 90.7%; width: 12%; font-size: 3.3cqw; }
.scanner .scan-details { position: static; height: auto; margin: 0; }
.scanner .detail-row { display: none; }
.scanner .detail-row:nth-child(2) {
  display: flex; position: absolute; left: 20.4%; top: 90.3%; width: 14%; height: 5.6%;
  min-height: 0; background: #073047; justify-content: center;
  box-shadow: 0 0 5px 3px #073047; border-radius: 4px;
  font: 600 3.4cqw/1 Arial, sans-serif;
}
.scanner .detail-row:nth-child(2) span, .scanner .detail-row:nth-child(2) i { display: none; }
.hud-orbit {
  position: absolute; left: 36.1%; top: 46.6%; width: 28%; aspect-ratio: 1;
  border: 2px solid transparent; border-top-color: #b9ffff; border-bottom-color: #17eaff;
  border-radius: 50%; box-shadow: 0 0 12px #00cfff66, inset 0 0 10px #00dfff44;
  animation: hud-spin 6s linear infinite;
}
.hud-orbit::after { content: ''; position: absolute; inset: 9%; border: 1px solid #64eeff33; border-right-color: #baffff; border-radius: 50%; }
.hud-bars { position: absolute; top: 75.3%; height: 3.6%; display: flex; align-items: end; gap: 3px; background: #062f44; }
.hud-bars-left { left: 21.3%; width: 9%; }
.hud-bars-right { left: 68.4%; width: 11.5%; }
.hud-bars i { flex: 1; height: 100%; background: #12edee; transform-origin: bottom; animation: hud-meter 1.8s ease-in-out infinite alternate; }
.hud-bars i:nth-child(2) { animation-delay: -.6s; }
.hud-bars i:nth-child(3) { animation-delay: -1.1s; }
.hud-bars i:nth-child(4) { animation-delay: -.3s; }
.hud-bars i:nth-child(5) { animation-delay: -.9s; }
.card-stage {
  --scene-offset: 0px;
  --card-offset: 0px;
  position: relative; margin: 0; padding: 0; min-height: 98cqw; flex: 1 0 auto;
  overflow: hidden; isolation: isolate;
  background: linear-gradient(#062940, #031323);
}
.card-stage::before {
  content: ''; position: absolute; inset: 0 0 auto; height: calc(98cqw + var(--scene-offset)); pointer-events: none;
  background: url('assets/floating-cards/stage.png') center bottom / 100% 100% no-repeat;
  mask-image: linear-gradient(transparent, #000 8%);
}
.card-stage::after {
  content: ''; position: absolute; inset: calc(98cqw + var(--scene-offset) - 1px) 0 0; pointer-events: none;
  background: url('assets/floating-cards/stage.png') center bottom / 100% auto no-repeat;
  transform: scaleY(-1); opacity: .38;
  mask-image: linear-gradient(transparent 15%, #000);
}
.card-stage #card-grid {
  position: absolute; inset: calc(3cqw + var(--card-offset)) 0 auto; z-index: 2; display: block;
  width: 100%; height: 76cqw; margin: 0; padding: 0;
  transform: translateY(-.5cqw) scale(.9); transform-origin: 50% 0;
}
.card-stage .game-card.prototype-card {
  position: absolute; margin: 0; padding: 0; border: 0; border-radius: 0;
  width: 31%; height: auto; aspect-ratio: 3 / 4;
  background: none; box-shadow: none; overflow: visible;
  opacity: 1; z-index: 1;
  animation: prototype-float var(--float-duration) ease-in-out var(--float-delay) infinite;
}
.card-stage .game-card.prototype-card:nth-child(1) { left: 7%; top: 12%; --tilt: 9deg; }
.card-stage .game-card.prototype-card:nth-child(2) { left: 36%; top: 2%; --tilt: 7deg; z-index: 2; }
.card-stage .game-card.prototype-card:nth-child(3) { left: 65%; top: 12%; --tilt: -9deg; }
.card-stage .game-card.prototype-card:nth-child(n + 4) { z-index: 3; }
.card-stage .game-card.prototype-card:nth-child(4) { left: 5%; top: 46%; --tilt: 8deg; }
.card-stage .game-card.prototype-card:nth-child(5) { left: 36%; top: 48%; --tilt: 11deg; z-index: 4; }
.card-stage .game-card.prototype-card:nth-child(6) { left: 66%; top: 44%; --tilt: -9deg; }
.card-stage .prototype-card::before, .card-stage .prototype-card::after { display: none; }
.portrait-frame {
  position: absolute; inset: 0; border-radius: 6% / 4.5%; transform: rotate(var(--tilt));
  background: linear-gradient(145deg, #e1efff 0%, #73b4f2 16%, #d5eaff 29%, #386c9d 48%, #acdcff 68%, #599cf0 88%, #dcefff);
  border: 0;
  box-shadow: 0 0 4px #c2e5ff77, 1px 3px 10px #3e9bff88, 0 0 22px #387dff33, 0 12px 18px #0009;
}
.portrait-frame::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  border: 1px solid #8dcaff99;
  box-shadow: 0 0 8px #7dbfff88, 0 0 18px #367eff66, 0 0 32px #286bff33;
  filter: blur(3px); opacity: .6;
  animation: rim-diffuse 5s ease-in-out var(--float-delay) infinite;
  pointer-events: none;
}
.portrait-frame::after {
  content: ''; position: absolute; inset: -5px; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse 20px 4px at 8% 3%, #edf6ffcc, #70baff66 30%, transparent),
    radial-gradient(ellipse 4px 19px at 8% 3%, #b5dcff99, transparent),
    radial-gradient(ellipse 24px 5px at 92% 97%, #d9ecffbb, #579dff55 30%, transparent);
  filter: blur(.5px);
}
.portrait-art { position: absolute; inset: 1.2px; border-radius: inherit; overflow: hidden; }
.card-stage .portrait-art img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.card-stage .portrait-image { filter: saturate(1.04); }
.card-stage .portrait-art .portrait-bloom {
  position: absolute; inset: 0; pointer-events: none;
  filter: blur(3px) brightness(1.15); mix-blend-mode: screen; opacity: .12;
}
.card-stage .portrait-art img { transform: scale(1.025); }
.card-stage .portrait-art .framed-artwork { transform: scale(1.1); }
.portrait-edge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.portrait-edge rect {
  fill: none; stroke-width: 1.1; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-dasharray: 21 79;
  animation: portrait-edge-flow 9s linear var(--float-delay) infinite;
}
.edge-ice { stroke: #e2f0ff; filter: drop-shadow(0 0 2px #92c9ff); }
.edge-blue { stroke: #a2d2ff; stroke-dashoffset: 50; filter: drop-shadow(0 0 3px #3a8dff); }
.portrait-edge .edge-halo { stroke-width: 6; opacity: .65; filter: blur(4px); }
.edge-halo.edge-ice { stroke: #92caff; }
.edge-halo.edge-blue { stroke: #3b83ff; }
.stage-sweep {
  position: absolute; inset: 0 0 auto; height: 75cqw; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, #99eeff00 45%, #b9ffff14 49%, #99eeff00 53%, transparent 60%);
  transform: translateX(-100%); animation: stage-scan 9s ease-in-out infinite; mix-blend-mode: screen;
}
.stage-ring {
  position: absolute; left: 24%; top: calc(79cqw + var(--scene-offset) * .82); width: 52%; height: 5cqw;
  border: 1px solid #7cffff; border-radius: 50%; box-shadow: 0 0 18px #04cfff99;
  animation: platform-pulse 4s ease-in-out infinite;
}
.app-shell.results-mode .hero-art { background-image: linear-gradient(transparent, var(--bg)), url('assets/scanner-reference.jpg'); background-position: center, center top; background-size: cover, 100% auto; }
.app-shell.results-mode .brand-lockup { padding-top: 24px; }
.app-shell.results-mode .hero { height: 176px; }
.app-shell.results-mode .hero-art { opacity: .45; }
.bottom-bar { background: transparent; border-color: #135576; }
.bottom-bar-inner { min-height: 76px; padding: 16px 24px; border-top-color: #69d9ed1a; background: #020e1bf5; }
.bottom-bar span { font-family: Arial, sans-serif; font-size: 12px; color: #7fa7b9; opacity: 1; }
.bottom-bar button { min-height: 42px; padding: 8px 18px; border: 1px solid #61e4ff66; border-radius: 6px; color: #d4faff; background: #0b3549; font: 600 14px/24px Arial, sans-serif; }
.bottom-bar button:hover { background: #0b3549; }
.bottom-bar button:disabled { opacity: .7; cursor: progress; }
body:has(.app-shell:not(.results-mode)) .bottom-bar { position: static; }
.game-dialog { background: #08263d; }
.dialog-action { background: #0b344b; }
@keyframes hud-spin { to { transform: rotate(360deg); } }
@keyframes prototype-float { 0%, 100% { transform: translateY(3px); } 50% { transform: translateY(-9px); } }
@keyframes rim-diffuse {
  0%, 100% { transform: scale(1); opacity: .3; }
  50% { transform: scale(1.045); opacity: .65; }
}
@keyframes portrait-edge-flow { to { stroke-dashoffset: -100; } }
.edge-blue { animation-name: portrait-edge-blue-flow; }
@keyframes portrait-edge-blue-flow { to { stroke-dashoffset: -50; } }
@keyframes hud-meter { from { transform: scaleY(.35); opacity: .65; } to { transform: scaleY(1); opacity: 1; } }
@keyframes stage-scan { 0%, 15% { transform: translateX(-100%); } 70%, 100% { transform: translateX(100%); } }
@keyframes platform-pulse { 0%, 100% { opacity: .2; transform: scale(.98); } 50% { opacity: .65; transform: scale(1.03); } }
@media (min-width: 768px) {
  .card-stage {
    --scene-offset: clamp(0px, calc((100svh - 76px - 182.722cqw) * .5), 14cqw);
    --card-offset: calc(var(--scene-offset) * .41);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hud-orbit, .hud-bars i, .portrait-edge rect, .portrait-frame::before, .stage-sweep, .stage-ring, .card-stage .game-card.prototype-card { animation: none; }
  .card-stage .game-card.prototype-card { transform: none; }
  .stage-sweep { display: none; }
}
