@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/fredoka/static/Fredoka-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/fredoka/static/Fredoka-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/fredoka/static/Fredoka-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/fredoka/static/Fredoka-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Quantico';
    src: url('/fonts/Quantico/Quantico-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Quantico';
    src: url('/fonts/Quantico/Quantico-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Quantico';
    src: url('/fonts/Quantico/Quantico-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: 'Quantico';
    src: url('/fonts/Quantico/Quantico-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
}

* {
    font-family: 'Fredoka', sans-serif;
}

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
}

header {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
}

.discord-login-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background-color: #5865F2;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.discord-login-btn:hover {
    background-color: #4752C4;
}

.discord-login-btn img {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    margin-bottom: 0;
    flex-shrink: 0;
    vertical-align: middle;
    filter: brightness(0) invert(1);
}

#error-stack-container,
#notif-stack-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.error-toast {
    pointer-events: auto;
    background-color: #1a1a1a;
    color: #eeeeee;
    width: 280px;
    padding: 12px 16px;
    border-radius: 6px;
    /* Full red outline */
    border: 1px solid #ff4444; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: toastSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes toastSlideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.error-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.error-header strong {
    color: #ff4444;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.error-time {
    color: #666;
    font-size: 0.65rem;
    font-family: monospace;
}

.error-content span {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #cccccc;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #555;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 12px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #ff4444;
}

.success-notif {
    pointer-events: auto;
    background-color: #1a1a1a;
    color: #eeeeee;
    width: 280px;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #44aa44;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: notifSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes notifSlideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notif-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.notif-header strong {
    color: #44aa44;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.notif-time {
    color: #666;
    font-size: 0.65rem;
    font-family: monospace;
}

.notif-content span {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #cccccc;
    word-break: break-word;
}

.notif-close {
    background: none;
    border: none;
    color: #555;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0 0 12px;
    transition: color 0.2s;
}

.notif-close:hover {
    color: #44aa44;
}

.main-content {
    padding: 40px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.content-divider {
    padding: 0;
    border: none;
}

.games-divider {
    grid-column: 1;
}

.leaderboard-divider {
    grid-column: 2;
}

.servers-divider {
    grid-column: 2;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #333;
}

.games-section,
.leaderboard-section,
.servers-section {
    display: block;
}

.mobile-tabs {
    display: none;
}


.main-content h2 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.game-tile {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.game-tile:hover {
    border-color: #6366f1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), inset 0 0 20px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
}

.game-tile-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    animation-play-state: paused;
    object-fit: cover;
}

.game-tile:hover .game-tile-bg {
    animation-play-state: running;
    opacity: 0.4;
}

.game-tile-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.game-tile-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.leaderboard-placeholder,
.servers-placeholder {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #999;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}


#leaderboard-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: #2a2a2a;
    border-bottom: 1px solid #333;
}

.leaderboard-table th {
    padding: 12px;
    text-align: left;
    color: #999;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #333;
    color: #ffffff;
}

.leaderboard-table tbody tr:hover {
    background: #252525;
}

.leaderboard-table .rank {
    font-weight: 700;
    color: #6366f1;
    width: 50px;
}

.leaderboard-table .player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #444;
}

.leaderboard-table .score {
    text-align: left;
    font-weight: 600;
    color: #4ade80;
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.server-tile {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.server-tile:hover {
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.server-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.server-image-placeholder {
    width: 100%;
    height: 160px;
    background: #2a2a2a;
}

.server-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.server-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
}

.server-description {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
    flex: 1;
}

.server-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #888;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.invite-btn {
    background: #5865F2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
}

.invite-btn:hover {
    background: #4752C4;
}

.redirect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.redirect-overlay.hidden {
    display: none;
    opacity: 0;
}

.redirect-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.redirect-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #333;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.redirect-text {
    font-size: 24px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        gap: 0;
        border-bottom: 1px solid #333;
        margin-bottom: 20px;
        padding: 0;
        background: #1a1a1a;
    }

    .mobile-tab {
        flex: 1;
        background: none;
        border: none;
        color: #999;
        padding: 12px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        border-bottom: 2px solid transparent;
        transition: all 0.2s ease;
        text-align: center;
    }

    .mobile-tab.active {
        color: #6366f1;
        border-bottom-color: #6366f1;
    }

    .mobile-tab:hover {
        color: #818cf8;
    }

    .main-content {
        padding: 20px;
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 0;
    }

    .content-divider {
        padding: 0;
        border: none;
    }

    .games-divider,
    .leaderboard-divider,
    .servers-divider {
        grid-column: auto;
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        display: none;
    }

    .games-divider.active,
    .leaderboard-divider.active,
    .servers-divider.active {
        display: block;
    }
}
