@font-face {
  font-family: "Neucha";
  src: url("assets/neucha-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  background: #151b20;
  color: #f0eadb;
  --pointer-x: 50%;
  --pointer-y: 50%;
}

* {
  box-sizing: border-box;
}

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

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

button {
  font: inherit;
}

.threshold {
  position: relative;
  isolation: isolate;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  background: #151b20;
}

.scene,
.scene__painting,
.scene__rain,
.scene__vignette,
.scene__grain {
  position: absolute;
  inset: 0;
}

.scene {
  z-index: 0;
  overflow: hidden;
  background: #202830;
}

.scene__painting {
  inset: -2.5%;
  background-position: center center;
  background-size: cover;
  transform: translate3d(
      calc((var(--pointer-x) - 50%) * -0.008),
      calc((var(--pointer-y) - 50%) * -0.006),
      0
    )
    scale(1.015);
  transition: transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 500ms ease;
  will-change: transform, filter;
}

.scene__painting--open {
  background-image: url("assets/house-outside-rusreal-v2.webp");
}

.scene__painting--closed {
  z-index: 1;
  background-image: url("assets/house-outside-closed-rusreal-v2.webp");
  opacity: 1;
  will-change: opacity;
}

.scene__light {
  position: absolute;
  border-radius: 45%;
  background: rgba(244, 170, 84, 0.28);
  filter: blur(18px);
  mix-blend-mode: screen;
  animation: breathe 7s ease-in-out infinite;
}

.scene__light--window {
  top: 44.5%;
  left: 51%;
  width: 3.5vw;
  height: 4.5vw;
}

.scene__light--door {
  top: 56%;
  left: 50%;
  width: 5vw;
  height: 4vw;
  animation-delay: -3s;
}

.scene__rain {
  opacity: 0.13;
  background-image: repeating-linear-gradient(
    102deg,
    transparent 0,
    transparent 23px,
    rgba(210, 224, 228, 0.22) 24px,
    transparent 25px,
    transparent 49px
  );
  transform: translateY(-10%);
  animation: rain 4s linear infinite;
  mix-blend-mode: screen;
}

.scene__vignette {
  background:
    linear-gradient(to bottom, rgba(7, 11, 15, 0.28), transparent 27%, transparent 64%, rgba(6, 9, 11, 0.38)),
    radial-gradient(circle at 50% 52%, transparent 22%, rgba(6, 9, 12, 0.12) 58%, rgba(6, 9, 12, 0.58) 110%);
}

.scene__grain {
  inset: -60%;
  width: 220%;
  height: 220%;
  opacity: 0.12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  animation: grain 450ms steps(2) infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.invitation {
  position: absolute;
  z-index: 2;
  top: clamp(2.25rem, 7vh, 5.5rem);
  left: 50%;
  width: min(92vw, 70rem);
  text-align: center;
  transform: translateX(-50%);
  text-shadow: 0 2px 14px rgba(4, 7, 10, 0.75);
  transition: opacity 500ms ease, transform 900ms ease;
}

.invitation h1 {
  margin: 0;
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: clamp(3.5rem, 9vw, 9rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.005em;
  color: #e8e0cf;
  transform: rotate(-0.7deg);
}

.invitation h1::first-letter {
  color: #efe7d7;
}

.invitation__epigraph {
  margin: 0.45rem 0 0;
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: clamp(1.095rem, 1.425vw, 1.325rem);
  font-style: normal;
  letter-spacing: 0.06em;
  color: rgba(235, 227, 207, 0.68);
  text-shadow: 0 2px 10px rgba(4, 7, 10, 0.85);
}

.fence-sign {
  position: absolute;
  z-index: 3;
  top: 66%;
  left: 50%;
  min-width: 10.6rem;
  padding: 0.32rem;
  border: 2px solid rgba(39, 48, 44, 0.96);
  border-radius: 5px 3px 6px 2px;
  background:
    radial-gradient(circle at 12% 26%, rgba(196, 132, 77, 0.58) 0 1px, transparent 2px),
    radial-gradient(circle at 87% 72%, rgba(121, 69, 45, 0.7) 0 1.5px, transparent 2.5px),
    linear-gradient(116deg, transparent 17%, rgba(239, 224, 181, 0.11) 18%, transparent 20%),
    linear-gradient(164deg, #697c70 0%, #43574f 50%, #293a35 100%);
  box-shadow:
    0 0 0 1px rgba(205, 202, 169, 0.23) inset,
    0 1px 0 rgba(246, 236, 199, 0.24) inset,
    0 0 10px rgba(236, 177, 99, 0.18),
    0 0 30px rgba(231, 162, 79, 0.16),
    8px 10px 15px rgba(2, 4, 5, 0.55),
    -4px 4px 0 -2px rgba(91, 48, 35, 0.8);
  color: rgba(245, 232, 196, 0.96);
  cursor: pointer;
  transform: translate(-50%, -50%) rotate(1.7deg);
  transition: color 240ms ease, box-shadow 240ms ease, transform 240ms ease, opacity 400ms ease;
}

.fence-sign::before,
.fence-sign::after {
  content: none;
}

.fence-sign__inner {
  position: relative;
  display: grid;
  min-height: 3.25rem;
  place-content: center;
  padding: 0.4rem 1.35rem;
  border: 1px solid rgba(210, 202, 164, 0.38);
  border-radius: 3px 1px 4px 2px;
  background: linear-gradient(100deg, rgba(247, 232, 187, 0.035), transparent 40%), rgba(22, 38, 33, 0.25);
  box-shadow: 0 0 0 1px rgba(12, 20, 18, 0.64) inset, 0 0 13px rgba(246, 185, 101, 0.08) inset;
}

.fence-sign__inner::before,
.fence-sign__inner::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8e8770;
  box-shadow: 0 1px 1px #121714 inset, 0 0 4px rgba(224, 174, 98, 0.25);
}

.fence-sign__inner::before { left: 0.42rem; }
.fence-sign__inner::after { right: 0.42rem; }

.fence-sign__word {
  display: block;
  width: 100%;
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: 1.38rem;
  line-height: 1;
  letter-spacing: 0.11em;
  text-indent: 0.11em;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 rgba(20, 26, 23, 0.8), 0 0 8px rgba(255, 205, 125, 0.25);
  text-align: center;
  transform: none;
}

.fence-sign:hover,
.fence-sign:focus-visible {
  color: #fff6df;
  outline: none;
  box-shadow:
    0 0 0 1px rgba(205, 202, 169, 0.27) inset,
    0 1px 0 rgba(255, 247, 220, 0.28) inset,
    0 0 14px rgba(249, 194, 116, 0.33),
    0 0 42px rgba(236, 161, 73, 0.27),
    8px 11px 18px rgba(2, 4, 6, 0.65);
  transform: translate(-50%, -52%) rotate(0.5deg) scale(1.035);
}

.fence-sign:hover .fence-sign__inner,
.fence-sign:focus-visible .fence-sign__inner {
  background-color: rgba(74, 75, 53, 0.3);
  box-shadow: 0 0 0 1px rgba(12, 20, 18, 0.64) inset, 0 0 18px rgba(255, 196, 111, 0.18) inset;
}

.inside {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  text-align: center;
  visibility: hidden;
  opacity: 0;
  background:
    linear-gradient(rgba(7, 10, 10, 0.08), rgba(7, 9, 9, 0.18)),
    url("assets/house-entrance-rusreal-v3.webp") center center / cover no-repeat;
  transition: opacity 900ms ease 3.1s, visibility 0s linear 4s;
}

.admin-nav {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 750ms ease 3.75s;
  pointer-events: none;
}

.threshold.is-entering .admin-nav {
  opacity: 1;
  pointer-events: auto;
}

.admin-nav__side {
  position: absolute;
  top: 10%;
  display: grid;
  width: clamp(10rem, 17vw, 15.5rem);
  height: 45%;
  align-content: space-between;
  gap: clamp(0.38rem, 0.8vh, 0.65rem);
}

.admin-nav__side--left {
  left: clamp(1.5rem, 5vw, 6rem);
}

.admin-nav__side--right {
  right: clamp(1.5rem, 5vw, 6rem);
  height: auto;
  align-content: start;
}

.admin-nav__side--long {
  top: 10%;
}

.admin-nav__side--long .admin-link {
  padding-block: 0.5rem 0.54rem;
}

.admin-link {
  position: relative;
  width: 100%;
  padding: 0.62rem 0.85rem 0.68rem;
  border: 1px solid rgba(152, 151, 133, 0.55);
  border-radius: 1px;
  background:
    linear-gradient(98deg, rgba(255, 250, 225, 0.045), transparent 31%),
    rgba(37, 48, 44, 0.86);
  box-shadow:
    0 1px 0 rgba(239, 232, 205, 0.1) inset,
    3px 5px 10px rgba(4, 6, 6, 0.34);
  color: rgba(226, 221, 203, 0.82);
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: clamp(0.98rem, 1.4vw, 1.28rem);
  letter-spacing: 0.055em;
  text-align: center;
  cursor: pointer;
  transform: rotate(-0.4deg);
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.admin-nav__side--right .admin-link {
  text-align: center;
  transform: rotate(0.45deg);
}

.admin-link::before,
.admin-link::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #77786c;
  box-shadow: 0 1px 1px #0c0f0e inset;
}

.admin-link::before { left: 0.35rem; }
.admin-link::after { right: 0.35rem; }

.admin-link:hover,
.admin-link:focus-visible {
  outline: none;
  color: #fff4d8;
  background-color: rgba(83, 88, 67, 0.82);
  box-shadow:
    0 1px 0 rgba(239, 232, 205, 0.17) inset,
    0 0 18px rgba(219, 167, 89, 0.16),
    3px 6px 12px rgba(4, 6, 6, 0.5);
  transform: translateY(-2px) rotate(0deg);
}

.stairs-link {
  position: absolute;
  top: 54%;
  left: 50%;
  bottom: auto;
  display: grid;
  justify-items: center;
  min-width: 15rem;
  padding: 0.75rem 1.4rem 0.72rem;
  border: 1px solid rgba(221, 210, 181, 0.3);
  background: rgba(20, 25, 23, 0.48);
  box-shadow: 0 0.4rem 1.2rem rgba(3, 5, 5, 0.34), inset 0 1px rgba(255, 247, 218, 0.08);
  color: rgba(229, 219, 193, 0.74);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.92);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.stairs-link::before {
  content: none;
}

.stairs-link span {
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.stairs-link small {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.66;
}

.stairs-link:hover,
.stairs-link:focus-visible {
  outline: none;
  color: #fff1cf;
  border-color: rgba(244, 226, 183, 0.48);
  background-color: rgba(42, 48, 41, 0.66);
  transform: translate(-50%, calc(-50% - 4px));
}

.section-stub {
  position: absolute;
  left: 50%;
  bottom: 4.2%;
  z-index: 2;
  margin: 0;
  padding: 0.35rem 0.7rem;
  background: rgba(12, 16, 15, 0.72);
  color: rgba(230, 220, 199, 0.8);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: translate(-50%, 0.4rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.section-stub.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.notice-board {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vh, 3rem);
  visibility: hidden;
  opacity: 0;
  transition: opacity 280ms ease, visibility 0s linear 280ms;
}

.notice-board.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.notice-board__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 8, 8, 0.76);
  backdrop-filter: blur(3px) saturate(0.7);
  cursor: default;
}

.notice-sheet {
  position: relative;
  width: min(48rem, 88vw);
  max-height: min(82vh, 54rem);
  overflow-y: auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.7rem, 5vw, 4.6rem) 2.4rem;
  border: 1px solid rgba(114, 96, 66, 0.7);
  background:
    linear-gradient(rgba(91, 74, 46, 0.06), transparent 18%),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(82, 68, 47, 0.035) 27px),
    #d8cfb8;
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.72), inset 0 0 4rem rgba(85, 65, 38, 0.12);
  color: #2e2b24;
  text-align: left;
  transform: translateY(1.2rem) rotate(-0.2deg);
  transition: transform 360ms cubic-bezier(0.22, 0.85, 0.32, 1);
  scrollbar-color: rgba(66, 58, 44, 0.5) transparent;
}

