/* A foto, o palco de partículas e a entrada sem script compartilham o mesmo corte. */
:root {
  --mine-x: 50%;
  --mine-y: 45%;
  --index-space: calc(var(--index-bottom) + var(--index-height) + var(--index-gap));
}
.geode img {object-position: var(--mine-x) var(--mine-y)}
#main .screen {background-position: var(--mine-x) var(--mine-y)}
#worlds .v0 {--land-x: 52%; --land-y: 49%} /* vagão à porta da oficina */
#worlds .v1 {--land-x: 67%; --land-y: 40%} /* boca do forno */
#worlds .v2 {--land-x: 59%; --land-y: 46%} /* poste no canal */
#worlds .v3 {--land-x: 76%; --land-y: 41%} /* ponte e estação suspensa */
#worlds .land {object-position: var(--land-x) var(--land-y); transform-origin: var(--land-x) var(--land-y)}
#duel .arena img {object-position: 52% 34%; transform-origin: 52% 34%}
#style .screen {background-position: center, 52% 45%}
.crew-label .kicker {background: #1a241fd9; color: #fff5d7; padding: 3px 8px; border-radius: 3px}
.fit-preview {background-position: center, 52% 55%}

#oficina .workshop-room, #style .fitting-room {
  inset-block-start: max(var(--chapter-start),10svh);
}
#crew {--crew-top: max(var(--chapter-start),15svh)}
#crew .crew-label {top: var(--crew-top)}

