:root {
  --gold: #e5b864;
  --gold-bright: #f2c66e;
  --gold-soft: rgba(229, 184, 100, .72);
  --ink: #1f1309;
  --dark: #050301;
  --scene-ratio-desktop: 1672 / 941;
  --scene-ratio-mobile: 941 / 1672;

  --door-left: 25.5%;
  --door-top: 52.2%;
  --door-width: 31.5%;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: block;
  background: var(--dark);
  color: #f7e8bf;
  font-family: Georgia, "Times New Roman", serif;
  padding-bottom: max(7rem, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

button,
input { font: inherit; }
button { border: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scene {
  position: relative;
  width: min(100vw, calc(100vh * 1672 / 941));
  aspect-ratio: var(--scene-ratio-desktop);
  overflow: visible;
  background-image: url("./main-bg-desktop-antipodas.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
  box-shadow: 0 0 60px rgba(0, 0, 0, .85);
  margin: 0 auto;
}

.scene__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 50%, transparent 0 34%, rgba(0, 0, 0, .18) 56%, rgba(0, 0, 0, .35) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 40%, rgba(0, 0, 0, .05));
}

.world-entry,
.info-entry,
.test-tools,
.route-log,
.fullscreen-open,
.fullscreen-close {
  position: absolute;
  z-index: 2;
}

.world-entry {
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.magic-door {
  position: absolute;
  left: var(--door-left);
  top: var(--door-top);
  width: var(--door-width);
  aspect-ratio: 2 / 3;
  padding: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  perspective: 1100px;
  perspective-origin: center center;
  transform-style: preserve-3d;
  filter: drop-shadow(0 .45rem .7rem rgba(0, 0, 0, .55));
  transition: filter .3s ease, scale .3s ease;
}

.magic-door:hover,
.magic-door:focus-visible {
  scale: 1.018;
  filter:
    drop-shadow(0 .45rem .7rem rgba(0, 0, 0, .55))
    drop-shadow(0 0 1rem rgba(77, 186, 255, .38));
  outline: none;
}

.magic-door:focus-visible {
  outline: .15rem solid rgba(255, 220, 140, .88);
  outline-offset: .25rem;
  border-radius: 48% 48% 10% 10%;
}

.magic-door__leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  transform-style: preserve-3d;
  transition:
    transform 1100ms cubic-bezier(.18, .84, .21, 1),
    filter 900ms ease;
  will-change: transform;
  backface-visibility: hidden;
}

.magic-door__leaf img {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.magic-door__leaf--left {
  left: 0;
  transform-origin: left center;
}

.magic-door__leaf--left img { left: 0; }

.magic-door__leaf--right {
  right: 0;
  transform-origin: right center;
}

.magic-door__leaf--right img { right: 0; }

.magic-door.is-opening .magic-door__leaf--left {
  transform: rotateY(72deg);
  filter: brightness(1.08);
}

.magic-door.is-opening .magic-door__leaf--right {
  transform: rotateY(-72deg);
  filter: brightness(1.08);
}

.magic-door__label {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 29%;
  width: 84%;
  transform: translateX(-50%);
  pointer-events: none;
  color: #f0c96f;
  font-weight: 700;
  font-size: clamp(.78rem, 2.05vw, 1.85rem);
  line-height: 1;
  text-align: center;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-shadow:
    0 2px 2px rgba(19, 9, 2, .92),
    0 0 .35rem rgba(255, 206, 91, .85),
    0 0 .75rem rgba(91, 207, 255, .42);
  transition: opacity .35s ease, transform .35s ease;
}

.magic-door.is-opening .magic-door__label {
  opacity: 0;
  transform: translateX(-50%) translateY(-.35rem) scale(.96);
}

.magic-door__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms ease;
  background:
    radial-gradient(circle at center, rgba(66, 190, 255, .25), transparent 39%),
    radial-gradient(circle at center, rgba(245, 172, 52, .22), transparent 62%);
  mix-blend-mode: screen;
}

.magic-door:hover .magic-door__glow,
.magic-door:focus-visible .magic-door__glow,
.magic-door.is-opening .magic-door__glow { opacity: 1; }

.fullscreen-open,
.fullscreen-close {
  z-index: 24;
  cursor: pointer;
  color: #261306;
  background: linear-gradient(180deg, #f2d98c, #b8792b);
  border: 1px solid rgba(65, 34, 8, .72);
  box-shadow: 0 .55rem 1rem rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 244, 205, .66);
  font-weight: 700;
}

.fullscreen-open:hover,
.fullscreen-open:focus-visible,
.fullscreen-close:hover,
.fullscreen-close:focus-visible {
  outline: .15rem solid rgba(255, 235, 174, .92);
  outline-offset: .14rem;
  filter: drop-shadow(0 0 .55rem rgba(255, 216, 127, .72));
}

.fullscreen-open {
  top: .65rem;
  left: .65rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2.15rem;
  padding: .36rem .66rem;
  border-radius: 999px;
  font-size: clamp(.66rem, .82vw, .9rem);
  line-height: 1;
}

.fullscreen-close {
  top: .65rem;
  right: .65rem;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1.55rem;
  line-height: 1;
}

.info-entry {
  right: 2.4%;
  top: 3.2%;
  width: 45.2%;
  height: 91.8%;
  display: grid;
  grid-template-rows: 19% 32% 45%;
  gap: 2%;
  align-items: center;
}

.saga-logo-row {
  z-index: 5;
  width: 92%;
  justify-self: center;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.45rem, 1vw, .9rem);
  min-width: 0;
  transform: translateX(-1.5%);
}

.saga-logo-button {
  flex: 0 0 auto;
  width: min(8vw, 6.6rem);
  aspect-ratio: 1;
  background: transparent;
  padding: 0;
  cursor: pointer;
  filter: drop-shadow(0 .35rem .6rem rgba(0, 0, 0, .6));
  transition: transform .22s ease, filter .22s ease;
}

.saga-logo-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.saga-logo-button:hover,
.saga-logo-button:focus-visible {
  transform: translateY(-2px) scale(1.045);
  filter:
    drop-shadow(0 .35rem .6rem rgba(0, 0, 0, .6))
    drop-shadow(0 0 .7rem rgba(255, 214, 130, .7));
  outline: none;
}

.saga-logo-hint,
.role-help__short {
  margin: 0;
  color: var(--gold-bright);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: .025em;
  text-shadow:
    0 2px 2px rgba(20, 8, 1, .94),
    0 0 .45rem rgba(252, 218, 120, .42);
}

.saga-logo-hint {
  max-width: min(22vw, 17rem);
  font-size: clamp(.72rem, 1.08vw, 1.02rem);
  text-align: left;
}

.main-scroll {
  position: relative;
  z-index: 3;
  width: 140%;
  min-height: 100%;
  justify-self: center;
  align-self: center;
  padding: 5.4% 18.5% 4.6%;
  color: var(--ink);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 244, 207, .56);
  background: url("./panel-parchment-large.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 .65rem 1.4rem rgba(0, 0, 0, .36));
}

.main-scroll h1 {
  margin: 0 0 .55rem;
  color: #e3b75c;
  font-size: clamp(1rem, 2vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: .035em;
  text-shadow:
    0 2px 2px rgba(48, 22, 4, .9),
    0 0 .35rem rgba(255, 236, 169, .52);
}

.main-scroll p {
  margin: .24rem auto;
  max-width: 48rem;
  font-size: clamp(.58rem, .9vw, .88rem);
  line-height: 1.18;
}

.main-scroll__small { font-size: clamp(.52rem, .78vw, .78rem) !important; }

.actions-panel {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 55% 40%;
  gap: 5%;
  align-items: start;
  align-self: start;
  padding-top: 1.2%;
}

.register-scroll,
.role-key {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform .22s ease, filter .22s ease;
}

.register-scroll {
  width: 100%;
  max-width: 19rem;
  justify-self: center;
  filter: drop-shadow(0 .6rem 1rem rgba(0, 0, 0, .45));
}

.register-scroll img,
.role-key img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.register-scroll:hover,
.register-scroll:focus-visible,
.role-key:hover,
.role-key:focus-visible {
  transform: translateY(-2px) scale(1.035);
  filter:
    drop-shadow(0 .6rem 1rem rgba(0, 0, 0, .5))
    drop-shadow(0 0 .8rem rgba(255, 205, 114, .48));
  outline: none;
}

.saga-logo-button:focus-visible,
.register-scroll:focus-visible,
.role-key:focus-visible {
  outline: .15rem solid rgba(255, 220, 140, .92);
  outline-offset: .22rem;
  border-radius: .5rem;
}

.role-help {
  display: grid;
  justify-items: center;
  align-items: start;
  gap: .35rem;
}

.role-help__short {
  font-size: clamp(.78rem, 1.14vw, 1.08rem);
  text-align: center;
}

.role-key {
  width: min(9.8vw, 8.4rem);
  filter: drop-shadow(0 .45rem .85rem rgba(0, 0, 0, .46));
}

.test-tools {
  top: 3.15rem;
  left: .55rem;
  display: flex;
  gap: .45rem;
  align-items: center;
  padding: .35rem .5rem;
  color: #f4ddb1;
  background: rgba(10, 6, 3, .62);
  border: 1px solid rgba(221, 177, 89, .38);
  border-radius: .6rem;
  font-size: clamp(.56rem, .76vw, .78rem);
  backdrop-filter: blur(5px);
}

.route-log {
  left: .65rem;
  bottom: .65rem;
  max-width: min(42%, 38rem);
  padding: .42rem .62rem;
  border: 1px solid rgba(229, 184, 100, .38);
  border-radius: .55rem;
  color: #f5dfad;
  background: rgba(7, 4, 2, .66);
  box-shadow: 0 .55rem 1.3rem rgba(0, 0, 0, .42);
  font-size: clamp(.6rem, .78vw, .82rem);
  line-height: 1.25;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  overflow-y: auto;
}

.modal.is-open { display: flex; }

.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(5px);
}

.modal__panel {
  position: relative;
  max-height: min(90vh, 56rem);
  color: var(--ink);
  background:
    linear-gradient(rgba(236, 214, 166, .92), rgba(218, 184, 123, .9)),
    url("./panel-parchment-large.png") center / 100% 100% no-repeat;
  border: 1px solid rgba(80, 43, 12, .55);
  border-radius: 1.1rem;
  box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .65), inset 0 0 2rem rgba(116, 68, 23, .24);
  padding: clamp(1.1rem, 3vw, 2.2rem);
  overflow: auto;
}