.notice-board.is-open .notice-sheet { transform: translateY(0) rotate(-0.2deg); }

.notice-sheet__close {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: rgba(50, 45, 35, 0.62);
  font-family: "Neucha", sans-serif;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.notice-sheet__close:hover,
.notice-sheet__close:focus-visible { color: #181712; outline: none; }

.notice-sheet__header { text-align: center; }

.notice-sheet__mark {
  margin: 0 0 0.45rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.notice-sheet h2 {
  margin: 0;
  font-family: "Neucha", sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 0.95;
}

.notice-sheet__epigraph {
  margin: 0.3rem 0 1.6rem;
  font-family: "Neucha", sans-serif;
  font-size: 1.15rem;
}

.notice-sheet__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 1.7rem;
  border-block: 1px solid rgba(73, 64, 48, 0.42);
}

.notice-sheet__facts div { padding: 0.7rem 0.35rem; }

.notice-sheet__facts .notice-sheet__fact--wide {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(73, 64, 48, 0.25);
}

.notice-sheet__facts dt {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.notice-sheet__facts dd {
  margin: 0.15rem 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  line-height: 1.35;
}

.notice-sheet__body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.82rem, 1vw, 0.91rem);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.008em;
}

.notice-sheet__body p { margin: 0 0 0.9rem; }

.notice-sheet__lead {
  font-size: 1em;
  line-height: 1.68;
}

.notice-sheet__callout {
  width: max-content;
  max-width: 100%;
  margin: 1.45rem auto !important;
  padding: 0.12rem 0.5rem 0.18rem;
  border-bottom: 2px solid rgba(80, 48, 38, 0.65);
  font-family: "Neucha", sans-serif;
  font-size: 1.55rem;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.notice-sheet h3 {
  margin: 1.8rem 0 0.7rem;
  font-family: "Neucha", sans-serif;
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.035em;
}

.notice-sheet h4 {
  margin: 0 0 0.45rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  line-height: 1.5;
}

.notice-sheet__principle {
  margin: 0 0 1.35rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(88, 61, 40, 0.32);
}

.notice-sheet__principle p:last-child { margin-bottom: 0; }

.notice-sheet__flags {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-sheet__flags li {
  position: relative;
  margin: 0 0 0.68rem;
  padding-left: 1.15rem;
}

.notice-sheet__flags li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: rgba(74, 55, 40, 0.72);
}

.notice-sheet__accent {
  padding: 0.8rem 1rem;
  border-left: 3px solid rgba(88, 61, 40, 0.55);
  background: rgba(105, 85, 54, 0.08);
  font-style: normal;
}

.notice-sheet__footer {
  margin-top: 1.7rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(73, 64, 48, 0.42);
  font-family: "Neucha", sans-serif;
  font-size: 1.15rem;
  text-align: right;
}

.notice-sheet--plot {
  width: min(45rem, 88vw);
}

.notice-sheet__lead--plot {
  margin-bottom: 1.35rem !important;
  font-family: "Neucha", sans-serif;
  font-size: 1.45rem;
  line-height: 1.35;
  text-align: center;
}

.notice-sheet__body--plot p {
  margin-bottom: 1.15rem;
}

.notice-sheet__body--material {
  min-height: 12rem;
  padding-top: 1rem;
  text-align: center;
}

.notice-sheet__body--material h3 {
  margin-top: 1rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.notice-sheet__body--material p {
  opacity: 0.62;
}

.material--article .notice-sheet {
  width: min(62rem, 94vw);
  height: min(54rem, 94vh);
  padding: 0;
  overflow: hidden;
}

.material--article .notice-sheet__header,
.material--article .notice-sheet__footer {
  display: none;
}

.material--article .notice-sheet__body--material {
  height: 100%;
  min-height: 0;
  padding: 0;
}

.material-article {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #b9aa82;
}

.material-article[hidden] {
  display: none;
}

.notice-sheet__finale {
  margin-top: 1.8rem !important;
  font-size: 0.96rem;
  font-weight: 600;
}

.corridor {
  position: absolute;
  inset: 0;
  z-index: 7;
  visibility: hidden;
  overflow: hidden;
  opacity: 0;
  background: url("assets/house-corridor-rusreal-v16.webp") center center / cover no-repeat;
  transform: scale(1.045);
  transition: opacity 900ms ease, visibility 0s linear 900ms, transform 1.4s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.threshold.is-upstairs .inside {
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease, visibility 0s linear 850ms;
}

.threshold.is-upstairs .corridor {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 900ms ease 500ms, visibility 0s, transform 1.4s cubic-bezier(0.2, 0.75, 0.2, 1) 300ms;
}

.corridor__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(4, 6, 7, 0.16), transparent 22%, transparent 76%, rgba(4, 6, 7, 0.18)),
    linear-gradient(to bottom, rgba(4, 5, 6, 0.13), transparent 32%, rgba(4, 5, 6, 0.12));
  pointer-events: none;
}

.wall-writing {
  position: absolute;
  z-index: 2;
  max-width: 24rem;
  font-family: "Neucha", "Arial Narrow", sans-serif;
  font-size: clamp(0.9rem, 1.55vw, 1.45rem);
  line-height: 0.95;
  letter-spacing: 0.035em;
  color: rgba(228, 222, 196, 0.72);
  text-shadow: 1px 1px 1px rgba(15, 13, 10, 0.62);
  mix-blend-mode: screen;
  pointer-events: none;
}

.wall-writing--canon {
  top: 10.5%;
  left: 30.5%;
  color: rgba(239, 230, 200, 0.79);
  font-size: clamp(0.78rem, 1.2vw, 1.18rem);
  transform: rotate(-4deg);
}

.wall-writing--warning {
  top: 17%;
  right: 7%;
  color: rgba(231, 210, 159, 0.68);
  transform: rotate(6deg);
}

.wall-writing--small {
  bottom: 16%;
  left: 42%;
  color: rgba(222, 225, 205, 0.57);
  font-size: clamp(0.72rem, 1vw, 0.96rem);
  transform: rotate(2deg);
}

.wall-writing--red {
  top: 37%;
  left: 1.7%;
  color: rgba(172, 69, 48, 0.73);
  font-size: clamp(0.85rem, 1.35vw, 1.25rem);
  transform: rotate(-7deg);
  mix-blend-mode: normal;
}

.room-door {
  position: absolute;
  z-index: 4;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
}

.room-door::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(224, 177, 104, 0.14), rgba(198, 132, 61, 0.045) 40%, transparent 72%);
  mix-blend-mode: screen;
  filter: blur(8px);
  transition: opacity 260ms ease;
}

