/* Opera: скрыть встроенную кнопку поверх видео (body + div[is-visible]) */
body + div[is-visible] {
    display: none !important;
}

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

/* Палитра Венсдей: тёмная фиолетово-сиреневая с градиентом */
:root {
    --wednesday-bg: linear-gradient(160deg, #3d3255 0%, #4a3d70 25%, #5c4a8a 50%, #4a3d70 75%, #2a2040 100%);
    --wednesday-bg-start: #4a3d70;
    --wednesday-bg-mid: #5c4a8a;
    --wednesday-bg-end: #2a2040;
    --wednesday-btn: linear-gradient(135deg, #5c4a8a 0%, #4527a0 100%);
    --wednesday-btn-start: #5c4a8a;
    --wednesday-btn-end: #4527a0;
    --wednesday-accent: #6a4c93;
    --wednesday-shadow: rgba(42, 32, 64, 0.6);
    --wednesday-text-on: #5e35b1;
}

/* П. 1.10.2: отсутствие браузерной прокрутки и pull-to-refresh (тянуть вниз не обновляет страницу) */
html {
    height: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: auto;
    background: var(--wednesday-bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Паттерн из эмодзи паутины 🕸️ на фоне body */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='50' y='55' text-anchor='middle' dominant-baseline='middle' font-size='56' opacity='0.2'%3E%26%23x1f578%3B%26%23xfe0f%3B%3C/text%3E%3C/svg%3E");
    background-size: 140px 140px;
    background-position: 0 0;
    background-repeat: repeat;
}

/* Контейнер игры: на мобильных — на всю ширину/высоту, на широких — фиксированная ширина */
/* П. 1.6.2.7 / 1.6.1.8: без выделения и контекстного меню во внутреннем поле игры */
#game-root {
    width: 100%;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--wednesday-bg);
    -webkit-user-select: none;
}

/* Паттерн из эмодзи паутины 🕸️ на основном фоне игры */
#game-root::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext x='50' y='55' text-anchor='middle' dominant-baseline='middle' font-size='56' opacity='0.25'%3E%26%23x1f578%3B%26%23xfe0f%3B%3C/text%3E%3C/svg%3E");
    background-size: 140px 140px;
    background-position: 0 0;
    background-repeat: repeat;
    opacity: 1;
}

#game-root input,
#game-root textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

#game-root img,
#game-root video {
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

/* Прозрачный оверлей поверх медиа — при наведении курсор на div, не на картинку/видео */
.hover-block-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: auto;
}

/* Маскирующая полоса сверху — скрывает панель браузера (субтитры и т.д.), только для видео */
.video-controls-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 10000;
    pointer-events: auto;
    background: linear-gradient(to bottom, rgba(74, 61, 101, 0.7) 0%, rgba(42, 32, 64, 0.3) 50%, transparent 100%);
    border-radius: 12px 12px 0 0;
    display: none;
}
.pre-story-image-wrap.has-video .video-controls-mask,
.dialog-media-wrap--video .video-controls-mask {
    display: block;
}

/* Широкие экраны (ПК): фиксированная ширина 720px, пропорции 9:16 */
@media (min-width: 721px) {
    #game-root {
        aspect-ratio: 9 / 16;
        width: min(100vw, calc(100vh * 9 / 16));
        height: min(100vh, calc(100vw * 16 / 9));
        max-width: 720px;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    }
}

@supports (height: 100dvh) {
    @media (min-width: 721px) {
        #game-root {
            width: min(100vw, calc(100dvh * 9 / 16));
            height: min(100dvh, calc(100vw * 16 / 9));
        }
    }
}

/* Сцены: overflow hidden — прокрутка только внутри контейнеров (.shop-container, .dialogs-list и т.д.) */
.scene {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.scene.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Оверлей загрузки */
#startup-loader.startup-loader {
    position: absolute;
    inset: 0;
    z-index: 9999;
    background: var(--wednesday-bg);
}

#startup-loader.startup-loader.hidden {
    display: none;
}

#startup-loader .loader-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

#startup-loader .loader-center {
    width: min(280px, 70vw);
    height: min(280px, 70vw);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
}

#startup-loader .loader-web {
    position: relative;
    width: 180px;
    height: 180px;
    display: grid;
    place-items: center;
}

