/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Ubuntu', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e8e8e8;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Auth Status Bar */
.auth-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.login-btn {
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.login-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.register-btn {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.register-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-1px);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.welcome-text {
    color: #e8e8e8;
    font-size: 0.9rem;
}

.user-btn {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid;
    background: none;
    cursor: pointer;
}

.token-btn {
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.3);
}

.token-btn:hover {
    background: rgba(59, 130, 246, 0.2);
}

.scripts-btn {
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.scripts-btn:hover {
    background: rgba(168, 85, 247, 0.2);
}

.user-btn.logout {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.user-btn.logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 600;
    background: linear-gradient(45deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    margin-bottom: 20px;
    color: #b8b8b8;
}

.status-info {
    margin-top: 15px;
}

.server-status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Game Selection */
.game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.game-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 15px;
    z-index: 1;
}

.game-icon-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: #60a5fa;
    text-align: center;
    z-index: 2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.game-content {
    position: relative;
    z-index: 3;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.3) 80%, transparent 100%);
    padding: 30px;
    margin-top: auto;
    border-radius: 0 0 15px 15px;
}

.game-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #ffffff;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.game-description {
    color: #e0e0e0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.game-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.game-features li {
    color: #60a5fa;
    margin: 8px 0;
    font-size: 0.9rem;
    padding-left: 20px;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.game-features li:before {
    content: "•";
    color: #22c55e;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.game-stats {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #9ca3af;
    display: block;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3b82f6;
    margin-top: 4px;
}

.game-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.game-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.info-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card ol {
    padding-left: 20px;
    color: #9ca3af;
}

.info-card li {
    margin: 8px 0;
    color: #b8b8b8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.footer p {
    color: #9ca3af;
    margin-bottom: 10px;
}

/* Status Colors */
.status-online {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #22c55e !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

.status-error {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.toast-message {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Toast Types */
.toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast-success .toast-icon {
    color: #22c55e;
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}

.toast-info .toast-icon {
    color: #60a5fa;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .auth-status {
        top: 15px;
        right: 15px;
        flex-direction: column;
    }

    .auth-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .auth-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .user-menu {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .game-selection {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-card {
        min-height: 400px;
    }

    .game-content {
        padding: 20px;
    }

    .game-stats {
        flex-direction: column;
        gap: 10px;
    }

    .info-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .toast {
        min-width: 280px;
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .auth-status {
        top: 10px;
        right: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .game-card {
        min-height: 350px;
    }

    .game-content {
        padding: 15px;
    }

    .game-icon-fallback {
        font-size: 3rem;
    }

    .toast {
        min-width: auto;
        left: 20px;
        right: 20px;
        transform: translateY(-100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* Smooth transitions */
.stat-value {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}