/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #090a14;
    font-family: 'Kingsbread', monospace;
    color: #ffffff;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Контейнер сайта */
.game-screen {
    width: 768px;
    max-width: 95vw;
    margin: 0 auto;
    padding: 20px 0;
    background-color: transparent;
}

/* Шапка с логотипом */
.header-container {
    width: 100%;
    height: 120px;
    background-color: #394a50;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.logo-image {
    height: 96px;
    width: auto;
    display: block;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}

/* Контейнер текста */
.text-container {
    width: 100%;
    min-height: 300px;
    background-color: #151d28;
    padding: 24px 18px;
    margin-bottom: 0;
}

.text-content {
    width: 100%;
    height: 100%;
}

.game-text {
    font-size: 12px;
    line-height: 20px;
    color: #e0e0e0;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 0.9px;
    margin: 0;
    text-align: center;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
}

/* Кнопки ПОД ТЕКСТОМ (3 КНОПКИ) */
.buttons-container {
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 80px;
    background-color: #151d28;
    padding: 18px 0;
    border-top: 6px solid #0c1117;
}

/* Кнопки */
.pixel-button {
    position: relative;
    display: inline-block;
    text-decoration: none;
    width: 96px;
    height: 96px;
    transition: transform 0.3s ease;
}

.pixel-button img {
    position: absolute;
    top: 0;
    left: 0;
    width: 96px;
    height: 96px;
    transition: opacity 0.2s ease;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    filter: brightness(1);
}

.button-default {
    opacity: 1;
}

.button-hover {
    opacity: 0;
}

.pixel-button:hover .button-default {
    opacity: 0;
}

.pixel-button:hover .button-hover {
    opacity: 1;
}

.pixel-button:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

/* Цветовые эффекты при наведении для разных кнопок */
.tg-button:hover {
    filter: drop-shadow(0 0 8px rgba(0, 136, 204, 0.5));
}

.yt-button:hover {
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.5));
}

.ds-button:hover {
    filter: drop-shadow(0 0 8px rgba(88, 101, 242, 0.5));
}

/* Подсказки */
.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #151d28;
    color: #ffffff;
    padding: 6px 18px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    border: 3px solid #394a50;
    pointer-events: none;
    margin-bottom: 12px;
    z-index: 10;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
}

.pixel-button:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* Скриншоты игры */
.screenshots-container {
    width: 100%;
    background-color: #090a14;
    padding: 30px 18px;
    border-top: 6px solid #151d28;
    margin-bottom: 30px;
    position: relative;
}

.screenshots-title {
    font-size: 18px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 24px;
    text-shadow: 2px 2px 0 #000;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    justify-items: center;
    margin: 0 auto;
    width: 100%;
    margin-bottom: 40px;
}

.screenshot {
    width: 360px;
    height: 201px;
    max-width: 100%;
    object-fit: cover;
    border: 6px solid #394a50;
    border-radius: 8px;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    transition: all 0.3s ease;
    cursor: pointer;
    filter: brightness(0.95);
}

.screenshot:hover {
    transform: scale(1.03);
    border-color: #4a5a60;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    filter: brightness(1.05);
}

/* Визуальный разделитель - КОНЕЦ СКРИНШОТОВ */
.screenshots-end {
    position: relative;
    margin: 60px auto 30px auto;
    padding: 50px 20px;
    max-width: 100%;
    text-align: center;
}

/* Фоновая горизонтальная линия */
.screenshots-end::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #394a50;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
}

/* Контейнер текста */
.end-text-container {
    position: relative;
    display: inline-block;
    background-color: #090a14;
    padding: 20px 40px;
    border: 3px solid #394a50;
    border-radius: 12px;
    z-index: 2;
    box-shadow: 
        0 0 20px rgba(57, 74, 80, 0.3),
        inset 0 0 15px rgba(100, 120, 130, 0.1);
}