#startup-loader .loader-web-dot {
    position: absolute;
    font-size: 56px;
    line-height: 1;
    opacity: 0.15;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
    animation: loaderWebPulse 1.35s ease-in-out infinite;
}

#startup-loader .loader-web-dot-1 { transform: translate(-36px, -22px) rotate(-10deg); animation-delay: 0ms; }
#startup-loader .loader-web-dot-2 { transform: translate(34px, -18px) rotate(12deg);  animation-delay: 220ms; }
#startup-loader .loader-web-dot-3 { transform: translate(0px, 42px) rotate(0deg);     animation-delay: 440ms; }

@keyframes loaderWebPulse {
    0%   { opacity: 0.12; }
    45%  { opacity: 0.78; }
    100% { opacity: 0.12; }
}

/* Титульная сцена — полка с историями */
#scene-title {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    background: var(--wednesday-bg);
    padding: 0;
}

.version-label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 5;
}

.crystals-display {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s;
}

.crystals-display:active {
    background: rgba(255, 255, 255, 0.4);
}

.crystals-icon {
    font-size: 20px;
    line-height: 1;
}

.crystals-count {
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.shelf-title {
    padding: 16px 16px 8px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    flex-shrink: 0;
}

.stories-shelf {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--wednesday-bg);
}

.scroll-container {
    height: 80%;
    max-height: 850px;
    overflow-y: scroll;
    overflow-x: hidden;
    background: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Высота контейнера = высота экрана минус заголовок и нижнее меню */
.stories-shelf-scroll-container {
    flex: 1;
    min-height: 0;
    height: calc(var(--vh, 1vh) * 100 - 100px);
    max-height: calc(var(--vh, 1vh) * 100 - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 15px 15px 90px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.stories-shelf-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.stories-shelf-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.stories-shelf-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.stories-shelf-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

.stories-shelf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    align-content: start;
    min-height: min-content;
}

.story-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    min-height: 200px;
    flex-shrink: 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-tile:active {
    transform: scale(0.98);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

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

.story-tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 12px;
}

.story-tile-name {
    font-size: clamp(12px, 3.5vw, 16px);
    font-weight: bold;
    color: white;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    margin-bottom: 8px;
}

.story-tile-price-badge {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    z-index: 2;
}

.story-tile-progress-top {
    position: absolute;
    top: 8px;
    left: 10%;
    right: 10%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-tile-progress-bar {
    flex: 1;
    width: 100%;
    height: 4px;
    background: rgba(80, 80, 80, 0.65);
    border-radius: 2px;
    overflow: hidden;
}

.story-tile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wednesday-btn-start), var(--wednesday-btn-end));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.story-tile-percent {
    position: absolute;
    top: 6px;
    right: 0;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.story-tile-btn {
    padding: clamp(8px, 2vw, 12px) clamp(20px, 5vw, 28px);
    font-size: clamp(13px, 3.5vw, 16px);
    font-weight: bold;
    color: white;
    background: var(--wednesday-btn);
    border: none;
    border-radius: 20px;
    pointer-events: none;
    box-shadow: 0 3px 12px var(--wednesday-shadow);
}

.story-tile-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Пройденная история — окантовка и кнопка «Пройдена» */
.story-tile.story-tile-completed {
    border: 3px solid rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3),
                0 0 20px rgba(255, 215, 0, 0.35),
                0 4px 15px rgba(0, 0, 0, 0.2);
}

.story-tile.story-tile-completed:active {
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.2);
}

.story-tile.story-tile-completed .story-tile-btn {
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(45, 212, 191, 0.45);
}

.story-tile.story-tile-completed .story-tile-btn::before {
    content: '✓ ';
    font-weight: bold;
}


/* Сцена переодевания */
#scene-dressing {
    background: var(--wednesday-bg);
    min-height: 0;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    max-height: calc(var(--vh, 1vh) * 100);
    position: relative;
    overflow: hidden;
}

