/* ===== OSWALD (self-hosted, OFL) ===== */
@font-face {
  font-family: 'Oswald';
  src: url('assets/fonts/Oswald.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #06060a;
  --text:         #d8d8e8;
  --text-dim:     rgba(216,216,232,0.42);
  --text-ghost:   rgba(216,216,232,0.2);
  --pink:         #E0206E;
  --cyan:         #00C8B4;
  --bronze:       #9A7540;
  --bronze-l:     #C4A060;
  --bronze-d:     #5A4020;
  --lava-r:       rgba(200,30,0,0.55);
  --lava-o:       rgba(255,90,0,0.18);
  --stone-dark:   #181820;
  --stone-mid:    #242432;
  --stone-edge:   #3a3a50;
  --stone-glow:   rgba(200,30,0,0.5);
  --screen-h:     100dvh;
  --ease-slide:   cubic-bezier(0.77,0,0.175,1);
  --ease-door:    cubic-bezier(0.4,0,0.2,1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #06060a; }
}
:root[data-theme="dark"] { --bg: #06060a; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  overflow: hidden;
  height: var(--screen-h);
  width: 100vw;
  touch-action: pan-y;
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-sw {
  position: fixed; top: .9rem; right: .9rem; z-index: 500;
  display: flex; gap: .38rem;
}
.lang-sw button {
  background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.14);
  color: var(--text-ghost); font: .65rem/1 Georgia,serif;
  letter-spacing: .09em; padding: .26rem .52rem; border-radius: 3px;
  cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.lang-sw button:hover,
.lang-sw button[aria-pressed="true"] {
  color: var(--text); border-color: rgba(255,255,255,.35);
  background: rgba(0,0,0,.7);
}

/* ===== SCREEN CONTAINER ===== */
#screens {
  position: relative; width: 100vw; height: var(--screen-h); overflow: hidden;
}

/* Desktop: centre 9:16 column */
@media (min-aspect-ratio: 10/16) {
  #screens { display: flex; justify-content: center; background: #000; }
  .screen  { max-width: calc(var(--screen-h) * 9 / 16); width: 100%; }
}

.screen {
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center;
  /* no transition by default -- JS handles zoom on s0; slide only on s1/s2 */
  will-change: transform, opacity;
}
/* Screens 1 and 2 use slide transition */
#s1, #s2 {
  transition: transform .75s var(--ease-slide), opacity .75s ease;
}
.screen.above  { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.screen.below  { transform: translateY(100%);  opacity: 0; pointer-events: none; }
.screen.active { transform: translateY(0);     opacity: 1; pointer-events: auto; }
/* s0 active: always visible (zoom out handled by JS transform) */
#s0.above, #s0.below { transform: none; opacity: 0; pointer-events: none; }
#s0.active            { opacity: 1; pointer-events: auto; }

/* ================================================================
   SCREEN 0 -- LIVING EYE
   Layout: TOP BAND (20%) / EYE (auto) / BOT BAND (24%)
   Text never overlaps the iris area.
================================================================ */
#s0 { justify-content: space-between; isolation: isolate; }

/* Full-screen eye image */
.eye-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 40%;
  pointer-events: none; user-select: none;
}

/* ---- TOP BAND ---- */
.s0-top-band {
  position: relative; z-index: 10;
  width: 100%;
  /* ~20 % of screen height */
  min-height: 19vh; max-height: 22vh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 1rem;
  background: linear-gradient(to bottom,
    rgba(6,6,10,0.96) 0%,
    rgba(6,6,10,0.80) 65%,
    transparent 100%);
  pointer-events: none;
}

/* ---- BOT BAND ---- */
.s0-bot-band {
  position: relative; z-index: 10;
  width: 100%;
  min-height: 22vh; max-height: 26vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 0 1rem 1.2rem;
  gap: .5rem;
  background: linear-gradient(to top,
    rgba(6,6,10,0.97) 0%,
    rgba(6,6,10,0.82) 60%,
    transparent 100%);
  pointer-events: none;
}

/* ---- Condensed fit-text titles ---- */
.fit-text {
  font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--pink);
  text-align: center;
  line-height: 1.0;
  white-space: nowrap;
  letter-spacing: .02em;
  text-shadow: 0 2px 22px rgba(224,32,110,.55);
  /* font-size set by JS fitText() */
  font-size: 4rem; /* sensible default */
}

