html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    /* Наконечник стрелы: hotspot у острия */
    --cursor-arrow: url("img/cursor-arrowhead-48.png") 2 2;

    font-family: Georgia, serif;
    background: #111;
    color: white;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: var(--cursor-arrow), auto;
}

/* Курсор — наконечник стрелы по всей игре */
body,
body * {
    cursor: var(--cursor-arrow), auto !important;
}

body a,
body button,
body label,
body select,
body summary,
body [onclick],
body [role="button"],
body .menu-item,
body .settings-button,
body .skip-btn,
body .main-btn {
    cursor: var(--cursor-arrow), pointer !important;
}

body input[type="text"],
body input[type="number"],
body input[type="search"],
body textarea {
    cursor: var(--cursor-arrow), text !important;
}

#gameViewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: black;
}

#gameScale {
    position: absolute;
    left: 0;
    top: 0;
    width: 1280px;
    height: 720px;
    transform-origin: top left;
}

.screen {
    position: absolute;
    inset: 0;
    width: 1280px;
    height: 720px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    text-align: center;
}

.hidden {
    display: none !important;
}

.title {
    font-size: 40px;
    margin-bottom: 20px;
}

.main-btn {
    position: relative;
    z-index: 3;
    min-height: 48px;
    padding: 12px 36px;
    font-family: "Pixelify Sans", "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 #fff;
    color: #111;
    background: #fff;
    border: 3px solid #111;
    border-radius: 0;
    outline: none;
    clip-path: polygon(0 10%,2% 5%,1% 36%,0 65%,2% 94%,19% 98%,37% 95%,55% 100%,73% 96%,100% 100%,98% 66%,100% 32%,98% 3%,78% 6%,59% 1%,39% 5%,20% 2%);
    box-shadow: 6px 6px 0 #111;
    transform: skewX(-2deg);
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.main-btn::before {
    content: "▶";
    margin-right: 10px;
    font-size: 12px;
    opacity: 0.75;
    vertical-align: middle;
}

.main-btn:hover {
    color: #fff;
    background: #111;
    text-shadow: none;
    box-shadow: 9px 9px 0 #777;
    transform: translate(-2px, -2px) skewX(-2deg);
}

.main-btn:hover::before {
    opacity: 1;
}

/* Общая орнаментальная рамка (intro / skip) */
.ui-ornate,
.intro-box,
.skip-btn {
    --ui-gold: #c9b48a;
    --ui-gold-dim: #7a664c;
    --ui-bronze: #9a8460;
    --ui-ink: #12100e;
    --ui-ink-hi: #221c18;
    --ui-text: #e8e2d6;
}

.ui-ornate,
.intro-box {
    position: relative;
    color: var(--ui-text);
    background-color: var(--ui-ink);
    background-image:
        radial-gradient(circle 2.5px at 10px 10px, var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2.5px at calc(100% - 10px) 10px, var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2.5px at 10px calc(100% - 10px), var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2.5px at calc(100% - 10px) calc(100% - 10px), var(--ui-gold) 0 55%, transparent 60%),
        linear-gradient(180deg, var(--ui-ink-hi) 0%, var(--ui-ink) 42%, #0a0908 100%);
    border: 2px solid var(--ui-gold-dim);
    border-radius: 2px;
    box-shadow:
        inset 0 0 0 1px rgba(201, 180, 138, 0.55),
        inset 0 0 0 3px #1a1511,
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 1px #070605,
        4px 5px 0 rgba(0, 0, 0, 0.45);
}

.intro-box::before,
.skip-btn::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(154, 132, 96, 0.45);
    pointer-events: none;
    box-shadow:
        inset 8px 0 0 -7px rgba(201, 180, 138, 0.35),
        inset -8px 0 0 -7px rgba(201, 180, 138, 0.35),
        inset 0 8px 0 -7px rgba(201, 180, 138, 0.35),
        inset 0 -8px 0 -7px rgba(201, 180, 138, 0.35);
}

.intro-box {
    max-width: 620px;
    width: min(78%, 620px);
    margin: 0;
    padding: 22px 28px 30px;
    z-index: 3;
    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-shadow: 1px 1px 0 #000;
    text-align: left;
    clip-path: none;
    transform: none;
}

.intro-box #introText {
    margin: 0;
    padding-right: 18px;
    white-space: pre-wrap;
    font-family: inherit;
    position: relative;
    z-index: 1;
}