.crystals-display-dressing {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.dressing-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    min-height: calc(var(--vh, 1vh) * 100);
    background: var(--wednesday-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.dressing-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px;
    padding-bottom: max(80px, 60px + env(safe-area-inset-bottom, 0px));
    position: relative;
    z-index: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.dressing-character-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 8px 0;
    flex-shrink: 0;
}

.dressing-char-btn {
    width: 96px;
    height: 96px;
    padding: 0;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dressing-char-btn.active {
    border-color: var(--wednesday-accent);
    box-shadow: 0 0 12px var(--wednesday-shadow);
}

.dressing-char-btn:hover {
    transform: scale(1.05);
}

.dressing-char-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dressing-viewport {
    flex: 1 1 auto;
    min-height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dressing-character-wrap {
    position: relative;
    width: 75%;
    max-width: 340px;
    height: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dressing-character {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.dressing-controls {
    flex-shrink: 0;
    padding: 12px 16px;
    margin: 0 12px 0;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.dressing-costumes-scroll-wrap {
    overflow: hidden;
}

.dressing-costumes-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 8px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.dressing-costumes-scroll::-webkit-scrollbar {
    height: 6px;
}

.dressing-costume-btn {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dressing-costume-btn:hover {
    border-color: rgba(255, 255, 255, 0.9);
}

.dressing-costume-btn.active {
    border-color: var(--wednesday-accent);
    box-shadow: 0 0 12px var(--wednesday-shadow);
}

.dressing-costume-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dressing-costume-btn.dressing-costume-base {
    flex-direction: column;
    padding: 4px 4px 6px;
}
.dressing-costume-btn.dressing-costume-base img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: contain;
}
.dressing-costume-base-label {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.85);
    margin-top: 4px;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dressing-costume-empty {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.6);
}

.dressing-costume-price-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    color: #fbbf24;
    z-index: 2;
}

.dressing-costume-price-badge .costume-crystal-icon {
    font-size: 12px;
}

/* Модалка покупки костюма */
.costume-purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600;
    padding: 20px;
}

.costume-purchase-content {
    background: var(--wednesday-bg);
    border-radius: 20px;
    max-width: 320px;
    width: 100%;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.costume-purchase-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 12px;
}

.costume-purchase-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.costume-purchase-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.costume-purchase-price {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 16px;
}

.costume-purchase-buttons {
    display: flex;
    gap: 10px;
}

.costume-purchase-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.costume-purchase-yes {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.costume-purchase-no {
    background: rgba(255, 255, 255, 0.9);
    color: var(--wednesday-text-on);
}

.costume-purchase-btn:active {
    transform: scale(0.98);
}

/* Сцена переодевания — мобильные экраны */
@media (max-width: 720px) {
    .dressing-content {
        gap: 12px;
    }
    .dressing-char-btn {
        width: 72px;
        height: 72px;
    }
    .dressing-character-selector {
        padding: 6px 0;
    }
    .dressing-costume-btn {
        width: 64px;
        height: 64px;
    }
    .dressing-viewport {
        min-height: 140px;
    }
    .dressing-character-wrap {
        width: 70%;
        max-width: 260px;
    }
    .dressing-controls {
        padding: 8px 0;
    }
}

/* Сцена интро */
#scene-intro {
    background: var(--wednesday-bg);
    justify-content: center;
    align-items: center;
}

.intro-video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.intro-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Сцена онбординг */
#scene-onboarding {
    background: var(--wednesday-bg);
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.onboarding-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.onboarding-image-wrap {
    position: relative;
    width: 90%;
    max-width: 350px;
    margin-bottom: 30px;
}

.onboarding-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.next-button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: var(--wednesday-btn);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--wednesday-shadow);
    transition: transform 0.2s;
}

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

/* Сцена игры */
#scene-game {
    background: var(--wednesday-bg);
    padding-bottom: 0;
}

.game-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ПК-версия: чаты по центру 720px, по краям — градиент как на сцене 1 */
@media (min-width: 721px) {
    #scene-game,
    #scene-shop,
    #scene-stories,
    #scene-settings {
        background: var(--wednesday-bg);
        justify-content: center;
    }

    #scene-game,
    #scene-shop,
    #scene-stories,
    #scene-settings {
        align-items: stretch;
    }

    #scene-game .game-container {
        max-width: 720px;
        width: 100%;
        height: 100%;
        min-height: 100%;
        background: var(--wednesday-bg);
        border-radius: 0;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
        overflow: hidden;
    }

    #scene-shop .shop-container,
    #scene-stories .stories-container,
    #scene-settings .settings-container {
        max-width: 720px;
        width: 100%;
        height: 100%;
        min-height: 100%;
        background: url('assets/back_chat_wednesday.png') center/cover no-repeat;
        border-radius: 0;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    }

    .bottom-nav {
        width: min(720px, calc(100vw - 24px));
    }
}

