﻿/* ==========================================
   ОСНОВНЫЕ СТИЛИ
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Philosopher", serif;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    overflow: hidden;
    background-color: #000;
    background-image: url("../img/bg.png");
    background-repeat: repeat;
    background-size: auto;
}

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body.aft-gameplay-paused #gameCanvas {
    pointer-events: none;
}

body.aft-gameplay-paused #gameCanvas *,
body.aft-gameplay-paused #gameCanvas *::before,
body.aft-gameplay-paused #gameCanvas *::after {
    animation-play-state: paused !important;
}

/* ==========================================
   ОСНОВНОЙ ИГРОВОЙ КОНТЕЙНЕР - ФИКСИРОВАННЫЙ С МАСШТАБИРОВАНИЕМ
   ========================================== */

#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
}

#gameCanvas {
    position: relative;
    flex: 0 0 1920px;
    width: 1920px;
    min-width: 1920px;
    height: 1080px;
    min-height: 1080px;
    transform-origin: center center;
    background: #000;
    will-change: transform;
}

/* ==========================================
   ЭКРАНЫ
   ========================================== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
}

#gameScreen {
    --scene-dim-duration: 180ms;
}

.screen-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    object-fit: cover;
    pointer-events: none;
    transition: filter var(--scene-dim-duration) ease;
}

#introImage:not([src]),
#introImage[src=""] {
    visibility: hidden;
}

.location-dust {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 420ms ease;
}

.location-dust.is-active {
    opacity: 1;
}

.location-dust__particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--w);
    height: var(--h);
    border-radius: var(--radius);
    opacity: 0;
    background: transparent;
    color: rgba(244, 220, 174, 0.72);
    mix-blend-mode: screen;
    transform-origin: center;
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
    animation:
        location-dust-drift var(--duration) ease-in-out infinite,
        location-dust-fade var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.location-dust__particle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(circle at 42% 38%, rgba(255, 247, 218, 0.96), rgba(245, 220, 174, 0.36) 34%, transparent 72%),
        radial-gradient(circle at 66% 63%, rgba(190, 150, 96, 0.2), transparent 58%);
    transform: rotate(var(--rotation)) scale(var(--shape-scale));
    transform-origin: center;
}

.location-dust__particle--speck::before {
    background:
        radial-gradient(circle at 38% 35%, rgba(255, 250, 225, 0.98), rgba(238, 210, 160, 0.42) 28%, transparent 68%),
        radial-gradient(circle at 70% 72%, rgba(120, 88, 48, 0.18), transparent 56%);
}

.location-dust__particle--soft::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 239, 202, 0.58), rgba(237, 208, 168, 0.18) 38%, transparent 76%);
    box-shadow: 0 0 var(--glow) rgba(246, 224, 181, 0.24);
}

.location-dust__particle--soft {
    filter: blur(var(--blur));
}

.location-dust__particle--flake::before {
    background:
        radial-gradient(ellipse at 36% 42%, rgba(255, 249, 224, 0.9), rgba(238, 211, 164, 0.34) 36%, transparent 74%),
        linear-gradient(90deg, transparent 0 22%, rgba(255, 246, 215, 0.36) 45%, transparent 72%);
}

.location-dust__particle--fiber::before {
    background:
        linear-gradient(90deg, transparent, rgba(255, 244, 211, 0.76), rgba(226, 192, 139, 0.22), transparent);
}

.location-dust__particle--glint::before {
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 236, 1), rgba(255, 227, 164, 0.54) 26%, transparent 58%),
        linear-gradient(90deg, transparent 18%, rgba(255, 247, 210, 0.5) 49%, transparent 82%),
        linear-gradient(0deg, transparent 24%, rgba(255, 247, 210, 0.38) 52%, transparent 78%);
    box-shadow:
        0 0 var(--glow) rgba(246, 224, 181, 0.3),
        0 0 var(--glow-strong) rgba(255, 238, 198, 0.1);
    animation: location-dust-shimmer var(--twinkle) ease-in-out infinite;
    animation-delay: var(--delay);
}

body.is-mobile-device .location-dust {
    display: none;
}

#gameScreen.zoom-active .location-dust {
    display: none;
}

@keyframes location-dust-drift {
    0% {
        transform: translate3d(var(--x0), var(--y0), 0) scale(0.72);
    }
    22% {
        transform: translate3d(var(--x1), var(--y1), 0) scale(0.96);
    }
    48% {
        transform: translate3d(var(--x2), var(--y2), 0) scale(1.12);
    }
    76% {
        transform: translate3d(var(--x3), var(--y3), 0) scale(0.94);
    }
    100% {
        transform: translate3d(var(--x4), var(--y4), 0) scale(1.22);
    }
}

@keyframes location-dust-fade {
    0%,
    100% {
        opacity: 0;
    }
    15%,
    78% {
        opacity: var(--alpha-soft);
    }
    34%,
    58% {
        opacity: var(--alpha);
    }
}

@keyframes location-dust-shimmer {
    0%,
    100% {
        filter: brightness(0.82);
    }
    47% {
        filter: brightness(var(--brightness));
    }
}

/* ==========================================
   ЭКРАН ЗАГРУЗКИ
   ========================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    gap: 30px;
}

.loading-screen.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: #e8d5b7;
    font-size: 28px;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   ГЛАВНОЕ МЕНЮ - КНОПКИ ЗАФИКСИРОВАНЫ
   ========================================== */

.menu-button {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.menu-button:hover {
    transform: scale(0.97);
    filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.4));
}

.menu-button:active {
    transform: scale(0.95);
}

.menu-button.is-dimmed {
    filter: brightness(0.52) saturate(0.84);
    pointer-events: none;
}

/* Фиксированные позиции кнопок меню */
#btnContinue {
    left: 773px;
    top: 579px;
}

#btnStartGame {
    left: 773px;
    top: 681px;
}