/* Skip >> — в стиле кнопок меню */
.skip-btn {
    position: absolute;
    top: 28px;
    right: 36px;
    z-index: 20;
    min-height: 0;
    padding: 10px 22px 11px;
    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: none;
    color: var(--ui-text);
    background-color: var(--ui-ink);
    background-image:
        radial-gradient(circle 2px at 8px 8px, var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2px at calc(100% - 8px) 8px, var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2px at 8px calc(100% - 8px), var(--ui-gold) 0 55%, transparent 60%),
        radial-gradient(circle 2px at calc(100% - 8px) calc(100% - 8px), var(--ui-gold) 0 55%, transparent 60%),
        linear-gradient(180deg, var(--ui-ink-hi) 0%, var(--ui-ink) 48%, #0a0908 100%);
    border: 2px solid var(--ui-gold-dim);
    border-radius: 2px;
    outline: none;
    box-shadow:
        inset 0 0 0 1px rgba(201, 180, 138, 0.5),
        inset 0 0 0 3px #1a1511,
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px #070605,
        3px 3px 0 rgba(0, 0, 0, 0.45);
    text-shadow: 1px 1px 0 #000;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, filter 0.15s ease, transform 0.15s ease;
    clip-path: none;
    transform: none;
}

.skip-btn span {
    margin-left: 6px;
    font-size: 0.85em;
    letter-spacing: 0.04em;
    color: var(--ui-gold);
}

.skip-btn:hover {
    color: #fff8ee;
    border-color: var(--ui-bronze);
    filter: brightness(1.12);
    background-color: var(--ui-ink);
    transform: translateY(-1px);
    box-shadow:
        inset 0 0 0 1px rgba(201, 180, 138, 0.65),
        inset 0 0 0 3px #1a1511,
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px #070605,
        3px 4px 0 rgba(0, 0, 0, 0.5),
        0 0 14px rgba(180, 140, 70, 0.18);
}

.skip-btn:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

.day-screen .skip-btn {
    top: 28px;
    right: 36px;
}

#bgVideo {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;
    object-fit: cover;

    z-index: 1;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
    pointer-events: none;
}

.content {
    position: relative;
    z-index: 3;
}

#introScreen {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 0 48px 48px 0;
}

#introScreen .content {
    width: min(78%, 620px);
    cursor: pointer;
}

#gameScreen {
    width: 1280px;
    height: 720px;
    position: absolute;
    inset: 0;
    background: #111;
    overflow: hidden;
}

.game-world {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform-origin: 50% 45%;
    will-change: transform;
}

#gameVideo,
#gameImage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Зум +30% с мягким шатанием в стороны (фон + свечи + пауки) */
@keyframes cameraZoomSway {
    0%   { transform: scale(1) translate3d(0, 0, 0); }
    20%  { transform: scale(1.05) translate3d(-1.2%, 0.2%, 0); }
    40%  { transform: scale(1.12) translate3d(1.4%, -0.15%, 0); }
    60%  { transform: scale(1.2) translate3d(-1.1%, 0.25%, 0); }
    78%  { transform: scale(1.26) translate3d(0.7%, -0.1%, 0); }
    90%  { transform: scale(1.29) translate3d(-0.35%, 0.08%, 0); }
    100% { transform: scale(1.3) translate3d(0, 0, 0); }
}

.game-world.camera-zoom-sway {
    animation: cameraZoomSway 4.2s cubic-bezier(0.33, 0.12, 0.25, 1) forwards;
}

/* Мерцание света свечи на стене поверх фона сцены (можно несколько) */
.game-candle-glows {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.game-candle-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    --glow-x: 46%;
    --glow-y: 38%;
    --glow-strength: 0.5;
    --glow-shift-x: 0px;
    --glow-shift-y: 0px;
    --glow-scale: 1;
    background:
        radial-gradient(
            ellipse 34% 42% at calc(var(--glow-x) + var(--glow-shift-x)) calc(var(--glow-y) + var(--glow-shift-y)),
            rgba(255, 170, 70, 0.42) 0%,
            rgba(255, 120, 40, 0.18) 34%,
            rgba(255, 90, 20, 0.06) 58%,
            transparent 76%
        ),
        radial-gradient(
            ellipse 12% 14% at calc(var(--glow-x) + var(--glow-shift-x)) calc(var(--glow-y) + var(--glow-shift-y)),
            rgba(255, 220, 140, 0.55) 0%,
            rgba(255, 150, 60, 0.16) 45%,
            transparent 72%
        );
    transform: scale(var(--glow-scale));
    transform-origin: var(--glow-x) var(--glow-y);
    will-change: opacity, transform;
    transition: opacity 0.35s ease;
}

.game-candle-glow.is-on {
    opacity: var(--glow-strength);
}

.game-spider-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

#gameScreen > .overlay,
.game-world > .overlay {
    z-index: 3;
}

.dev-layout-point-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12px;
}

.dev-layout-point-row.hidden {
    display: none !important;
}

.dev-layout-point-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.layout-tune-handle--b {
    border-color: #7ec8ff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 14px rgba(100, 180, 255, 0.55);
}