.s0-sub {
  font-family: 'Oswald', Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(.68rem, 2.2vw, .9rem);
  color: var(--cyan);
  text-align: center;
  letter-spacing: .04em; line-height: 1.55;
  text-shadow: 0 0 14px rgba(0,200,180,.4);
  max-width: 90%;
}

.swipe-hint {
  position: absolute; bottom: .45rem;
  font-size: .54rem; letter-spacing: .24em; text-transform: uppercase;
  color: rgba(216,216,232,.18);
  animation: hint-bob 3s ease-in-out 4.5s infinite both;
  user-select: none; pointer-events: none; z-index: 10;
}
@keyframes hint-bob {
  0%,100% { opacity: .18; transform: translateY(0); }
  50%     { opacity: .45; transform: translateY(-4px); }
}

/* ---- Iris tracking clip ---- */
.iris-clip {
  position: absolute; border-radius: 50%; overflow: hidden;
  pointer-events: none;
  /* position+size set by JS */
  transform: translate(-50%, -50%);
  filter: brightness(1.1) contrast(1.06);
  mix-blend-mode: screen; opacity: .5;
  will-change: transform;
}
.iris-inner {
  position: absolute; object-fit: cover;
  pointer-events: none; user-select: none;
  /* width/height/left/top set by JS */
}

/* Pupil dilation while iris tracks */
@keyframes iris-breathe {
  0%,100% { transform: translate(-50%,-50%) scale(1);    opacity: .5; }
  50%     { transform: translate(-50%,-50%) scale(1.07); opacity: .62; }
}
.iris-clip.breathing { animation: iris-breathe 3s ease-in-out infinite; }

/* ---- Focus frame corners ---- */
.focus-frame {
  position: absolute; pointer-events: none;
  transform: translate(-50%, -50%);
  /* position+size set by JS */
}
.ff-corner {
  position: absolute; width: 18px; height: 18px;
  border-color: var(--cyan); border-style: solid; opacity: .88;
  transition: transform .4s var(--ease-door), opacity .4s;
}
.ff-tl { top:0; left:0;  border-width: 2px 0 0 2px; }
.ff-tr { top:0; right:0; border-width: 2px 2px 0 0; }
.ff-bl { bottom:0; left:0;  border-width: 0 0 2px 2px; }
.ff-br { bottom:0; right:0; border-width: 0 2px 2px 0; }

.focus-frame.closing .ff-tl { transform: translate( 10px,  10px); }
.focus-frame.closing .ff-tr { transform: translate(-10px,  10px); }
.focus-frame.closing .ff-bl { transform: translate( 10px, -10px); }
.focus-frame.closing .ff-br { transform: translate(-10px, -10px); }

/* ---- Door group (centered on pupil) ---- */
.door-group {
  position: absolute; pointer-events: none;
  transform: translate(-50%, -50%);
  /* size+position set by JS */
  opacity: 0; transition: opacity .4s ease; /* invisible until door-show phase */
  z-index: 6; /* above iris-clip stacking context */
  perspective: 400px;
}
.door-group.show        { opacity: 1; }
.door-group.show-frame  { opacity: 1; }

/* golden light behind door */
.door-light {
  position: absolute; inset: 0; border-radius: 4px;
  background: radial-gradient(ellipse at center,
    rgba(255,220,100,0) 0%, rgba(255,220,100,0) 100%);
  transition: background .5s ease;
  z-index: 0;
}
.door-group.open .door-light {
  background: radial-gradient(ellipse at center,
    rgba(255,230,140,.95) 0%, rgba(255,180,60,.5) 40%, transparent 70%);
}

/* pulsing light when door is "alive" */
@keyframes door-breathe {
  0%,100% { opacity: .6; }
  50%     { opacity: 1; }
}
.door-group.alive .door-light {
  background: radial-gradient(ellipse at center,
    rgba(255,220,100,.28) 0%, rgba(255,180,60,.10) 40%, transparent 68%);
  animation: door-breathe 2.2s ease-in-out infinite;
}

.door-frame-img {
  position: absolute; transform: translate(-50%,-50%);
  left: 50%; top: 50%;
  pointer-events: none; user-select: none;
  z-index: 1;
  /* size set by JS */
  opacity: 0; transition: opacity .5s ease;
}
.door-group.show-frame .door-frame-img { opacity: 1; }