#btnSettings {
    left: 773px;
    top: 783px;
}

/* Анимация появления меню */
#mainMenu.fade-in {
    animation: fadeIn 1s ease-out;
}

#mainMenu.fade-in .menu-button {
    animation: fadeInScale 0.6s ease-out;
}

#mainMenu.fade-in #btnContinue {
    animation-delay: 0.1s;
}

#mainMenu.fade-in #btnStartGame {
    animation-delay: 0.2s;
}

#mainMenu.fade-in #btnSettings {
    animation-delay: 0.3s;
}

#mainMenu.is-dimmed .screen-bg,
#mainMenu.is-dimmed .menu-button {
    filter: brightness(0.52) saturate(0.84);
}

#mainMenu.is-dimmed .menu-button {
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ==========================================
   ИГРА
   ========================================== */

.clickable-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
    z-index: 20;
    transition: filter var(--scene-dim-duration) ease;
}

.clickable-svg polygon {
    fill: rgba(255, 255, 255, 0);
    stroke: none;
    cursor: pointer;
    pointer-events: all;
    transition: fill 0.2s ease;
}

/* ==========================================
   ИНВЕНТАРЬ - 8 ЯЧЕЕК (4x2) - ЗАФИКСИРОВАН
   ========================================== */

.inventory {
    position: absolute;
    top: 24px;
    left: 24px;
    display: grid;
    grid-template-columns: repeat(4, 110px);
    grid-template-rows: repeat(2, 110px);
    gap: 12px;
    z-index: 400;
}

.inventory-slot {
    width: 110px;
    height: 110px;
    background: rgba(20, 20, 20, 0.85);
    border: 3px solid rgba(100, 80, 60, 0.7);
    border-radius: 10px;
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.8),
        0 4px 18px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.inventory-slot:hover {
    border-color: rgba(150, 120, 80, 0.9);
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.8),
        0 4px 22px rgba(100, 80, 60, 0.5);
    transform: scale(1.05);
}

.inventory-slot.is-selected {
    border-color: rgba(212, 175, 55, 0.95);
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.8),
        0 0 0 2px rgba(212, 175, 55, 0.2),
        0 8px 26px rgba(212, 175, 55, 0.35);
}

.inventory-slot.is-feedback-error {
    border-color: rgba(255, 81, 72, 0.96);
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.8),
        0 0 0 3px rgba(255, 81, 72, 0.32),
        0 8px 28px rgba(255, 81, 72, 0.36);
}

.inventory-slot.is-feedback-success {
    border-color: rgba(92, 224, 118, 0.96);
    box-shadow:
        inset 0 2px 12px rgba(0, 0, 0, 0.8),
        0 0 0 3px rgba(92, 224, 118, 0.34),
        0 8px 28px rgba(92, 224, 118, 0.36);
}

.inventory-slot::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
}

.inventory-slot img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.9));
    pointer-events: none;
}

.inventory-tooltip {
    position: absolute;
    top: 272px;
    left: 24px;
    width: 476px;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0.18s;
    z-index: 405;
}

.inventory-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition-delay: 0s, 0s, 0s;
}

.inventory-tooltip__text {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    max-width: 100%;
    padding: 12px 26px;
    color: #f1e7d4;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.4px;
    text-align: center;
    white-space: nowrap;
    background: linear-gradient(
        180deg,
        rgba(27, 23, 20, 0.95),
        rgba(13, 11, 10, 0.98)
    );
    border-radius: 8px;
    box-shadow:
        0 0 0 1px rgba(174, 142, 93, 0.38),
        0 8px 24px rgba(0, 0, 0, 0.34);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}

.inventory-tooltip__text::before,
.inventory-tooltip__text::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(214, 180, 122, 0.5);
    border-left: 1px solid rgba(214, 180, 122, 0.5);
    background: rgba(18, 15, 12, 0.96);
}

.inventory-tooltip__text::before {
    left: -7px;
    transform: translateY(-50%) rotate(-45deg);
}

.inventory-tooltip__text::after {
    right: -7px;
    transform: translateY(-50%) rotate(135deg);
}

.inventory-toggle-button {
    display: none;
}

.mobile-selection-indicator {
    display: none;
}

.mobile-selection-indicator[hidden] {
    display: none !important;
}

/* ==========================================
   HUD КНОПКИ - ЗАФИКСИРОВАНЫ В ПРАВОМ ВЕРХНЕМ УГЛУ
   ========================================== */

.hud-button {
    position: absolute;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-drag: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
    z-index: 400;
}

.hud-button:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 6px 16px rgba(212, 175, 55, 0.4));
}

.hud-button:active {
    transform: scale(1.02);
}

/* Фиксированные позиции HUD кнопок */
#btnAdvice {
    left: 1628px;
    top: 24px;
}

#btnGameSettings {
    left: 1771px;
    top: 24px;
}

/* ==========================================
   ТЕКСТОВОЕ ОКНО
   ========================================== */

.text-box {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 1400px;
    min-height: 120px;
    padding: 25px 40px;
    background: #1a140f;
    border-top: 12px solid #0a0705;
    border-bottom: 12px solid #0a0705;
    border-left: 18px solid #0a0705;
    border-right: 18px solid #0a0705;
    box-shadow:
        inset 0 10px 35px rgba(0, 0, 0, 0.8),
        inset 0 -10px 35px rgba(0, 0, 0, 0.8),
        0 10px 45px rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 400;
    cursor: pointer;
}

.text-box.visible {
    opacity: 1;
    pointer-events: auto;
}

.text-content {
    font-size: 26px;
    font-weight: 700;
    color: #d9cbb8;
    line-height: 1.5;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.95);
    letter-spacing: 0.5px;
}

/* ==========================================
   ПРЕДМЕТЫ НА ЛОКАЦИИ
   ========================================== */