.layout-tune-handle--b .layout-tune-handle-cross::before,
.layout-tune-handle--b .layout-tune-handle-cross::after,
.layout-tune-handle--b .layout-tune-handle-label {
    background: #7ec8ff;
    color: #7ec8ff;
}

.layout-tune-handle--b .layout-tune-handle-label {
    background: rgba(0, 0, 0, 0.75);
}

/* Пиксельный рендер только для спрайтов-ходоков */
.pixel-walker-sprite {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
}

.portrait img {
    filter: drop-shadow(4px 6px 0 #0008);
}

#menuWorld,
.menu-world {
    image-rendering: auto;
}

#menuWorld .menu-layer--1,
#menuWorld .menu-layer--2 {
    image-rendering: auto;
}

#gameVideo,
#bgVideo,
.local-map-bg-video,
.media-thumb video,
.media-modal-content video {
    image-rendering: auto;
}

/* Портрет */
.portrait {
    position: absolute;
    bottom: 0;
    left: 24px;
    z-index: 30005;
    pointer-events: none;
}

.portrait img {
    height: 460px;
    width: auto;
    display: block;
}

.portrait img.portrait-animated {
    filter: drop-shadow(4px 6px 0 #0008);
    image-rendering: auto;
}

/* Диалоговое окно — dark fantasy (как референс) */
.dialog-box {
    --dlg-bronze: #8b6a3e;
    --dlg-bronze-hi: #c9a46a;
    --dlg-copper: #d48e5c;
    --dlg-ink: rgba(18, 12, 10, 0.88);
    --dlg-ink-hi: rgba(42, 30, 22, 0.82);
    --dlg-text: #f4f0e8;

    position: absolute;
    bottom: 36px;
    left: 40px;
    right: auto;
    transform: none;

    width: min(52%, 560px);
    max-width: 560px;
    min-height: 148px;
    box-sizing: border-box;

    padding: 22px 28px 30px;

    color: var(--dlg-text);
    font-family: Georgia, "Times New Roman", "Palatino Linotype", serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);

    background:
        radial-gradient(ellipse 120% 80% at 20% 0%, rgba(90, 60, 35, 0.22) 0%, transparent 55%),
        linear-gradient(165deg, var(--dlg-ink-hi) 0%, var(--dlg-ink) 48%, rgba(8, 6, 5, 0.92) 100%);
    border: 1px solid var(--dlg-bronze);
    box-shadow:
        inset 0 0 0 1px rgba(201, 164, 106, 0.28),
        inset 0 0 40px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(0, 0, 0, 0.75),
        0 10px 28px rgba(0, 0, 0, 0.45);
    clip-path: polygon(
        14px 0%, calc(100% - 14px) 0%,
        100% 14px, 100% calc(100% - 14px),
        calc(100% - 14px) 100%, 14px 100%,
        0% calc(100% - 14px), 0% 14px
    );

    z-index: 30010;
}

.dialog-box::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(139, 106, 62, 0.45);
    pointer-events: none;
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%,
        100% 10px, 100% calc(100% - 10px),
        calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
}

.dialog-box.dialog-box--top {
    top: 8%;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Два окна: эхо реплики + выбор */
.dialog-box--echo {
    bottom: 36px;
    left: 40px;
    right: auto;
    width: min(42%, 460px);
    max-width: 460px;
    min-height: 120px;
    z-index: 30009;
    opacity: 0.92;
}

#gameUi.dual-dialog .dialog-box:not(.dialog-box--echo) {
    left: auto;
    right: 40px;
    bottom: 36px;
    width: min(42%, 460px);
    max-width: 460px;
}

#gameUi.dual-dialog .choices:not(:empty):not(.choices--free) {
    left: auto;
    right: 40px;
    bottom: 210px;
    width: min(42%, 460px);
    transform: none;
}

/* Выбор поверх диалога (как в референсе): диалог слева, choices поверх справа */
#gameUi.choices-over-dialog .dialog-box:not(.dialog-box--echo) {
    left: 40px;
    right: auto;
    bottom: 36px;
    width: min(54%, 580px);
    max-width: 580px;
    z-index: 30010;
}

#gameUi.choices-over-dialog .choices:not(:empty):not(.choices--free) {
    left: 38%;
    right: auto;
    bottom: 58px;
    width: min(480px, 48%);
    transform: none;
    z-index: 30020;
    gap: 12px;
}

.dialog-speaker {
    margin: 0 0 10px;
    color: var(--dlg-copper);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 1;
}

#dialogText {
    margin: 0;
    padding-right: 18px;
    white-space: pre-wrap;
    color: #ffffff;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.dialog-box.typing #dialogText::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 5px;
    background: var(--dlg-copper);
    box-shadow: 0 0 4px rgba(212, 142, 92, 0.5);
    vertical-align: -0.1em;
    animation: dialogue-cursor 0.65s steps(1, end) infinite;
}