.door-img {
  position: absolute; transform: translate(-50%,-50%);
  left: 50%; top: 50%;
  pointer-events: none; user-select: none;
  z-index: 2;
  /* size set by JS */
  opacity: 0; transition: opacity .5s ease;
  transform-origin: left center;
  /* override absolute centering when opened */
}
/* show door (fade in) */
.door-group.show .door-img { opacity: 1; transform: translate(-50%,-50%); }
/* open door (rotateY) */
.door-group.open .door-img {
  opacity: 1;
  transform: translate(-50%,-50%) perspective(300px) rotateY(-80deg);
  transition: transform .7s var(--ease-door), opacity .2s;
}

/* Debug ring + door debug */
.debug-ring {
  position: absolute; border-radius: 50%;
  border: 2px dashed rgba(0,255,128,.75);
  pointer-events: none; display: none;
  transform: translate(-50%, -50%);
}
.debug-mode .debug-ring { display: block; }
.debug-mode .door-group {
  opacity: 1 !important;
  outline: 2px solid red;
  outline-offset: -2px;
}

/* ================================================================
   SCREEN 1 -- LAVA + FLOATING STONES
================================================================ */
#s1 { justify-content: flex-start; }

/* Lava bg */
.s1-bg {
  position: absolute; inset: 0; pointer-events: none;
}
.lava-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 65%;
  filter: brightness(.42) saturate(1.35);
}
.lava-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--bg) 0%, transparent 25%,
                    transparent 60%, var(--bg) 100%),
    radial-gradient(ellipse 85% 42% at 50% 92%, var(--lava-r) 0%,
                    var(--lava-o) 44%, transparent 70%);
  animation: lava-pulse 5s ease-in-out infinite;
}
@keyframes lava-pulse {
  0%,100% { opacity: .85; }
  50%     { opacity: 1; }
}

/* Text block */
.s1-texts {
  position: relative; z-index: 4;
  text-align: center;
  padding: clamp(2rem,7vw,4rem) 1.5rem 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6,6,10,.88) 0%, rgba(6,6,10,.55) 65%, transparent 100%);
}
.s1-title {
  font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(1.5rem,6.5vw,2.8rem);
  color: var(--pink); text-transform: uppercase;
  letter-spacing: .04em; line-height: 1.1;
  text-shadow: 0 2px 18px rgba(224,32,110,.5);
}
.s1-sub {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(.7rem,2.4vw,.98rem);
  color: var(--cyan); margin-top: .65rem;
  line-height: 1.65; letter-spacing: .02em;
  text-shadow: 0 0 10px rgba(0,200,180,.35);
}

/* Stones stage */
.stones-stage {
  position: relative; z-index: 2; flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(1.8rem,10vw,6rem);
  padding: 0 1rem clamp(4rem,14vh,8rem);
}

/* Stone group: column (labels at bottom) */
.stone-group {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; cursor: grab; user-select: none;
}
.stone-group:active { cursor: grabbing; }

/* Platform wrapper (levitates as one unit) */
.platform-wrap {
  position: relative; z-index: 1; display: flex;
  align-items: flex-end; justify-content: center;
  margin-top: var(--plat-overlap, 0px); /* JS sets per-stone overlap */
}
.platform-img {
  width: clamp(110px,30vw,180px);
  height: auto; object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(200,30,0,.55));
}

/* Platform shadow on lava (shrinks when platform is high) */
.platform-shadow {
  position: absolute; bottom: -6px;
  left: 10%; right: 10%; height: 14px;
  background: radial-gradient(ellipse, rgba(200,30,0,.45) 0%, transparent 75%);
  border-radius: 50%; filter: blur(5px); pointer-events: none;
}

/* Items layer: floats ABOVE the platform */
.items-layer {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; justify-content: center;
  margin-bottom: 0; /* overlap applied by JS via platform-wrap margin-top */
}
.item-img {
  width: clamp(60px,18vw,120px);
  height: auto; object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.7));
}
/* Key+shield layout: overlapping */
.items-key { position: relative; }
.items-key .shield-img {
  width: clamp(55px,15vw,100px);
  position: relative;
}
.items-key .key-img {
  width: clamp(38px,10vw,68px);
  position: absolute; left: 58%; bottom: 10%;
  transform: rotate(-15deg);
}
/* item shadow on platform */
.item-shadow {
  position: absolute; bottom: -3px;
  left: 15%; right: 15%; height: 10px;
  background: radial-gradient(ellipse, rgba(0,0,0,.5) 0%, transparent 75%);
  border-radius: 50%; filter: blur(3px); pointer-events: none;
}

