:root {
    --bg-color: #111;
    --card-bg: #1e1e1e;
    --text-color: #eee;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--telegram-bg-color, var(--bg-color));
    color: var(--telegram-text-color, var(--text-color));
    font-family: sans-serif;
    -webkit-tap-highlight-color: transparent;
}

.gallery-container {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-bottom: 50px;
}

.image-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    position: relative;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-card img.loaded {
    opacity: 1;
}

.skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #222, #333, #222);
    background-size: 200%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-img-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.modal img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
}

.modal-info {
    padding: 20px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}

.empty-state {
    grid-column: span 2;
    text-align: center;
    padding-top: 50px;
    color: #777;
}