@keyframes dialogue-cursor {
    50% { opacity: 0; }
}

/* Стрелка «далее» */
.dialog-continue {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 12px;
    height: 10px;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(#d48e5c, #d48e5c) center top / 12px 2px no-repeat,
        linear-gradient(#d48e5c, #d48e5c) center 4px / 8px 2px no-repeat,
        linear-gradient(#d48e5c, #d48e5c) center 8px / 4px 2px no-repeat;
    filter: drop-shadow(0 1px 1px #000);
}

.dialog-box:not(.typing):not(.dialog-box--no-continue) .dialog-continue,
.intro-box .dialog-continue {
    opacity: 1;
    animation: dialog-continue-blink 0.85s steps(1, end) infinite;
}

.dialog-box.typing .dialog-continue,
.dialog-box.dialog-box--no-continue .dialog-continue {
    opacity: 0;
    animation: none;
}

@keyframes dialog-continue-blink {
    50% { opacity: 0.25; }
}

/* ПРЕВЬЮ МЕДИА В ДИАЛОГЕ */
.dialog-media-preview {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.media-thumb {
    position: relative;
    width: 220px;
    height: 124px;
    border-radius: 0;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #111;
    background: #fff;
    box-shadow: 5px 5px 0 #111;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.media-thumb:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 #111;
}

.media-thumb img,
.media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-thumb-label {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 3px 8px;
    font-family: "Pixelify Sans", "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 0;
    border: 2px solid #111;
    background: #fff;
    color: #111;
    pointer-events: none;
}

.media-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 54px;
    height: 54px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.65);
    color: white;
    font-size: 24px;
    pointer-events: none;
}

.choices {
    --dlg-bronze: #8b6a3e;
    --dlg-bronze-hi: #c9a46a;

    position: absolute;
    bottom: 210px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(520px, calc(100% - 48px));
    z-index: 30011;
    pointer-events: none;
}

.choices:empty {
    display: none;
}

.choices:not(:empty):not(.choices--free) {
    padding: 0;
    background: none;
    border: 0;
    clip-path: none;
    box-shadow: none;
    pointer-events: auto;
}

.choices:not(:empty):not(.choices--free)::before {
    content: none;
}

.choices.choices--free {
    gap: 0;
    padding: 0;
    background: none;
    border: 0;
    clip-path: none;
    box-shadow: none;
}

.choices.choices--free::before {
    content: none;
}

.choice-btn {
    position: relative;
    width: 100%;
    min-height: 48px;
    padding: 12px 22px;
    overflow: hidden;

    font-family: Georgia, "Times New Roman", "Palatino Linotype", serif;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    text-align: left;

    color: #f4f0e8;
    background:
        linear-gradient(180deg, rgba(28, 20, 16, 0.94) 0%, rgba(12, 9, 8, 0.96) 100%);
    border: 1px solid var(--dlg-bronze);
    border-radius: 0;
    outline: none;
    clip-path: polygon(
        10px 0%, calc(100% - 10px) 0%,
        100% 10px, 100% calc(100% - 10px),
        calc(100% - 10px) 100%, 10px 100%,
        0% calc(100% - 10px), 0% 10px
    );
    box-shadow:
        inset 0 0 0 1px rgba(201, 164, 106, 0.18),
        inset 0 0 22px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.35);
    transform: none;
    cursor: pointer;

    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.choice-btn::before {
    content: none;
}

.choice-btn:hover,
.choice-btn:focus-visible {
    color: #fffaf0;
    background:
        linear-gradient(180deg, rgba(92, 62, 38, 0.95) 0%, rgba(52, 34, 22, 0.96) 100%);
    border-color: var(--dlg-bronze-hi);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    box-shadow:
        inset 0 0 0 1px rgba(201, 164, 106, 0.45),
        inset 0 0 28px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(201, 164, 106, 0.2),
        0 6px 16px rgba(0, 0, 0, 0.4);
    outline: none;
    transform: none;
    animation: none;
}

.choice-btn:active {
    background:
        linear-gradient(180deg, rgba(70, 46, 28, 0.96) 0%, rgba(36, 24, 16, 0.97) 100%);
}

.day-screen {
    background: black;
    z-index: 10;
}

.day-text {
    font-size: 56px;
    color: white;
    font-family: "Cinzel", Georgia, "Times New Roman", serif;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0;
    animation: dayFadeIn 1s ease forwards;
}

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

.cutscene-screen {
    background: #000;
    z-index: 11;
}

.cutscene-screen video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background: #000;
}

.cutscene-fade {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #000;
    opacity: 1;
    pointer-events: none;
    transition: opacity 1s ease;
}

.cutscene-fade.is-clear {
    opacity: 0;
}

.cutscene-screen .skip-btn {
    z-index: 3;
    top: 28px;
    right: 36px;
}

.dev-panel {
    position: fixed;
    top: 10px;
    left: 10px;

    background: rgba(0, 0, 0, 0.9);
    padding: 12px;
    border-radius: 12px;

    font-family: monospace;
    font-size: 14px;

    z-index: 9999;
    min-width: 160px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.dev-panel.hidden {
    display: none;
}

.dev-layout-tune {
    margin-top: 10px;
    min-width: 220px;
}

.dev-layout-scene {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 6px;
    word-break: break-all;
}

.dev-layout-xy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

.dev-layout-xy label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    opacity: 0.85;
}

.dev-layout-xy input {
    width: 100%;
}

.dev-layout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 6px;
}

.dev-layout-status {
    font-size: 11px;
    opacity: 0.7;
    line-height: 1.35;
    word-break: break-word;
}

.dev-dialog-tune {
    margin-top: 10px;
    min-width: 220px;
}

.dev-dialog-w {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.dev-dialog-w input {
    width: 100%;
}

#gameUi.dialog-layout-editing .dialog-box,
#gameUi.dialog-layout-editing .choices:not(:empty) {
    outline: 2px dashed rgba(255, 210, 122, 0.85);
    outline-offset: 2px;
    cursor: grab;
    pointer-events: auto !important;
    touch-action: none;
    user-select: none;
}

#gameUi.dialog-layout-editing .choice-btn {
    cursor: grab;
    pointer-events: none;
}