/* Stone variation CSS classes (applied to platform-img) */
.stone-v1 { /* default stone_empty -- no extra transform */ }
.stone-v2 { filter: drop-shadow(0 6px 22px rgba(220,40,0,.6)) brightness(1.05); }
.st-flip   { transform: scaleX(-1); }
.st-tilt-l { transform: rotate(-3.5deg); }
.st-tilt-r { transform: rotate( 3.5deg); }
.st-sm     { transform: scale(.92); }
.st-lg     { transform: scale(1.08); }
.st-bright { filter: drop-shadow(0 8px 26px rgba(230,50,0,.7)) brightness(1.12); }
/* Combined transforms */
.st-flip.st-tilt-r  { transform: scaleX(-1) rotate( 3.5deg); }
.st-flip.st-tilt-l  { transform: scaleX(-1) rotate(-3.5deg); }
.st-flip.st-tilt-r.st-sm { transform: scaleX(-1) rotate(3.5deg) scale(.92); }
.st-flip.st-tilt-l.st-sm { transform: scaleX(-1) rotate(-3.5deg) scale(.92); }

/* Labels */
.stone-swipe-lbl {
  font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(216,216,232,.38); user-select: none;
}
.stone-owner-lbl {
  font-size: .54rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--pink); text-align: center; user-select: none;
}

/* PLATFORM float animation */
.stone-group#stone-book .platform-wrap {
  animation: plat-a 4s ease-in-out infinite;
}
.stone-group#stone-key .platform-wrap {
  animation: plat-b 5.8s ease-in-out .9s infinite;
}
@keyframes plat-a {
  0%,100% { transform: translateY(0)     rotate(0deg); }
  45%     { transform: translateY(-18px) rotate(-1deg); }
  70%     { transform: translateY(-10px) rotate(.4deg); }
}
@keyframes plat-b {
  0%,100% { transform: translateY(-7px)  rotate(.8deg); }
  50%     { transform: translateY(7px)   rotate(-.6deg); }
}
/* Platform shadow sync */
.stone-group#stone-book .platform-shadow {
  animation: shad-a 4s ease-in-out infinite;
}
.stone-group#stone-key .platform-shadow {
  animation: shad-b 5.8s ease-in-out .9s infinite;
}
@keyframes shad-a {
  0%,100% { transform: scaleX(1);    opacity: .7; }
  45%     { transform: scaleX(.62);  opacity: .3; }
}
@keyframes shad-b {
  0%,100% { transform: scaleX(.7);   opacity: .4; }
  50%     { transform: scaleX(1.08); opacity: .75; }
}

/* ITEM float (relative to platform, smaller amplitude) */
.items-book {
  animation: item-book 3.2s ease-in-out .6s infinite;
}
.items-key {
  animation: item-key 2.9s ease-in-out 0s infinite;
}
@keyframes item-book {
  0%,100% { transform: translateY(0)   rotate(0deg); }
  50%     { transform: translateY(-7px) rotate(.8deg); }
}
@keyframes item-key {
  0%,100% { transform: translateY(-3px) rotate(-.5deg); }
  50%     { transform: translateY(4px)  rotate(.5deg); }
}

/* ================================================================
   SCREEN 2 -- TEAM
================================================================ */
#s2 { justify-content: flex-start; overflow-y: auto; overflow-x: hidden; }

.s2-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #0a0a12 0%, var(--bg) 70%);
}
.s2-lava {
  position: absolute; bottom: 0; left: 0; right: 0; height: 38%;
  background:
    radial-gradient(ellipse 100% 80% at 50% 100%, var(--lava-r) 0%,
                    var(--lava-o) 40%, transparent 68%),
    radial-gradient(ellipse 55% 40% at 22% 100%, rgba(220,50,0,.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 78% 100%, rgba(180,20,0,.16) 0%, transparent 55%);
  animation: lava-pulse 5.5s ease-in-out infinite;
}

.s2-inner {
  position: relative; z-index: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(9rem,22vh,14rem) 1rem 2rem; gap: .8rem; min-height: 100%;
}

/* Hero platform */
.hero-wrap { cursor: pointer; animation: float-hero 4.8s ease-in-out infinite; }
@keyframes float-hero {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-11px); }
}

.hero-platform-wrap {
  position: relative; display: flex; flex-direction: column; align-items: center;
}
.hero-stone-img {
  width: clamp(150px,42vw,230px); height: auto; object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(200,30,0,.6));
}
.hero-avatar-slot {
  position: absolute; left: 50%;
  transform: translateX(-50%);
  /* bottom + height set by JS from scene.json (top_surface_pct, 1.3x stone) */
  bottom: var(--avatar-bottom, 60%);
  height: var(--avatar-h, clamp(100px,28vw,160px));
  width: auto; pointer-events: none;
}

