:root {
  --bg-deep: #090a0f;
  --noir-surface: rgba(14, 16, 22, 0.88);
  --noir-glass: rgba(14, 16, 22, 0.72);
  --noir-dialogue-bg: rgba(10, 12, 18, 0.50);
  --noir-thought-bg: rgba(12, 18, 30, 0.50);
  --noir-choice-bg: rgba(10, 12, 18, 0.60);
  --bg-elevated: #12151f;
  --bg-elevated-soft: #1a1e2b;

  --ruby: #d94b5a;
  --ruby-bright: #ee6271;
  --ruby-soft: rgba(217, 75, 90, 0.18);
  --ruby-line: rgba(217, 75, 90, 0.44);

  /* Токены совместимости для dev_mode.css и второго iPhone Маши */
  --gold: #d6b272;
  --gold-bright: #ebd09b;
  --gold-soft: rgba(214, 178, 114, 0.18);
  --gold-line: rgba(214, 178, 114, 0.34);

  --text-main: #f5f2eb;
  --text-muted: #9fa6b8;
  --text-dim: #6f778a;

  --accent-vanilla: #76a8f4;
  --accent-alpha: #e09f5a;
  --accent-loyalty: #58c998;
  --accent-risk: #df6d75;

  --line-subtle: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-title: "Oswald", "Manrope", sans-serif;

  --safe-top: calc(
    var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) +
      var(--tg-content-safe-area-inset-top, 0px)
  );
  --safe-bottom: calc(
    var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) +
      var(--tg-content-safe-area-inset-bottom, 0px)
  );
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --in-oklab: ;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: #05060a;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.48;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

h1,
h2,
h3,
.title-logo,
.dialog-title {
  margin: 0;
  text-wrap: balance;
}

p,
li {
  margin: 0;
  text-wrap: pretty;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
.dialogue-veil:focus-visible {
  outline: 2px solid var(--ruby-bright);
  outline-offset: 2px;
}

.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;
}

/* ==================== ВЕКТОРНЫЕ ИКОНКИ (1.5PX STROKE) ==================== */
.icon-svg,
.icon-svg-sm,
.dialogue-chevron,
.masha-lock-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-svg {
  width: 1.2rem;
  height: 1.2rem;
}

.icon-svg-sm {
  width: 1rem;
  height: 1rem;
}

.hud-icon-btn[aria-pressed="false"] .icon-sound-on {
  display: none;
}

.hud-icon-btn[aria-pressed="true"] .icon-sound-off {
  display: none;
}

/* ==================== ОБОЛОЧКА КАДРА 9:16 ==================== */
.app-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  margin-inline: auto;
  background: var(--bg-deep);
  overflow: hidden;
  container-type: inline-size;
  container-name: stage;
}

@media (min-width: 560px) {
  body {
    display: grid;
    place-items: center;
    background:
      radial-gradient(circle at 50% 22%, rgba(217, 75, 90, 0.09), transparent 52%),
      #05060a;
  }

  .app-shell {
    height: min(100dvh, 960px);
    width: auto;
    aspect-ratio: 9 / 16;
    max-width: 100dvw;
    border-inline: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.88);
  }
}

@media (min-width: 560px) and (min-height: 760px) {
  .app-shell {
    height: min(94dvh, 920px);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 22px;
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ==================== ТИТУЛЬНЫЙ ЭКРАН (НЕО-НУАР) ==================== */
.title-screen {
  justify-content: space-between;
  background: #090a0f;
  isolation: isolate;
}

.title-media-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.title-cover-img {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center;
}

@media (prefers-reduced-motion: no-preference) {
  .title-media-wrap.video-fallback .title-cover-img {
    animation: subtleKenBurns 22s ease-in-out infinite alternate;
  }
}

.title-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.title-cover-video.is-ready {
  opacity: 1;
}

.app-shell.motion-paused .title-cover-video {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .title-cover-video {
    display: none;
  }
}

.title-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg var(--in-oklab), rgba(5, 6, 10, 0.34) 0%, transparent 24%, rgba(5, 6, 10, 0.22) 56%, rgba(7, 8, 13, 0.86) 76%, #07080d 100%),
    radial-gradient(circle at 18% 72%, rgba(217, 56, 72, 0.12), transparent 48%),
    radial-gradient(circle at 50% 34%, transparent 45%, rgba(5, 6, 10, 0.38) 100%);
}

.title-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: calc(var(--safe-top) + 0.85rem) calc(var(--safe-right) + 1.05rem) 0.5rem calc(var(--safe-left) + 1.05rem);
}

.title-top-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.title-age-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: normal;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-main);
  background: rgba(14, 16, 22, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.title-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  padding: 1.5rem calc(var(--safe-right) + 1.2rem) calc(var(--safe-bottom) + 1.45rem) calc(var(--safe-left) + 1.2rem);
}

.title-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  margin: 0;
}

.title-kicker-row {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.title-crimson-bar {
  width: 22px;
  height: 2px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.85);
  flex-shrink: 0;
}

.title-kicker {
  font-family: var(--font-sans);
  font-size: clamp(0.62rem, 2.7vw, 0.86rem);
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f3efe6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.92);
}