#gameUi.dialog-layout-editing .dialog-box.is-dialog-dragging,
#gameUi.dialog-layout-editing .choices.is-dialog-dragging {
    cursor: grabbing;
    outline-color: #ffe08a;
}

#gameUi.dialog-layout-editing .dialog-box.dialog-layout-selected,
#gameUi.dialog-layout-editing .choices.dialog-layout-selected {
    outline-color: #7dffb0;
}

.layout-tune-handle {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 5000;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid #ffd27a;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 180, 70, 0.55);
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
}

.layout-tune-handle.is-dragging {
    cursor: grabbing;
}

.layout-tune-handle-cross {
    position: absolute;
    inset: 5px;
    pointer-events: none;
}

.layout-tune-handle-cross::before,
.layout-tune-handle-cross::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    background: #ffd27a;
    transform: translate(-50%, -50%);
}

.layout-tune-handle-cross::before {
    width: 12px;
    height: 2px;
}

.layout-tune-handle-cross::after {
    width: 2px;
    height: 12px;
}

.layout-tune-handle-label {
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    white-space: nowrap;
    font: 11px/1 monospace;
    color: #ffd27a;
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 5px;
    border-radius: 4px;
    pointer-events: none;
}

.dev-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.dev-subtitle {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 13px;
    opacity: 0.7;
}

.dev-days button {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    padding: 5px;

    background: #222;
    border: none;
    color: white;
    cursor: pointer;
}

.dev-days button:hover {
    background: #444;
}

/* МОДАЛКА */
.media-modal {
    position: absolute;
    inset: 0;
    z-index: 20000;
}

.media-modal.hidden {
    display: none;
}

.media-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.media-modal-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 800px;
    height: 600px;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);

    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.85);

    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.media-modal-content {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #000;
}

.media-modal-content img,
.media-modal-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.media-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20001;

    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.media-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* МОБИЛКА */
@media (max-width: 900px) {
    .portrait {
        left: 8px;
        bottom: 0;
    }

    .portrait img {
        height: 320px;
    }

    .dialog-box {
        left: 14px;
        right: 14px;
        width: auto;
        max-width: none;
        font-size: 17px;
        padding: 16px 18px 24px;
    }

    .dialog-speaker {
        font-size: 18px;
        letter-spacing: 0.02em;
    }

    .skip-btn {
        top: 16px;
        right: 16px;
        font-size: 13px;
        padding: 7px 12px;
    }

    .choices {
        bottom: 185px;
        width: calc(100% - 28px);
    }

    .choice-btn {
        width: 100%;
        min-height: 44px;
        padding: 11px 16px;
        font-size: 16px;
    }

    .media-thumb {
        width: 180px;
        height: 100px;
    }
}

.game-stats {
    position: absolute;
    top: 20px;
    right: 20px;

    background: rgba(0, 0, 0, 0.7);
    padding: 12px 16px;
    border-radius: 12px;

    font-size: 16px;
    font-family: monospace;

    z-index: 10005;
}

.map-screen {
    position: absolute;
    inset: 0;
    z-index: 30009;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

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

.castle-map {
    position: relative;
    width: 900px;
    max-width: 90%;
    pointer-events: auto;
}

.castle-map-image {
    width: 100%;
    display: block;
    border-radius: 0;
    box-shadow: 8px 10px 0 #0008;
}


.map-queen {
    position: absolute;
    width: 72px;
    height: 108px;
    transform: translate(-50%, -78%);
    z-index: 12;
    pointer-events: none;
    transition: left 0.9s linear, top 0.9s linear;
}

.map-queen.walking {
    /* sprite animation handles walk cycle */
}

.map-travel-hint {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 14;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.88);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    pointer-events: none;
}