#locationObjects {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    pointer-events: none;
    z-index: 30;
    transition: filter var(--scene-dim-duration) ease;
}

.location-object {
    position: absolute;
    cursor: pointer;
    filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.6));
    pointer-events: auto;
}

/* ==========================================
   ОВЕРЛЕЙ ЗУМА
   ========================================== */

.zoom-overlay {
    --zoom-overlay-duration: 180ms;
    --zoom-scale-duration: 220ms;
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity var(--zoom-overlay-duration) ease,
        background-color var(--zoom-overlay-duration) ease;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-overlay.active {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    pointer-events: auto;
}

/* Затемнение локации при зуме с прозрачностью */
#gameScreen.zoom-active #locationImage {
    filter: brightness(0.4);
}

#gameScreen.zoom-active #clickableAreas {
    filter: brightness(0.4);
}

#gameScreen.zoom-active #locationObjects {
    filter: brightness(0.4);
}

.zoom-container {
    position: relative;
    flex: 0 0 auto;
    transform: scale(0.8);
    opacity: 0;
    transition:
        transform var(--zoom-scale-duration) cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity var(--zoom-scale-duration) ease;
}

.zoom-container.is-loading {
    visibility: hidden;
    opacity: 0 !important;
}

.zoom-overlay.active .zoom-container {
    transform: scale(1);
    opacity: 1;
}

.zoom-image {
    display: block;
    max-width: 1728px; /* 90% от 1920 */
    max-height: 972px; /* 90% от 1080 */
    filter: drop-shadow(0 10px 50px rgba(0, 0, 0, 0.9));
    border-radius: 8px;
}

#zoomObjects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#zoomClickableAreas,
#zoomObjects {
    transform-origin: top left;
}

#zoomObjects .location-object {
    pointer-events: auto;
}

.close-zoom-button {
    position: absolute;
    top: 45px;
    right: 335px;
    width: 70px;
    height: 70px;
    background: rgba(20, 20, 20, 0.85);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 401;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.zoom-overlay.active .close-zoom-button {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.2s;
}

.close-zoom-button:hover {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(212, 175, 55, 0.7);
    transform: scale(1.12) rotate(90deg);
}

.close-zoom-button:active {
    transform: scale(1) rotate(90deg);
}

/* ==========================================
   ОВЕРЛЕЙ ЗАТЕМНЕНИЯ
   ========================================== */

.fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
    z-index: 500;
}

.fade-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1920px;
    height: 1080px;
    background: rgba(0, 0, 0, 0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    z-index: 900;
}

.ad-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ad-overlay[hidden] {
    display: none !important;
}

.ad-overlay__spinner {
    width: 64px;
    height: 64px;
    border: 6px solid rgba(255, 255, 255, 0.18);
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

/* ==========================================
   ГОЛОВОЛОМКА С ЖИВОТНЫМИ
   ========================================== */

.puzzle-animal {
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    object-fit: contain;
}

.puzzle-animal-min {
    pointer-events: auto !important;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    object-fit: contain;
}

/* ==========================================
   INTRO
   ========================================== */

.vn-text-box {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    min-width: 800px;
    max-width: 1400px;
    padding: 28px 48px 32px;
    background:
        linear-gradient(rgba(40, 30, 20, 0.15), rgba(40, 30, 20, 0.5)),
        rgba(30, 20, 12, 0.94);
    border-radius: 12px;
    box-shadow:
        0 0 0 2px rgba(160, 120, 80, 0.6),
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        0 20px 60px rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 200;
}

.vn-text-box.visible {
    opacity: 1;
    pointer-events: auto;
}

.vn-text-box::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    pointer-events: none;
}

.vn-text {
    width: auto;
    max-width: 1200px;
    font-family: "Philosopher", serif;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    color: #f5e6d3;
    text-shadow:
        2px 2px 10px rgba(0, 0, 0, 1),
        0 0 20px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

.vn-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    width: 100%;
    margin-top: 20px;
}