/* Список диалогов */
.dialogs-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dialogs-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px;
    background: var(--wednesday-bg);
}

.dialogs-bottom {
    flex-shrink: 0;
    padding: 15px;
    padding-top: 0;
    padding-bottom: max(15px, env(safe-area-inset-bottom, 0px));
    background: var(--wednesday-bg);
}

.dialog-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dialog-item-to-title {
    background: white;
}

.dialog-item-to-title .dialog-name {
    color: #333;
}

.dialog-item-replay {
    background: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

.dialog-item-replay .dialog-name {
    color: #666;
}

.dialog-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.dialog-item-locked {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(100%);
}

.dialog-item-locked:active {
    transform: none;
}

.lock-icon {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.dialog-icon-wrapper {
    position: relative;
    margin-right: 15px;
    flex-shrink: 0;
}

.dialog-icon-frame {
    position: absolute;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--chat-avatar-border-image, none);
    pointer-events: none;
}

.dialog-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    position: relative;
    z-index: 1;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    z-index: 10;
    background: var(--wednesday-btn-end);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 0 5px;
    box-shadow: 0 2px 5px var(--wednesday-shadow);
    border: 2px solid white;
}

.dialog-info {
    flex: 1;
}

.dialog-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.dialog-preview {
    font-size: 14px;
    color: #666;
}

/* Окно чата */
.chat-window {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--wednesday-bg);
    position: relative;
}

.chat-header {
    background: white;
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
    position: relative;
}

.back-button {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--wednesday-text-on);
    cursor: pointer;
    padding: 5px 10px;
    margin-right: 10px;
}

.chat-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 100px; /* место под лентой, чтобы кнопки ответов не перекрывались сообщениями */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background-image: var(--chat-bg-image, url('assets/back_chat.png'));
    /* Высота по размеру контейнера, ширина по пропорции — перекрывает чат, без растягивания */
    background-size: auto 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    -webkit-overflow-scrolling: touch;
}

.message {
    max-width: 75%;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.left {
    align-self: flex-start;
    flex-direction: row;
}

.message.right {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar-frame {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-image: var(--chat-avatar-border-image, none);
}
.message-avatar-frame .message-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.message-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-sender-name {
    font-size: 12px;
    color: white;
    margin-bottom: 4px;
    font-weight: 600;
    text-shadow: 0 0 1px #555, 0 0 2px #555, 1px 1px 1px #555, -1px -1px 1px #555, 1px -1px 1px #555, -1px 1px 1px #555;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.4;
}

.message.left .message-bubble,
.message.right .message-bubble {
    text-align: left;
}

.message.left .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.message.right .message-bubble {
    background: var(--wednesday-bg);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px var(--wednesday-shadow);
    text-align: left;
}

/* Реакции на сообщения НПС */
.message-reactions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
}

.message-reaction-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.message-reaction-btn:hover {
    background: rgba(106, 76, 147, 0.35);
    transform: scale(1.15);
}

.message-reaction-btn:active {
    transform: scale(0.95);
}

.message-reactions-fixed .message-reaction-fixed {
    display: inline-block;
    font-size: 22px;
    animation: reactionPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reactionPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Предистория при входе в историю */
.pre-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2610;
    padding: 20px;
}

.pre-story-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 560px;
    width: 100%;
    max-height: 92vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.pre-story-viewer {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin-bottom: 16px;
}

.pre-story-arrow {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pre-story-arrow:hover,
.pre-story-arrow:active {
    background: rgba(255, 255, 255, 0.5);
}

.pre-story-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pre-story-image-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.pre-story-img,
.pre-story-video {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.pre-story-img {
    object-fit: contain;
}

.pre-story-video {
    object-fit: cover;
}

.pre-story-btn {
    flex-shrink: 0;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
    background: white;
    color: var(--wednesday-text-on);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.pre-story-btn:active {
    transform: scale(0.98);
}

/* Окно подтверждения сброса прогресса */
.reset-progress-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2595;
    padding: 20px;
}

.reset-progress-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 360px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.reset-progress-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 24px;
}

.reset-progress-buttons {
    display: flex;
    gap: 12px;
}

.reset-progress-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.reset-progress-yes {
    background: white;
    color: var(--wednesday-text-on);
}

.reset-progress-no {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.reset-progress-btn:active {
    transform: scale(0.98);
}

/* Окно по завершении всех глав чата */
.chat-completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600;
    padding: 20px;
}

.chat-completion-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 360px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.chat-completion-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 12px;
}

.chat-completion-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.4;
}