@keyframes queenWalkBounce {
    from { margin-top: 0; }
    to { margin-top: -4px; }
}

.map-point {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #d9b35f;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255, 215, 120, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.map-point:hover {
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 20px rgba(255, 230, 160, 1);
}

.map-point span {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 4px 13px;
    border-radius: 3px;
    background: linear-gradient(160deg, rgba(28,18,4,0.97), rgba(50,32,6,0.95));
    border: 1px solid rgba(180,135,40,0.55);
    color: #f0d880;
    font-size: 13px;
    font-family: Georgia, 'Times New Roman', serif;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    box-shadow: 0 2px 10px rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.map-point:hover span {
    opacity: 1;
}

.map-point.visited {
    background: #6e6e6e;
    box-shadow: 0 0 10px rgba(180, 180, 180, 0.5);
}

.map-point.hidden {
    display: none;
}

.map-point-end {
    background: #8bc34a;
    box-shadow: 0 0 14px rgba(160, 255, 140, 0.9);
}

.map-point-city {
    background: #8b6f3a;
    border-color: #d4a853;
    box-shadow: 0 0 12px rgba(200, 160, 60, 0.8);
}

.map-point-city:hover {
    box-shadow: 0 0 22px rgba(220, 180, 80, 1);
}

#reportScreen .day-text {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 34px;
    text-align: left;
    line-height: 1.45;
    color: #111;
    background-color: #fffffff7;
    background-image: radial-gradient(#0000001c 1px, transparent 1px);
    background-size: 5px 5px;
    border: 5px solid #080808;
    clip-path: polygon(0 7%,3% 5%,1% 24%,2% 43%,0 61%,2% 82%,1% 100%,17% 97%,35% 100%,52% 97%,69% 100%,85% 97%,100% 100%,98% 79%,100% 58%,98% 37%,100% 6%,83% 9%,67% 6%,50% 9%,33% 5%,17% 9%);
    box-shadow: 10px 11px 0 #0008;
    text-shadow: 2px 2px 0 #fff;
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 20px;
    transform: skewX(-1deg);
}

#reportScreen h2 {
    font-size: 26px;
    margin: 0 0 16px;
    text-align: center;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
}

#reportText {
    font-size: 18px;
    color: #111;
}

#reportText p {
    margin: 8px 0;
}

#reportScreen .main-btn {
    display: block;
    margin: 20px auto 0;
}

.dev-flags-list {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 4px;
}

.dev-flag-item {
    padding: 4px 6px;
    margin-bottom: 4px;
    background: #1b1b1b;
    border-radius: 6px;
    word-break: break-word;
}

.dev-flag-empty {
    opacity: 0.6;
    font-style: italic;
}

.dev-flag-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.dev-flag-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    background: #151515;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-family: monospace;
    font-size: 13px;
}

.dev-flag-btn {
    padding: 6px 10px;
    background: #2b2b2b;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: monospace;
    font-size: 13px;
}

.dev-flag-btn:hover {
    background: #444;
}

.dev-subtitle-inline {
    margin-top: 12px;
}

.dev-flags-list-known {
    max-height: 220px;
}

.dev-flag-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.dev-flag-item {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    background: #1b1b1b;
    border-radius: 6px;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dev-flag-status {
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
}

.dev-flag-status.is-active {
    background: rgba(90, 180, 90, 0.25);
}

.dev-flag-status.is-inactive {
    background: rgba(150, 150, 150, 0.2);
}

.dev-flag-btn,
.dev-flag-action-btn {
    padding: 6px 10px;
    background: #2b2b2b;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: monospace;
    font-size: 13px;
    flex-shrink: 0;
}

.dev-flag-btn:hover,
.dev-flag-action-btn:hover {
    background: #444;
}

@keyframes screenShake {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-8px, -3px); }
    20% { transform: translate(8px, 3px); }
    30% { transform: translate(-10px, 4px); }
    40% { transform: translate(10px, -4px); }
    50% { transform: translate(-8px, 3px); }
    60% { transform: translate(8px, -3px); }
    70% { transform: translate(-6px, 2px); }
    80% { transform: translate(6px, -2px); }
    90% { transform: translate(-3px, 1px); }
    100% { transform: translate(0, 0); }
}

.screen-shake {
    animation: screenShake 0.6s ease;
}

.screen-shake-long {
    animation: screenShake 0.2s linear infinite;
}