.vn-skip-button {
    position: relative;
    padding: 8px 18px;
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 999px;
    background: rgba(82, 58, 36, 0.28);
    font-family: "Philosopher", serif;
    font-size: 17px;
    font-weight: 700;
    color: rgba(245, 230, 211, 0.88);
    text-shadow:
        1px 1px 6px rgba(0, 0, 0, 0.9),
        0 0 14px rgba(0, 0, 0, 0.5);
    box-shadow:
        inset 0 0 0 1px rgba(255, 244, 214, 0.05),
        0 8px 18px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.vn-skip-button:hover,
.vn-skip-button:focus-visible {
    border-color: rgba(212, 175, 55, 0.56);
    background: rgba(110, 82, 48, 0.38);
    color: #fff0cf;
    box-shadow:
        inset 0 0 0 1px rgba(255, 244, 214, 0.08),
        0 10px 22px rgba(0, 0, 0, 0.26);
    transform: translateY(-1px);
}

.vn-skip-button:focus-visible {
    outline: 1px solid rgba(244, 224, 187, 0.9);
    outline-offset: 2px;
}

.vn-continue {
    font-family: "Philosopher", serif;
    font-size: 19px;
    font-weight: 700;
    color: #d4af37;
    text-shadow:
        2px 2px 8px rgba(0, 0, 0, 0.95),
        0 0 20px rgba(212, 175, 55, 0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.vn-continue.visible {
    opacity: 1;
    animation: vn-pulse 2s ease-in-out infinite;
}

@keyframes vn-pulse {
    0%,
    100% {
        opacity: 0.65;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

/* ==========================================
   MENU MODAL
   ========================================== */

.menu-modal-layer {
    position: absolute;
    inset: 0;
    z-index: 900;
    pointer-events: auto;
}

.menu-modal-layer[hidden] {
    display: none;
}

.menu-modal-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    background: radial-gradient(
        circle at center,
        rgba(20, 15, 10, 0.22),
        rgba(2, 2, 2, 0.82)
    );
    backdrop-filter: blur(4px);
    animation: menu-modal-backdrop-in 0.24s ease;
}

.menu-modal {
    position: absolute;
    display: grid;
    gap: 0;
    width: 430px;
    padding: 24px;
    border: 1px solid rgba(231, 190, 122, 0.24);
    border-radius: 8px;
    background: rgba(20, 16, 14, 0.78);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(8px);
    overflow: hidden;
    pointer-events: auto;
    animation: menu-modal-in 0.2s ease both;
}

.menu-modal--hint {
    width: 720px;
    padding: 34px;
}

.menu-modal:focus {
    outline: none;
}

.menu-modal__content {
    position: relative;
    padding: 0;
    animation: menu-modal-content-in 0.34s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.menu-modal__content::before {
    display: none;
}

.menu-modal__kicker {
    position: relative;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(242, 201, 132, 0.78);
}

.menu-modal__kicker[hidden] {
    display: none;
}

.menu-modal__title {
    position: relative;
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.06;
    color: #f9e7c1;
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.menu-modal__text {
    position: relative;
    margin: 9px 0 0;
    font-size: 17px;
    line-height: 1.38;
    color: rgba(246, 232, 205, 0.68);
}

.menu-modal__actions {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
    padding: 0;
    animation: menu-modal-actions-in 0.28s ease 0.08s both;
}

.menu-modal__button {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 7px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: "Philosopher", serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.menu-modal__button:hover {
    transform: translateY(-1px);
}

.menu-modal__button:active {
    transform: scale(0.985);
}

.menu-modal__button--primary {
    background: linear-gradient(180deg, #ecc173, #9a642d);
    color: #21130b;
    box-shadow:
        inset 0 1px 0 rgba(255, 249, 239, 0.42),
        0 10px 20px rgba(0, 0, 0, 0.18);
}

.menu-modal__button--primary:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 249, 239, 0.4),
        0 12px 24px rgba(0, 0, 0, 0.24);
}

.menu-modal__button--ghost {
    background: rgba(255, 244, 220, 0.08);
    color: #fae6c2;
    border-color: rgba(231, 190, 122, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 244, 220, 0.08);
}

.menu-modal__button--ghost:hover {
    background: rgba(255, 244, 220, 0.13);
    border-color: rgba(231, 190, 122, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 244, 220, 0.12);
}

.menu-modal--hint .menu-modal__title {
    font-size: 38px;
    line-height: 1.08;
}

.menu-modal--hint .menu-modal__text {
    margin-top: 12px;
    font-size: 22px;
    line-height: 1.42;
}

.menu-modal--hint .menu-modal__actions {
    gap: 12px;
    margin-top: 22px;
}

.menu-modal--hint .menu-modal__button {
    min-height: 56px;
    font-size: 20px;
}

/* ==========================================
   SETTINGS MODAL
   ========================================== */

.settings-modal-layer {
    position: absolute;
    inset: 0;
    z-index: 930;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: auto;
}

.settings-modal-layer[hidden] {
    display: none;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(20, 15, 10, 0.22), rgba(2, 2, 2, 0.82)),
        rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(4px);
    animation: menu-modal-backdrop-in 0.24s ease;
}

.settings-modal {
    position: relative;
    width: min(620px, 100%);
    padding: 30px;
    border: 1px solid rgba(231, 190, 122, 0.28);
    border-radius: 8px;
    background: rgba(20, 16, 14, 0.84);
    box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 236, 202, 0.08);
    backdrop-filter: blur(9px);
    overflow: hidden;
    pointer-events: auto;
    animation: menu-modal-in 0.2s ease both;
}

.settings-modal:focus {
    outline: none;
}

.settings-modal__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.settings-modal__kicker {
    margin: 0 0 8px;
    color: rgba(242, 201, 132, 0.78);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.settings-modal__title {
    margin: 0;
    color: #f9e7c1;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.06;
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
}

.settings-modal__close {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(231, 190, 122, 0.28);
    border-radius: 8px;
    background: rgba(255, 244, 220, 0.07);
    color: #f8e3bb;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.settings-modal__close:hover,
.settings-modal__close:focus-visible {
    border-color: rgba(231, 190, 122, 0.54);
    background: rgba(255, 244, 220, 0.12);
    outline: none;
}

.settings-modal__close:active {
    transform: scale(0.96);
}

.settings-modal__close svg {
    width: 21px;
    height: 21px;
}

.settings-modal__list {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(231, 190, 122, 0.14);
    border-bottom: 1px solid rgba(231, 190, 122, 0.14);
}

.settings-modal__row {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 2px;
    border-bottom: 1px solid rgba(231, 190, 122, 0.12);
}

.settings-modal__row:last-child {
    border-bottom: 0;
}

.settings-modal__copy {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.settings-modal__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffd88c;
}

.settings-modal__icon svg {
    width: 22px;
    height: 22px;
}

.settings-modal__row-title {
    margin: 0;
    color: #f7e8cc;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
}

.settings-modal__switch {
    position: relative;
    width: 64px;
    height: 36px;
    flex: 0 0 auto;
    border: 1px solid rgba(231, 190, 122, 0.25);
    border-radius: 999px;
    background: rgba(255, 244, 220, 0.08);
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.settings-modal__switch::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e9d7bd;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.18s ease,
        background 0.18s ease;
}

.settings-modal__switch[aria-checked="true"] {
    border-color: rgba(255, 219, 151, 0.72);
    background: linear-gradient(180deg, #e7bd72, #8c5d2b);
    box-shadow: 0 0 0 1px rgba(231, 190, 122, 0.18);
}

.settings-modal__switch[aria-checked="true"]::after {
    transform: translateX(28px);
    background: #24150c;
}

.settings-modal__switch:focus-visible,
.settings-modal__segment button:focus-visible {
    outline: 2px solid rgba(255, 216, 140, 0.72);
    outline-offset: 2px;
}

.settings-modal__segment {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(82px, 1fr));
    gap: 4px;
    flex: 0 0 auto;
    padding: 4px;
    border: 1px solid rgba(231, 190, 122, 0.22);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.24);
}

.settings-modal__segment button {
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(248, 232, 204, 0.68);
    cursor: pointer;
    font-family: "Philosopher", serif;
    font-weight: 700;
    line-height: 1;
}

.settings-modal__segment button.is-active {
    color: #21150c;
    background: linear-gradient(180deg, #f2ce8c, #bb8242);
}

.mobile-ui-layer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    pointer-events: none;
    display: none;
}

.mobile-ui-host {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;
}

.inventory-toggle-button[hidden],
.mobile-selection-indicator[hidden],
.mobile-zoom-inventory-backdrop[hidden] {
    display: none !important;
}

.mobile-orientation-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: calc(var(--safe-area-top) + 24px)
        calc(var(--safe-area-right) + 24px) calc(var(--safe-area-bottom) + 24px)
        calc(var(--safe-area-left) + 24px);
    background:
        radial-gradient(
            circle at top,
            rgba(128, 84, 32, 0.28),
            transparent 42%
        ),
        linear-gradient(180deg, rgba(17, 12, 9, 0.98), rgba(4, 4, 4, 0.99));
    text-align: center;
}

.mobile-orientation-overlay__content {
    width: min(100%, 420px);
    max-width: 420px;
    padding: 28px 24px;
    border-radius: 24px;
    background: rgba(19, 14, 10, 0.9);
    box-shadow:
        0 18px 46px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(214, 171, 104, 0.28);
}

.mobile-orientation-overlay__icon {
    font-size: 54px;
    line-height: 1;
    color: #f0c98a;
}

.mobile-orientation-overlay__title {
    margin-top: 18px;
    font-size: clamp(28px, 8vw, 32px);
    color: #f7e7c5;
    overflow-wrap: anywhere;
}

.mobile-orientation-overlay__text {
    margin-top: 12px;
    font-size: clamp(18px, 5vw, 20px);
    line-height: 1.5;
    color: rgba(244, 226, 194, 0.84);
    overflow-wrap: anywhere;
}

@keyframes menu-modal-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes menu-modal-content-in {
    from {
        opacity: 0;
        filter: blur(6px);
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes menu-modal-actions-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes menu-modal-backdrop-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 1400px) {
    .vn-text-box {
        max-width: 90%;
        padding: 24px 40px 28px;
    }

    .vn-text {
        font-size: 26px;
    }

    .vn-continue {
        font-size: 17px;
    }

    .vn-skip-button {
        font-size: 16px;
        padding: 8px 16px;
    }
}

@media (max-width: 800px) {
    .vn-text-box {
        min-width: 85%;
        padding: 20px 32px 24px;
        bottom: 40px;
    }

    .vn-text {
        font-size: 22px;
        line-height: 1.6;
    }

    .vn-actions {
        gap: 10px 16px;
        margin-top: 16px;
    }

    .vn-continue {
        font-size: 15px;
    }

    .vn-skip-button {
        font-size: 14px;
        padding: 7px 14px;
    }

    .menu-modal {
        width: min(90vw, 400px);
        padding: 22px;
    }

    .menu-modal--hint {
        width: min(92vw, 680px);
        padding: 32px;
    }

    .menu-modal__title {
        font-size: 28px;
    }

    .menu-modal__text {
        font-size: 16px;
    }

    .menu-modal__actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mobile-orientation-overlay {
        padding: 16px;
    }

    .mobile-orientation-overlay__content {
        width: calc(100vw - 24px);
        max-width: 320px;
        padding: 24px 18px;
    }

    .mobile-orientation-overlay__title {
        font-size: clamp(20px, 7vw, 24px);
        line-height: 1.2;
    }

    .mobile-orientation-overlay__text {
        font-size: clamp(14px, 4.4vw, 16px);
        line-height: 1.45;
    }
}

body.is-mobile-device .mobile-ui-layer {
    display: block;
}

body.is-mobile-device #mobileOverlayHost {
    display: block;
}

body.is-mobile-portrait .mobile-orientation-overlay {
    display: flex;
}

body.is-mobile-landscape {
    --mobile-edge-offset: clamp(8px, 1.4vw, 12px);
    --mobile-scene-left-inset: var(--safe-area-left);
    --mobile-scene-top-inset: var(--safe-area-top);
    --mobile-scene-right-inset: var(--safe-area-right);
    --mobile-scene-bottom-inset: var(--safe-area-bottom);
    --mobile-scene-width: calc(
        100vw - var(--safe-area-left) - var(--safe-area-right)
    );
    --mobile-scene-height: calc(
        100vh - var(--safe-area-top) - var(--safe-area-bottom)
    );
    --mobile-scene-toolbar-top: calc(
        var(--mobile-scene-top-inset) + var(--mobile-edge-offset)
    );
    --mobile-scene-left-edge: calc(
        var(--mobile-scene-left-inset) + var(--mobile-edge-offset)
    );
    --mobile-scene-right-edge: calc(
        var(--mobile-scene-right-inset) + var(--mobile-edge-offset)
    );
    --mobile-bottom-edge: calc(
        var(--safe-area-bottom) + var(--mobile-edge-offset)
    );
    --mobile-toolbar-button-size: clamp(52px, 6vw, 58px);
    --mobile-toolbar-button-gap: clamp(8px, 1.3vw, 12px);
    --mobile-inventory-toggle-height: clamp(48px, 5.8vw, 54px);
    --mobile-selection-status-gap: 6px;
    --mobile-slot-size: clamp(54px, 8.2vh, 70px);
    --mobile-slot-gap: clamp(8px, 1.2vw, 10px);
    --mobile-inventory-top: calc(
        var(--mobile-scene-toolbar-top) +
            var(--mobile-inventory-toggle-height) +
            var(--mobile-selection-status-gap)
    );
    --mobile-inventory-width: min(
        calc(
            (var(--mobile-slot-size) * 4) + (var(--mobile-slot-gap) * 3) + 32px
        ),
        calc(var(--mobile-scene-width) - (var(--mobile-edge-offset) * 2))
    );
    --mobile-scene-settings-left: calc(
        var(--mobile-scene-left-inset) + var(--mobile-scene-width) -
            var(--mobile-edge-offset) - var(--mobile-toolbar-button-size)
    );
    --mobile-scene-advice-left: calc(
        var(--mobile-scene-settings-left) - var(--mobile-toolbar-button-size) -
            var(--mobile-toolbar-button-gap)
    );
}

body.is-mobile-landscape .clickable-svg polygon {
    stroke: rgba(255, 255, 255, 0.001);
    stroke-width: 24px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

body.is-mobile-landscape .location-object {
    -webkit-user-drag: none;
    touch-action: none;
}

body.is-mobile-landscape #mobileMenuHost {
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    padding: calc(var(--safe-area-top) + 20px)
        calc(var(--safe-area-right) + 16px) calc(var(--safe-area-bottom) + 16px)
        calc(var(--safe-area-left) + 16px);
}

body.is-mobile-landscape[data-active-screen="intro"] #mobileIntroHost,
body.is-mobile-landscape[data-active-screen="game"] #mobileHudHost,
body.is-mobile-landscape[data-active-screen="game"] #mobileInventoryHost,
body.is-mobile-landscape[data-active-screen="game"] #mobileDialogueHost {
    display: block;
}

body.is-mobile-landscape[data-active-screen="game"][data-scene-mode="transitioning"]
    #mobileHudHost,
body.is-mobile-landscape[data-active-screen="game"][data-scene-mode="transitioning"]
    #mobileInventoryHost {
    display: none;
}

body.is-mobile-landscape[data-active-screen="menu"] #mobileMenuHost {
    display: flex;
}

body.is-mobile-landscape #mainMenu {
    --mobile-menu-button-width: 500px;
    --mobile-menu-button-left: 710px;
    --mobile-menu-button-top: 568px;
    --mobile-menu-button-gap: 124px;
}

