* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #14181c;
    color: #e8e8e8;
    min-height: 100vh;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1a1f24 0%, #0d1117 100%);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border: 1px solid #2a323a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.title h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #f5c842, #f59e42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.title p {
    font-size: 13px;
    color: #8899a6;
    margin-top: 2px;
    font-weight: 400;
}

.navbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.navbar a {
    color: #b0c0d0;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.navbar a:hover {
    background: #2a323a;
    color: #ffffff;
    transform: translateY(-1px);
}

.navbar a:last-child {
    background: linear-gradient(135deg, #f5c842, #f59e42);
    color: #14181c;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(245, 200, 66, 0.3);
}

.navbar a:last-child:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 25px rgba(245, 200, 66, 0.4);
}

.btn-log {
    font-size: 18px !important;
    padding: 12px 28px !important;
}

/* ==================== CATEGORIAS E GRIDS ==================== */

.categoria {
    background: #1a1f24;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #2a323a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.categoria h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.categoria h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #2a323a, transparent);
    margin-left: 10px;
}

/* Grid Corrigido para a seção de Logs Recentes */
.logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    width: 100%;
}

.logs-grid a {
    background: #0d1117;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: #e8e8e8;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}

.logs-grid a:hover {
    transform: translateY(-4px);
    border-color: #f5c842;
    box-shadow: 0 8px 30px rgba(245, 200, 66, 0.15);
    background: #1a1f24;
}

.logs-grid a img {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a1f24, #0d1117);
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #2a323a;
}

.logs-grid a h3 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 4px 0 0 0;
    line-height: 1.3;
}

.logs-grid a h3::after {
    display: none;
}

.logs-grid a p {
    font-size: 12px;
    color: #8899a6;
    margin: 0;
}

.logs-grid a p strong {
    color: #e8e8e8;
    font-weight: 500;
}

.logs-grid a p:last-of-type {
    font-size: 13px;
    color: #f5c842;
    letter-spacing: 1px;
}

/* Grid para Popular Games */
.categoria:last-of-type {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.categoria:last-of-type h3 {
    grid-column: 1 / -1;
}

.categoria:last-of-type a {
    background: #0d1117;
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: #e8e8e8;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.categoria:last-of-type a:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
    background: #1a1f24;
}

.categoria:last-of-type a img {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a1f24, #0d1117);
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #2a323a;
}

.categoria:last-of-type a h3 {
    font-size: 13px;
    font-weight: 500;
    color: #e8e8e8;
    margin: 0;
    line-height: 1.3;
}

.categoria:last-of-type a h3::after {
    display: none;
}

/* Fallback Imagem Vazia */
.categoria a img[src=""] {
    background: linear-gradient(135deg, #1a1f24 0%, #2a323a 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.categoria a img[src=""]::after {
    content: '🎮';
    position: absolute;
    font-size: 40px;
    opacity: 0.3;
}

.no-logs {
    color: #8899a6;
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

/* ==================== MODAL ==================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #1a1f24;
    border-radius: 16px;
    padding: 40px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #2a323a;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #8899a6;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.modal-close:hover {
    color: #fff;
}

.modal-game-detail {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.modal-game-image {
    width: 200px;
    border-radius: 12px;
    border: 1px solid #2a323a;
}

.modal-game-info {
    flex: 1;
}

.modal-game-title {
    color: #fff;
    font-size: 28px;
    margin-bottom: 10px;
}

.modal-game-user {
    color: #8899a6;
    margin-bottom: 5px;
}

.modal-game-user strong {
    color: #e8e8e8;
}

.modal-game-rating {
    color: #f5c842;
    font-size: 24px;
    margin-bottom: 15px;
}

.modal-game-genre {
    color: #8899a6;
    margin-bottom: 5px;
}

.modal-game-genre strong {
    color: #e8e8e8;
}

.modal-game-tags {
    color: #8899a6;
    margin-bottom: 15px;
}

.modal-game-tags strong {
    color: #e8e8e8;
}

.modal-game-review {
    background: #0d1117;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #2a323a;
    margin-bottom: 20px;
}

.modal-game-review p {
    color: #e8e8e8;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-back {
    background: #2a323a;
    color: #e8e8e8;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn-back:hover {
    background: #3a424a;
}

.btn-submit {
    background: linear-gradient(135deg, #f5c842, #f59e42);
    color: #14181c;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 200, 66, 0.4);
}

.modal-rating-section {
    margin: 15px 0;
}

.modal-rating-section label {
    color: #8899a6;
    display: block;
    margin-bottom: 5px;
}

.star-rating-modal {
    display: flex;
    gap: 5px;
    font-size: 30px;
    cursor: pointer;
}

.star-rating-modal span {
    color: #2a323a;
    transition: 0.2s;
}

.star-rating-modal span:hover {
    transform: scale(1.2);
}

.modal-review-section {
    margin: 15px 0;
}

.modal-review-section label {
    color: #8899a6;
    display: block;
    margin-bottom: 5px;
}

.modal-review-section textarea {
    width: 100%;
    background: #0d1117;
    border: 1px solid #2a323a;
    border-radius: 8px;
    padding: 10px;
    color: #e8e8e8;
    resize: vertical;
    font-family: inherit;
}

.modal-review-section textarea:focus {
    border-color: #f5c842;
    outline: none;
}

/* ==================== FOOTER ==================== */

footer {
    background: linear-gradient(135deg, #0d1117 0%, #1a1f24 100%);
    border-radius: 16px;
    border: 1px solid #2a323a;
    padding: 40px 30px 20px;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #f5c842, #f59e42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.footer-section h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.footer-section p {
    color: #8899a6;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
    color: #8899a6;
    font-size: 14px;
}

.footer-section ul li a {
    color: #8899a6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: #f5c842;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #0d1117;
    border-radius: 50%;
    color: #8899a6;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    border: 1px solid #2a323a;
}

.social-links a:hover {
    background: #2a323a;
    color: #f5c842;
    transform: translateY(-3px);
    border-color: #f5c842;
}

.footer-bottom {
    border-top: 1px solid #2a323a;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-bottom p {
    color: #8899a6;
    font-size: 13px;
}

.footer-bottom p:last-child {
    color: #6a7a8a;
    font-size: 13px;
}

/* ==================== RESPONSIVIDADE ==================== */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px;
    }

    .title h1 {
        font-size: 24px;
    }

    .navbar {
        justify-content: center;
        gap: 4px;
    }

    .navbar a {
        font-size: 12px;
        padding: 6px 12px;
    }

    .logs-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .categoria:last-of-type {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        padding: 16px;
    }

    .categoria h3 {
        font-size: 17px;
    }

    .logs-grid a h3 {
        font-size: 12px;
    }

    .categoria:last-of-type a h3 {
        font-size: 11px;
    }

    .modal-content {
        padding: 25px;
        width: 95%;
    }

    .modal-game-detail {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .modal-game-image {
        width: 150px;
    }

    .modal-actions {
        justify-content: center;
    }

    footer {
        padding: 30px 20px 15px;
    }

    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-section h3 {
        font-size: 20px;
    }

    .footer-section h4 {
        font-size: 14px;
    }

    .footer-section ul li {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .logs-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .categoria:last-of-type {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .navbar a {
        font-size: 11px;
        padding: 5px 10px;
    }

    .logs-grid a h3 {
        font-size: 11px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .footer-section:first-child {
        grid-column: 1 / -1;
    }

    .social-links {
        justify-content: center;
    }
}