.chat-completion-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-completion-btn {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-completion-reward {
    font-size: 18px;
    font-weight: bold;
    color: #fbbf24;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

.chat-completion-exit {
    background: rgba(255, 255, 255, 0.95);
    color: var(--wednesday-text-on);
}

.chat-completion-btn:active {
    transform: scale(0.98);
}

/* Окно покупки товара в магазине */
.shop-purchase-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2590;
    padding: 20px;
}

.shop-purchase-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 24px;
    max-width: 400px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.shop-purchase-title {
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.shop-purchase-preview {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.shop-purchase-icon {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.shop-purchase-info {
    flex: 1;
    min-width: 0;
}

.shop-purchase-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.shop-purchase-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.shop-purchase-price {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-top: 10px;
}

.shop-purchase-currency-icon {
    vertical-align: middle;
    height: 1.2em;
    margin-left: 2px;
}

.shop-purchase-buttons {
    display: flex;
    gap: 12px;
}

.shop-purchase-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.shop-purchase-yes {
    background: white;
    color: #059669;
}

.shop-purchase-no {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.shop-purchase-btn:active {
    transform: scale(0.98);
}

/* Панель «Купить историю» */
.purchase-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2600;
    padding: 20px;
}

.purchase-story-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 400px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.purchase-story-title {
    font-size: 22px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.purchase-story-preview {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.purchase-story-cover-wrap {
    position: relative;
    flex-shrink: 0;
}

.purchase-story-cover {
    width: 100px;
    height: 133px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.2);
}

.purchase-story-info {
    flex: 1;
    min-width: 0;
}

.purchase-story-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.purchase-story-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.purchase-story-price-line {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.purchase-story-buttons {
    display: flex;
    gap: 12px;
}

.purchase-story-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.purchase-story-yes {
    background: white;
    color: var(--wednesday-text-on);
}

.purchase-story-no {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.purchase-story-btn:active {
    transform: scale(0.98);
}

/* Ежедневные награды (7 дней) */
.daily-rewards-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    padding: 20px;
}

.daily-rewards-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    padding: 28px 24px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.daily-rewards-title {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-bottom: 6px;
}

.daily-rewards-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 24px;
}

.daily-rewards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.daily-reward-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.daily-reward-item.claimed {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.7);
}

.daily-reward-item.current {
    background: linear-gradient(135deg, rgba(92, 74, 138, 0.85) 0%, rgba(69, 39, 160, 0.8) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px var(--wednesday-shadow);
}

.daily-reward-day {
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.daily-reward-gift {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.95);
    overflow-wrap: break-word;
    word-break: break-word;
}

.daily-rewards-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: bold;
    color: var(--wednesday-text-on);
    background: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.daily-rewards-btn:active {
    transform: scale(0.98);
}

.daily-rewards-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Плашка «Бейдж получен» */
.badge-notification {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2500;
    padding: 12px 16px;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.3s ease-out;
}

.badge-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.badge-notification.leaving {
    transform: translateY(-100%);
    opacity: 0;
}

.badge-notification-content {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--wednesday-bg);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px var(--wednesday-shadow);
    max-width: 100%;
}

.badge-notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    overflow: hidden;
}

.badge-notification-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge-notification-text {
    flex: 1;
    min-width: 0;
}

.badge-notification-name {
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 2px;
}

.badge-notification-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* Модальное окно увеличения изображения */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.image-zoom-img-wrap {
    position: relative;
    width: 100%;
    height: 80vh;
    max-width: 95vw;
    max-height: 85vh;
}

.image-zoom-modal .image-zoom-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.image-zoom-close {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 36px;
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 3001;
}

.image-zoom-close:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Видео в круге: прогресс по краю, кнопка плей по центру */
.video-container.video-circle {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.video-circle .message-video-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

.video-circle .message-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.video-circle .video-progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 1;
}

.video-circle .video-progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 4;
}

.video-circle .video-progress-fill {
    fill: none;
    stroke: var(--wednesday-btn-end);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

.video-circle .video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--wednesday-btn-end);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    padding-left: 4px;
}

.video-circle .video-play-btn:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.chat-input-panel {
    background: transparent;
    padding: 15px;
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.chat-end-panel {
    background: var(--wednesday-bg);
    padding: 16px 20px 24px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 -2px 10px var(--wednesday-shadow);
    flex-shrink: 0;
}

.chat-end-text {
    color: white;
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: block;
    margin-bottom: 12px;
}

.chat-end-home-btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--wednesday-text-on);
    background: white;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-end-home-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.chat-end-home-btn:active {
    transform: scale(0.98);
}

.response-button {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    color: white;
    background: var(--wednesday-btn);
    background-clip: padding-box;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 3px 10px var(--wednesday-shadow);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Кнопки выбора ответа в цвет стиля (красный/зелёный/розовый — мягкие) */
#game-root[data-chat-style] .response-button {
    background: var(--chat-style-btn-bg);
    background-clip: padding-box;
    color: var(--chat-style-btn-text);
    border: 2px solid var(--chat-style-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
#game-root[data-chat-style] .response-button:active {
    filter: brightness(0.95);
}

/* Обводки под стили чата — мягкие тени */
#game-root[data-chat-style] .chat-end-home-btn {
    border-color: var(--chat-style-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), 0 0 0 2px var(--chat-style-accent);
}
#game-root[data-chat-style] .message-reaction-btn {
    border: 2px solid var(--chat-style-accent);
    box-shadow: 0 0 0 1px var(--chat-style-accent);
}
#game-root[data-chat-style] .message-avatar-frame,
#game-root[data-chat-style] .message-avatar-frame .message-avatar {
    border-color: var(--chat-style-accent) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1), 0 0 0 2px var(--chat-style-accent);
}
#game-root[data-chat-style] .dialog-icon-wrapper .dialog-icon {
    border-color: var(--chat-style-accent);
    box-shadow: 0 0 0 2px var(--chat-style-accent);
}
#game-root[data-chat-style] .dialog-icon-frame {
    box-shadow: 0 0 0 2px var(--chat-style-accent);
    z-index: 0;
}