.court-title {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) skewX(-1deg);
    z-index: 30010;
    padding: 12px 28px;
    color: #111;
    background-color: #fffffff7;
    background-image: radial-gradient(#0000001c 1px, transparent 1px);
    background-size: 5px 5px;
    border: 4px solid #080808;
    font-family: "Pixelify Sans", "Segoe UI", sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 2px 2px 0 #fff;
    box-shadow: 8px 9px 0 #0008;
    transition: opacity 0.6s ease;
}

.court-title.fading {
    opacity: 0;
    pointer-events: none;
}

.map-point.active-location {
    background: #d9b35f;
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255, 215, 120, 0.9);
}

#gameImage,
#gameVideo,
#bgVideo,
img,
video {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

#gameUi {
    position: absolute;
    inset: 0;
    width: 1280px;
    height: 720px;
    z-index: 30000;
    pointer-events: none;
}

#gameUi .dialog-box,
#gameUi .dialog-box--echo,
#gameUi .choices,
#gameUi .portrait,
#gameUi .map-screen,
#gameUi .court-title {
    pointer-events: auto;
}

.menu-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.menu-bg {
    position: absolute;
    inset: 0;
    background: url("img/menu-bg.png") center center / cover no-repeat;
    transform: scale(1.05);
    transition: transform 0.15s linear;
    z-index: 1;
}

.menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 2;
}

.menu-content {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== ЛОКАЛЬНАЯ КАРТА ===== */
.local-map-screen {
    position: absolute;
    inset: 0;
    width: 1280px;
    height: 720px;
    overflow: hidden;
    cursor: crosshair;
    z-index: 30020;
    background: #000;
}

.local-map-screen.hidden {
    display: none;
}

.local-map-bg-video,
.local-map-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.local-map-objects {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

/* Базовый объект */
.local-map-object {
    position: absolute;
    transform: translate(-50%, -100%);
    pointer-events: auto;
    cursor: pointer;
    text-align: center;
}

.local-map-object img {
    height: 90px;
    display: block;
    filter: drop-shadow(3px 4px 0 #0008);
    transition: filter 0.2s, transform 0.2s;
}

.local-map-object:hover img {
    filter: drop-shadow(0 0 12px rgba(255,220,100,0.75)) drop-shadow(3px 4px 0 #0008);
    transform: scale(1.06);
}

/* Иконка-заглушка когда нет картинки */
.local-map-object-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #f0d880;
    background: radial-gradient(circle at 40% 35%, rgba(70,50,10,0.88), rgba(20,12,2,0.92));
    border: 1px solid rgba(190,145,45,0.55);
    outline: 1px solid rgba(90,60,10,0.35);
    outline-offset: 2px;
    box-shadow:
        0 0 14px rgba(0,0,0,0.55),
        0 0 8px rgba(150,100,20,0.2);
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.local-map-object:hover .local-map-object-icon {
    background: radial-gradient(circle at 40% 35%, rgba(120,85,15,0.95), rgba(50,32,5,0.95));
    border-color: rgba(240,195,75,0.85);
    box-shadow:
        0 0 22px rgba(210,155,30,0.5),
        0 0 8px rgba(255,220,80,0.3);
}

/* Дверь — особый стиль */
.local-map-object-door .local-map-object-icon {
    width: 58px;
    height: 58px;
    font-size: 26px;
    border-radius: 4px;
    background: linear-gradient(160deg, rgba(60,38,6,0.94), rgba(28,16,2,0.96));
    border-color: rgba(200,155,50,0.65);
    box-shadow:
        0 0 20px rgba(180,130,30,0.4),
        inset 0 1px 0 rgba(255,220,100,0.12);
}

.local-map-object-door:hover .local-map-object-icon {
    background: linear-gradient(160deg, rgba(100,68,10,0.98), rgba(55,32,4,0.98));
    border-color: rgba(255,205,70,0.9);
    box-shadow:
        0 0 30px rgba(220,165,35,0.6),
        inset 0 1px 0 rgba(255,230,110,0.18);
}

/* Пройденные NPC/предметы */
.local-map-object.interacted {
    opacity: 0.45;
    pointer-events: none;
}

.local-map-object-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    font-family: "Pixelify Sans", "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #fffffff5;
    border: 2px solid #111;
    padding: 3px 10px;
    border-radius: 0;
    color: #111;
    text-shadow: 1px 1px 0 #fff;
    pointer-events: none;
    box-shadow: 3px 3px 0 #0008;
}

/* Королева на локальной карте */
.local-map-queen {
    position: absolute;
    width: 84px;
    height: 132px;
    transform: translate(-50%, -100%);
    z-index: 5;
    pointer-events: none;
}

.local-map-queen.walking {
    /* sprite animation handles walk cycle */
}

/* ===== ПИКСЕЛЬНЫЙ СПРАЙТ ХОДЬБЫ ===== */
.pixel-walker-sprite {
    width: 100%;
    height: 100%;
    background-image: url("img/pixel-queen-walk-sheet.png?v=pixel3");
    background-repeat: no-repeat;
    background-size: 600% 100%;
    background-position: 0% 0%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: nearest-neighbor;
    transform-origin: center bottom;
    transition: none !important;
}

.local-map-hint {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10,10,10,0.85);
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 15px;
    z-index: 6;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

/* ===== НАСТРОЙКИ (в стиле главного меню) ===== */
.settings-modal {
    --settings-ink: #07060c;
    --settings-frost: #f7f4ee;
    --settings-muted: rgba(247, 244, 238, 0.62);
    --settings-stone: #2a221c;
    --settings-edge: #8a7a66;
    --settings-hi: #3a3028;

    position: absolute;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', 'Palatino Linotype', serif;
}

.settings-modal.hidden {
    display: none;
}

.settings-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 50% 45%, rgba(28, 22, 30, 0.55) 0%, rgba(7, 6, 12, 0.88) 55%, rgba(7, 6, 12, 0.96) 100%);
    backdrop-filter: blur(4px);
}

.settings-window {
    position: relative;
    width: min(420px, 88%);
    padding: 34px 38px 30px;
    color: var(--settings-frost);
    background:
        linear-gradient(165deg, rgba(42, 34, 28, 0.97) 0%, rgba(18, 15, 18, 0.98) 45%, rgba(7, 6, 12, 0.99) 100%);
    border: 1px solid rgba(138, 122, 102, 0.55);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.75),
        0 28px 70px rgba(0, 0, 0, 0.78),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -20px 40px rgba(0, 0, 0, 0.35);
    clip-path: polygon(
        0 14px, 14px 0,
        calc(100% - 14px) 0, 100% 14px,
        100% calc(100% - 14px), calc(100% - 14px) 100%,
        14px 100%, 0 calc(100% - 14px)
    );
}