body.is-mobile-landscape #mainMenu .menu-button {
    width: var(--mobile-menu-button-width);
    height: auto;
    transform-origin: center center;
}

body.is-mobile-landscape #mainMenu #btnContinue {
    left: var(--mobile-menu-button-left);
    top: var(--mobile-menu-button-top);
}

body.is-mobile-landscape #mainMenu #btnStartGame {
    left: var(--mobile-menu-button-left);
    top: calc(var(--mobile-menu-button-top) + var(--mobile-menu-button-gap));
}

body.is-mobile-landscape #mainMenu #btnSettings {
    left: var(--mobile-menu-button-left);
    top: calc(
        var(--mobile-menu-button-top) + (var(--mobile-menu-button-gap) * 2)
    );
}

body.is-mobile-landscape #mobileMenuHost .menu-button {
    position: static;
    width: clamp(184px, 30vw, 280px);
    max-width: 280px;
    height: auto;
    pointer-events: auto;
}

body.is-mobile-landscape #mobileMenuHost #btnContinue,
body.is-mobile-landscape #mobileMenuHost #btnStartGame,
body.is-mobile-landscape #mobileMenuHost #btnSettings {
    left: auto;
    top: auto;
}

body.is-mobile-landscape #mobileIntroHost {
    padding: calc(var(--safe-area-top) + 14px)
        calc(var(--safe-area-right) + 16px) calc(var(--safe-area-bottom) + 14px)
        calc(var(--safe-area-left) + 16px);
}