/* Фон при выбранном покупном стиле: по вертикали под высоту, ширина по пропорции, без растягивания */
#game-root[data-chat-style] #scene-game,
#game-root[data-chat-style] .game-container,
#game-root[data-chat-style] .dialogs-list,
#game-root[data-chat-style] .chat-messages {
    background-image: var(--chat-bg-image);
    background-size: auto 100%;
    background-position: center center;
    background-repeat: no-repeat;
}
#game-root[data-chat-style] .dialogs-list {
    background-attachment: scroll;
}
@media (min-width: 721px) {
    #game-root[data-chat-style] #scene-game .game-container {
        background-image: var(--chat-bg-image);
        background-size: auto 100%;
        background-position: center center;
        background-repeat: no-repeat;
    }
}

.response-button-text {
    display: block;
    width: 100%;
    text-align: center;
    line-height: 1.4;
}

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


/* Скрытие скроллбара но сохранение функциональности */
.dialogs-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.dialogs-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.dialogs-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

/* Основные сцены с навигацией */
.main-scene {
    padding-bottom: 0;
}

/* Когда открыт конкретный чат — убираем отступ под навигацию */
#scene-game.in-chat {
    padding-bottom: 0;
}

/* Нижняя панель навигации — светло-сиреневый, как карточки в магазине */
.bottom-nav {
    position: absolute;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 450px);
    max-width: calc(100% - 24px);
    min-width: 0;
    background: rgba(228, 216, 245, 0.95);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    box-sizing: border-box;
}

.nav-button {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 6px 2px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px;
    margin: 0 2px;
}

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

.nav-button.active {
    background: var(--wednesday-bg);
    border-radius: 12px;
}

.nav-button.active .nav-icon {
    transform: scale(1.1);
}

.nav-button.active .nav-label {
    color: white;
    font-weight: bold;
}

.nav-icon {
    font-size: clamp(18px, 5vw, 24px);
    margin-bottom: 2px;
    transition: transform 0.2s;
}