/* Bronze plaque */
.hero-plaque {
  background: linear-gradient(180deg, var(--bronze) 0%, var(--bronze-d) 100%);
  border: 1px solid var(--bronze-l); border-radius: 4px;
  padding: .38rem .9rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,200,100,.2);
  text-align: center; margin-top: .35rem;
}
.hero-plaque span {
  font-family: Georgia, serif; font-size: clamp(.58rem,1.9vw,.76rem);
  font-weight: bold; letter-spacing: .07em; text-transform: uppercase;
  color: #F0D890; text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

/* Team title */
.team-title {
  font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem,8vw,3.2rem);
  color: var(--pink); letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 0 2px 20px rgba(224,32,110,.5);
}

/* 4 char stones row */
.chars-row {
  display: flex; gap: clamp(.4rem,1.8vw,1rem);
  justify-content: center; align-items: flex-end;
  width: 100%;
  margin-top: clamp(4rem,11vh,7rem);
}
.char-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: .22rem; cursor: pointer; user-select: none;
  flex: 1; max-width: clamp(58px,23vw,110px);
}
.char-platform-wrap { position: relative; width: 100%; display: flex; align-items: flex-end; }

/* platform-img inside chars-row */
.chars-row .platform-img {
  width: 100%; height: auto; object-fit: contain;
  filter: drop-shadow(0 5px 16px var(--stone-glow));
}

.char-avatar-slot {
  position: absolute; left: 50%;
  transform: translateX(-50%);
  /* bottom + height set by JS from scene.json */
  bottom: var(--avatar-bottom, 60%);
  height: var(--avatar-h, clamp(55px,16vw,88px));
  width: auto; pointer-events: none;
}

/* Char float (staggered) */
.chars-row .char-wrap:nth-child(1) { animation: cf1 3.9s ease-in-out 0.0s infinite; }
.chars-row .char-wrap:nth-child(2) { animation: cf2 4.4s ease-in-out 0.6s infinite; }
.chars-row .char-wrap:nth-child(3) { animation: cf3 3.7s ease-in-out 1.2s infinite; }
.chars-row .char-wrap:nth-child(4) { animation: cf4 4.6s ease-in-out 0.3s infinite; }
@keyframes cf1 { 0%,100%{transform:translateY(0);}     50%{transform:translateY(-9px);}  }
@keyframes cf2 { 0%,100%{transform:translateY(-4px);}  50%{transform:translateY(5px);}   }
@keyframes cf3 { 0%,100%{transform:translateY(0);}     50%{transform:translateY(-8px);}  }
@keyframes cf4 { 0%,100%{transform:translateY(-3px);}  50%{transform:translateY(7px);}   }

.char-name {
  font-size: clamp(.52rem,1.8vw,.7rem); font-weight: bold;
  letter-spacing: .06em; color: var(--text);
  text-align: center; text-transform: uppercase;
}
.char-topic {
  font-size: clamp(.48rem,1.55vw,.62rem); letter-spacing: .1em;
  color: var(--text-dim); text-align: center; text-transform: lowercase;
}

/* Avatar + placeholder */
.avatar-img {
  height: 100%; width: auto; object-fit: contain;
  display: block; max-width: none;
  /* no border-radius -- full figure cutout */
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.65));
}
/* Placeholder: hide once avatar loaded */
.has-avatar .avatar-ph { display: none; }
/* Placeholder circle shown until/if avatar-img fails */
.avatar-ph {
  position: absolute; inset: auto;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: clamp(36px,11vw,60px); height: clamp(36px,11vw,60px);
}
.avatar-ph svg { width: 100%; height: 100%; }
.ph-circle { fill: var(--stone-mid); stroke: var(--bronze); stroke-width: 1.5; }
.ph-q { fill: var(--bronze-l); font-size: 18px; font-family: Georgia,serif; font-weight: bold; }