body.is-mobile-landscape .vn-text-box {
    position: absolute;
    left: 50%;
    bottom: var(--mobile-bottom-edge);
    transform: none;
    width: min(80vw, 640px);
    min-width: 0;
    max-width: none;
    padding: 14px 18px 16px;
}

body.is-mobile-landscape .vn-text-box::before {
    inset: 10px;
}

body.is-mobile-landscape .vn-text {
    max-width: none;
    font-size: clamp(16px, 1.75vw, 19px);
    line-height: 1.28;
    letter-spacing: 0;
}

body.is-mobile-landscape .vn-actions {
    gap: 8px 12px;
    margin-top: 9px;
}

body.is-mobile-landscape .vn-continue {
    font-size: clamp(10px, 1.15vw, 12px);
    text-align: right;
    white-space: nowrap;
}

body.is-mobile-landscape .vn-skip-button {
    padding: 5px 12px;
    font-size: 13px;
}

body.is-mobile-landscape .inventory-toggle-button {
    position: absolute;
    top: var(--mobile-scene-toolbar-top);
    left: var(--mobile-scene-left-edge);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--mobile-inventory-toggle-height);
    min-width: 0;
    height: var(--mobile-inventory-toggle-height);
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #f4e0bb;
    touch-action: manipulation;
    pointer-events: auto;
    overflow: visible;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}

body.is-mobile-landscape .inventory-toggle-button--zoom {
    z-index: 360;
}

body.is-mobile-landscape .inventory-toggle-button__icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

body.is-mobile-landscape .inventory-toggle-button__close-hint {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(242, 204, 140, 0.72);
    border-radius: 50%;
    background: rgba(18, 14, 11, 0.96);
    color: #f7e6c7;
    opacity: 0;
    transform: scale(0.72);
    transform-origin: center;
    transition:
        opacity 0.14s ease,
        transform 0.14s ease;
    pointer-events: none;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 244, 220, 0.16);
}