/* Первая строка */
.end-text-main {
    font-size: 22px;
    color: #ffffff;
    text-shadow: 
        2px 2px 0 #000,
        0 0 5px rgba(255, 255, 255, 0.5);
    font-style: italic;
    letter-spacing: 1.2px;
    font-weight: bold;
    margin: 0;
    line-height: 1.4;
}

/* Вторая строка - год */
.end-text-year {
    font-size: 18px;
    color: #a0b0c0;
    text-shadow: 
        1px 1px 0 #000,
        0 0 3px rgba(160, 176, 192, 0.5);
    letter-spacing: 1px;
    margin: 5px 0 0 0;
    font-weight: normal;
    font-style: normal;
}

/* Модальное окно для полноэкранного просмотра */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.97);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border: 3px solid #394a50;
    border-radius: 8px;
    background-color: #090a14;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: #394a50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #4a5a60;
    transform: scale(1.1);
}

/* Большой пустой пробел */
.big-void {
    width: 100%;
    height: 3600px;
    background-color: #090a14;
}

/* Гифка */
.gif-container {
    width: 100%;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #090a14;
    border-top: 6px solid #151d28;
    margin-top: 0;
}

.heart-gif {
    width: 288px;
    height: 432px;
    max-width: 90%;
    object-fit: contain;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    filter: brightness(1);
    transition: filter 0.3s ease;
}

/* Футер */
.footer-container {
    width: 100%;
    height: 90px;
    background-color: #090a14;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 6px solid #151d28;
    margin-top: 60px;
    padding-top: 30px;
}

.footer-text {
    font-size: 9px;
    color: #7a7a8c;
    text-shadow: 1px 1px 0 #000;
    margin: 0;
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
}

/* Скроллбар для всего сайта */
body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: #0c1117;
    border-radius: 5px;
}

body::-webkit-scrollbar-thumb {
    background: #394a50;
    border-radius: 5px;
    transition: background 0.3s;
}

body::-webkit-scrollbar-thumb:hover {
    background: #4a5a60;
}

/* ========== АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ ========== */

/* Для планшетов (900px и меньше) */
@media (max-width: 900px) {
    .game-screen {
        transform: scale(0.9);
        transform-origin: top center;
        margin: 15px auto 50px auto;
        display: block;
    }
    
    body {
        padding: 15px 5px;
        justify-content: center;
        display: flex;
    }
    
    .header-container {
        height: 100px;
    }
    
    .logo-image {
        height: 80px;
    }
    
    .text-container {
        min-height: 280px;
    }
    
    .game-text {
        font-size: 13px;
        line-height: 21px;
    }
    
    .buttons-container {
        height: 100px;
        gap: 60px;
    }
    
    .pixel-button {
        width: 80px;
        height: 80px;
    }
    
    .pixel-button img {
        width: 80px;
        height: 80px;
    }
    
    .screenshots-grid {
        gap: 15px;
    }
    
    .screenshot {
        width: 320px;
        height: 180px;
    }
    
    .screenshots-end {
        margin: 50px auto 25px auto;
        padding: 40px 15px;
    }
    
    .screenshots-end::before {
        height: 2px;
    }
    
    .end-text-container {
        padding: 15px 30px;
    }
    
    .end-text-main {
        font-size: 22px; /* Одинаковый размер на всех устройствах */
    }
    
    .end-text-year {
        font-size: 18px; /* Одинаковый размер на всех устройствах */
    }
    
    .big-void {
        height: 3000px;
    }
    
    .gif-container {
        height: 500px;
    }
    
    .heart-gif {
        width: 240px;
        height: 360px;
    }
    
    .footer-container {
        height: 80px;
        margin-top: 50px;
    }
    
    .footer-text {
        font-size: 10px;
    }
}

