@font-face {
    font-family: 'Days Sans Black';
    src: url('dayssansblack.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Vela Sans';
    src: url('VelaSans-Medium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

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

body {
    background: linear-gradient(to bottom, #000000, #271DAF, #8982E9);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    color: white;
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 10%;
    background: transparent;
}

.header-left {
    font-family: 'Vela Sans', sans-serif;
    font-weight: bold;
    color: #FF53AC;
    font-size: 1.2rem;
}

.header-center {
    font-family: 'Days Sans Black', sans-serif;
    font-weight: normal;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    gap: 15px;
    color: #FF53AC;
    align-items: center;
    font-size: 1.2rem;
}

.control-btn {
    cursor: pointer;
    display: inline-block;
}

.minimize {
    width: 15px;
    height: 2px;
    background-color: #FF53AC;
}

.maximize {
    width: 14px;
    height: 14px;
    border: 2px solid #FF53AC;
}

.content-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 2%;
}

.scene-container {
    position: relative;
    width: 100%;
    max-width: 1800px;
}

.base-image {
    width: 100%;
    height: auto;
    display: block;
}

.speech-bubble {
    position: absolute;
    background-color: #FFF9C4;
    color: #000;
    padding: 15px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid #000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    z-index: 5;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    border-style: solid;
    display: block;
    width: 0;
}

.bubble-left {
    top: 25%;
    left: 25%;
    transform: translate(-50%, -50%);
    min-width: 150px;
    min-height: 120px;
}

.bubble-left::after {
    top: 100%;
    right: 20px;
    border-width: 20px 0 0 15px;
    border-color: #FFF9C4 transparent transparent transparent;
}

.bubble-right {
    top: 15%;
    right: 34%;
    transform: translate(50%, -60%);
    min-width: 260px;
    min-height: 100px;
}

.bubble-right::after {
    top: 100%;
    left: auto;
    right: 25px;
    border-width: 20px 0 0 20px;
    border-color: #FFF9C4 transparent transparent transparent;
}

.corkboard-grid {
    position: absolute;
    top: 31%;
    left: 40.5%;
    width: 39%;
    height: 44%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 5px;
    padding: 25px;
    padding-bottom: 5px;
}

.pin-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pin-container:nth-child(1) { transform: rotate(-4deg) translate(0, 0); }
.pin-container:nth-child(2) { transform: rotate(3deg) translate(-10px, -10px); }
.pin-container:nth-child(3) { transform: rotate(-5deg) translate(5px, -5px); }
.pin-container:nth-child(4) { transform: rotate(6deg) translate(15px, -20px); }
.pin-container:nth-child(5) { transform: rotate(-2deg) translate(20px, -35px); }
.pin-container:nth-child(6) { transform: rotate(4deg) translate(5px, -10px); }

.pinned-img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease-out;
    position: relative;
    z-index: 10;
}

.pin-container:nth-child(n) .pinned-img:hover,
.pin-container:nth-child(n) .pinned-img.mobile-zoomed {
    transform: scale(1.6) rotate(0deg) translate(0, 0);
    z-index: 20;
}

.bottom-footer {
    text-align: center;
    padding: 20px 10%;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ================= АДАПТИВ ПОД ТЕЛЕФОНЫ (breakpoint 768px) ================= */
@media (max-width: 768px) {
    .top-bar, .bottom-footer {
        padding: 15px 20px;
    }

    /* Изображение идет ровно от края до края экрана телефона */
    .content-wrapper {
        padding: 0;
    }

    .scene-container {
        width: 100%;
        max-width: 100%;
    }

    /* Сетка сжата по вертикали, чтобы уменьшить расстояние между рядами */
    .corkboard-grid {
        top: 18.4%; /* Слегка скорректировано под новую высоту */
        left: 10%;
        width: 80%;
        height: 14.5%; /* Уменьшено с 16.5%, чтобы сблизить ряды */
        padding: 10px;
        gap: 0px 5px; /* 2px по вертикали (меньше расстояния), 5px по горизонтали */
    }

    /* Аккуратные наклоны элементов для мобильной сетки */
    .pin-container { transform: none !important; }
    .pin-container:nth-child(1) { transform: rotate(-2deg) !important; }
    .pin-container:nth-child(2) { transform: rotate(2deg) !important; }
    .pin-container:nth-child(3) { transform: rotate(-1deg) !important; }
    .pin-container:nth-child(4) { transform: rotate(2deg) !important; }
    .pin-container:nth-child(5) { transform: rotate(-2deg) !important; }
    .pin-container:nth-child(6) { transform: rotate(1deg) !important; }

    /* Безопасный размер картинок, чтобы они не касались деревянных краев */
    .pinned-img {
        max-width: 85%;
        max-height: 85%;
        object-fit: contain;
    }

    .pin-container:nth-child(n) .pinned-img:hover,
    .pin-container:nth-child(n) .pinned-img.mobile-zoomed {
        transform: scale(1.25) rotate(0deg);
    }

    /* ВЕРХНИЙ БАББЛ (текст "за покупку рендера...") */
    .bubble-right {
        top: 6.5%;
        left: 25%;
        transform: none;
        width: 46%;
        min-width: unset;
        min-height: unset;
        padding: 8px 10px;
        font-size: 0.6rem;
        border: 1px solid #000;
        z-index: 5;
    }
    .bubble-right::after {
        top: 100%;
        right: 15px;
        left: auto;
        border-width: 15px 0 0 20px;
        border-color: #FFF9C4 transparent transparent transparent;
    }

    /* НИЖНИЙ БАББЛ (список "не пососно...") */
    .bubble-left {
        top: 58.5%;
        left: 34%;
        transform: none;
        width: 38%;
        min-width: unset;
        min-height: unset;
        padding: 8px 10px;
        font-size: 0.6rem;
        border: 1px solid #000;
        z-index: 5;
    }
    .bubble-left::after {
        top: 100%;
        left: 20px;
        right: auto;
        border-width: 15px 20px 0 0;
        border-color: #FFF9C4 transparent transparent transparent;
    }
}

/* ================= ПОЛНОЭКРАННЫЙ ПРОСМОТР (LIGHTBOX) ================= */
.lightbox {
    display: none; /* По умолчанию скрыто */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85); /* Затемнение заднего фона */
    z-index: 9999; /* Поверх абсолютно всех элементов */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

/* Активное состояние окна */
.lightbox.active {
    display: flex;
    opacity: 1;
}

/* Стили для максимального увеличения картинки на весь экран */
.lightbox-content {
    width: 100%;
    height: 100%;
    max-width: 50%;  /* Занимает ровно 100% ширины экрана */
    max-height: 50%; /* Занимает ровно 100% высоты экрана */
    object-fit: contain; /* Картинка увеличивается до упора в края, сохраняя свои пропорции */
    border-radius: 0; /* Убираем скругления, чтобы на телефонах картинка сидела бесшовно */
    box-shadow: none; /* Тени больше не нужны, так как картинка упирается в края экрана */

    /* Плавный эффект появления */
    transform: scale(0.97);
    transition: transform 0.18s ease-in-out;
}

/* Состояние при открытом лайтбоксе */
.lightbox.active .lightbox-content {
    transform: scale(1);
}

html, body {
    /* Дублируем запрет на темную тему для браузеров на уровне CSS */
    color-scheme: light !important;
}

/* Абсолютная защита картинок от принудительного обесцвечивания и инверсии цветов */
img,
.base-image,
.pinned-img,
.lightbox-content {
    /* Сбрасываем любые фильтры (включая grayscale и invert), которые пытается внедрить Samsung Internet */
    filter: none !important;

    /* Явно прописываем нулевое обесцвечивание и полную яркость с наивысшим приоритетом */
    filter: grayscale(0%) brightness(100%) contrast(100%) !important;

    /* Отключаем возможные режимы смешивания слоев, которые браузер мог применить */
    mix-blend-mode: normal !important;
}

.base-image, .pinned-img, .lightbox-content {
    will-change: transform;
    transform: translateZ(0);
}