.modal__panel--login { width: min(27rem, 92vw); }
.modal__panel--role-intro { width: min(34rem, 92vw); text-align: center; }
.modal__panel--role { width: min(72rem, 96vw); }

.modal__close {
  position: sticky;
  top: 0;
  float: right;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  cursor: pointer;
  color: #241305;
  background: #dfb568;
  box-shadow: 0 .3rem .8rem rgba(0, 0, 0, .28);
  font-size: 1.5rem;
  line-height: 1;
}

.modal h2,
.modal h3 { margin-top: 0; }

.modal h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  text-align: center;
}

.modal h3 {
  margin: 1.1rem 0 .35rem;
  font-size: clamp(1.08rem, 1.6vw, 1.35rem);
}

.modal p,
.modal li {
  line-height: 1.45;
  font-size: clamp(.95rem, 1.15vw, 1.1rem);
}

.login-form {
  display: grid;
  gap: .85rem;
}

.login-form label {
  display: grid;
  gap: .35rem;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  border: 1px solid rgba(75, 42, 14, .5);
  border-radius: .5rem;
  padding: .72rem .8rem;
  color: #1e1208;
  background: rgba(255, 248, 220, .82);
}

.primary-button,
.secondary-button {
  cursor: pointer;
  padding: .72rem 1rem;
  border-radius: .6rem;
  color: #251506;
  background: linear-gradient(180deg, #efcd7d, #bd7b32);
  border: 1px solid rgba(73, 37, 8, .62);
  box-shadow: 0 .5rem .9rem rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 246, 210, .58);
  font-weight: 700;
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible,
.modal__close:hover,
.modal__close:focus-visible {
  outline: .15rem solid rgba(74, 36, 8, .82);
  outline-offset: .18rem;
  filter: drop-shadow(0 0 .4rem rgba(255, 234, 169, .72));
}

.secondary-button { background: linear-gradient(180deg, #ead8a9, #cba260); }

.register-callout {
  margin-top: 1.1rem;
  padding-top: .95rem;
  border-top: 1px solid rgba(70, 40, 15, .28);
  text-align: center;
}

.register-callout p {
  margin: 0 0 .65rem;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}

.role-content { clear: both; }

.directory-block {
  margin-top: 1rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(89, 51, 17, .34);
  border-radius: .8rem;
  background: rgba(126, 76, 28, .08);
}

.directory-note {
  margin-top: 0;
  font-style: italic;
}

.directory-empty {
  margin-bottom: 0;
  color: #694016;
  font-style: italic;
}

.collaborator-directory {
  display: grid;
  gap: 2rem;
  margin-top: 1.25rem;
}

.collaborator-category {
  padding-top: 1.15rem;
  border-top: 1px solid rgba(89, 51, 17, .34);
}

.collaborator-category:first-child { padding-top: 0; border-top: 0; }

.modal .collaborator-category__title {
  margin: 0 0 1rem;
  color: #49270d;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  letter-spacing: .08em;
  text-align: center;
}

.collaborator-country + .collaborator-country { margin-top: 1.35rem; }

.modal .collaborator-country__title {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 0 .7rem;
  color: #694016;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
}

.collaborator-country__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(105, 64, 22, .45), transparent);
}

.collaborator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.collaborator-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(79, 43, 13, .38);
  border-radius: .85rem;
  background: rgba(255, 248, 220, .58);
  box-shadow: 0 .45rem 1rem rgba(67, 36, 11, .15);
}