.room-door:hover::after,
.room-door:focus-visible::after {
  opacity: 1;
}

.room-door:focus-visible { outline: none; }
/* The invisible buttons cover the complete painted doors. The max() coordinates
   keep them attached to the artwork while background-size: cover crops the scene. */
.room-door--maidens {
  left: calc(50% + max(32.7vw, 58.13vh));
  top: calc(50% - max(28.5vh, 16.03vw));
  width: max(8.5vw, 15.11vh);
  height: max(66vh, 37.13vw);
  transform: rotate(0.5deg);
}
.room-door--rats {
  left: calc(50% - max(24.8vw, 44.09vh));
  top: calc(50% - max(24vh, 13.5vw));
  width: max(7.5vw, 13.33vh);
  height: max(53vh, 29.81vw);
}
.room-door--dogs {
  left: calc(50% - max(15.6vw, 27.73vh));
  top: calc(50% - max(21vh, 11.81vw));
  width: max(5vw, 8.89vh);
  height: max(46vh, 25.88vw);
}
.room-door--birds {
  left: calc(50% - max(7.9vw, 14.04vh));
  top: calc(50% - max(21.5vh, 12.09vw));
  width: max(9.5vw, 16.89vh);
  height: max(44vh, 24.75vw);
}
.room-door--coffee {
  left: calc(50% + max(6.4vw, 11.38vh));
  top: calc(50% - max(21.5vh, 12.09vw));
  width: max(9.7vw, 17.24vh);
  height: max(44vh, 24.75vw);
}
.room-door--fourth {
  left: calc(50% - max(41.1vw, 73.07vh));
  top: calc(50% - max(30vh, 16.88vw));
  width: max(11.3vw, 20.09vh);
  height: max(68vh, 38.25vw);
}

.corridor__back {
  position: absolute;
  z-index: 6;
  left: clamp(1.2rem, 2.5vw, 2.5rem);
  bottom: clamp(1rem, 2vw, 2rem);
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(192, 182, 151, 0.38);
  background: rgba(18, 24, 21, 0.72);
  color: rgba(226, 216, 193, 0.67);
  font-family: "Neucha", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.corridor__back:hover,
.corridor__back:focus-visible {
  outline: none;
  color: #fff0ce;
  border-color: rgba(234, 194, 128, 0.57);
}

.corridor-orientation {
  display: none;
}

.corridor-stub {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 5%;
  margin: 0;
  padding: 0.42rem 0.72rem;
  background: rgba(11, 14, 13, 0.8);
  color: rgba(232, 220, 193, 0.85);
  font-family: "Neucha", sans-serif;
  font-size: 0.9rem;
  opacity: 0;
  transform: translate(-50%, 0.4rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.corridor-stub.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pack-room {
  --room-wall: #3c403a;
  --room-wall-dark: #202520;
  --room-ink: #d8cfb4;
  --room-glow: rgba(198, 164, 104, 0.18);
  position: absolute;
  inset: 0;
  z-index: 9;
  visibility: hidden;
  overflow: hidden auto;
  opacity: 0;
  color: var(--room-ink);
  background: var(--room-wall-dark);
  transition: opacity 650ms ease, visibility 0s linear 650ms;
}

.threshold.is-in-room .corridor {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease, visibility 0s linear 650ms;
}

.threshold.is-upstairs.is-returning-room .corridor {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 520ms ease, visibility 0s, transform 700ms ease;
}

.threshold.is-in-room .pack-room {
  visibility: visible;
  opacity: 1;
  transition: opacity 750ms ease 280ms, visibility 0s;
}

.pack-room__wall {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.24), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.28)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 42%, rgba(0, 0, 0, 0.26)),
    var(--room-image, none) center center / cover no-repeat,
    var(--room-wall);
}

.pack-room__wall::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background: radial-gradient(ellipse at center, transparent 18%, rgba(7, 9, 8, 0.18) 100%);
  pointer-events: none;
}

.pack-room__light {
  position: fixed;
  z-index: 1;
  top: -15vh;
  left: 50%;
  width: min(58rem, 72vw);
  height: 70vh;
  background: radial-gradient(ellipse, var(--room-glow), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.pack-room__header {
  position: relative;
  z-index: 2;
  width: min(74rem, 88vw);
  margin: 0 auto;
  padding: clamp(1.2rem, 3.5vh, 2.4rem) 0 0.35rem;
  text-align: center;
}

.pack-room__header h2 {
  margin: 0;
  font-family: "Neucha", sans-serif;
  font-size: clamp(2.2rem, 4.3vw, 4.2rem);
  font-weight: 400;
  line-height: 0.95;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.55);
  transform: rotate(-0.6deg);
}

.marker-legend {
  position: fixed;
  z-index: 5;
  right: clamp(1rem, 2vw, 2rem);
  bottom: clamp(1rem, 2vw, 1.8rem);
  display: flex;
  min-height: 4rem;
  align-items: center;
  gap: 1.25rem;
  max-width: calc(100vw - 12rem);
  padding: 0.75rem 1.15rem;
  border: 1px solid rgba(194, 179, 142, 0.28);
  background: rgba(19, 21, 18, 0.9);
  box-shadow: 0 0.55rem 1.4rem rgba(0, 0, 0, 0.4);
  color: rgba(232, 221, 194, 0.88);
}

.marker-legend::before {
  content: none;
}

.marker-legend__title {
  flex: 0 0 auto;
  margin: 0;
  font-family: "Neucha", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-align: center;
  opacity: 0.58;
}

.marker-legend__items {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1.1rem, 2vw, 2rem);
}

