:root {
    color-scheme: dark;

    --background: #080b12;
    --surface: #111622;
    --surface-light: #171e2d;
    --border: #283247;
    --text: #f5f7ff;
    --muted-text: #9da8bc;
    --accent: #7c5cff;
    --accent-hover: #9178ff;
    --error: #ff6b7a;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    color: var(--text);
    background:
            radial-gradient(circle at top, #18203a 0, transparent 40%),
            var(--background);

    font-family:
            Inter,
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;
}

.site-header {
    min-height: 72px;
    padding: 0 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(8, 11, 18, 0.8);
    border-bottom: 1px solid var(--border);
}

.logo {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
}

.logout-button {
    padding: 10px 16px;

    color: var(--text);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;

    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.logout-button:hover {
    color: white;
    background: var(--accent);
    border-color: var(--accent);
}

.home-page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 64px 32px;
}

.status-message,
.error-message {
    text-align: center;
}

.status-message {
    color: var(--muted-text);
}

.error-message {
    color: var(--error);
}

.profile-card {
    padding: 32px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.profile-heading {
    margin-bottom: 32px;
}

.username {
    margin: 0 0 8px;
    color: var(--accent-hover);
    font-weight: 600;
}

h1 {
    margin: 0;
    font-size: 2rem;
}

.statistics {
    margin: 0;

    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.statistic {
    padding: 20px;

    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.statistic dt {
    margin-bottom: 10px;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.statistic dd {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

@media (max-width: 800px) {
    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .site-header {
        padding: 0 16px;
    }

    .home-page {
        padding: 40px 16px;
    }

    .profile-card {
        padding: 22px;
    }

    .statistics {
        grid-template-columns: 1fr;
    }
}

/* Каталог игр */

.games-section {
    margin-top: 36px;
}

.games-heading {
    margin-bottom: 20px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.games-heading h2 {
    margin: 0;
    font-size: 1.65rem;
}

.games-caption {
    margin: 0 0 6px;

    color: var(--accent-hover);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.games-description {
    margin: 0;

    color: var(--muted-text);
    font-size: 0.9rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* Одна карточка игры */

.game-card {
    min-height: 210px;
    padding: 22px;

    display: flex;
    flex-direction: column;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.game-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.game-icon {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    color: white;
    background: rgba(124, 92, 255, 0.18);
    border: 1px solid rgba(124, 92, 255, 0.38);
    border-radius: 12px;

    font-size: 1.25rem;
    font-weight: 800;
}

.game-difficulty {
    padding: 6px 9px;

    color: var(--muted-text);
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
}

.game-card h3 {
    margin: 18px 0 8px;
    font-size: 1.25rem;
}

.game-card-description {
    margin: 0 0 22px;

    color: var(--muted-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.game-launch-button {
    width: 100%;
    margin-top: auto;
    padding: 12px 16px;

    color: white;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 10px;

    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.game-launch-button:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.game-launch-button:disabled {
    color: var(--muted-text);
    background: var(--surface-light);
    border-color: var(--border);
    cursor: default;
}

/* Адаптация каталога под небольшой экран */

@media (max-width: 800px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .games-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}