@font-face { font-family: "Noto Serif"; font-weight: 300; font-style: italic; font-display: swap;
  src: url(../assets/fonts/ns-latin-ext-300i.woff2) format("woff2"); unicode-range: U+0100-017F, U+0218-021B; }
@font-face { font-family: "Noto Serif"; font-weight: 300; font-style: italic; font-display: swap;
  src: url(../assets/fonts/ns-latin-300i.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url(../assets/fonts/ns-latin-ext-400i.woff2) format("woff2"); unicode-range: U+0100-017F, U+0218-021B; }
@font-face { font-family: "Noto Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url(../assets/fonts/ns-latin-400i.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url(../assets/fonts/ns-cyrillic-400i.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-latin-ext-600.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url(../assets/fonts/os-cyrillic-600.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --R: 300px;
  --base-top: 0.6595; --base-left: 0.0878;
  --base-w: 1.8314;
  --base-h: 0.5716;
  --navy-dark: #030928;
  --space: #02040B;
  --space-soft: #071229;
  --ink: #EEF2FB;
  --ink-muted: #9AA4BD;
  --gold: #D9A67B;
  --gold-base: #B4865E;
  --burgundy: #A00332;
  --burgundy-dark: #800228;
  --error: #F87171;
  --line: rgb(238 242 251 / .22);
  --font-heading: "Noto Serif", Georgia, serif;
  --font-body: "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

.backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100lvh; pointer-events: none; }

.globe-box { container-type: size; }
.stage {
  --R: min(46cqw, 38.546cqh);
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--R) * 2);
  height: calc(var(--R) * (1 + var(--base-top) + var(--base-h)));
  margin-left: calc(var(--R) * -1);
  margin-top: calc(var(--R) * (1 + var(--base-top) + var(--base-h)) / -2);
  touch-action: pan-y;
  cursor: grab;
  will-change: transform;
}
.stage.is-live { touch-action: none; }
.stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.stage.is-grabbing { cursor: grabbing; }
.stage::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(var(--R) * -0.07);
  width: calc(var(--R) * 2.1);
  height: calc(var(--R) * 0.2);
  transform: translate(-50%, var(--up, 0px));
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 2, 12, .6) 0%, rgba(0, 2, 12, .3) 45%, rgba(0, 2, 12, 0) 72%);
  z-index: 0;
  pointer-events: none;
}

.globe {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--R) * 2);
  height: calc(var(--R) * 2);
  border-radius: 50%;
  z-index: 2;
}
.globe::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 calc(var(--R) * .05) rgba(200, 225, 255, .25),
    0 0 calc(var(--R) * .3) rgba(110, 160, 255, .18);
}

.globe__inner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  background: #0b1438;
}

.poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.snow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  animation: snow-in .6s ease both;
}
@keyframes snow-in { from { opacity: 0; } }

.glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.glass__tint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 62% 16% at 50% 86%, rgba(240, 190, 110, .2), rgba(240, 190, 110, 0) 70%),
    radial-gradient(circle at 50% 46%,
    rgba(255, 255, 255, 0) 0 56%,
    rgba(150, 185, 255, .07) 72%,
    rgba(185, 215, 255, .2) 86%,
    rgba(225, 240, 255, .42) 96%,
    rgba(255, 255, 255, .62) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .35),
    inset 0 calc(var(--R) * -.08) calc(var(--R) * .16) rgba(4, 10, 40, .35),
    inset 0 0 calc(var(--R) * .05) rgba(210, 230, 255, .35);
}
.base {
  position: absolute;
  width: calc(var(--R) * var(--base-w));
  left: calc(var(--R) * var(--base-left, 0.1));
  top: calc(var(--R) * (1 + var(--base-top)));
  pointer-events: none;
}
.base { z-index: 3; }

.mute {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
}
.mute:hover { color: var(--gold); }
.mute:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mute svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mute svg .fill { fill: currentColor; stroke: none; }
.mute__off .slash { stroke-width: 2; }
.mute__off path:first-child, .mute__off .fill { opacity: .55; }
.mute__off { display: none; }
.mute.is-muted .mute__on { display: none; }
.mute.is-muted .mute__off { display: block; }