.marker-legend__item {
  display: inline-grid;
  grid-template-columns: 2.15rem auto;
  align-items: center;
  gap: 0.5rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  color: #dfd5b8;
}

.marker-legend svg,
.role-marker svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.marker-legend svg {
  width: 2rem;
  height: 2rem;
  justify-self: center;
}

.character-wall {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(11.8rem, 14.2rem));
  justify-content: center;
  row-gap: clamp(1.2rem, 2.8vh, 2.2rem);
  column-gap: clamp(1.3rem, 2.5vw, 2.7rem);
  width: min(76rem, 94vw);
  margin: 0 auto;
  padding: clamp(0.25rem, 0.8vh, 0.65rem) 1.25rem 8rem;
}

.character-card {
  --card-turn: -0.45deg;
  --mount: #a99a7c;
  --mount-light: #c1b394;
  --mount-dark: #766b56;
  position: relative;
  min-width: 0;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  color: #29251e;
  cursor: pointer;
  filter: drop-shadow(0 0.65rem 0.7rem rgba(0, 0, 0, 0.48));
  transform: rotate(var(--card-turn));
  transition: transform 240ms ease, filter 240ms ease, box-shadow 240ms ease;
}

.character-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.28rem -0.28rem -0.32rem 0.32rem;
  border: 1px solid rgba(14, 13, 11, 0.5);
  background: linear-gradient(145deg, #514b3e, #25241f);
  transform: rotate(0.65deg);
  pointer-events: none;
}

.character-card__paper {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(5.65rem, auto);
  padding: 0.55rem 0.55rem 0;
  border: 1px solid rgba(43, 38, 29, 0.72);
  background:
    radial-gradient(circle at 11% 16%, rgba(74, 55, 31, 0.1) 0 1px, transparent 1.6px),
    radial-gradient(circle at 84% 79%, rgba(75, 54, 31, 0.08) 0 1px, transparent 1.6px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px),
    linear-gradient(152deg, var(--mount-light), var(--mount) 54%, var(--mount-dark));
  box-shadow:
    inset 0 0 1.8rem rgba(48, 37, 21, 0.19),
    inset 0 0 0 1px rgba(235, 219, 180, 0.18);
}

.character-card__paper::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0.34rem;
  right: 0.34rem;
  bottom: 5.92rem;
  left: 0.34rem;
  border: 1px solid rgba(225, 208, 169, 0.16);
  pointer-events: none;
}

.character-card:nth-child(2n) { --card-turn: 0.55deg; }
.character-card:nth-child(3n) { --card-turn: -0.7deg; }
.character-card:nth-child(4n) { --card-turn: 0.25deg; }

.character-card:hover,
.character-card:focus-visible {
  z-index: 3;
  outline: none;
  filter: brightness(1.08);
  filter: brightness(1.08) drop-shadow(0 1.2rem 1rem rgba(0, 0, 0, 0.62));
  transform: translateY(-0.38rem) rotate(0deg) scale(1.035);
}

.character-card__pin {
  position: absolute;
  z-index: 2;
  top: -0.42rem;
  left: 50%;
  width: 0.66rem;
  height: 0.66rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d5c9a8, #574c3b 58%, #171612 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
  transform: translateX(-50%);
}

.character-card__portrait {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 4.25;
  border: 1px solid rgba(35, 30, 23, 0.86);
  background:
    radial-gradient(circle at 50% 33%, rgba(210, 199, 170, 0.28) 0 8%, transparent 8.5%),
    linear-gradient(145deg, transparent 0 44%, rgba(221, 210, 181, 0.11) 45%, transparent 46%),
    #343a35;
  box-shadow:
    inset 0 0 2rem rgba(0, 0, 0, 0.48),
    0 0 0 0.22rem rgba(54, 47, 35, 0.55),
    0 0 0 0.29rem rgba(215, 198, 158, 0.14);
}

.character-card__portrait--image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: contrast(0.96) brightness(0.88) saturate(0.72);
}

.character-card__portrait--image::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 1.35rem rgba(13, 14, 12, 0.42);
  pointer-events: none;
}

