* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: radial-gradient(ellipse at center, #0a1230 0%, #050b20 50%, #030814 100%);
    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Home page layout */
.home-layout {
    display: flex;
    min-height: 100vh;
    gap: 60px;
    padding: 40px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-section {
    flex: 0 0 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: 700px;
}

.social-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.social-cta {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
}

.social-links-container {
    display: flex;
    gap: 30px;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f5f5f5;
    text-decoration: none;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
    font-weight: 500;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.social-icon {
    width: 24px;
    height: 24px;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.game-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.game-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.game-thumbnail {
    width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}

.game-info h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 8px;
}

.game-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.game-tag.coming-soon {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.game-tag.in-dev {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.game-tag.play-now {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
    border: 1px solid rgba(76, 175, 80, 0.6);
    padding: 6px 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    width: fit-content;
}

.game-tag.play-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.tag-icon {
    width: 16px;
    height: 16px;
}

.game-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #e0e0e0;
    margin-top: 12px;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: #c0c0c0;
}

.support-email {
    font-size: 0.9rem;
    color: #808080;
}

/* Game card link styling */
.game-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.game-card-link:hover {
    transform: translateY(-4px);
}

/* Game page specific styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-small {
    max-width: 150px;
    height: auto;
}

.back-link {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.game-page {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

.game-hero {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 60px;
}

.game-hero-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-hero-content h1 {
    font-size: 3rem;
    color: #ffffff;
    margin: 0;
}

.game-description-full {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #e0e0e0;
}

.game-stats {
    display: flex;
    gap: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffffff;
}

.play-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    align-self: flex-start;
    width: fit-content;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.button-icon {
    width: 28px;
    height: 28px;
}

/* Leaderboard styles */
.leaderboard-section {
    margin-top: 40px;
}

.leaderboard-section h2 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 30px;
    text-align: center;
}

/* Search and pagination controls */
.leaderboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.pagination-info {
    color: #a0a0a0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.page-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.page-btn.active {
    background: #60a5fa;
    border-color: #60a5fa;
    color: #ffffff;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #808080;
    padding: 0 8px;
    user-select: none;
}

.leaderboard-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-row {
    transition: background 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-row.top-three {
    background: rgba(255, 215, 0, 0.05);
}

.leaderboard-row.top-three:hover {
    background: rgba(255, 215, 0, 0.08);
}

.rank {
    font-weight: bold;
    color: #ffffff;
    font-size: 1.1rem;
}

.badge {
    font-size: 1.3rem;
    margin-right: 4px;
}

.player {
    color: #f5f5f5;
    font-weight: 500;
}

.score {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.1rem;
}

.date {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.loading-spinner,
.empty-message,
.error-message {
    text-align: center;
    padding: 40px;
    color: #a0a0a0;
    font-size: 1.1rem;
}

.error-message {
    color: #ff6b6b;
}

/* Global leaderboard specific styles */
.leaderboard-header {
    text-align: center;
    margin-bottom: 24px;
}

.leaderboard-header h3 {
    font-size: 1.8rem;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.leaderboard-subtitle {
    color: #a0a0a0;
    font-size: 0.95rem;
    margin: 0;
}

.leaderboard-footer {
    text-align: center;
    color: #808080;
    font-size: 0.85rem;
    margin-top: 20px;
    font-style: italic;
}

.time {
    color: #60a5fa;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
}

.difficulty {
    text-align: center;
}

.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 968px) {
    .game-hero-content h1 {
        font-size: 2.2rem;
    }

    .game-stats {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 968px) {
    .home-layout {
        flex-direction: column;
        padding: 30px 20px;
        gap: 40px;
    }

    .logo-section {
        flex: 0 0 auto;
    }

    .logo {
        max-width: 300px;
    }

    .content-section {
        max-width: 100%;
    }

    .social-section {
        align-items: center;
    }

    .game-card {
        flex-direction: column;
        text-align: center;
    }

    .game-thumbnail {
        width: 100%;
        max-width: 300px;
    }

    .game-info {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .social-links-container {
        flex-direction: column;
        gap: 15px;
    }

    .social-link {
        width: 220px;
        justify-content: center;
    }

    .game-info h2 {
        font-size: 1.5rem;
    }

    .game-description {
        font-size: 1rem;
    }

    .game-header {
        padding: 15px 20px;
    }

    .logo-small {
        max-width: 100px;
    }

    .game-hero-content h1 {
        font-size: 1.8rem;
    }

    .game-description-full {
        font-size: 1rem;
    }

    .leaderboard-container {
        padding: 15px;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
}
