/* ========================
   THE GAME - GRIGLIA 5x5
   ======================== */

.tg-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.tg-item {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tg-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tg-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    transition: opacity 0.3s;
}

.tg-thumb:hover {
    opacity: 0.85;
}

.tg-info {
    padding: 12px;
    text-align: center;
}

.tg-title {
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

.tg-btn:hover {
    background: #005a87;
    color: #fff;
}

/* Pagination */
.tg-pagination {
    text-align: center;
    margin: 30px 0;
}

.tg-pagination a,
.tg-pagination span {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.tg-pagination a:hover {
    background: #555;
}

.tg-pagination .current {
    background: #0073aa;
}

/* ========================
   LIGHTBOX
   ======================== */

#tg-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    animation: tgFadeIn 0.3s;
}

#tg-lightbox.active {
    display: flex;
}

#tg-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.tg-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.tg-close:hover {
    color: #ff4444;
}

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

/* ========================
   RESPONSIVE
   ======================== */

@media (max-width: 1200px) {
    .tg-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .tg-grid { grid-template-columns: repeat(3, 1fr); }
    .tg-thumb { height: 180px; }
}

@media (max-width: 768px) {
    .tg-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .tg-thumb { height: 160px; }
}

@media (max-width: 480px) {
    .tg-grid { grid-template-columns: 1fr; }
    .tg-thumb { height: 220px; }
}