body.is-mobile-landscape .inventory-toggle-button__close-icon {
    width: 15px;
    height: 15px;
}

body.is-mobile-landscape .inventory-toggle-button.is-active {
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.52),
        0 0 0 2px rgba(236, 194, 116, 0.2);
}

body.is-mobile-landscape
    .inventory-toggle-button.is-active
    .inventory-toggle-button__icon {
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 8px rgba(236, 194, 116, 0.36));
}

body.is-mobile-landscape
    .inventory-toggle-button.is-active
    .inventory-toggle-button__close-hint {
    opacity: 1;
    transform: scale(1);
}

body.is-mobile-landscape .mobile-selection-indicator {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(
        var(--mobile-scene-width) - (var(--mobile-edge-offset) * 2)
    );
    min-height: 46px;
    padding: 6px 8px;
    border: 1px solid rgba(224, 186, 126, 0.34);
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        rgba(30, 23, 17, 0.98),
        rgba(10, 9, 8, 0.98)
    );
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 244, 220, 0.12);
    pointer-events: auto;
    z-index: 2;
}

body.is-mobile-landscape .mobile-selection-indicator--zoom {
    z-index: 360;
}

body.is-mobile-landscape .mobile-selection-indicator.is-feedback {
    border-width: 3px;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 244, 220, 0.14);
}

body.is-mobile-landscape .mobile-selection-indicator.is-feedback-error {
    border-color: rgba(224, 69, 57, 0.9);
    background: linear-gradient(
        180deg,
        rgba(54, 20, 17, 0.98),
        rgba(18, 9, 8, 0.98)
    );
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.42),
        0 0 0 2px rgba(224, 69, 57, 0.34),
        0 0 20px rgba(224, 69, 57, 0.34),
        inset 0 1px 0 rgba(255, 244, 220, 0.14);
}

body.is-mobile-landscape .mobile-selection-indicator.is-feedback-success {
    border-color: rgba(88, 194, 103, 0.95);
    background: linear-gradient(
        180deg,
        rgba(22, 51, 27, 0.98),
        rgba(8, 19, 11, 0.98)
    );
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.42),
        0 0 0 2px rgba(88, 194, 103, 0.36),
        0 0 22px rgba(88, 194, 103, 0.36),
        inset 0 1px 0 rgba(255, 244, 220, 0.14);
}

body.is-mobile-landscape
    .mobile-selection-indicator.is-feedback
    .mobile-selection-indicator__text {
    color: #fff2cf;
    font-size: 15px;
}

body.is-mobile-landscape .mobile-selection-indicator__content {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

body.is-mobile-landscape .mobile-selection-indicator__image {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.9));
}

body.is-mobile-landscape .mobile-selection-indicator__text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

body.is-mobile-landscape .mobile-selection-indicator__clear {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border: 1px solid rgba(228, 193, 134, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: #f7e6c7;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

body.is-mobile-landscape .mobile-zoom-inventory-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    border: none;
    padding: 0;
    background: transparent;
    pointer-events: auto;
    z-index: 340;
}

body.is-mobile-landscape #btnAdvice,
body.is-mobile-landscape #btnGameSettings {
    top: var(--mobile-scene-toolbar-top);
    width: var(--mobile-toolbar-button-size);
    height: var(--mobile-toolbar-button-size);
    pointer-events: auto;
}

body.is-mobile-landscape #btnAdvice {
    left: var(--mobile-scene-advice-left);
    right: auto;
}

body.is-mobile-landscape #btnGameSettings {
    left: var(--mobile-scene-settings-left);
    right: auto;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"] #btnGameSettings {
    display: none;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"] #btnAdvice {
    top: calc(var(--safe-area-top) + var(--mobile-edge-offset));
    left: auto;
    right: calc(
        var(--safe-area-right) + var(--mobile-edge-offset) +
            var(--mobile-toolbar-button-size) + var(--mobile-toolbar-button-gap)
    );
}

body.is-mobile-landscape[data-mobile-zoom-active="true"] #inventoryToggleButton,
body.is-mobile-landscape[data-mobile-zoom-active="true"] #inventoryTooltip {
    display: none;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"]
    .mobile-selection-indicator--status {
    display: none;
}

body.is-mobile-landscape #inventory {
    position: absolute;
    top: var(--mobile-inventory-top);
    left: var(--mobile-scene-left-edge);
    width: var(--mobile-inventory-width);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: var(--mobile-slot-gap);
    padding: 12px;
    background: linear-gradient(
        180deg,
        rgba(24, 18, 13, 0.96),
        rgba(8, 7, 6, 0.96)
    );
    border-radius: 18px;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(194, 154, 101, 0.2);
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
    z-index: 1;
}

body.is-mobile-landscape #inventory.inventory--mobile-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"] #inventory {
    top: auto;
    width: min(
        560px,
        calc(var(--mobile-scene-width) - (var(--mobile-edge-offset) * 2))
    );
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(
        180deg,
        rgba(18, 15, 13, 0.98),
        rgba(7, 6, 6, 0.98)
    );
    box-shadow:
        0 22px 54px rgba(0, 0, 0, 0.56),
        0 0 0 1px rgba(210, 169, 113, 0.22);
    transform: translateY(24px) scale(0.96);
    z-index: 350;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"]
    #inventory.inventory--mobile-zoom-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

body.is-mobile-landscape .inventory-slot {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-width: 2px;
    border-radius: 16px;
}

body.is-mobile-landscape .inventory-slot:hover {
    transform: none;
}

body.is-mobile-landscape[data-mobile-zoom-active="true"] .inventory-slot {
    border-radius: 18px;
}

body.is-mobile-landscape #inventoryTooltip {
    position: absolute;
    top: calc(
        var(--mobile-inventory-top) + (var(--mobile-slot-size) * 2) +
            var(--mobile-slot-gap) + 20px
    );
    left: var(--mobile-scene-left-edge);
    width: var(--mobile-inventory-width);
    min-height: 0;
    justify-content: flex-start;
    padding: 0;
}