.title-main {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2.15rem, 11vw, 3.7rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(180deg var(--in-oklab), #ffffff 15%, #ece8df 68%, #c6cddb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.92));
}

.title-tagline {
  max-width: 34ch;
  font-size: clamp(0.88rem, 3.4vw, 1.02rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  color: rgba(245, 242, 235, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  margin-bottom: 0.55rem;
}

@supports (font-size: 1cqi) {
  .title-crimson-bar {
    width: 5.6cqi;
  }

  .title-kicker {
    font-size: clamp(0.62rem, 2.85cqi, 0.86rem);
  }

  .title-main {
    font-size: clamp(2.15rem, 11.4cqi, 3.7rem);
  }

  .title-tagline {
    font-size: clamp(0.88rem, 3.6cqi, 1.02rem);
  }
}

.title-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.title-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

/* ==================== КНОПКИ НЕО-НУАР ==================== */
.btn-noir {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 2.95rem;
  padding: 0.68rem 1.05rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: normal;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.14s ease, opacity 0.18s ease;
}

.btn-noir:active {
  transform: scale(0.985);
}

.btn-primary {
  background: linear-gradient(180deg var(--in-oklab), #cc3848 0%, #a52434 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 26px rgba(217, 75, 90, 0.34);
}

.btn-primary:hover {
  background: linear-gradient(180deg var(--in-oklab), #d64353 0%, #b02b3b 100%);
}

.btn-secondary {
  background: rgba(14, 16, 24, 0.68);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-continue-main {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.btn-submeta {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.88;
  margin-top: 0.12rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== ВЕРХНИЙ HUD (ЛОКАЦИЯ + 2 КНОПКИ) ==================== */
.hud-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: calc(var(--safe-top) + 0.55rem) calc(var(--safe-right) + 0.75rem) 0.55rem calc(var(--safe-left) + 0.75rem);
  background: linear-gradient(180deg, rgba(9, 10, 15, 0.64) 0%, rgba(9, 10, 15, 0.22) 72%, transparent 100%);
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.hud-location {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 68%;
  padding: 0.36rem 0.75rem;
  border-radius: 999px;
  background: rgba(12, 14, 20, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hud-loc-text {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(245, 242, 235, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-controls {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-shrink: 0;
}

.hud-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.38rem;
  height: 2.38rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: rgba(245, 242, 235, 0.92);
  background: rgba(14, 16, 22, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.hud-icon-btn[aria-pressed="false"] {
  color: rgba(245, 242, 235, 0.62);
  border-color: rgba(255, 255, 255, 0.1);
}

.hud-icon-btn:hover,
.hud-icon-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

@media (pointer: coarse) {
  .hud-icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

.hud-unread-dot {
  position: absolute;
  top: 0.34rem;
  right: 0.34rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ruby);
  box-shadow: 0 0 0 2px #0c0d11, 0 0 10px rgba(217, 75, 90, 0.85);
}

/* ==================== 4-СЛОЙНАЯ СЦЕНА 9:16 ==================== */
.stage-viewport {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090a0f;
  cursor: pointer;
}

.stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center 20%;
}

.stage-bg-back {
  z-index: 1;
}

.stage-bg-front {
  z-index: 2;
  opacity: 1;
  transition: opacity 0.34s ease-out, filter 0.34s ease-out;
}

.stage-bg-front.is-fading-in {
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage-bg-front {
    transition: opacity 0.12s ease-out, filter 0.12s ease-out;
  }
}

.stage-bg.cam-sepia {
  filter: sepia(0.52) saturate(0.75) contrast(1.06) brightness(0.88);
}

.stage-bg.cam-dim {
  filter: brightness(0.62) contrast(1.05);
}

@media (prefers-reduced-motion: no-preference) {
  .stage-bg.cam-zoom-slow {
    animation: subtleKenBurns 18s ease-out forwards;
  }

  .stage-bg.cam-pan-up-reveal {
    animation: panUpReveal 9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .stage-viewport.fx-shake {
    animation: stageShake 0.42s ease-in-out;
  }
}

.app-shell.motion-paused .title-cover-img,
.app-shell.motion-paused .stage-bg {
  animation-play-state: paused !important;
}

/* Видеослой Kling поверх фонового кадра */
.stage-video {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: center 20%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stage-video.is-oneshot {
  transition: opacity 0.08s linear;
}

.stage-video.is-ready {
  opacity: 1;
}

.stage-placeholder {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, #161925, #090a0f);
}

.stage-placeholder-tag {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--ruby-bright);
  margin-bottom: 0.4rem;
}

.stage-placeholder-text {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.room-props-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

/* Слой 3: Персонажный спрайт (масштаб человека и привязка к архитектуре локации) */
.sprite-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.stage-sprite {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 74%;
  max-width: 96%;
  opacity: 1;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.72));
  transition: opacity 0.22s ease-out, transform 0.26s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .stage-sprite {
    transition: opacity 0.08s ease-out;
  }
}

.stage-sprite.pos-sidewalk-right {
  height: 74%;
  bottom: 0;
  transform: translateX(-42%);
}

.stage-sprite.pos-awning-right {
  height: 74%;
  bottom: 0;
  transform: translateX(-40%);
}

.stage-sprite.pos-booth-seated {
  height: 68%;
  bottom: 13%;
  max-width: 94%;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 72%, rgba(0, 0, 0, 0.45) 88%, transparent 100%);
}

.stage-sprite.pos-living-floor {
  height: 74%;
  bottom: 0;
  transform: translateX(-42%);
}

.stage-sprite.pos-bedroom-closet {
  height: 74%;
  bottom: 0;
  transform: translateX(-40%);
}

.stage-sprite.pos-kitchen-counter {
  height: 74%;
  bottom: 0;
  transform: translateX(-44%);
}

.stage-sprite.pos-park-path {
  height: 74%;
  bottom: 0;
  transform: translateX(-54%);
}

.stage-sprite.pos-katya-full {
  height: 82%;
  bottom: 4%;
  max-width: 102%;
  transform: translateX(-50%);
}

.stage-sprite.pos-katya-bakery {
  height: 82%;
  bottom: 4%;
  max-width: 102%;
  transform: translateX(-36%);
}

/* Парные спрайты диалога */
.sprite-layer .stage-sprite.stage-sprite-dual {
  position: absolute;
  bottom: 0;
  width: auto;
  height: 70%;
  max-width: 82%;
  opacity: 1;
  object-fit: contain;
  object-position: bottom center;
  transform: scale(1);
  transform-origin: bottom center;
  transition: opacity 0.22s ease-out, transform 0.26s ease-out, filter 0.26s ease-out;
}

.stage-sprite.is-entering,
.sprite-layer .stage-sprite.stage-sprite-dual.is-entering {
  opacity: 0;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .sprite-layer .stage-sprite.stage-sprite-dual {
    transition: opacity 0.08s ease-out, filter 0.14s ease-out;
  }
}

.sprite-layer .stage-sprite.stage-sprite-left {
  left: -12%;
  right: auto;
  transform: scale(1);
  transform-origin: bottom center;
}

.sprite-layer .stage-sprite.stage-sprite-right {
  right: -12%;
  left: auto;
  transform: scale(1);
  transform-origin: bottom center;
}

.sprite-layer .stage-sprite-dual.is-flipped {
  transform: scaleX(-1);
}

.sprite-layer .stage-sprite-dual.is-active {
  z-index: 3;
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.78)) brightness(1.04);
  transform: scale(1.03);
}

.sprite-layer .stage-sprite-dual.is-active.is-flipped {
  transform: scaleX(-1) scale(1.03);
}

.sprite-layer .stage-sprite-dual.is-dimmed {
  z-index: 1;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.65)) brightness(0.66) saturate(0.82);
  transform: scale(0.95);
}

.sprite-layer .stage-sprite-dual.is-dimmed.is-flipped {
  transform: scaleX(-1) scale(0.95);
}

.sprite-layer .stage-sprite-dual.is-neutral {
  z-index: 2;
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.72)) brightness(0.92);
  transform: scale(0.99);
}

.sprite-layer .stage-sprite-dual.is-neutral.is-flipped {
  transform: scaleX(-1) scale(0.99);
}

/* Слой 4: 60fps Canvas атмосферы */
.fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Карточка крупного плана улики / реквизита на сцене */
.prop-card-overlay {
  position: absolute;
  top: 41%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  margin: 0;
  width: min(64%, 256px);
  pointer-events: none;
}

.prop-card-frame {
  padding: 0.35rem;
  border-radius: 1rem;
  background: rgba(14, 16, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.prop-card-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.72rem;
}

/* Входящее сообщение Кати поверх кадра */
.incoming-msg-card {
  position: absolute;
  top: calc(var(--safe-top) + 3.8rem);
  left: 0.85rem;
  right: 0.85rem;
  z-index: 14;
  pointer-events: auto;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(14, 16, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.incoming-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
}

.incoming-msg-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ruby-bright);
}

.incoming-msg-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.incoming-msg-sender {
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
  margin-bottom: 0.3rem;
}

.incoming-msg-body {
  font-size: 0.82rem;
  line-height: 1.44;
  color: rgba(245, 242, 235, 0.92);
  margin-bottom: 0.55rem;
}

.incoming-msg-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.24rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.attachment-chip-btn {
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.attachment-chip-btn:hover,
.attachment-chip-btn:focus-visible {
  background: rgba(118, 168, 244, 0.18);
  border-color: rgba(118, 168, 244, 0.45);
  color: #ffffff;
}

.attachment-chip-btn:active {
  transform: scale(0.97);
}

.attachment-photo-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.38rem 0.55rem 0.38rem 0.38rem;
  border-radius: 0.65rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-main);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.attachment-photo-btn:hover,
.attachment-photo-btn:focus-visible {
  background: rgba(118, 168, 244, 0.16);
  border-color: rgba(118, 168, 244, 0.42);
}

.attachment-photo-btn:active {
  transform: scale(0.985);
}

.attachment-photo-thumb {
  width: 42px;
  height: 42px;
  border-radius: 0.45rem;
  object-fit: cover;
  flex-shrink: 0;
  background: #0c0d11;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.attachment-photo-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1 1 auto;
}

.attachment-photo-label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: #f5f2eb;
}

.attachment-photo-hint {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ec5ff;
}

/* ==================== ПЕСОЧНИЦА INTRO_4: СВЕТО-МАЯЧКИ И ДОК КОМНАТ ==================== */
.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}

.hotspot-beacon-btn {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.26rem;
  min-width: 48px;
  min-height: 48px;
  padding: 0.25rem;
  background: transparent;
  transition: transform 0.2s ease, opacity 0.22s ease;
}

.hotspot-beacon-btn[data-tag-pos="top"] {
  flex-direction: column-reverse;
}

.hotspot-beacon-btn:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.hotspot-beacon {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
}

.hotspot-beacon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(217, 75, 90, 0.42);
}

@media (prefers-reduced-motion: no-preference) {
  .hotspot-beacon-ring {
    animation: beaconPulse 2.2s ease-in-out infinite;
  }
}

.hotspot-beacon-core {
  position: relative;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: var(--ruby);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.hotspot-beacon-btn.is-exit .hotspot-beacon-ring {
  background: rgba(118, 168, 244, 0.36);
  animation: none;
}

.hotspot-beacon-btn.is-exit .hotspot-beacon-core {
  background: var(--accent-vanilla);
}

.hotspot-beacon-btn.is-inspected .hotspot-beacon-ring {
  animation: none;
  background: rgba(255, 255, 255, 0.14);
}

.hotspot-beacon-btn.is-inspected .hotspot-beacon-core {
  width: 1.15rem;
  height: 1.15rem;
  background: rgba(14, 16, 22, 0.82);
  border-color: rgba(88, 201, 152, 0.85);
  color: var(--accent-loyalty);
  display: grid;
  place-items: center;
}

.hotspot-object-tag {
  padding: 0.2rem 0.56rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.hotspot-beacon-btn.is-inspected .hotspot-object-tag {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Полупрозрачные секретные слои (полароиды и запотевшее зеркало — без точек и подписей) */
.hotspot-secret-layer {
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--secret-rot, 0deg));
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.hotspot-secret-layer.is-polaroid {
  background: rgba(248, 243, 232, 0.2);
  border: 1.5px solid rgba(255, 224, 170, 0.48);
  border-radius: 0.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 224, 170, 0.22);
}

.hotspot-secret-layer.is-mirror {
  background: linear-gradient(135deg, rgba(210, 230, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1.5px solid rgba(205, 230, 255, 0.42);
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32), 0 0 14px rgba(180, 215, 255, 0.2);
}

@media (prefers-reduced-motion: no-preference) {
  .hotspot-secret-layer.is-polaroid:not(.is-found) {
    animation: secretSoftGlow 2.8s ease-in-out infinite;
  }

  .hotspot-secret-layer.is-mirror:not(.is-found) {
    animation: secretSoftGlow 3.2s ease-in-out infinite;
  }
}

.hotspot-secret-layer:hover,
.hotspot-secret-layer:focus-visible {
  opacity: 0.95;
  transform: translate(-50%, -50%) rotate(var(--secret-rot, 0deg)) scale(1.06);
  animation: none;
}

.hotspot-secret-layer.is-found {
  opacity: 0.16;
  animation: none;
  box-shadow: none;
}

.hotspot-secret-layer.is-mirror.is-found {
  opacity: 0.15;
}

.hotspot-secret-layer.is-found:hover,
.hotspot-secret-layer.is-found:focus-visible {
  opacity: 0.72;
}

/* Нижняя навигация песочницы */
.room-nav {
  position: absolute;
  left: calc(var(--safe-left) + 0.75rem);
  right: calc(var(--safe-right) + 0.75rem);
  bottom: calc(var(--safe-bottom) + 0.75rem);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.sandbox-progress-pill {
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.88);
  background: rgba(10, 12, 18, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: default;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sandbox-progress-pill.is-ready {
  background: rgba(217, 75, 90, 0.9);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(217, 75, 90, 0.35);
}

.room-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.28rem;
  border-radius: 1rem;
  background: rgba(14, 16, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.58);
}

.room-tab-btn {
  position: relative;
  min-height: 2.35rem;
  padding: 0.35rem 0.25rem;
  border-radius: 0.75rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.room-tab-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.room-tab-dot {
  display: inline-block;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: var(--ruby);
  margin-left: 0.24rem;
  vertical-align: middle;
}

.room-tab-secret-dot {
  display: inline-block;
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: #f0c475;
  box-shadow: 0 0 8px rgba(240, 196, 117, 0.75);
  margin-left: 0.2rem;
  vertical-align: middle;
}

@media (pointer: coarse) {
  .room-tab-btn {
    min-height: 44px;
  }
}

.game-screen.is-inspecting-spot .room-nav,
.game-screen.is-inspecting-spot .hotspot-layer {
  opacity: 0;
  pointer-events: none;
}

/* ==================== ПАРЯЩЕЕ ДЫМЧАТОЕ ОКНО ДИАЛОГА (50% НЕО-НУАР) ==================== */
.vn-bottom-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.choice-wrap {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.5rem calc(var(--safe-right) + 0.85rem) calc(var(--safe-bottom) + 0.95rem) calc(var(--safe-left) + 0.85rem);
  background: linear-gradient(180deg, transparent 0%, rgba(9, 10, 15, 0.56) 34%, rgba(9, 10, 15, 0.84) 100%);
}

.choice-context-quote {
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(245, 242, 235, 0.92);
  padding: 0.55rem 0.78rem;
  border-radius: 0.85rem;
  background: rgba(10, 12, 18, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.choice-context-quote[data-role="mct"] {
  border-left: 2px solid rgba(118, 168, 244, 0.65);
  color: #d6e5ff;
  font-style: italic;
}

.choice-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-btn {
  position: relative;
  width: 100%;
  min-height: 3rem;
  text-align: left;
  padding: 0.78rem 1rem 0.78rem 1.15rem;
  border-radius: 0.9rem;
  background: var(--noir-choice-bg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f5f2eb;
  font-size: clamp(0.86rem, 0.82rem + 0.24vw, 0.95rem);
  font-weight: 600;
  line-height: 1.38;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.choice-btn::before {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.58rem;
  bottom: 0.58rem;
  width: 3px;
  border-radius: 999px;
  background: var(--ruby);
  opacity: 0.6;
  transition: opacity 0.16s ease;
}

.choice-btn:hover,
.choice-btn:active {
  background: rgba(25, 28, 38, 0.76);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.choice-btn:active {
  transform: scale(0.985);
}

.choice-btn:hover::before,
.choice-btn:active::before {
  opacity: 1;
}

/* Парящее окно диалога 50% */
.dialogue-veil {
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0 calc(var(--safe-right) + 0.75rem) calc(var(--safe-bottom) + 0.85rem) calc(var(--safe-left) + 0.75rem);
  padding: 0.88rem 0.98rem 0.76rem;
  border-radius: 1.15rem;
  background: var(--noir-dialogue-bg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  cursor: pointer;
  transition: border-color 0.22s ease, background-color 0.22s ease;
}

.dialogue-veil[data-role="mct"] {
  background: rgba(11, 17, 32, 0.72);
  border-color: rgba(118, 168, 244, 0.46);
  border-left: 3px solid rgba(118, 168, 244, 0.78);
}

.speaker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 1.55rem;
}

.speaker-id {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.speaker-avatar-wrap {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(118, 168, 244, 0.58);
  background: #141824;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.48);
  flex-shrink: 0;
}

.speaker-avatar-sprite {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}

.speaker-avatar-monogram {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  background: radial-gradient(circle at 30% 30%, #252b3f, #12151f);
}

.speaker-accent-bar {
  width: 3px;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--ruby);
  flex-shrink: 0;
}

.speaker-name {
  font-family: var(--font-sans);
  font-size: clamp(0.88rem, 0.84rem + 0.24vw, 0.98rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f5f2eb;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.speaker-thought-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.14rem 0.46rem;
  border-radius: 999px;
  background: rgba(118, 168, 244, 0.18);
  border: 1px solid rgba(118, 168, 244, 0.44);
  color: #bed8ff;
  flex-shrink: 0;
}

.dialogue-veil[data-role="masha"] .speaker-accent-bar {
  background: var(--ruby);
}

.dialogue-veil[data-role="masha"] .speaker-name {
  color: #f9ebe8;
}

.dialogue-veil[data-role="katya"] .speaker-accent-bar {
  background: var(--accent-loyalty);
}

.dialogue-veil[data-role="katya"] .speaker-name {
  color: #9be8c7;
}

.dialogue-veil[data-role="lenka"] .speaker-accent-bar {
  background: #f07b96;
}

.dialogue-veil[data-role="lenka"] .speaker-name {
  color: #f7b0c0;
}

.dialogue-veil[data-role="mc"] .speaker-accent-bar {
  background: #f5f2eb;
}

.dialogue-veil[data-role="mc"] .speaker-name {
  color: #f5f2eb;
}

.dialogue-veil[data-role="mc"] .dialogue-text {
  color: #ffffff;
  font-style: normal;
}

.dialogue-veil[data-role="mct"] .speaker-accent-bar {
  background: var(--accent-vanilla);
}

.dialogue-veil[data-role="mct"] .speaker-name {
  color: #9ec5ff;
}

.dialogue-veil[data-role="komendant"] .speaker-accent-bar,
.dialogue-veil[data-role="narrator"] .speaker-accent-bar {
  background: rgba(255, 255, 255, 0.55);
}

.dialogue-quick-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.dialogue-mini-btn {
  padding: 0.22rem 0.5rem;
  border-radius: 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.82);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dialogue-mini-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.dialogue-text {
  font-size: clamp(0.92rem, 0.88rem + 0.26vw, 1.02rem);
  line-height: 1.52;
  color: #f5f2eb;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.86);
  min-height: 2.9em;
  max-height: 38dvh;
  overflow-y: auto;
}

.dialogue-veil[data-role="mct"] .dialogue-text {
  font-style: italic;
  color: #dce9ff;
}

.dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.05rem;
}

.dialogue-continue-line {
  width: 1.4rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
}

.dialogue-chevron {
  width: 0.88rem;
  height: 0.88rem;
  color: var(--ruby-bright);
}

/* ==================== РЕЖИМ «ЧИСТЫЙ КАДР» ==================== */
.app-shell.clean-frame .hud-bar,
.app-shell.clean-frame .vn-bottom-panel,
.app-shell.clean-frame .room-nav,
.app-shell.clean-frame .hotspot-layer,
.app-shell.clean-frame .epilogue-bar {
  opacity: 0;
  pointer-events: none;
}

.clean-frame-hint {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.88);
  background: rgba(12, 14, 20, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
}

/* Плашка финала Части 1 */
.epilogue-bar {
  position: absolute;
  left: calc(var(--safe-left) + 0.75rem);
  right: calc(var(--safe-right) + 0.75rem);
  bottom: calc(var(--safe-bottom) + 0.85rem);
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  background: rgba(14, 16, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.epilogue-bar-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.82rem;
}

.epilogue-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ruby-bright);
}

.epilogue-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.btn-epilogue-chip {
  flex: 1 1 auto;
  min-height: 2.45rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
}

/* ==================== МОДАЛЬНЫЕ ОКНА И НИЖНИЕ ШТОРКИ (<dialog>) ==================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

.vn-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  width: min(92dvw, 410px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 1.5rem);
  overflow: visible;
  opacity: 0;
  transition: opacity 0.22s ease, overlay 0.22s ease, display 0.22s ease;
  transition-behavior: allow-discrete;
}

.vn-dialog.dialog-sheet {
  margin: auto auto 0 auto;
  width: min(100dvw, 430px);
  max-height: calc(100dvh - var(--safe-top) - 1rem);
}

.vn-dialog[open]:where(:not([data-closing])) {
  opacity: 1;
}

@starting-style {
  .vn-dialog[open]:where(:not([data-closing])) {
    opacity: 0;
  }
}

.vn-dialog::backdrop {
  background: rgba(5, 6, 10, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background-color 0.24s ease, backdrop-filter 0.24s ease, overlay 0.24s ease, display 0.24s ease;
  transition-behavior: allow-discrete;
}

.vn-dialog[open]:where(:not([data-closing]))::backdrop {
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@starting-style {
  .vn-dialog[open]:where(:not([data-closing]))::backdrop {
    background: rgba(5, 6, 10, 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .vn-dialog {
    transform: translateY(10px) scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s ease, overlay 0.22s ease, display 0.22s ease;
    transition-behavior: allow-discrete;
  }

  .vn-dialog.dialog-sheet {
    transform: translateY(28px);
  }

  .vn-dialog[open]:where(:not([data-closing])) {
    transform: translateY(0) scale(1);
  }

  @starting-style {
    .vn-dialog[open]:where(:not([data-closing])) {
      transform: translateY(10px) scale(0.985);
    }

    .vn-dialog.dialog-sheet[open]:where(:not([data-closing])) {
      transform: translateY(28px);
    }
  }
}

.dialog-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 1.5rem);
  overflow-y: auto;
  padding: 1.15rem;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #141722 0%, #0d0f16 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.84);
}

.sheet-card {
  border-radius: 1.5rem 1.5rem 0 0;
  border-bottom: none;
  padding-top: 0.65rem;
  padding-bottom: calc(var(--safe-bottom) + 1.15rem);
  max-height: calc(100dvh - var(--safe-top) - 1rem);
}

.sheet-handle {
  width: 2.6rem;
  height: 0.24rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 0.25rem;
  flex-shrink: 0;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.dialog-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ruby-bright);
  margin-bottom: 0.2rem;
}

.dialog-title {
  font-family: var(--font-sans);
  font-size: clamp(1.18rem, 1.08rem + 0.45vw, 1.4rem);
  font-weight: 800;
  line-height: 1.2;
  color: #f5f2eb;
}

.dialog-close-btn,
.phone-close-btn {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

@media (pointer: coarse) {
  .dialog-close-btn,
  .phone-close-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

.dialog-close-btn:hover,
.phone-close-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.dialog-lead {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.name-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field-input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.7rem;
  background: rgba(9, 10, 15, 0.78);
  border: 1px solid var(--line-strong);
  font-size: 1rem;
  color: #ffffff;
}

.field-input:focus {
  border-color: var(--ruby-bright);
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.dialog-actions-dual {
  flex-direction: row;
}

.dialog-actions-dual > .btn-noir {
  flex: 1 1 0;
}

/* ==================== ШТОРКА ЭПИЗОДОВ ==================== */
.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.episode-card {
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.episode-card:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: var(--ruby-line);
}

.episode-num {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--ruby-bright);
  margin-bottom: 0.12rem;
}

.episode-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
  color: #f5f2eb;
}

.episode-desc {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.16rem;
  line-height: 1.38;
}

.episode-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==================== ДВА СМАРТФОНА (OLED АРТЁМ VS ТИТАН МАШИ) ==================== */
.phone-device {
  display: flex;
  flex-direction: column;
  height: min(82dvh, 690px);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 1.5rem);
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.88);
}

.phone-mc {
  background: #11131a;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}

.phone-masha {
  background: linear-gradient(180deg, #191722 0%, #0e0d15 100%);
  border: 2px solid rgba(224, 194, 146, 0.45);
}

.phone-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.68rem 0.95rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-clock {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.phone-island {
  width: 4.8rem;
  height: 1.1rem;
  border-radius: 999px;
  background: #040508;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.3rem;
  padding: 0.42rem 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-tabs-bottom {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  gap: 0.2rem;
  padding: 0.42rem 0.45rem 0.5rem;
  background: rgba(9, 10, 15, 0.72);
}

.phone-tab {
  position: relative;
  min-width: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color 0.16s ease, color 0.16s ease;
}

.phone-tabs-bottom .phone-tab {
  gap: 0.22rem;
  padding: 0.34rem 0.22rem;
  font-size: 0.69rem;
}

.phone-tabs-bottom .phone-tab .icon-svg-sm {
  width: 0.92rem;
  height: 0.92rem;
}

@media (max-width: 380px) {
  .phone-tabs-bottom .phone-tab {
    flex-direction: column;
    gap: 0.12rem;
    padding: 0.26rem 0.14rem;
    font-size: 0.63rem;
    line-height: 1.15;
  }
}

@media (pointer: coarse) {
  .phone-tab {
    min-height: 44px;
  }
}

.phone-tab.active {
  background: #f5f2eb;
  color: #0c0d11;
}

.phone-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0.55rem 0.16rem;
  border-block-end: 2px solid currentColor;
  pointer-events: none;
}

.masha-phone-tabs .phone-tab.active {
  background: rgba(214, 178, 114, 0.22);
  color: var(--gold-bright);
}

.phone-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Вкладка «Связи» в смартфоне Артёма */
.relation-card,
.scale-card {
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.relation-card-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.relation-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  background: #171b28;
}

.relation-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.scale-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.scale-card-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
}

.scale-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ruby-bright);
  flex-shrink: 0;
}

.stars-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.star-glyph {
  width: 1.1rem;
  height: 1.1rem;
  color: rgba(255, 255, 255, 0.22);
}

.star-glyph.filled {
  color: var(--ruby-bright);
  fill: var(--ruby);
}

.pendulum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pendulum-track {
  position: relative;
  height: 0.52rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(118, 168, 244, 0.5) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(224, 159, 90, 0.55) 100%
  );
}

.pendulum-center-tick {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(255, 255, 255, 0.38);
}

.pendulum-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.94rem;
  height: 0.94rem;
  border-radius: 50%;
  background: #f5f2eb;
  border: 2px solid #0c0d11;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.meter-track {
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.meter-fill.loyalty {
  background: linear-gradient(90deg, #42a67d, #68dba9);
}

.meter-fill.risk {
  background: linear-gradient(90deg, #cf6252, #e66c75);
}

.scale-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Чаты и инлайн-карточки досье */
.chat-thread-btn,
.clue-accordion-card {
  width: 100%;
  text-align: left;
  padding: 0.78rem 0.85rem;
  border-radius: 0.88rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.chat-thread-btn:hover,
.clue-accordion-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.075);
}

.chat-thread-row,
.clue-card-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.chat-thread-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  background: #171b28;
}

.clue-accordion-card {
  cursor: pointer;
}

.clue-thumb-btn {
  display: block;
  padding: 0;
  border-radius: 0.6rem;
  flex-shrink: 0;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.clue-thumb-btn:hover,
.clue-thumb-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.clue-thumb {
  display: block;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 0.6rem;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  background: #0c0d11;
}

.thread-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.thread-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.thread-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
}

.thread-sub {
  font-size: 0.68rem;
  color: var(--ruby-bright);
  flex-shrink: 0;
}

.thread-preview {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clue-accordion-detail {
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.clue-accordion-detail p {
  font-size: 0.77rem;
  line-height: 1.44;
  color: rgba(245, 242, 235, 0.9);
}

.clue-accordion-note {
  color: var(--text-muted) !important;
}

.clue-detail-photo-btn {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.35rem;
  border-radius: 0.72rem;
  background: rgba(9, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.clue-detail-photo-btn:hover,
.clue-detail-photo-btn:focus-visible {
  border-color: rgba(118, 168, 244, 0.45);
  background: rgba(118, 168, 244, 0.12);
}

.clue-detail-photo-img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #07080d;
}

.clue-detail-photo-cap {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ec5ff;
  padding: 0 0.2rem 0.1rem;
}

/* ==================== ПОЛНОЭКРАННЫЙ ПРОСМОТР ФОТО ==================== */
.vn-dialog.dialog-lightbox {
  width: min(92vw, 440px);
  max-width: 92vw;
}

.vn-dialog.dialog-lightbox[open]:where(:not([data-closing]))::backdrop {
  background: rgba(5, 6, 10, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.photo-lightbox-card {
  gap: 0.75rem;
  padding: 0.9rem;
  background: linear-gradient(180deg, #131622 0%, #090b11 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.photo-lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.photo-lightbox-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.photo-lightbox-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f5f2eb;
}

.photo-lightbox-caption {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.photo-lightbox-frame {
  border-radius: 0.85rem;
  overflow: hidden;
  background: #06070c;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.photo-lightbox-img {
  display: block;
  width: 100%;
  max-height: 74dvh;
  object-fit: contain;
  background: #06070c;
}

.chat-back-inline {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 2.2rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg-bubble {
  max-width: 88%;
  padding: 0.68rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.81rem;
  line-height: 1.44;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.msg-bubble.in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom-left-radius: 0.25rem;
}

.msg-bubble.out {
  align-self: flex-end;
  background: rgba(217, 75, 90, 0.2);
  border: 1px solid rgba(217, 75, 90, 0.36);
  border-bottom-right-radius: 0.25rem;
}

.phone-masha .msg-bubble.out {
  background: rgba(214, 178, 114, 0.17);
  border-color: rgba(214, 178, 114, 0.32);
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.section-subhead {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.empty-note {
  padding: 1.1rem;
  border-radius: 0.85rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

/* Экран блокировки PIN 1408 на iPhone Маши (сохранён диегетический титановый стиль) */
.masha-lock-screen {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.5rem 1.05rem 0.75rem;
  background:
    radial-gradient(circle at 50% 18%, rgba(214, 178, 114, 0.18), transparent 58%),
    linear-gradient(180deg, #1b1826 0%, #0d0c14 100%);
}

.masha-lock-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.18rem;
  flex-shrink: 0;
}

.masha-lock-icon {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--gold-bright);
}

.masha-lock-time {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 1.5rem + 1.5vw, 2.35rem);
  font-weight: 600;
  line-height: 1;
  color: #ffffff;
}

.masha-lock-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.pin-dots {
  display: flex;
  gap: 0.7rem;
  margin: 0.25rem 0 0.08rem;
}

.pin-dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  border: 1.5px solid var(--gold-bright);
  background: transparent;
  transition: background-color 0.15s ease;
}

.pin-dot.filled {
  background: var(--gold-bright);
}

.pin-dots.is-error .pin-dot {
  border-color: var(--accent-risk);
  background: var(--accent-risk);
}

@media (prefers-reduced-motion: no-preference) {
  .pin-dots.is-error {
    animation: stageShake 0.35s ease;
  }
}

.masha-pin-hint {
  min-height: 1.2em;
  font-size: 0.7rem;
  line-height: 1.25;
  color: var(--gold);
  max-width: 32ch;
}

.pin-keypad {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.42rem;
  max-width: 236px;
  width: 100%;
  margin-inline: auto;
}

.pin-key {
  display: grid;
  place-items: center;
  height: 2.7rem;
  border-radius: 999px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.pin-key:hover,
.pin-key:active {
  background: rgba(214, 178, 114, 0.24);
  border-color: var(--gold);
}

.pin-key-aux {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}

.masha-unlocked-screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.masha-app-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.masha-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 2.2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(214, 178, 114, 0.14);
}

.masha-app-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Уведомления на экране блокировки iPhone Маши */
.masha-lock-notifs {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-top: 0.12rem;
  text-align: left;
  flex-shrink: 0;
}

.masha-lock-notif-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.62rem;
  border-radius: 0.78rem;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.34);
}

.masha-lock-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.masha-lock-notif-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
}

.masha-lock-notif-body,
.masha-lock-notif-preview {
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(245, 242, 235, 0.82);
}

/* Вложения-фотографии внутри чатов (.msg-bubble) */
.msg-photo-btn {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  margin-top: 0.22rem;
  padding: 0.24rem;
  border-radius: 0.68rem;
  background: rgba(6, 8, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  text-align: left;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.msg-photo-btn:hover,
.msg-photo-btn:focus-visible {
  border-color: rgba(214, 178, 114, 0.55);
  background: rgba(214, 178, 114, 0.1);
}

.msg-photo-thumb {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border-radius: 0.46rem;
  background: #07080d;
}

.msg-photo-caption,
.msg-photo-cap {
  font-size: 0.66rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.84);
  padding: 0.08rem 0.22rem 0.1rem;
}

/* Вкладки Фото, Скрытая папка и Заметки на iPhone Маши */
.masha-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.masha-photo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  border-radius: 0.8rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.masha-photo-tile:hover,
.masha-photo-tile:focus-visible {
  border-color: rgba(214, 178, 114, 0.55);
  transform: translateY(-1px);
}

.masha-photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.masha-photo-tile-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 1.1rem 0.45rem 0.35rem;
  font-size: 0.64rem;
  font-weight: 600;
  color: #f5f2eb;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 8, 13, 0.88) 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masha-hidden-folder-card {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.82rem 0.9rem;
  border-radius: 0.92rem;
  text-align: left;
  background: linear-gradient(135deg, rgba(214, 178, 114, 0.18), rgba(18, 16, 26, 0.9));
  border: 1px solid rgba(214, 178, 114, 0.44);
  color: #f5f2eb;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.masha-hidden-folder-card:hover,
.masha-hidden-folder-card:focus-visible {
  border-color: var(--gold-bright);
  background: linear-gradient(135deg, rgba(214, 178, 114, 0.26), rgba(22, 19, 32, 0.94));
}

.masha-pattern-pane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.15rem;
}

.masha-pattern-pane .pattern-lock-root {
  --pl-accent: var(--gold);
  --pl-success: var(--accent-loyalty);
  --pl-error: var(--ruby);
}

.masha-pattern-pane .pattern-lock-board {
  background:
    radial-gradient(circle at 50% 25%, rgba(214, 178, 114, 0.12), transparent 62%),
    rgba(13, 14, 22, 0.88);
  border-color: rgba(214, 178, 114, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.45);
}

.masha-pattern-pane .pattern-node::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(235, 208, 155, 0.28);
  border: 2px solid rgba(235, 208, 155, 0.65);
}

.masha-pattern-pane .pattern-lock-svg {
  filter: drop-shadow(0 0 6px rgba(214, 178, 114, 0.32));
}

.masha-pattern-pane .is-success .pattern-lock-board,
.pattern-lock-root.is-success .pattern-lock-board {
  border-color: rgba(88, 201, 152, 0.55);
}

.masha-pattern-pane .is-error .pattern-lock-board,
.pattern-lock-root.is-error .pattern-lock-board {
  border-color: rgba(217, 75, 90, 0.58);
}

@media (prefers-reduced-motion: no-preference) {
  .pattern-lock-root.is-error .pattern-lock-board,
  .pattern-lock-board.is-error {
    animation: stageShake 0.36s ease;
  }
}

.masha-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.masha-note-card {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.82rem 0.9rem;
  border-radius: 0.88rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(214, 178, 114, 0.22);
}

.masha-note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.masha-note-body {
  font-size: 0.77rem;
  line-height: 1.48;
  color: rgba(245, 242, 235, 0.9);
  white-space: pre-line;
}

/* Вкладка «Галерея» в смартфоне Артёма */
.gallery-summary-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.62rem 0.78rem;
  border-radius: 0.82rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gallery-summary-bar strong {
  color: #f5f2eb;
}

.gallery-filters {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.05rem 0 0.2rem;
  scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
  display: none;
}

.gallery-filter-btn {
  flex: none;
  min-height: 2rem;
  padding: 0.26rem 0.68rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.gallery-filter-btn.active,
.gallery-filter-btn[aria-pressed="true"] {
  background: rgba(217, 75, 90, 0.22);
  border-color: var(--ruby-bright);
  color: #ffffff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  padding: 0;
  text-align: left;
  transition: border-color 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.gallery-card:not(.is-locked):hover,
.gallery-card:not(.is-locked):focus-visible {
  border-color: rgba(214, 178, 114, 0.55);
  transform: translateY(-1px);
}

.gallery-card.is-locked {
  background: rgba(10, 12, 18, 0.82);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
  cursor: default;
}

.gallery-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #07090e;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.gallery-card-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card.is-locked .gallery-card-media {
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.05), transparent 65%),
    #080a10;
  color: var(--text-dim);
}

.gallery-card-body {
  padding: 0.48rem 0.55rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.gallery-card-badge {
  align-self: flex-start;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.gallery-card.is-locked .gallery-card-badge {
  color: var(--text-dim);
}

.gallery-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.25;
  color: #f5f2eb;
}

.gallery-card.is-locked .gallery-card-title {
  color: var(--text-muted);
}

.gallery-card-hint {
  font-size: 0.66rem;
  line-height: 1.3;
  color: var(--text-dim);
}

/* ==================== ДИАЛОГ ЗАПОТЕВШЕГО ЗЕРКАЛА ==================== */
.vn-dialog.dialog-mirror {
  width: min(94dvw, 430px);
}

.mirror-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 7;
  border-radius: 0.95rem;
  overflow: hidden;
  touch-action: none;
  border: 1px solid rgba(205, 230, 255, 0.24);
  background: #090c14;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.62), 0 12px 30px rgba(0, 0, 0, 0.52);
}

.mirror-progress-track {
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.mirror-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #76a8f4, #d6b272);
  transition: width 0.16s ease;
}

/* ==================== 3D-ПРОСМОТР СНИМКА POLAROID ==================== */
.vn-dialog.dialog-polaroid {
  width: min(92dvw, 390px);
}

.polaroid-scene {
  perspective: 1100px;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.2rem 0;
}

.polaroid-card-3d {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 3 / 3.7;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.22, 0.72, 0.24, 1);
  cursor: pointer;
  border-radius: 0.35rem;
}

.polaroid-card-3d.is-flipped {
  transform: rotateY(180deg);
}

.polaroid-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 0.35rem;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72);
}

.polaroid-face-front {
  background: linear-gradient(175deg, #f8f4ea 0%, #ede4d1 100%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  padding: 0.68rem 0.68rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: #19181c;
}

.polaroid-photo-wrap {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0.18rem;
  overflow: hidden;
  background: #101218;
  border: 1px solid rgba(20, 18, 16, 0.14);
}

.polaroid-front-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-front-caption {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.22;
  color: #221f24;
  text-align: center;
  min-height: 1.35em;
}

.polaroid-face-back {
  transform: rotateY(180deg);
  background: linear-gradient(170deg, #e9dec8 0%, #dcd0b6 100%);
  border: 1px solid rgba(190, 174, 145, 0.82);
  padding: 1.15rem 1.05rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.8rem;
  color: #242023;
}

.polaroid-back-meta {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c5b49;
  border-bottom: 1px dashed rgba(60, 48, 36, 0.25);
  padding-bottom: 0.45rem;
}

.polaroid-back-note {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.45;
  color: #1e1a1d;
  white-space: pre-line;
}

/* Системное меню (нижняя шторка) и бэклог */
.system-menu-card {
  height: min(76dvh, 610px);
}

.menu-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.backlog-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.backlog-entry {
  padding: 0.68rem 0.78rem;
  border-radius: 0.78rem;
  background: rgba(255, 255, 255, 0.045);
  border-left: 2px solid var(--ruby-line);
}

.backlog-speaker {
  display: block;
  font-size: 0.73rem;
  font-weight: 700;
  color: #f5f2eb;
  margin-bottom: 0.18rem;
}

.backlog-text {
  font-size: 0.8rem;
  color: rgba(245, 242, 235, 0.88);
  line-height: 1.44;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.78rem 0.82rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-row strong {
  display: block;
  font-size: 0.85rem;
}

.setting-row p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.btn-chip-toggle {
  min-height: 2.3rem;
  padding: 0.36rem 0.82rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.audio-mixer-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.72rem 0.82rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: opacity 0.2s ease;
}

.audio-mixer-group.is-muted {
  opacity: 0.45;
}

.audio-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  cursor: pointer;
}

.audio-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.88);
}

.audio-slider-val {
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--gold-bright);
}

.audio-range {
  width: 100%;
  height: 0.28rem;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  accent-color: var(--gold-bright);
  outline: none;
  cursor: pointer;
}

.audio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.96rem;
  height: 0.96rem;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid #090a0f;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
}

.audio-range::-moz-range-thumb {
  width: 0.96rem;
  height: 0.96rem;
  border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid #090a0f;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.2rem 0;
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.btn-danger-outline {
  min-height: 2.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.78rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f08c93;
  background: rgba(223, 109, 117, 0.09);
  border: 1px solid rgba(223, 109, 117, 0.34);
}

/* Итоги Части 1 */
.ending-summary-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ending-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.ending-stat-box {
  padding: 0.68rem 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ending-stat-box span {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ending-stat-box strong {
  font-size: 0.92rem;
  color: #ffffff;
}

.ending-recap-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ending-recap-list li {
  padding: 0.58rem 0.72rem;
  border-radius: 0.68rem;
  font-size: 0.79rem;
  color: rgba(245, 242, 235, 0.9);
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid var(--ruby);
}

.ending-support-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem;
  border-radius: 0.95rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 178, 114, 0.14), transparent 56%),
    linear-gradient(180deg, rgba(25, 27, 38, 0.94) 0%, rgba(14, 16, 24, 0.96) 100%);
  border: 1px solid rgba(214, 178, 114, 0.34);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.ending-support-kicker {
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.ending-support-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
}

.ending-support-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.78rem;
  line-height: 1.42;
  color: rgba(245, 242, 235, 0.88);
}

.ending-support-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

/* ==================== POPOVER="MANUAL" TOAST УВЕДОМЛЕНИЯ ==================== */
.toast-region {
  position: absolute;
  top: calc(var(--safe-top) + 3.6rem);
  left: calc(var(--safe-left) + 0.75rem);
  right: calc(var(--safe-right) + 0.75rem);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.vn-toast[popover] {
  position: fixed;
  inset: auto;
  top: calc(var(--safe-top) + 3.6rem + var(--toast-idx, 0) * 3.1rem);
  left: 50%;
  margin: 0;
  width: min(88dvw, 352px);
  padding: 0.5rem 0.55rem 0.5rem 0.82rem;
  border-radius: 0.85rem;
  background: rgba(14, 16, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease, overlay 0.22s ease, display 0.22s ease;
  transition-behavior: allow-discrete;
}

.vn-toast[popover]:is(:popover-open, .\:popover-open):where(:not([data-closing])) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@starting-style {
  .vn-toast[popover]:is(:popover-open, .\:popover-open):where(:not([data-closing])) {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px);
  }
}

@supports not selector(:popover-open) {
  .vn-toast[popover]:not(.\:popover-open) {
    display: none;
  }
}

.vn-toast.is-fallback-toast {
  position: relative;
  width: 100%;
  max-width: 22rem;
  padding: 0.5rem 0.55rem 0.5rem 0.82rem;
  border-radius: 0.85rem;
  background: rgba(14, 16, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.vn-toast.is-fallback-toast.is-open:not([data-closing]) {
  opacity: 1;
  transform: translateY(0);
}

.vn-toast-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.32;
  color: #f5f2eb;
  overflow-wrap: anywhere;
}

.vn-toast-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ruby);
  flex-shrink: 0;
}

.vn-toast-close {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (pointer: coarse) {
  .vn-toast-close {
    min-width: 44px;
    min-height: 44px;
  }
}

.vn-toast-close:hover {
  color: #ffffff;
}

/* ==================== МИНИ-ИГРА «РАСКЛАД НА 4 КОРОЛЕВ» (НЕО-НУАР) ==================== */
.queens-spread-overlay {
  position: absolute;
  top: calc(var(--safe-top) + 3.55rem);
  left: 0.75rem;
  right: 0.75rem;
  z-index: 18;
  padding: 0.82rem 0.85rem;
  border-radius: 1.1rem;
  background: rgba(14, 16, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: default;
}

.queens-spread-header {
  text-align: center;
  margin-bottom: 0.65rem;
}

.queens-spread-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ruby-bright);
}

.queens-spread-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.08rem;
  color: #ffffff;
  margin: 0.14rem 0;
}

.queens-spread-hint {
  font-size: 0.74rem;
  color: rgba(245, 242, 235, 0.82);
  line-height: 1.35;
}

.queens-cards-board {
  view-transition-scope: all;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.42rem;
  min-height: 122px;
  align-items: center;
  justify-items: center;
}

.queens-cards-board.mode-cut {
  grid-template-columns: 1fr;
}

.queens-cards-board.mode-wager {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.playing-card-btn {
  view-transition-name: match-element;
  width: 100%;
  max-width: 84px;
  aspect-ratio: 2.5 / 3.6;
  border-radius: 0.6rem;
  padding: 0.3rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.playing-card-btn:hover {
  transform: translateY(-4px);
}

.playing-card-btn.is-facedown {
  background:
    radial-gradient(circle at 50% 50%, rgba(217, 75, 90, 0.2), transparent 62%),
    repeating-linear-gradient(45deg, #171b28 0 6px, #10131d 6px 12px);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), inset 0 0 0 3px rgba(255, 255, 255, 0.08);
  color: var(--ruby-bright);
  align-items: center;
  justify-content: center;
}

.playing-card-btn.is-faceup {
  background: linear-gradient(165deg, #fbf7ee, #efe4ce);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.7);
}

.playing-card-btn.suit-red {
  color: #b42334;
}

.playing-card-btn.suit-dark {
  color: #171a24;
}

.playing-card-btn.has-tell {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), 0 0 14px rgba(217, 75, 90, 0.55);
}

.card-corner {
  font-weight: 800;
  font-size: 0.74rem;
  line-height: 1;
  text-align: left;
}

.card-corner.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card-queen-emblem {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}

.card-queen-crown {
  font-size: 1.25rem;
  line-height: 1;
}

.card-queen-label {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.card-back-crest {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ruby-bright);
}

.queens-spread-footer {
  margin-top: 0.6rem;
  display: flex;
  justify-content: center;
}

.queens-action-btn {
  width: 100%;
  min-height: 2.55rem;
  font-size: 0.8rem;
}

/* ==================== META ADS DEMO HUD PILL И ОКНО ПЕРЕХОДА В TG ==================== */
.meta-demo-pill {
  pointer-events: auto;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.68rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(180deg var(--in-oklab), rgba(204, 56, 72, 0.92) 0%, rgba(165, 36, 52, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 6px 18px rgba(217, 75, 90, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.14s ease, filter 0.16s ease;
}

.meta-demo-pill:hover {
  filter: brightness(1.08);
}

.meta-demo-pill:active {
  transform: scale(0.97);
}

.meta-gate-card {
  gap: 0.85rem;
}

.meta-gate-actions {
  gap: 0.55rem;
}

.btn-text-link {
  align-self: center;
  min-height: 2.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.16s ease, background-color 0.16s ease;
}

.btn-text-link:hover,
.btn-text-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

/* ==================== VIP РАННИЙ ДОСТУП И МОДАЛКА ПОДПИСКИ ==================== */
.episode-card-vip {
  border-color: rgba(214, 178, 114, 0.36);
  background:
    radial-gradient(circle at 100% 0%, rgba(214, 178, 114, 0.14), transparent 55%),
    linear-gradient(180deg, rgba(28, 30, 42, 0.94) 0%, rgba(16, 18, 26, 0.96) 100%);
}

.episode-card-vip.is-vip {
  border-color: rgba(114, 214, 152, 0.48);
  background:
    radial-gradient(circle at 100% 0%, rgba(114, 214, 152, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(20, 34, 30, 0.94) 0%, rgba(14, 20, 22, 0.96) 100%);
}

.episode-vip-badge {
  flex-shrink: 0;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(214, 178, 114, 0.14);
  border: 1px solid rgba(214, 178, 114, 0.38);
}

.episode-card-vip.is-vip .episode-vip-badge {
  color: #9ff0bf;
  background: rgba(84, 204, 134, 0.16);
  border-color: rgba(114, 214, 152, 0.45);
}

.vip-dialog-card {
  gap: 0.8rem;
}

.vip-status-pill {
  padding: 0.48rem 0.72rem;
  border-radius: 0.75rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  color: #aef4c8;
  background: rgba(44, 148, 92, 0.2);
  border: 1px solid rgba(114, 214, 152, 0.38);
}

.vip-perks-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.82rem;
  line-height: 1.42;
  color: rgba(245, 242, 235, 0.9);
}

.vip-actions {
  gap: 0.55rem;
}

/* ==================== КЛЮЧЕВЫЕ КАДРЫ АНИМАЦИЙ ==================== */
@keyframes subtleKenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.055);
  }
}

@keyframes panUpReveal {
  0% {
    transform: scale(1.09) translateY(3.2%);
  }
  100% {
    transform: scale(1.02) translateY(0%);
  }
}

@keyframes stageShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes beaconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.26);
    opacity: 0.35;
  }
}

@keyframes secretSoftGlow {
  0%,
  100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.68;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vn-dialog,
  .vn-dialog::backdrop,
  .vn-toast[popover] {
    transition-duration: 0.1s;
  }

  .hotspot-secret-layer,
  .hotspot-secret-layer.is-polaroid,
  .hotspot-secret-layer.is-mirror,
  .pattern-lock-root.is-error .pattern-lock-board,
  .pattern-lock-board.is-error {
    animation: none !important;
  }

  .hotspot-secret-layer,
  .msg-photo-btn,
  .masha-photo-tile,
  .masha-hidden-folder-card,
  .gallery-filter-btn,
  .gallery-card,
  .mirror-progress-fill,
  .polaroid-card-3d {
    transition: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