.motion-alert {
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 1px solid rgba(255, 190, 205, .45);
  border-radius: 50%;
  background: #a00332;
  color: #fff;
  cursor: pointer;
  animation: motion-pulse 1.6s ease-out infinite;
}
.motion-alert[hidden] { display: none; }
.motion-alert svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.motion-alert:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes motion-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(160, 3, 50, .75); background: #a00332; }
  50%  { background: #c8104a; }
  70%  { box-shadow: 0 0 0 14px rgba(160, 3, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(160, 3, 50, 0); background: #a00332; }
}

.motion-help {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(4, 7, 22, .72);
  overflow-y: auto;
  -webkit-user-select: text;
  user-select: text;
}
.motion-help[hidden] { display: none; }
.motion-help__panel {
  width: min(440px, 100%);
  padding: 22px 20px 18px;
  border: 1px solid rgb(180 134 94 / .5);
  border-radius: 0;
  background: var(--space-soft);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
}
.motion-help__title { margin: 0 0 8px; color: var(--gold); font: italic 400 26px/1.2 var(--font-heading); }
.motion-help p { margin: 0 0 12px; opacity: .9; }
.motion-help h3 { margin: 4px 0 6px; font-size: 15px; color: var(--gold); }
.motion-help ol { margin: 0 0 12px; padding-left: 20px; }
.motion-help li { margin-bottom: 6px; }
.motion-help b { color: #fff; }
.motion-help__note { font-style: italic; opacity: .75; }
.motion-help__status {
  padding: 10px 12px;
  border-left: 3px solid #a00332;
  border-radius: 0;
  background: rgba(160, 3, 50, .18);
  opacity: 1 !important;
}
.motion-help__status[hidden] { display: none; }
.motion-help__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.motion-help__actions button {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
}
.motion-help__retry { border: 0; background: #a00332; color: #fff; font-weight: 600; }
.motion-help__close { border: 1px solid rgb(180 134 94 / .5); background: transparent; color: var(--ink); }
.motion-help__actions button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0 16px;
  text-align: center;
  font: italic 400 15px/1.3 var(--font-heading);
  letter-spacing: .02em;
  color: #fff;
  text-shadow: 0 0 3px rgba(2, 8, 40, .9), 0 0 10px rgba(2, 8, 40, .9), 0 0 22px rgba(2, 8, 40, .8);
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
  z-index: 10;
}
.hint.is-visible { opacity: 1; }

.permit-wrap {
  position: fixed;
  inset: 0;
  z-index: 34;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(2 4 11 / .78);
}
.permit-wrap[hidden] { display: none; }
.permit {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 32px));
  padding: 26px 22px 18px;
  border: 1px solid rgb(180 134 94 / .5);
  border-radius: 0;
  background: var(--space-soft);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
  text-align: center;
  animation: permit-in .5s ease-out;
}
@keyframes permit-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.permit__icon {
  width: 72px;
  height: 72px;
  fill: none;
  stroke: #fff;
  stroke-width: .75;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: permit-shake 2.4s ease-in-out infinite;
  transform-origin: 50% 80%;
}
@keyframes permit-shake {
  0%, 55%, 100% { transform: rotate(0); }
  62% { transform: rotate(-9deg); }
  70% { transform: rotate(8deg); }
  78% { transform: rotate(-6deg); }
  86% { transform: rotate(4deg); }
}
.permit__title { margin: 0; color: var(--gold); font: italic 400 clamp(26px, 7vw, 34px)/1.1 var(--font-heading); }
.permit__text {
  margin: 0 0 6px;
  font: 15px/1.3 var(--font-body);
}
.permit__yes {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  background: var(--burgundy);
  color: #fff;
  font: 600 15px/1 var(--font-body);
  letter-spacing: .06em;
  cursor: pointer;
}
.permit__yes::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 244, 220, .15) 35%, rgba(255, 250, 238, .6) 50%, rgba(255, 244, 220, .15) 65%, transparent 100%);
  transform: translateX(-110%) skewX(-12deg);
  animation: permit-shine 7s ease-in-out 1s infinite;
  pointer-events: none;
}
@keyframes permit-shine {
  0% { transform: translateX(-110%) skewX(-12deg); }
  35%, 100% { transform: translateX(240%) skewX(-12deg); }
}
@media (prefers-reduced-motion: reduce) { .permit__yes::after { animation: none; display: none; } }
.permit__no {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 15px/1 var(--font-body);
  opacity: .7;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.permit__yes:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.permit__no:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.debug {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 40;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .65);
  color: #9f9;
  font: 11px/1.35 ui-monospace, Menlo, monospace;
  pointer-events: none;
  white-space: pre;
}

.debug-test {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 40;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: #2b6;
  color: #fff;
  font: 14px ui-monospace, Menlo, monospace;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .motion-alert { animation: none; }
  .permit, .permit__icon { animation: none; }
}