.workshop-room > .chapter-heading, .fitting-room > .chapter-heading {display: block}
.chapter-heading h2 {font-style: normal; line-height: 1.04; letter-spacing: -.055em}
.chapter-heading .kicker {color: #654323}
.fitting-room .kicker {color: #ffe5ad}

@media (orientation: landscape) {
  #powers .power-copy {
    width: 34%; inset-block: var(--chapter-start); transform: none;
    align-content: safe center;
  }
  #worlds .world-copy {
    width: min(43%,750px); top: var(--chapter-start); align-content: safe end;
  }
  #worlds .world-copy h2, .chapter-heading h2 {font-size: clamp(52px,6.4vw,112px)}
  .world:after {background: linear-gradient(90deg,#0a181cf0,#0a181cd9 49%,transparent 65%)}
  #duel .duel-copy {justify-content: flex-end; padding-bottom: var(--index-space)}
  #duel .duel-copy h2 {font-size: min(13vw,17svh)}
  #duel .duel-lico {max-height: 22svh}
}
@media (min-aspect-ratio: 1/1) and (max-aspect-ratio: 3/2) {
  :root {--mine-x: 40%} /* preserva o vagão e a mão mais à direita em 4:3 */
}
@media (min-aspect-ratio: 2/1) {
  :root {--mine-y: 32%}
  #worlds .v3 {--land-y: 34%}
  #duel .arena img {object-position: 50% 28%}
}
@media (orientation: portrait) {
  :root {--mine-x: 52%; --mine-y: 0%}
  body:not(.live) #main .screen {background-image: url(../media/r17/entrada-retrato.webp)}
  .hero-copy .lead {font-size: clamp(16px,2.4vw,21px); max-width: min(37ch,87vw)}
  #main .hero-copy {bottom: max(var(--index-space),calc(max(12px,env(safe-area-inset-bottom)) + 58px))}
  #worlds .world {
    height: 100svh; display: flex; flex-direction: column;
    background: #101c20; color: #fff3d9;
  }
  #worlds .land {
    position: relative; inset: auto; width: 100%; height: 0;
    flex: 1 1 0; min-height: var(--chapter-start);
  }
  #worlds .world:after {display: none}
  #worlds .world-copy {
    position: relative; inset: auto; flex: none; width: 100%; max-width: none;
    padding: clamp(14px,2svh,26px) var(--pad) calc(var(--index-space) + 60px);
    background: #101c20;
  }
  #worlds .world-copy::before {
    content: ''; position: absolute; inset: -36px 0 100%;
    background: linear-gradient(transparent,#101c20); pointer-events: none;
  }
  #worlds .world-copy .kicker, .chapter-heading .kicker {margin-bottom: 8px}
  #worlds .world-copy h2, .chapter-heading h2 {font-size: clamp(32px,7vw,76px)}
  #worlds .world-copy h2 {margin-bottom: 8px}
  #worlds .world-copy .lead {max-width: 48ch; font-size: clamp(15px,2.4vw,22px)}
  .live #worlds .switches,.live #powers .switches {
    bottom: var(--index-space); left: var(--pad); right: var(--pad);
    display: grid; grid-template-columns: repeat(4,minmax(44px,1fr)); gap: 4px;
  }
  .live #powers .switches {left: 12px; right: 12px}
  #worlds .switches button {padding-inline: 2px}
  #game .game-copy, #powers .power-copy {
    top: max(13svh,84px); left: var(--pad); width: auto; transform: none;
  }
  .capture {transform: translateY(19%) scale(.70)}
  #game .game-copy {right: var(--pad)}
  #game .game-copy h2 {font-size: clamp(48px,12vw,95px)}
  #powers .power-copy {top: max(var(--chapter-start),13svh); right: 25%}
  #powers .power-copy h2 {font-size: clamp(56px,15vw,115px)}
  #powers .power-icon {inset: max(14svh,88px) var(--pad) auto auto; width: 17%; height: 12svh}
  #powers .power-film {
    inset: auto var(--pad) calc(var(--index-space) + 60px);
    width: auto; transform: none;
  }
  #powers .power-film video {max-height: 38svh}
  .crew-controls {bottom: var(--index-space)}
  #crew {--crew-top: max(var(--chapter-start),12svh)}
  .live #crew .crew-card.chosen {
    display: grid; grid-template-rows: auto minmax(0,1fr) auto;
    padding: calc(var(--crew-top) + 26px) 8px calc(var(--index-space) + 52px);
  }
  .live #crew .chosen .crew-name {
    position: static; font-size: min(18vw,var(--name-limit,27.5cqi));
  }
  .live #crew .chosen .crew-art {
    position: static; width: 100%; height: 100%; min-height: 0;
    object-fit: contain; object-position: center;
  }
  .live #crew .chosen .crew-bio {position: static; max-width: 100%; padding: 0 4px}
  .live #crew .chosen .seal {display: none}
  #style .screen {background-position: center, 38% 48%}
  body:not(.live) #duel .screen, .live #duel:is(.active,.bridging) .screen {
    display: grid; grid-template-rows: minmax(0,min(78vw,48svh)) auto; align-content: center;
    background: #0e1923; padding: max(80px,9svh) 0 var(--index-space);
  }
  body:not(.live) #duel .screen {height: 100svh}
  #duel .arena {min-height: 0}
  #duel .arena img {object-fit: cover; object-position: 52% 34%; transform-origin: 52% 34%}
  #duel .arena::after {background: linear-gradient(0deg,#0e1923,transparent 14%)}
  #duel .duel-copy {position: relative; padding: 10px var(--pad) 4px}
  #duel .duel-copy h2 {font-size: clamp(64px,18vw,140px)}
  #duel .duel-copy .kicker {margin-bottom: 8px}
  #duel .duel-rival {padding: 0; margin-top: 6px; gap: clamp(8px,2vw,20px)}
  #duel .duel-lico {width: min(28vw,22svh); max-height: 24svh}
  #duel .duel-story {max-width: 42ch}
}

.power-steps {display: none}
.live #powers .screen {touch-action: pan-y pinch-zoom}
.live .power-steps {
  display: flex; gap: 8px; position: absolute; z-index: 5;
  bottom: 8.6%; right: var(--pad); pointer-events: none;
}
.power-steps button {
  pointer-events: auto; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid #d5c8ae; background: #151c1c; color: #fff1d8; font-size: 20px;
}
@media (orientation: portrait), (max-width: 650px) {
  .live .power-steps {
    bottom: var(--index-bottom); left: 12px; right: 12px; justify-content: space-between;
  }
}
@media (prefers-reduced-motion: reduce) {
  .live #powers .chosen {animation: none}
}