.settings-kicker {
    margin: 0 0 8px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--settings-muted);
}

.settings-window h2 {
    margin: 0 0 28px;
    text-align: center;
    color: var(--settings-frost);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: 0 2px 0 #000, 0 0 18px rgba(0, 0, 0, 0.55);
}

.settings-block {
    padding: 18px 16px 8px;
    margin-bottom: 18px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(138, 122, 102, 0.28);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.35);
}

.settings-row,
.settings-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--settings-frost);
}

.settings-row span:last-child {
    color: var(--settings-muted);
    font-variant-numeric: tabular-nums;
}

.settings-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    margin: 18px 0 22px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(247, 244, 238, 0.35), rgba(138, 122, 102, 0.35));
    outline: none;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--settings-frost);
    border: 2px solid var(--settings-stone);
    box-shadow: 0 0 0 1px rgba(138, 122, 102, 0.7), 0 2px 6px rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.settings-range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--settings-frost);
    border: 2px solid var(--settings-stone);
    box-shadow: 0 0 0 1px rgba(138, 122, 102, 0.7), 0 2px 6px rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.settings-range::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(138, 122, 102, 0.35);
}

.settings-check {
    justify-content: flex-start;
    margin-bottom: 14px;
    cursor: pointer;
    user-select: none;
}

.settings-check input {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    margin: 0 12px 0 0;
    border: 1px solid var(--settings-edge);
    background: rgba(7, 6, 12, 0.85);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
}

.settings-check input:checked {
    background: var(--settings-hi);
    border-color: rgba(247, 244, 238, 0.55);
}

.settings-check input:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: var(--settings-frost);
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-button {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    color: var(--settings-frost);
    font: 600 14px 'Cinzel', 'Palatino Linotype', serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background:
        linear-gradient(180deg, rgba(58, 48, 40, 0.95) 0%, rgba(26, 20, 18, 0.98) 100%);
    border: 1px solid rgba(138, 122, 102, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45),
        0 3px 0 rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.settings-button::after {
    content: "";
    position: absolute;
    inset: 10% 8%;
    pointer-events: none;
    opacity: 0;
    border-radius: 40%;
    background:
        radial-gradient(ellipse 70% 55% at 40% 45%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.14) 42%, transparent 68%),
        radial-gradient(ellipse 55% 50% at 65% 55%, rgba(255, 255, 255, 0.35) 0%, transparent 68%);
    filter: blur(1.2px);
    mix-blend-mode: screen;
}

.settings-button.is-sparking::after {
    animation: settingsBtnCloud 0.7s ease-out forwards;
}

@keyframes settingsBtnCloud {
    0% { opacity: 0; transform: scale(0.75); }
    18% { opacity: 0.95; transform: scale(1); }
    55% { opacity: 0.6; transform: scale(1.08); }
    100% { opacity: 0; transform: scale(1.2); }
}

.settings-button:active {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(0, 0, 0, 0.35);
}

.settings-button-primary {
    border-color: rgba(247, 244, 238, 0.35);
}