.nav-label {
    font-size: clamp(7px, 2.2vw, 12px);
    color: #666;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-button.active .nav-label {
    color: white;
}

@media (max-width: 360px) {
    .bottom-nav {
        padding: 6px 2px;
        border-radius: 16px;
    }
    .nav-button {
        padding: 4px 1px;
        margin: 0 1px;
    }
    .nav-icon {
        font-size: 18px;
    }
    .nav-label {
        font-size: 7px;
    }
}

/* Сцена магазин */
#scene-shop {
    background: var(--wednesday-bg);
    align-items: stretch;
}

.shop-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 20px 15px 90px;
    overflow-y: auto;
    background: url('assets/back_chat_wednesday.png') center/cover no-repeat;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.shop-header .section-title {
    margin-bottom: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.shop-header .shop-crystals {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.shop-crystals {
    position: static;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(92, 74, 138, 0.5) 0%, rgba(69, 39, 160, 0.4) 100%);
    border: 1px solid rgba(106, 76, 147, 0.6);
}

.shop-crystals .crystals-count {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.shop-item {
    background: rgba(228, 216, 245, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.shop-item.owned {
    opacity: 0.6;
}

.shop-item-style.owned {
    opacity: 1;
}

/* Выбранный стиль — мягкая подсветка в цвет стиля */
.shop-item-style-active.shop-item-style-style_1 {
    border: 2px solid var(--wednesday-accent);
    background: rgba(106, 76, 147, 0.25);
    box-shadow: 0 2px 12px var(--wednesday-shadow);
}
.shop-item-style-active.shop-item-style-style_2 {
    border: 2px solid #d4b8e8;
    background: rgba(212, 184, 232, 0.2);
    box-shadow: 0 2px 12px rgba(212, 184, 232, 0.35);
}
.shop-item-style-active.shop-item-style-style_3 {
    border: 2px solid #f48fb1;
    background: rgba(244, 143, 177, 0.15);
    box-shadow: 0 2px 12px rgba(244, 143, 177, 0.25);
}

.shop-style-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.shop-style-toggle .shop-style-toggle-label {
    font-size: 12px;
    color: #666;
}
.shop-style-toggle input { display: none; }
.shop-style-toggle .toggle-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.2s;
}
.shop-style-toggle .toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}
.shop-style-toggle input:checked + .toggle-slider {
    background: var(--wednesday-btn-end);
}
.shop-style-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.shop-item-icon-wrap {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 61, 101, 0.4);
    border-radius: 50%;
    overflow: hidden;
}

.shop-item-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-item-icon-placeholder {
    font-size: 28px;
}

.shop-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.shop-item-price {
    font-size: 16px;
    color: var(--wednesday-btn-end);
    font-weight: bold;
}

.shop-item-currency-icon {
    vertical-align: middle;
    height: 1.1em;
    margin-left: 2px;
    display: inline-block;
}

.shop-item.owned .shop-item-price {
    color: #4caf50;
    content: 'Куплено';
}

.shop-item.owned .shop-item-price::after {
    content: ' ✓';
}

/* Сцена истории */
#scene-stories {
    background: var(--wednesday-bg);
    align-items: stretch;
}

#scene-stories .stories-container {
    background: url('assets/back_chat_wednesday.png') center/cover no-repeat;
}

.stories-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 4px;
}

.stories-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.stories-tab.active {
    background: white;
    color: var(--wednesday-text-on);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stories-tab:active {
    opacity: 0.9;
}

.stories-tab-content.hidden {
    display: none !important;
}

.rewards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rewards-section-title {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
}

.reward-item {
    display: flex;
    align-items: center;
    background: rgba(228, 216, 245, 0.98);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(180, 160, 220, 0.6);
    min-width: 0;
}

.reward-item.reward-earned {
    border-color: rgba(106, 76, 147, 0.7);
    background: rgba(228, 216, 245, 0.98);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(106, 76, 147, 0.3);
}

.reward-item-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 232, 250, 0.9);
    border-radius: 50%;
    overflow: hidden;
}

.reward-item-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reward-item-icon-emoji {
    font-size: 28px;
}

.reward-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.reward-item-name {
    font-size: clamp(11px, 3.2vw, 16px);
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
}