/* Для всех мобильных (до 768px) */
@media (max-width: 768px) {
    .game-screen {
        width: 100%;
        max-width: 100vw;
        padding: 10px 5px;
        transform: none;
        margin: 10px auto 40px auto;
    }
    
    .header-container {
        height: 80px;
    }
    
    .logo-image {
        height: 64px;
        max-width: 80%;
    }
    
    .text-container {
        min-height: auto;
        padding: 15px 10px;
    }
    
    .game-text {
        font-size: 14px;
        line-height: 22px;
    }
    
    .buttons-container {
        height: 80px;
        gap: 40px;
        padding: 15px 0;
    }
    
    .pixel-button {
        width: 64px;
        height: 64px;
    }
    
    .pixel-button img {
        width: 64px;
        height: 64px;
    }
    
    .screenshots-container {
        padding: 20px 10px;
    }
    
    .screenshots-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 30px;
    }
    
    .screenshot {
        width: 100%;
        height: 150px;
        max-width: 100%;
        border-radius: 6px;
        border-width: 4px;
    }
    
    .screenshots-end {
        margin: 40px auto 20px auto;
        padding: 30px 10px;
    }
    
    .end-text-container {
        padding: 12px 25px;
    }
    
    .end-text-main {
        font-size: 22px; /* Одинаковый размер на всех устройствах */
    }
    
    .end-text-year {
        font-size: 18px; /* Одинаковый размер на всех устройствах */
    }
    
    .big-void {
        height: 2400px;
    }
    
    .gif-container {
        height: 300px;
    }
    
    .heart-gif {
        width: 192px;
        height: 288px;
    }
    
    .footer-container {
        height: 60px;
        margin-top: 30px;
        padding-top: 15px;
    }
    
    .footer-text {
        font-size: 10px;
    }
    
    .tooltip {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* Для средних телефонов (600px и меньше) */
@media (max-width: 600px) {
    .game-screen {
        padding: 8px 4px;
    }
    
    .header-container {
        height: 70px;
    }
    
    .logo-image {
        height: 56px;
    }
    
    .text-container {
        padding: 12px 8px;
    }
    
    .game-text {
        font-size: 13px;
        line-height: 21px;
    }
    
    .buttons-container {
        height: 70px;
        gap: 30px;
    }
    
    .pixel-button {
        width: 56px;
        height: 56px;
    }
    
    .pixel-button img {
        width: 56px;
        height: 56px;
    }
    
    .screenshots-grid {
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .screenshot {
        height: 140px;
    }
    
    .screenshots-end {
        margin: 35px auto 15px auto;
        padding: 25px 8px;
    }
    
    .screenshots-end::before {
        height: 1.5px;
    }
    
    .end-text-container {
        padding: 10px 20px;
    }
    
    .end-text-main {
        font-size: 22px; /* Одинаковый размер на всех устройствах */
    }
    
    .end-text-year {
        font-size: 18px; /* Одинаковый размер на всех устройствах */
    }
    
    .big-void {
        height: 2000px;
    }
    
    .gif-container {
        height: 250px;
    }
    
    .heart-gif {
        width: 160px;
        height: 240px;
    }
    
    .footer-container {
        height: 55px;
        margin-top: 25px;
    }
    
    .footer-text {
        font-size: 9px;
    }
}

/* Для маленьких телефонов (до 480px) */
@media (max-width: 480px) {
    .game-screen {
        padding: 5px;
    }
    
    .header-container {
        height: 60px;
    }
    
    .logo-image {
        height: 48px;
    }
    
    .text-container {
        padding: 10px 6px;
    }
    
    .game-text {
        font-size: 12px;
        line-height: 20px;
    }
    
    .buttons-container {
        height: 60px;
        gap: 25px;
    }
    
    .pixel-button {
        width: 48px;
        height: 48px;
    }
    
    .pixel-button img {
        width: 48px;
        height: 48px;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .screenshot {
        height: 180px;
        border-radius: 6px;
    }
    
    .screenshots-end {
        margin: 30px auto 12px auto;
        padding: 20px 5px;
    }
    
    .end-text-container {
        padding: 8px 16px;
        border-width: 2px;
    }
    
    .end-text-main {
        font-size: 22px; /* Одинаковый размер на всех устройствах */
        line-height: 1.3;
    }
    
    .end-text-year {
        font-size: 18px; /* Одинаковый размер на всех устройствах */
        line-height: 1.3;
    }
    
    .big-void {
        height: 1800px;
    }
    
    .gif-container {
        height: 220px;
    }
    
    .heart-gif {
        width: 144px;
        height: 216px;
    }
    
    .footer-container {
        height: 50px;
        margin-top: 20px;
        padding-top: 10px;
    }
    
    .footer-text {
        font-size: 8px;
    }
}

/* Для очень маленьких телефонов (до 320px) */
@media (max-width: 320px) {
    .game-screen {
        padding: 3px;
    }
    
    .header-container {
        height: 50px;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .text-container {
        padding: 8px 4px;
    }
    
    .game-text {
        font-size: 11px;
        line-height: 18px;
    }
    
    .buttons-container {
        height: 50px;
        gap: 20px;
    }
    
    .pixel-button {
        width: 42px;
        height: 42px;
    }
    
    .pixel-button img {
        width: 42px;
        height: 42px;
    }
    
    .screenshot {
        height: 150px;
    }
    
    .screenshots-end {
        margin: 25px auto 10px auto;
        padding: 15px 3px;
    }
    
    .end-text-container {
        padding: 6px 12px;
        border-width: 1px;
    }
    
    .end-text-main {
        font-size: 22px; /* Одинаковый размер на всех устройствах */
        line-height: 1.2;
    }
    
    .end-text-year {
        font-size: 18px; /* Одинаковый размер на всех устройствах */
        line-height: 1.2;
    }
    
    .big-void {
        height: 1500px;
    }
    
    .gif-container {
        height: 180px;
    }
    
    .heart-gif {
        width: 120px;
        height: 180px;
    }
    
    .footer-container {
        height: 40px;
        margin-top: 15px;
    }
    
    .footer-text {
        font-size: 7px;
    }
}

/* Для очень больших экранов (ПК) */
@media (min-width: 1200px) {
    .game-screen {
        transform: scale(1.1);
        transform-origin: top center;
        margin: 30px auto 80px auto;
        display: block;
    }
    
    body {
        padding: 30px 0;
        justify-content: center;
        display: flex;
    }
    
    .header-container {
        height: 140px;
    }
    
    .logo-image {
        height: 112px;
    }
    
    .text-container {
        min-height: 330px;
    }
    
    .game-text {
        font-size: 13px;
        line-height: 22px;
    }
    
    .buttons-container {
        height: 140px;
        gap: 100px;
    }
    
    .pixel-button {
        width: 112px;
        height: 112px;
    }
    
    .pixel-button img {
        width: 112px;
        height: 112px;
    }
    
    .screenshot {
        width: 400px;
        height: 225px;
    }
    
    .screenshots-end {
        margin: 70px auto 40px auto;
        padding: 60px 25px;
    }
    
    .end-text-container {
        padding: 25px 50px;
    }
    
    .end-text-main {
        font-size: 22px;
    }
    
    .end-text-year {
        font-size: 18px;
    }
    
    .big-void {
        height: 4000px;
    }
    
    .gif-container {
        height: 700px;
    }
    
    .heart-gif {
        width: 336px;
        height: 504px;
    }
    
    .footer-container {
        height: 100px;
        margin-top: 80px;
    }
    
    .footer-text {
        font-size: 11px;
    }
}

/* Для экстремально больших экранов */
@media (min-width: 1600px) {
    .game-screen {
        transform: scale(1.2);
    }
    
    .screenshots-end {
        margin: 80px auto 50px auto;
        padding: 70px 30px;
    }
    
    .end-text-container {
        padding: 30px 60px;
    }
    
    .big-void {
        height: 4500px;
    }
}

/* Фикс для iOS Safari */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        body {
            padding-top: env(safe-area-inset-top);
            padding-bottom: env(safe-area-inset-bottom);
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
    }
}

/* Фикс для Firefox */
@-moz-document url-prefix() {
    body {
        scrollbar-width: thin;
        scrollbar-color: #394a50 #0c1117;
    }
}