.character-card__figure {
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 58%;
  height: 62%;
  border-radius: 48% 48% 18% 18% / 28% 28% 10% 10%;
  background: linear-gradient(90deg, #191d1a, #353a34 48%, #171a18);
  filter: blur(0.4px);
  transform: translateX(-50%);
}

.character-card__figure::before {
  content: "";
  position: absolute;
  top: -32%;
  left: 50%;
  width: 48%;
  aspect-ratio: 0.82;
  border-radius: 48% 52% 44% 46%;
  background: #292e2a;
  box-shadow: inset 0 -0.8rem 1rem rgba(0, 0, 0, 0.32);
  transform: translateX(-50%);
}

.character-card__scratch {
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background: linear-gradient(112deg, transparent 47%, rgba(218, 205, 170, 0.55) 48%, transparent 49%);
}

.character-card__portrait--image .character-card__scratch {
  opacity: 0.12;
}

.character-card__caption {
  position: relative;
  display: grid;
  min-height: 5.65rem;
  align-items: start;
  padding: 0.72rem 0.35rem 0.42rem 0.6rem;
  border-top: 1px solid rgba(73, 60, 40, 0.2);
}

.character-card__name {
  display: block;
  align-self: start;
  justify-self: center;
  overflow-wrap: anywhere;
  font-family: "Neucha", sans-serif;
  font-size: clamp(1.22rem, 1.55vw, 1.52rem);
  line-height: 0.95;
  letter-spacing: 0.035em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(237, 215, 165, 0.32);
  transform: rotate(-1.1deg);
}

.character-card__meta {
  position: absolute;
  left: 0.6rem;
  right: 0.25rem;
  bottom: 0.38rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(1.45rem, auto);
  align-items: end;
  gap: 0.28rem 0.35rem;
}

.character-card__status {
  grid-column: 1;
  grid-row: 1;
  display: block;
  color: #395541;
  font-family: "Neucha", sans-serif;
  justify-self: start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
}

.character-card__applications {
  display: block;
  grid-column: 1;
  grid-row: 2;
  color: #594c37;
  align-self: end;
  justify-self: start;
  font-family: "Neucha", sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-align: left;
  white-space: nowrap;
}

.character-card__markers {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.16rem;
}

.character-card__markers:empty { display: none; }

.role-marker {
  display: inline-block;
  width: 1.65rem;
  height: 1.65rem;
  color: #493923;
  text-decoration: none;
  transform: rotate(-4deg);
}

.role-marker:nth-child(2n) { transform: rotate(5deg); }

.character-card--2 { --mount: #9e947e; --mount-light: #b9af98; --mount-dark: #716957; }
.character-card--3 { --mount: #aa9878; --mount-light: #c2b291; --mount-dark: #76664d; }
.character-card--4 { --mount: #9b8a72; --mount-light: #b4a38a; --mount-dark: #6d5f4e; }
.character-card--5 { --mount: #a1967e; --mount-light: #bbb09a; --mount-dark: #706856; }

.pack-room__empty {
  position: relative;
  z-index: 2;
  width: min(32rem, 82vw);
  margin: 4rem auto;
  font-family: "Neucha", sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0.72;
}

.pack-room__back {
  position: fixed;
  z-index: 5;
  left: clamp(1.2rem, 2.5vw, 2.5rem);
  bottom: clamp(1rem, 2vw, 2rem);
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(215, 203, 171, 0.36);
  background: rgba(12, 15, 13, 0.8);
  color: rgba(235, 224, 198, 0.82);
  font-family: "Neucha", sans-serif;
  cursor: pointer;
}

.coffee-space {
  position: relative;
  z-index: 3;
  min-height: calc(100vh - 6.5rem);
  pointer-events: none;
}

.coffee-notes {
  position: fixed;
  top: clamp(6.5rem, 18vh, 10.5rem);
  left: 44%;
  display: grid;
  grid-template-columns: repeat(3, minmax(6.2rem, 1fr));
  align-content: start;
  gap: clamp(0.65rem, 1.4vw, 1.15rem);
  width: min(34vw, 39rem);
  max-height: 50vh;
  overflow: hidden auto;
  padding: 0.8rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 170, 112, 0.45) transparent;
  pointer-events: auto;
}

.coffee-note {
  --note-turn: -1.5deg;
  position: relative;
  min-height: 5rem;
  padding: 1.05rem 0.72rem 0.65rem;
  border: 0;
  background: #c9b987;
  box-shadow: 0 0.45rem 0.8rem rgba(12, 8, 5, 0.38), inset 0 0 1.2rem rgba(103, 75, 38, 0.12);
  color: #2f291f;
  transform: rotate(var(--note-turn));
}

.coffee-note:nth-child(3n + 2) {
  --note-turn: 1.8deg;
  background: #b7c0ae;
}

.coffee-note:nth-child(3n) {
  --note-turn: -0.4deg;
  background: #c2aa9c;
}

.coffee-note::before {
  content: "";
  position: absolute;
  top: 0.24rem;
  left: 50%;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e5d7ab, #6b5130 58%, #22170d 100%);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
}

.coffee-note__text {
  margin: 0;
  font-family: "Neucha", sans-serif;
  font-size: clamp(0.82rem, 1.05vw, 1.02rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.coffee-note__nick {
  display: block;
  margin-top: 0.5rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.07em;
  text-align: right;
  opacity: 0.66;
}

.coffee-notes__empty {
  position: fixed;
  top: 34%;
  left: 51%;
  margin: 0;
  color: rgba(78, 57, 34, 0.7);
  font-family: "Neucha", sans-serif;
  font-size: 1.2rem;
  transform: rotate(-2deg);
}

.coffee-composer {
  position: fixed;
  z-index: 6;
  right: clamp(1.2rem, 3vw, 3rem);
  bottom: clamp(1rem, 2vw, 2rem);
  display: grid;
  grid-template-columns: minmax(8rem, 0.7fr) minmax(13rem, 1.4fr) auto;
  gap: 0.5rem;
  width: min(47rem, calc(100vw - 17rem));
  padding: 0.65rem;
  border: 1px solid rgba(212, 183, 131, 0.32);
  background: rgba(24, 20, 15, 0.9);
  box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.44);
  pointer-events: auto;
}

.coffee-composer__title {
  position: absolute;
  bottom: calc(100% + 0.28rem);
  left: 0.3rem;
  margin: 0;
  color: rgba(226, 202, 159, 0.8);
  font-family: "Neucha", sans-serif;
  font-size: 0.9rem;
  transform: rotate(-1deg);
}

.coffee-composer input,
.coffee-composer textarea {
  min-width: 0;
  resize: none;
  border: 0;
  border-bottom: 1px solid rgba(214, 194, 155, 0.35);
  border-radius: 0;
  outline: none;
  background: rgba(239, 225, 193, 0.08);
  color: #eee0c2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  line-height: 1.35;
  padding: 0.55rem 0.65rem;
}

.coffee-composer input:focus,
.coffee-composer textarea:focus {
  border-bottom-color: rgba(239, 196, 118, 0.85);
  background: rgba(239, 225, 193, 0.13);
}

.coffee-composer input::placeholder,
.coffee-composer textarea::placeholder {
  color: rgba(237, 223, 192, 0.42);
}

.coffee-composer button {
  border: 1px solid rgba(221, 190, 133, 0.45);
  background: #564332;
  color: #f0dfbd;
  font-family: "Neucha", sans-serif;
  font-size: 0.94rem;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.coffee-composer button:hover,
.coffee-composer button:focus-visible {
  outline: none;
  background: #765b3e;
  color: #fff1d0;
}

.coffee-composer__status {
  position: absolute;
  right: 0.4rem;
  bottom: calc(100% + 0.28rem);
  margin: 0;
  color: rgba(229, 207, 166, 0.82);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.58rem;
}

.pack-room--coffee .marker-legend,
.pack-room--coffee .pack-room__light {
  display: none;
}

.pack-room--coffee .pack-room__header {
  position: fixed;
  top: 0.8rem;
  left: 1.4rem;
  width: auto;
  margin: 0;
  padding: 0;
  text-align: left;
}

.pack-room--coffee .pack-room__header h2 {
  color: rgba(239, 218, 176, 0.9);
  font-size: clamp(2rem, 3.4vw, 3.5rem);
}

.pack-room--rats { --room-image: url("assets/room-rats-rusreal-v1.webp"); --room-wall: #3b4038; --room-wall-dark: #20251f; --room-glow: rgba(146, 170, 102, 0.2); }
.pack-room--birds { --room-image: url("assets/room-birds-rusreal-v1.webp"); --room-wall: #353e43; --room-wall-dark: #1d2428; --room-glow: rgba(128, 170, 190, 0.22); }
.pack-room--fourth { --room-image: url("assets/room-fourth-rusreal-v2.webp"); --room-wall: #343b39; --room-wall-dark: #1c2220; --room-glow: rgba(177, 154, 106, 0.2); }
.pack-room--dogs { --room-image: url("assets/room-dogs-rusreal-v2.webp"); --room-wall: #41372f; --room-wall-dark: #241e1a; --room-glow: rgba(181, 118, 74, 0.2); }
.pack-room--maidens { --room-image: url("assets/room-maidens-rusreal-v1.webp"); --room-wall: #4a3d45; --room-wall-dark: #281f25; --room-glow: rgba(198, 125, 163, 0.2); }
.pack-room--coffee { --room-image: url("assets/room-coffee-rusreal-v1.webp"); --room-wall: #433b31; --room-wall-dark: #252019; --room-glow: rgba(213, 157, 91, 0.24); }

.character-profile {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 2rem);
  opacity: 0;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
  pointer-events: none;
}

.character-profile.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 260ms ease, visibility 0s;
  pointer-events: auto;
}

.character-profile__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(7, 8, 7, 0.83);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.character-profile__sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(15rem, 0.82fr) minmax(25rem, 1.55fr);
  width: min(72rem, 94vw);
  height: min(52rem, calc(100dvh - 2rem));
  max-height: min(52rem, 92vh);
  overflow: hidden;
  border: 1px solid rgba(75, 61, 39, 0.72);
  outline: none;
  background:
    radial-gradient(circle at 9% 12%, rgba(94, 65, 31, 0.12) 0 2px, transparent 3px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 4px),
    linear-gradient(148deg, #c7b891, #a99870 56%, #bdad85);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.72), inset 0 0 3rem rgba(61, 43, 22, 0.2);
  color: #29251e;
  transform: translateY(1.2rem) rotate(-0.18deg);
  transition: transform 300ms ease;
}

.character-profile.is-open .character-profile__sheet {
  transform: translateY(0) rotate(-0.18deg);
}

.character-profile--without-portrait .character-profile__sheet {
  grid-template-columns: 1fr;
  width: min(58rem, 94vw);
}

.character-profile__sheet::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0.65rem;
  border: 1px solid rgba(75, 59, 35, 0.26);
  pointer-events: none;
}

.character-profile__close {
  position: absolute;
  z-index: 5;
  top: 0.6rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  color: #342c20;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.character-profile__portrait {
  position: relative;
  min-height: 0;
  margin: 1.2rem 0 1.2rem 1.2rem;
  overflow: hidden;
  border: 0.4rem solid #3a352b;
  background: #262724;
  box-shadow: 0 1rem 2rem rgba(45, 31, 16, 0.35), inset 0 0 2rem rgba(0, 0, 0, 0.45);
}

.character-profile__portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: contrast(0.98) brightness(0.86) saturate(0.72);
}

.character-profile__content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: clamp(2.2rem, 4vw, 3.5rem) clamp(2rem, 4.5vw, 4.2rem) 2rem clamp(1.8rem, 3vw, 3rem);
}

.character-profile__header {
  flex: 0 0 auto;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(68, 52, 31, 0.32);
}

.character-profile__header h2 {
  margin: 0 0 0.8rem;
  font-family: "Neucha", sans-serif;
  font-size: clamp(2.4rem, 4.5vw, 4rem);
  font-weight: 400;
  line-height: 0.95;
}

.character-profile__facts {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
}

.character-profile__status {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(47, 83, 57, 0.42);
  color: #2e593d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.character-profile__applications {
  margin: -0.15rem 0 0.55rem;
  color: #514634;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.character-profile__facts div { display: flex; gap: 0.35rem; }
.character-profile__facts dt { font-weight: 700; }
.character-profile__facts dd { margin: 0; }

.character-profile__text {
  min-height: 0;
  overflow: hidden auto;
  padding: 0.65rem 0.6rem 0.4rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(75, 55, 31, 0.42) transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.78rem, 1.05vw, 0.94rem);
  line-height: 1.52;
}

.character-profile__text p { margin: 0 0 0.72rem; }

.character-profile__track {
  flex: 0 0 auto;
  margin-top: 0.65rem;
}

.character-profile__track iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 0.7rem;
  background: #191714;
  box-shadow: 0 0.45rem 1rem rgba(45, 31, 16, 0.2);
}

.character-profile__apply {
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 12rem;
  margin-top: 0.7rem;
  padding: 0.7rem 1.25rem;
  border: 1px solid rgba(46, 38, 27, 0.78);
  background: #40392d;
  box-shadow: 0 0.5rem 1rem rgba(45, 31, 16, 0.28);
  color: #e1d4b2;
  font-family: "Neucha", sans-serif;
  font-size: 1.22rem;
  cursor: pointer;
  transform: rotate(-0.5deg);
}

.character-profile__apply:hover,
.character-profile__apply:focus-visible {
  outline: 2px solid rgba(67, 50, 29, 0.45);
  outline-offset: 0.2rem;
  background: #594b38;
}

.character-profile.is-applying .character-profile__portrait,
.character-profile.is-applying .character-profile__header,
.character-profile.is-applying .character-profile__text,
.character-profile.is-applying .character-profile__track,
.character-profile.is-applying .character-profile__apply {
  display: none;
}

.character-profile.is-applying .character-profile__sheet {
  display: block;
  width: min(54rem, 94vw);
  overflow: hidden;
}

.character-profile.is-applying .character-profile__content {
  height: min(52rem, calc(100dvh - 2rem));
  padding: 2.5rem clamp(1.5rem, 4vw, 3.5rem) 2rem;
}

.role-application {
  min-height: 0;
  overflow: hidden auto;
  padding: 0 0.5rem 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(75, 55, 31, 0.42) transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
}

.role-application__heading {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  background: linear-gradient(#c2b288 80%, rgba(194, 178, 136, 0));
}

.role-application__heading h3 {
  order: -1;
  margin: 0;
  font-family: "Neucha", sans-serif;
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  font-weight: 400;
  line-height: 1;
}

.role-application__return {
  border: 0;
  border-bottom: 1px solid rgba(55, 44, 29, 0.5);
  background: transparent;
  color: #3a3125;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.64rem;
  cursor: pointer;
}

.role-application fieldset {
  display: grid;
  gap: 0.85rem;
  margin: 0 0 1.2rem;
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid rgba(67, 51, 31, 0.28);
}

.role-application legend {
  padding: 0 0.5rem;
  font-family: "Neucha", sans-serif;
  font-size: 1.35rem;
}

.role-application label,
.role-application__choice {
  display: grid;
  gap: 0.35rem;
  line-height: 1.35;
}

.role-application input[type="text"],
.role-application input[type="email"],
.role-application input[type="number"],
.role-application textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(56, 43, 27, 0.48);
  border-radius: 0;
  outline: none;
  background: rgba(255, 247, 220, 0.18);
  color: #27231c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.55rem 0.65rem;
  caret-color: #27231c;
  cursor: text;
}

.role-application textarea { resize: vertical; }

.role-application input:focus,
.role-application textarea:focus {
  border-bottom-color: #403423;
  outline: 2px solid rgba(74, 59, 36, 0.62);
  outline-offset: 2px;
  background: rgba(255, 247, 220, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 229, 0.5);
}

.role-application input[readonly] {
  color: #4f4433;
  font-weight: 700;
}

.role-application__choice {
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.65rem;
}

.role-application__choice label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.role-application__percent {
  display: grid;
  grid-template-columns: minmax(5rem, 8rem) auto;
  align-items: center;
  gap: 0.35rem;
}

.role-application__submit {
  display: block;
  min-width: 14rem;
  margin-left: auto;
  padding: 0.72rem 1.2rem;
  border: 1px solid rgba(46, 38, 27, 0.78);
  background: #40392d;
  color: #e1d4b2;
  font-family: "Neucha", sans-serif;
  font-size: 1.2rem;
  cursor: pointer;
}

.role-application__submit:disabled { cursor: wait; opacity: 0.62; }

.role-application__message {
  min-height: 1.3rem;
  margin: 0.8rem 0 0;
  font-weight: 700;
  text-align: right;
}

.role-application__message.is-success { color: #28543a; }
.role-application__message.is-error { color: #763b31; }

.igrotech-form {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1.2rem) 0 1rem;
  font-family: Arial, Helvetica, sans-serif;
}

.igrotech-form__intro {
  max-width: 36rem;
  margin: 0 0 1.4rem;
  color: #504735;
  font-size: 0.86rem;
  line-height: 1.55;
}

.igrotech-form label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  color: #342e24;
  font-size: 0.78rem;
  font-weight: 700;
}

.igrotech-form input,
.igrotech-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(56, 43, 27, 0.48);
  border-radius: 0;
  outline: none;
  background: rgba(255, 247, 220, 0.2);
  color: #27231c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.65rem 0.7rem;
  caret-color: #27231c;
  cursor: text;
}

.igrotech-form textarea {
  min-height: 9rem;
  resize: vertical;
}

.igrotech-form input:focus,
.igrotech-form textarea:focus {
  border-bottom-color: #403423;
  outline: 2px solid rgba(74, 59, 36, 0.62);
  outline-offset: 2px;
  background: rgba(255, 247, 220, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 249, 229, 0.5);
}

.igrotech-form__submit {
  display: block;
  min-width: 13rem;
  margin: 1.3rem 0 0 auto;
  padding: 0.75rem 1.3rem;
  border: 1px solid rgba(46, 38, 27, 0.78);
  background: #40392d;
  color: #e1d4b2;
  font-family: "Neucha", sans-serif;
  font-size: 1.25rem;
  cursor: pointer;
}

.igrotech-form__submit:hover,
.igrotech-form__submit:focus-visible {
  outline: 2px solid rgba(67, 50, 29, 0.35);
  outline-offset: 0.2rem;
  background: #594b38;
}

.igrotech-form__message {
  min-height: 1.3rem;
  margin: 0.8rem 0 0;
  color: #28543a;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: right;
}

.submission-push {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  visibility: hidden;
  opacity: 0;
  background: rgba(5, 7, 6, 0.68);
  backdrop-filter: blur(4px);
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}

.submission-push.is-visible {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.submission-push__card {
  position: relative;
  width: min(35rem, 92vw);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 3.75rem);
  border: 1px solid rgba(218, 203, 165, 0.58);
  background:
    linear-gradient(rgba(31, 35, 30, 0.94), rgba(15, 18, 16, 0.97));
  box-shadow:
    inset 0 0 0 0.35rem rgba(213, 197, 157, 0.05),
    0 1.5rem 4rem rgba(0, 0, 0, 0.62);
  color: #eadfc2;
  text-align: center;
  transform: translateY(1rem) scale(0.98);
  transition: transform 240ms ease;
}

.submission-push.is-visible .submission-push__card {
  transform: translateY(0) scale(1);
}

.submission-push__title {
  margin: 0 0 1rem;
  font-family: "Neucha", sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
}

.submission-push__text {
  max-width: 27rem;
  margin: 0 auto;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  line-height: 1.55;
}

.submission-push__close {
  position: absolute;
  top: 0.65rem;
  right: 0.8rem;
  border: 0;
  background: transparent;
  color: rgba(235, 222, 191, 0.72);
  font-size: 1.8rem;
  cursor: pointer;
}

.submission-push__close:hover,
.submission-push__close:focus-visible {
  outline: none;
  color: #fff0ce;
}

@media (max-height: 850px) and (min-width: 721px) {
  .character-profile {
    padding: 0.65rem;
  }

  .character-profile__sheet {
    grid-template-columns: minmax(12rem, 0.7fr) minmax(25rem, 1.65fr);
    width: min(68rem, 96vw);
    height: calc(100dvh - 1.3rem);
    max-height: none;
  }

  .character-profile__sheet::before {
    inset: 0.42rem;
  }

  .character-profile__portrait {
    margin: 0.8rem 0 0.8rem 0.8rem;
    border-width: 0.3rem;
  }

  .character-profile__content {
    padding: 1.35rem 2.4rem 1rem 1.6rem;
  }

  .character-profile__header {
    padding-bottom: 0.55rem;
  }

  .character-profile__header h2 {
    margin-bottom: 0.42rem;
    font-size: clamp(2.1rem, 4vw, 3.15rem);
  }

  .character-profile__status {
    margin-bottom: 0.38rem;
    padding: 0.18rem 0.42rem;
    font-size: 0.56rem;
  }

  .character-profile__facts {
    font-size: 0.7rem;
  }

  .character-profile__text {
    padding-top: 0.48rem;
    font-size: clamp(0.7rem, 0.92vw, 0.82rem);
    line-height: 1.42;
  }

  .character-profile__text p {
    margin-bottom: 0.55rem;
  }

  .character-profile__track {
    margin-top: 0.4rem;
  }

  .character-profile__track iframe {
    height: 80px;
  }

  .character-profile__apply {
    min-width: 11rem;
    margin-top: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 1.08rem;
  }

  .character-profile.is-applying .character-profile__content {
    height: calc(100dvh - 1.3rem);
    padding: 1.5rem 2.2rem 1rem;
  }

  .role-application__heading h3 {
    font-size: 2.7rem;
  }

  .role-application fieldset {
    gap: 0.65rem;
    margin-bottom: 0.8rem;
    padding: 0.7rem 0.9rem 0.85rem;
  }
}

@media (max-height: 650px) and (min-width: 721px) {
  .character-profile__sheet {
    grid-template-columns: minmax(10rem, 0.58fr) minmax(25rem, 1.72fr);
  }

  .character-profile__content {
    padding-top: 1rem;
  }

  .character-profile__header h2 {
    font-size: 2.35rem;
  }

  .character-profile__text {
    font-size: 0.68rem;
    line-height: 1.34;
  }
}

.inside__back {
  position: absolute;
  left: clamp(1.25rem, 3vw, 3rem);
  bottom: clamp(1.2rem, 2.5vw, 2.5rem);
  border: 0;
  background: transparent;
  color: rgba(225, 216, 196, 0.52);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 0.35em;
  cursor: pointer;
}

.inside__back:focus-visible {
  outline: 1px solid rgba(226, 210, 176, 0.55);
  outline-offset: 0.45rem;
}

/* Единый стиль для переходов назад между пространствами Дома. */
.inside__back,
.corridor__back,
.pack-room__back {
  min-width: clamp(11.5rem, 15vw, 14.5rem);
  min-height: 3.2rem;
  padding: 0.72rem 1.35rem;
  border: 1px solid rgba(218, 203, 165, 0.52);
  border-radius: 0.18rem;
  background:
    linear-gradient(180deg, rgba(74, 75, 65, 0.5), rgba(20, 24, 21, 0.82));
  box-shadow:
    inset 0 1px rgba(255, 244, 210, 0.1),
    0 0.45rem 1.2rem rgba(0, 0, 0, 0.34);
  color: rgba(241, 229, 198, 0.92);
  font-family: "Neucha", sans-serif;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  line-height: 1.1;
  letter-spacing: 0.055em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.inside__back:hover,
.inside__back:focus-visible,
.corridor__back:hover,
.corridor__back:focus-visible,
.pack-room__back:hover,
.pack-room__back:focus-visible {
  outline: none;
  color: #fff0ce;
  border-color: rgba(238, 204, 139, 0.78);
  background:
    linear-gradient(180deg, rgba(91, 87, 70, 0.62), rgba(25, 29, 25, 0.9));
  box-shadow:
    inset 0 1px rgba(255, 245, 214, 0.16),
    0 0 1.15rem rgba(213, 174, 105, 0.16),
    0 0.55rem 1.35rem rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.threshold.is-entering .scene__painting--open {
  filter: brightness(0.48) saturate(0.72);
  transform: translate3d(0, 7%, 0) scale(3.2);
  transition-duration: 2.8s;
  transition-delay: 700ms;
  transition-timing-function: cubic-bezier(0.55, 0.05, 0.3, 1);
}

.threshold.is-entering .scene__painting--closed {
  opacity: 0;
  filter: brightness(0.82);
  transition: opacity 850ms ease, filter 850ms ease;
}

.threshold.is-entering .invitation {
  opacity: 0;
  transform: translate(-50%, -1.5rem);
}

.threshold.is-entering .fence-sign {
  opacity: 0;
  pointer-events: none;
}

.threshold.is-entering .inside {
  visibility: visible;
  opacity: 1;
  transition: opacity 900ms ease 3.1s, visibility 0s;
}

@keyframes breathe {
  0%, 100% { opacity: 0.42; }
  48% { opacity: 0.68; }
  53% { opacity: 0.46; }
  56% { opacity: 0.64; }
}

@keyframes rain {
  to { transform: translate3d(-18px, 10%, 0); }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(2%, -1%); }
  50% { transform: translate(-1%, 2%); }
  75% { transform: translate(1%, 1%); }
  100% { transform: translate(-2%, -1%); }
}

@media (max-width: 720px) {
  .scene__painting {
    inset: -1%;
    background-position: 50% center;
  }

  .invitation {
    top: 7vh;
  }

  .invitation h1 {
    font-size: clamp(3rem, 16vw, 5rem);
    line-height: 0.88;
  }

  .invitation h1 > span {
    display: block;
  }

  .fence-sign {
    top: 66%;
    left: 50%;
    min-width: 7.8rem;
    transform: translate(-50%, -50%) rotate(2deg) scale(0.88);
  }

  .scene__light--window {
    left: 49%;
    width: 12vw;
    height: 14vw;
  }

  .inside {
    overflow-y: auto;
    background-position: center center;
  }

  .admin-nav {
    inset: 0;
    min-height: 100%;
    padding: 5.4rem 0.65rem 1.2rem;
    overflow-y: auto;
    align-content: start;
    background: linear-gradient(to top, rgba(7, 10, 10, 0.92) 0%, rgba(7, 10, 10, 0.7) 68%, transparent 100%);
  }

  .admin-nav__side {
    position: static;
    display: grid;
    width: 100%;
    height: auto;
    align-content: normal;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .admin-nav__side--right {
    margin-top: 0.55rem;
  }

  .admin-nav__side--long {
    top: auto;
  }

  .admin-link,
  .admin-nav__side--right .admin-link {
    min-height: 2.8rem;
    padding: 0.42rem 0.5rem;
    font-size: 0.82rem;
    text-align: center;
    transform: none;
  }

  .stairs-link {
    top: 0.7rem;
    right: 0.65rem;
    bottom: auto;
    left: auto;
    min-width: 9.6rem;
    padding: 0.45rem 0.65rem 0.4rem;
    transform: none;
  }

  .stairs-link span {
    font-size: 1rem;
  }

  .stairs-link small {
    font-size: 0.52rem;
  }

  .stairs-link:hover,
  .stairs-link:focus-visible {
    transform: translateY(-2px);
  }

  .inside__back {
    top: 0.7rem;
    left: 0.65rem;
    bottom: auto;
    min-width: 8.8rem;
    min-height: 2.7rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.92rem;
  }

  .section-stub {
    bottom: 5.3rem;
    width: max-content;
    max-width: 90vw;
    text-align: center;
  }

  .notice-board { padding: 0.55rem; }

  .notice-sheet {
    width: calc(100vw - 1.1rem);
    max-height: calc(100vh - 1.1rem);
    padding: 2.8rem 1.2rem 1.8rem;
    transform: translateY(1rem) rotate(0deg);
  }

  .notice-board.is-open .notice-sheet { transform: translateY(0) rotate(0deg); }

  .notice-sheet__facts { grid-template-columns: 1fr; }
  .notice-sheet__facts div { padding: 0.48rem 0.25rem; }
  .notice-sheet__body { font-size: 0.84rem; }

  .corridor {
    background-position: 43% center;
  }

  .corridor-orientation {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.8rem;
    padding: 2rem;
    background: rgba(7, 10, 9, 0.78);
    color: #eee3c7;
    text-align: center;
    backdrop-filter: blur(4px);
  }

  .corridor-orientation__phone {
    display: grid;
    width: 3.1rem;
    height: 5rem;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 0.55rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    transform: rotate(90deg);
  }

  .corridor-orientation strong {
    font-family: "Neucha", sans-serif;
    font-size: 1.65rem;
    font-weight: 400;
    letter-spacing: 0.04em;
  }

  .corridor-orientation small {
    max-width: 19rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.76rem;
    line-height: 1.45;
    opacity: 0.78;
  }

  .room-door--fourth,
  .room-door--maidens { display: none; }

  .pack-room__header { padding-top: 4.4rem; }

  .pack-room__back {
    top: 0.7rem;
    left: 0.65rem;
    bottom: auto;
    min-width: 10.5rem;
    min-height: 2.8rem;
    padding: 0.52rem 0.75rem;
    font-size: 1rem;
  }

  .marker-legend {
    position: fixed;
    display: flex;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    min-height: auto;
    gap: 0.75rem;
    padding: 0.48rem 0.7rem calc(0.48rem + env(safe-area-inset-bottom));
    overflow-x: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    scrollbar-width: none;
  }

  .marker-legend::-webkit-scrollbar { display: none; }

  .marker-legend__title {
    position: sticky;
    left: 0;
    margin: 0;
    padding-right: 0.65rem;
    background: rgba(19, 21, 18, 0.98);
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .marker-legend__items {
    display: flex;
    width: max-content;
    gap: 1rem;
  }

  .marker-legend__item {
    grid-template-columns: 1.65rem auto;
    gap: 0.35rem;
    font-size: 0.62rem;
  }

  .marker-legend svg {
    width: 1.55rem;
    height: 1.55rem;
  }

  .character-wall {
    grid-template-columns: repeat(2, minmax(10.3rem, 12.5rem));
    justify-content: center;
    gap: 2rem 1.25rem;
    padding-bottom: 6.5rem;
  }

  .character-card__caption {
    min-height: 7rem;
  }

  .character-card__meta {
    grid-template-rows: auto auto minmax(1.65rem, auto);
  }

  .character-card__applications {
    grid-row: 3;
  }

  .character-card__markers {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .character-card__name { font-size: 1.22rem; }

  .pack-room--coffee .pack-room__wall {
    background-position: 54% center;
  }

  .pack-room--coffee .pack-room__header {
    top: 0.8rem;
    left: 1rem;
  }

  .coffee-notes {
    top: 6.5rem;
    right: 0.55rem;
    bottom: 10.5rem;
    left: 0.55rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    max-height: none;
    padding: 0.55rem;
  }

  .coffee-note {
    min-height: 4.8rem;
    background: rgba(201, 185, 135, 0.94);
  }

  .coffee-composer {
    right: 0.6rem;
    bottom: 0.6rem;
    left: 0.6rem;
    grid-template-columns: 1fr auto;
    width: auto;
  }

  .coffee-composer textarea {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .coffee-composer button {
    grid-column: 2;
    grid-row: 1;
    padding: 0.4rem 0.65rem;
  }

  .pack-room--coffee .pack-room__back {
    top: 0.7rem;
    right: auto;
    bottom: auto;
    left: 0.65rem;
  }

  .character-profile__sheet {
    display: block;
    height: auto;
    max-height: calc(100vh - 1rem);
    overflow: auto;
  }

  .character-profile__portrait {
    width: min(17rem, calc(100% - 2rem));
    height: 15rem;
    margin: 1rem auto 0;
  }

  .character-profile__content {
    padding: 1.4rem 1.4rem 1.6rem;
  }

  .character-profile__header h2 { font-size: 2.5rem; }
  .character-profile__facts { flex-wrap: wrap; gap: 0.35rem 1rem; }
  .character-profile__text { overflow: visible; font-size: 0.82rem; }
  .character-profile__track iframe { height: 152px; }
  .character-profile__apply { width: 100%; }
  .character-profile.is-applying .character-profile__content { height: auto; min-height: calc(100vh - 1rem); }
  .role-application { overflow: visible; }
  .role-application__heading { position: static; }
  .role-application__choice { grid-template-columns: 1fr auto auto; }

}

@media (max-width: 720px) and (orientation: landscape) {
  .corridor-orientation {
    display: none;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .pack-room__header {
    width: min(48rem, 72vw);
    padding-top: 0.55rem;
  }

  .pack-room__header h2 {
    font-size: clamp(1.7rem, 5vh, 2.25rem);
  }

  .pack-room__back {
    top: 0.55rem;
    bottom: auto;
    left: 0.65rem;
    min-width: 10rem;
    min-height: 2.65rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.96rem;
  }

  .marker-legend {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 0.42rem 0.75rem calc(0.42rem + env(safe-area-inset-bottom));
    gap: 0.85rem;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    scrollbar-width: none;
  }

  .marker-legend::-webkit-scrollbar {
    display: none;
  }

  .marker-legend__title {
    position: sticky;
    left: 0;
    margin: 0;
    padding-right: 0.7rem;
    background: rgba(19, 21, 18, 0.98);
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .marker-legend__items {
    width: max-content;
    gap: 1.15rem;
  }

  .marker-legend__item {
    grid-template-columns: 1.7rem auto;
    gap: 0.35rem;
    font-size: 0.66rem;
  }

  .marker-legend svg {
    width: 1.6rem;
    height: 1.6rem;
  }

  .character-wall {
    padding-bottom: 5.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene__painting,
  .scene__grain,
  .scene__rain,
  .scene__light {
    animation: none;
  }

  .scene__painting {
    transform: none;
  }

  .threshold.is-entering .scene__painting {
    transform: scale(1.08);
    transition-duration: 400ms;
    transition-delay: 0ms;
  }

  .inside {
    transition-delay: 450ms;
  }

  .admin-nav {
    transition-delay: 650ms;
  }
}