.reward-item-desc {
    font-size: clamp(10px, 2.6vw, 13px);
    color: #666;
    margin-bottom: 4px;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
}

.reward-item-status {
    font-size: clamp(10px, 2.2vw, 12px);
    color: #22c55e;
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
}

.reward-item:not(.reward-earned) .reward-item-status {
    color: #999;
}

.stories-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 20px 15px 90px;
    overflow-y: auto;
    overflow-x: hidden;
    background: url('assets/back_chat_wednesday.png') center/cover no-repeat;
}

.story-item {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.story-item-avatar {
    flex-shrink: 0;
    margin-right: 15px;
}

.story-item-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.story-item-info {
    flex: 1;
    min-width: 0;
}

.story-item-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.story-item-preview {
    font-size: 14px;
    color: #666;
}

/* Всплывающее окно истории */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.story-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Модальное окно наград */
.rewards-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.rewards-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 380px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 24px;
}

.rewards-modal-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    padding-right: 35px;
}

.rewards-modal-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #f5f5f5;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e0e0e0;
    opacity: 0.6;
}

.badge-item.badge-earned {
    background: linear-gradient(135deg, rgba(92, 74, 138, 0.5) 0%, rgba(69, 39, 160, 0.35) 100%);
    border-color: var(--wednesday-accent);
    opacity: 1;
}

.badge-icon {
    font-size: 32px;
    margin-bottom: 6px;
    line-height: 1;
}

.badge-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.badge-status {
    font-size: 10px;
    color: #22c55e;
}

.badge-status.badge-locked {
    color: #999;
}

.rewards-modal-content .modal-close {
    top: 12px;
    right: 12px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:active {
    transform: scale(0.9);
}

.story-modal-x-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.story-modal-x-close:hover,
.story-modal-x-close:active {
    background: rgba(0, 0, 0, 0.15);
}

/* Био: картинка сверху, текст снизу, div вместо img (без контекстного меню) */
.story-modal-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 35vh;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.story-modal-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.story-modal-text {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    text-align: left;
    flex: 1;
    min-height: 120px;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 8px;
}

.story-modal-text .story-bio-p {
    margin: 0 0 1em 0;
    text-indent: 1.5em;
}

.story-modal-text .story-bio-p:first-child {
    margin-top: 0;
    text-indent: 0;
}

.story-modal-text .story-bio-p:last-child {
    margin-bottom: 0;
}

.story-modal-close-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 14px 24px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: var(--wednesday-bg);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 16px var(--wednesday-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.story-modal-close-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--wednesday-shadow);
}

.story-modal-close-btn:active {
    transform: scale(0.98);
}

/* Сцена настройки */
#scene-settings {
    background: var(--wednesday-bg);
    align-items: stretch;
}

.settings-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 20px 15px 90px;
    overflow-y: auto;
    background: url('assets/back_chat_wednesday.png') center/cover no-repeat;
}

.settings-container .section-title {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.settings-list {
    background: rgba(228, 216, 245, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.settings-list > *:last-child {
    border-bottom: none;
}

.setting-link-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
    width: 100%;
    font: inherit;
    text-align: left;
    transition: background 0.2s;
}

.setting-link-item:hover,
.setting-link-item:active {
    background: #f8f9fa;
}

.setting-link-icon {
    font-size: 28px;
    margin-right: 15px;
    flex-shrink: 0;
}

.setting-link-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-link-label {
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.setting-link-desc {
    font-size: 13px;
    color: #666;
}

.setting-link-arrow {
    font-size: 20px;
    color: var(--wednesday-text-on);
    flex-shrink: 0;
}

.setting-link-btn {
    appearance: none;
}

.setting-label {
    font-size: 18px;
    color: #333;
    font-weight: 500;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--wednesday-btn-end);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Картинка/видео в плашке во время диалога (fullscreenImage / fullscreenVideo) — стиль как предистория */
.dialog-media-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.dialog-media-content {
    background: var(--wednesday-bg);
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dialog-media-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.dialog-media-img,
.dialog-media-video {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.dialog-media-video {
    width: 100%;
}

.dialog-media-btn {
    flex-shrink: 0;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
    background: white;
    color: var(--wednesday-text-on);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.dialog-media-btn:active {
    transform: scale(0.98);
}