body.is-mobile-landscape .inventory-tooltip__text {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    font-size: 15px;
    white-space: normal;
}

body.is-mobile-landscape .inventory-tooltip__text::before,
body.is-mobile-landscape .inventory-tooltip__text::after {
    display: none;
}

body.is-mobile-landscape #textBox {
    transform: none;
    min-height: 0;
    padding: 12px 16px 14px;
    border-top-width: 6px;
    border-right-width: 10px;
    border-bottom-width: 6px;
    border-left-width: 10px;
    overflow-y: auto;
}

body.is-mobile-landscape .text-content {
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.36;
    letter-spacing: 0;
}

body.is-mobile-landscape #menuModalLayer,
body.is-mobile-landscape #settingsModalLayer,
body.is-mobile-landscape #zoomOverlay {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
}

body.is-mobile-landscape .menu-modal {
    width: min(92vw, 500px);
    padding: 22px;
}

body.is-mobile-landscape .menu-modal--hint {
    width: min(92vw, 520px);
}

body.is-mobile-landscape .menu-modal__content {
    padding: 0;
}

body.is-mobile-landscape .menu-modal__title {
    font-size: clamp(28px, 3.6vw, 32px);
}

body.is-mobile-landscape .menu-modal__text {
    font-size: clamp(17px, 2.1vw, 19px);
}

body.is-mobile-landscape .menu-modal__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.is-mobile-landscape .menu-modal__button {
    min-height: 46px;
    font-size: 17px;
}

body.is-mobile-landscape .settings-modal-layer {
    padding: calc(var(--safe-area-top) + 8px)
        calc(var(--safe-area-right) + 12px)
        calc(var(--safe-area-bottom) + 8px)
        calc(var(--safe-area-left) + 12px);
}

body.is-mobile-landscape .settings-modal {
    width: min(88vw, 500px);
    max-height: calc(100vh - var(--safe-area-top) - var(--safe-area-bottom) - 16px);
    padding: 14px 16px;
    overflow: hidden;
}

body.is-mobile-landscape .settings-modal__top {
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

body.is-mobile-landscape .settings-modal__kicker {
    margin-bottom: 4px;
    font-size: 11px;
}

body.is-mobile-landscape .settings-modal__title {
    font-size: clamp(22px, 3.1vw, 26px);
}

body.is-mobile-landscape .settings-modal__close {
    width: 36px;
    height: 36px;
}

body.is-mobile-landscape .settings-modal__close svg {
    width: 18px;
    height: 18px;
}

body.is-mobile-landscape .settings-modal__row {
    min-height: 50px;
    gap: 12px;
    padding: 5px 0;
}

body.is-mobile-landscape .settings-modal__copy {
    gap: 10px;
}

body.is-mobile-landscape .settings-modal__icon {
    width: 34px;
    height: 34px;
}

body.is-mobile-landscape .settings-modal__icon svg {
    width: 18px;
    height: 18px;
}

body.is-mobile-landscape .settings-modal__row-title {
    font-size: clamp(16px, 2vw, 18px);
}

body.is-mobile-landscape .settings-modal__switch {
    width: 54px;
    height: 30px;
}

body.is-mobile-landscape .settings-modal__switch::after {
    width: 22px;
    height: 22px;
    top: 3px;
    left: 3px;
}

body.is-mobile-landscape .settings-modal__switch[aria-checked="true"]::after {
    transform: translateX(24px);
}

body.is-mobile-landscape .settings-modal__segment {
    grid-template-columns: repeat(2, minmax(68px, 1fr));
    padding: 3px;
}

body.is-mobile-landscape .settings-modal__segment button {
    min-height: 30px;
    font-size: 15px;
}

body.is-mobile-landscape .zoom-overlay {
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0;
    isolation: isolate;
}

body.is-mobile-landscape .zoom-overlay::before {
    content: "";
    position: absolute;
    left: var(--mobile-scene-left-inset);
    top: var(--mobile-scene-top-inset);
    width: var(--mobile-scene-width);
    height: var(--mobile-scene-height);
    background: rgba(0, 0, 0, 0);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity var(--zoom-overlay-duration) ease,
        background-color var(--zoom-overlay-duration) ease;
    z-index: 0;
}

body.is-mobile-landscape .zoom-overlay.active {
    background: transparent;
}

body.is-mobile-landscape .zoom-overlay.active::before {
    background: rgba(0, 0, 0, 0.78);
    opacity: 1;
}

body.is-mobile-landscape #gameScreen.zoom-active #locationImage,
body.is-mobile-landscape #gameScreen.zoom-active #clickableAreas,
body.is-mobile-landscape #gameScreen.zoom-active #locationObjects {
    filter: none;
}

body.is-mobile-landscape .zoom-container {
    position: absolute;
    left: calc(
        var(--mobile-scene-left-inset) + (var(--mobile-scene-width) / 2)
    );
    top: calc(var(--mobile-scene-top-inset) + (var(--mobile-scene-height) / 2));
    max-width: min(100%, 980px);
    max-height: 100%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 1;
}

body.is-mobile-landscape .zoom-overlay.active .zoom-container {
    transform: translate(-50%, -50%) scale(1);
}

body.is-mobile-landscape .zoom-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

body.is-mobile-landscape .close-zoom-button {
    top: calc(var(--safe-area-top) + var(--mobile-edge-offset));
    left: auto;
    right: calc(var(--safe-area-right) + var(--mobile-edge-offset));
    width: var(--mobile-toolbar-button-size);
    height: var(--mobile-toolbar-button-size);
    font-size: 36px;
}

body.is-mobile-landscape .zoom-overlay.active .close-zoom-button {
    transition:
        opacity 0.12s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    transition-delay: 0s;
}