.collaborator-card--no-image {
  background:
    linear-gradient(135deg, rgba(255, 248, 220, .7), rgba(220, 184, 119, .22));
}

.collaborator-card__media {
  display: grid;
  height: clamp(9rem, 17vw, 11.5rem);
  place-items: center;
  padding: .7rem;
  background: rgba(45, 25, 9, .09);
  border-bottom: 1px solid rgba(79, 43, 13, .24);
}

.collaborator-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 10.1rem;
  object-fit: contain;
  object-position: center;
}

.collaborator-card__body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  padding: 1rem;
}

.collaborator-card--no-image .collaborator-card__body { padding-top: 1.25rem; }

.modal .collaborator-card__name {
  margin: 0 0 .35rem;
  color: #321a08;
  font-size: 1.13rem;
}

.modal .collaborator-card__type,
.modal .collaborator-card__location {
  margin: 0;
  font-size: .91rem;
  line-height: 1.35;
}

.collaborator-card__type { color: #5a3413; font-weight: 700; }
.collaborator-card__location { color: #694016; }

.modal .collaborator-card__quote {
  margin: .8rem 0 1rem;
  padding-left: .75rem;
  border-left: .18rem solid rgba(130, 74, 24, .45);
  color: #3b210c;
  font-size: .94rem;
  font-style: italic;
  line-height: 1.45;
}

.collaborator-card__quote::before { content: "\201C"; }
.collaborator-card__quote::after { content: "\201D"; }

.collaborator-card__links {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.collaborator-card__link {
  display: inline-flex;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  padding: .55rem .8rem;
  border: 1px solid rgba(73, 37, 8, .58);
  border-radius: .55rem;
  color: #251506;
  background: linear-gradient(180deg, #ead8a9, #cba260);
  box-shadow: inset 0 1px 0 rgba(255, 246, 210, .58);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.collaborator-card__link:hover,
.collaborator-card__link:focus-visible {
  outline: .13rem solid rgba(74, 36, 8, .82);
  outline-offset: .15rem;
  filter: drop-shadow(0 0 .3rem rgba(255, 234, 169, .72));
}

@media (max-width: 640px) {
  .directory-block { padding: .75rem; }
  .collaborator-directory { gap: 1.6rem; }
  .collaborator-grid { grid-template-columns: 1fr; }
  .collaborator-card__media { height: 11rem; }
}

body.has-open-modal { overflow: hidden; }

.magic-door[aria-busy="true"] { cursor: progress; }

body.is-pseudo-fullscreen .scene {
  width: min(100vw, calc(100vh * 1672 / 941));
  max-width: 100vw;
  max-height: none;
}

@media (orientation: portrait), (max-width: 760px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
  }

  body {
    display: block;
    min-height: 100svh;
    background: var(--dark);
    padding-bottom: max(9rem, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .scene,
  body.is-pseudo-fullscreen .scene {
    width: 100vw;
    max-width: 100vw;
    max-height: none;
    min-height: max(100svh, 278vw);
    height: auto;
    aspect-ratio: auto;
    overflow: visible !important;
    background-image: url("./main-bg-mobile-antipodas.png");
    background-size: 100vw auto;
    background-position: top center;
    background-repeat: no-repeat;
    box-shadow: none;
  }

  .scene::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 176vw;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(5, 3, 1, 0), #050301 3rem, #050301 100%);
  }

  .scene__shade {
    background:
      linear-gradient(180deg, rgba(0,0,0,.10), transparent 28vw, rgba(0,0,0,.16) 100vw, rgba(0,0,0,.38) 100%);
  }

  .fullscreen-open {
    position: fixed;
    top: max(.45rem, env(safe-area-inset-top));
    left: max(.45rem, env(safe-area-inset-left));
    z-index: 34;
    min-height: 1.95rem;
    padding: .32rem .52rem;
    font-size: .68rem;
  }

  .fullscreen-open__text { display: none; }

  .fullscreen-close {
    position: fixed;
    z-index: 34;
    top: max(.45rem, env(safe-area-inset-top));
    right: max(.45rem, env(safe-area-inset-right));
    width: 1.95rem;
    height: 1.95rem;
    font-size: 1.35rem;
  }

  .magic-door {
    left: 50vw;
    top: 55vw;
    width: 63vw;
  }

  .magic-door__label {
    top: 28%;
    font-size: clamp(.86rem, 5.1vw, 1.7rem);
    letter-spacing: .11em;
  }

  .info-entry {
    left: 6.4vw;
    right: auto;
    top: 90.5vw;
    width: 87.2vw;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: .56rem;
    align-items: stretch;
  }

  .saga-logo-row {
    width: 100%;
    transform: none;
    justify-content: center;
    gap: .45rem;
    margin: 0 0 .1rem;
  }

  .saga-logo-button {
    width: min(17vw, 4.6rem);
    margin: 0;
  }

  .saga-logo-hint {
    max-width: 54vw;
    font-size: clamp(.66rem, 2.55vw, .9rem);
    line-height: 1.08;
    text-align: left;
  }

  .main-scroll {
    width: 108%;
    min-height: 0;
    padding: 1.38rem 1.65rem 1.12rem;
    transform: translateX(-4%);
  }

  .main-scroll h1 {
    font-size: clamp(.98rem, 4.55vw, 1.42rem);
    margin-bottom: .28rem;
  }

  .main-scroll p {
    font-size: clamp(.62rem, 2.65vw, .86rem);
    line-height: 1.18;
    margin: .24rem 0;
  }

  .main-scroll__small { display: none; }

  .actions-panel {
    display: grid;
    grid-template-columns: 52% 45%;
    gap: 3%;
    align-items: start;
    margin-top: .35rem;
  }

  .register-scroll { margin-top: .15rem; }

  .role-help {
    align-self: start;
    gap: .16rem;
  }

  .role-help__short {
    font-size: clamp(.72rem, 3vw, .95rem);
    line-height: 1.05;
  }

  .role-key { width: min(23vw, 5.6rem); }

  .test-tools {
    position: fixed;
    z-index: 30;
    top: calc(max(.45rem, env(safe-area-inset-top)) + 2.35rem);
    left: max(.45rem, env(safe-area-inset-left));
    transform: scale(.78);
    transform-origin: top left;
  }

  .route-log {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    max-width: 92vw;
    width: 92vw;
    transform: translateX(-50%);
    font-size: .64rem;
    opacity: .88;
  }

  .modal {
    align-items: flex-start;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) .85rem max(1rem, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .modal__panel {
    max-height: none;
    width: min(94vw, 56rem);
    margin: 1rem 0;
  }
}


/* v8: ajuste específico para móvil en horizontal.
   Mantiene la anchura del panel informativo, pero aumenta su altura un 30%
   y sube el bloque de texto para que no se salga por debajo del pergamino. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1180px) {
  html,
  body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    min-height: 100svh;
    padding-bottom: max(5.5rem, env(safe-area-inset-bottom));
  }

  .scene,
  body.is-pseudo-fullscreen .scene {
    width: min(100vw, calc(100svh * 1672 / 941));
    max-width: 100vw;
    min-height: 0;
    height: auto;
    aspect-ratio: var(--scene-ratio-desktop);
    overflow: visible !important;
    background-image: url("./main-bg-desktop-antipodas.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 5.5rem;
  }

  .scene::after { display: none; }

  .scene__shade {
    background:
      radial-gradient(circle at 25% 50%, transparent 0 34%, rgba(0, 0, 0, .18) 56%, rgba(0, 0, 0, .35) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, .22), transparent 40%, rgba(0, 0, 0, .05));
  }

  .magic-door {
    left: var(--door-left);
    top: var(--door-top);
    width: var(--door-width);
  }

  .magic-door__label {
    top: 29%;
    font-size: clamp(.72rem, 1.75vw, 1.35rem);
    letter-spacing: .12em;
  }

  .info-entry {
    right: 2.4%;
    left: auto;
    top: 3%;
    width: 45.2%;
    height: 92%;
    display: grid;
    grid-template-rows: 16.5% 34.5% 43%;
    gap: 2%;
    align-items: center;
  }

  .saga-logo-row {
    width: 92%;
    transform: translateX(-1.5%);
    justify-content: center;
    gap: clamp(.35rem, .9vw, .7rem);
    margin: 0;
  }

  .saga-logo-button {
    width: min(7.4vw, 5.7rem);
  }

  .saga-logo-hint {
    max-width: min(22vw, 15rem);
    font-size: clamp(.58rem, .94vw, .86rem);
    line-height: 1.05;
    text-align: left;
  }

  .main-scroll {
    width: 140%;
    min-height: 130%;
    height: 130%;
    justify-self: center;
    align-self: start;
    transform: translateY(-7.5%);
    padding: 3.35% 18.5% 6.8%;
  }

  .main-scroll h1 {
    margin: 0 0 .3rem;
    font-size: clamp(.82rem, 1.55vw, 1.42rem);
    line-height: 1;
  }

  .main-scroll p {
    margin: .16rem auto;
    font-size: clamp(.49rem, .76vw, .73rem);
    line-height: 1.12;
  }

  .main-scroll__small {
    font-size: clamp(.45rem, .68vw, .66rem) !important;
  }

  .actions-panel {
    display: grid;
    grid-template-columns: 55% 40%;
    gap: 5%;
    align-items: start;
    align-self: start;
    margin-top: .2%;
    padding-top: 0;
  }

  .register-scroll {
    width: 100%;
    max-width: 17.5rem;
    margin-top: 0;
  }

  .role-help {
    gap: .18rem;
  }

  .role-help__short {
    font-size: clamp(.62rem, 1vw, .92rem);
    line-height: 1.04;
  }

  .role-key {
    width: min(8.8vw, 7.6rem);
  }

  .test-tools {
    top: 2.8rem;
    left: .45rem;
    transform: scale(.82);
    transform-origin: top left;
  }

  .route-log {
    left: .55rem;
    bottom: .55rem;
    max-width: min(42%, 34rem);
    width: auto;
    transform: none;
    font-size: clamp(.52rem, .68vw, .72rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .magic-door.is-opening .magic-door__leaf--left,
  .magic-door.is-opening .magic-door__leaf--right { transition-duration: .01ms !important; }

  .magic-door.is-opening .magic-door__leaf--left { transform: rotateY(72deg); }
  .magic-door.is-opening .magic-door__leaf--right { transform: rotateY(-72deg); }
}