/* Social tiles */
.soc-tiles {
  display: flex; gap: clamp(.35rem,1.6vw,.7rem);
  justify-content: center; flex-wrap: nowrap; width: 100%;
  padding: 0 .2rem;
}
.soc-tile {
  display: flex; flex-direction: column; align-items: center; gap: .28rem;
  background: linear-gradient(160deg, var(--stone-mid) 20%, var(--stone-dark) 100%);
  border: 1px solid var(--stone-edge); border-radius: 7px;
  padding: .5rem .5rem .4rem; cursor: pointer;
  text-decoration: none; color: var(--bronze-l);
  transition: border-color .2s, filter .2s;
  flex: 1; max-width: clamp(44px,15vw,64px);
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.soc-tile:hover { border-color: var(--bronze); filter: brightness(1.18); }
.soc-tile.dimmed { opacity: .33; pointer-events: none; cursor: default; }
.soc-tile svg { width: clamp(18px,5vw,26px); height: clamp(18px,5vw,26px); }
.soc-tile-lbl {
  font-size: clamp(.4rem,1.4vw,.55rem); letter-spacing: .08em;
  text-transform: uppercase; white-space: nowrap;
}

/* Footer */
.s2-footer {
  display: flex; flex-direction: column; align-items: center;
  gap: .28rem; padding-top: .3rem; padding-bottom: .8rem;
}
.ad-badge {
  font-size: .5rem; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(216,216,232,.28); border: 1px solid rgba(216,216,232,.12);
  padding: .1rem .38rem; border-radius: 2px; user-select: none;
}
.official-note {
  font-size: .54rem; letter-spacing: .1em;
  color: rgba(216,216,232,.2); text-align: center; user-select: none;
}

/* ================================================================
   SCREEN 1 -- ATMOSPHERIC ELEMENTS (ghost chart, sparks, ticker)
================================================================ */
.s1-atm {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
}

/* Ticker strip at very top */
.s1-ticker {
  position: absolute; top: 0; left: 0; right: 0;
  height: 1.5rem; overflow: hidden;
  opacity: 0.1;
}
.s1-ticker-inner {
  display: flex; white-space: nowrap; align-items: center;
  height: 100%; gap: 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: .54rem; letter-spacing: .06em;
  color: rgba(196,160,96,.95);
  animation: ticker-scroll 22s linear infinite;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Ghost chart */
.s1-ghost-wrap {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 58%;
  overflow: hidden;
  opacity: 0.11;
  filter: blur(1.5px);
}
.s1-ghost-wrap svg {
  display: block;
  animation: ghost-scroll 40s linear infinite;
}
@keyframes ghost-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Sparks */
.s1-sparks {
  position: absolute; bottom: 10%; left: 0; right: 0; height: 65%;
  overflow: hidden;
}
.s1-spark {
  position: absolute; bottom: 0; border-radius: 50%;
  animation: spark-rise linear infinite;
}
.s1-ember {
  background: radial-gradient(circle, rgba(255,155,30,.9) 0%, rgba(200,50,0,.35) 65%, transparent 100%);
  box-shadow: 0 0 5px rgba(255,100,0,.5);
}
.s1-coin {
  background: radial-gradient(circle, rgba(196,160,96,.9) 25%, rgba(154,117,64,.3) 68%, transparent 100%);
  box-shadow: 0 0 7px rgba(196,160,96,.45);
}
@keyframes spark-rise {
  0%   { transform: translateY(0) scale(1);      opacity: 0; }
  8%   { opacity: .85; }
  75%  { opacity: .35; }
  100% { transform: translateY(-240px) scale(.25); opacity: 0; }
}

/* ===== TRANSITION VEIL ===== */
.transition-veil {
  position: fixed; inset: 0; background: #000;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity .4s ease;
}
.transition-veil.show { opacity: 1; pointer-events: auto; }

/* ===== SWIPE PAUSE ===== */
body.is-swiping .platform-wrap,
body.is-swiping .items-layer,
body.is-swiping .hero-wrap,
body.is-swiping .char-wrap { animation-play-state: paused; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .platform-wrap, .items-layer, .platform-shadow,
  .hero-wrap, .char-wrap,
  .lava-overlay, .s2-lava,
  .swipe-hint, .iris-clip.breathing,
  .door-group.alive .door-light,
  .s1-ghost-wrap svg, .s1-ticker-inner, .s1-spark { animation: none !important; }
  #s1, #s2 { transition: opacity .3s ease !important; }
}

/* ===== SMALL PHONE ===== */
@media (max-width: 360px) {
  .stones-stage { gap: 1.2rem; }
  .platform-img { width: 90px; }
  .item-img     { width: 54px; }
  .soc-tiles    { gap: .25rem; }
  .soc-tile     { padding: .4rem .35rem .32rem; }
}
