:root {
    --bg: #8f939c;
    --bg-deep: #7a7f88;
    --surface: #e6e4df;
    --surface-raised: #f3f1ec;
    --border: #5c6068;
    --border-soft: #b0b4bc;
    --text: #12141a;
    --text-secondary: #3a3f4a;
    --text-tertiary: #5e6470;
    --accent: #2e4a62;
    --accent-light: #d4dde6;
    --accent-hover: #1e3345;
    --warm: #9a4a2e;
    --warm-light: #ead9cf;
    --shadow-sm: 0 1px 0 rgba(18, 20, 26, 0.08);
    --shadow-md: 0 4px 16px rgba(18, 20, 26, 0.14);
    --shadow-lg: 0 12px 40px rgba(18, 20, 26, 0.22);
    --radius: 2px;
    --radius-lg: 3px;
    --font: "IBM Plex Sans", system-ui, sans-serif;
    --display: "Syne", system-ui, sans-serif;
    --max: 1160px;
}

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

body {
    font-family: var(--font);
    font-size: 15px;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    background-image:
        linear-gradient(90deg, rgba(18, 20, 26, 0.04) 1px, transparent 1px),
        linear-gradient(180deg, rgba(18, 20, 26, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.site-header {
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.125rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-decoration: none;
    color: inherit;
}

.brand-title {
    font-family: var(--display);
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--text);
    text-transform: uppercase;
}

.brand-tag {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

.header-nav a:hover {
    color: var(--text);
    text-decoration: underline;
}

.search-form {
    flex: 1;
    max-width: 360px;
}

.search-form input {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    background: var(--surface-raised);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9375rem;
    transition: border-color 0.15s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--border);
}

.category-nav {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1.5rem;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--border-soft);
}

.category-list {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    padding: 0.625rem 0 0.75rem;
}

.category-list button {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.category-list button:hover {
    background: var(--surface-raised);
    color: var(--text);
    border-color: var(--border-soft);
}

.category-list button.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--surface-raised);
}

.main-content {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.status-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--surface-raised);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    color: var(--surface-raised);
}

.page-indicator {
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}

.btn-text {
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--surface-raised);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.btn-text:hover:not(:disabled) {
    color: #fff;
}

.btn-text:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.featured-section {
    margin-bottom: 1.5rem;
}

.featured-game-card {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.featured-game-card:hover {
    box-shadow: 0 16px 48px rgba(18, 20, 26, 0.28);
    border-color: var(--text);
}

.featured-game-card:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

.featured-game-image {
    aspect-ratio: 21 / 9;
    min-height: 320px;
    background: var(--bg-deep);
    overflow: hidden;
}

.featured-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.35s ease, opacity 0.2s;
}

.featured-game-card:hover .featured-game-image img {
    transform: scale(1.03);
    opacity: 0.94;
}

.featured-game-image .placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
}

.featured-game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem 2.75rem;
    background: linear-gradient(to top, rgba(18, 20, 26, 0.88) 0%, rgba(18, 20, 26, 0.45) 45%, transparent 100%);
    pointer-events: none;
}

.featured-game-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--surface-raised);
    margin-bottom: 0.625rem;
}

.featured-game-title {
    font-family: var(--display);
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    max-width: 80%;
}

.featured-game-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warm-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.625rem;
}

.featured-game-cat {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(243, 241, 236, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

.section-heading {
    font-family: var(--display);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--surface-raised);
    margin-bottom: 0.75rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.game-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.game-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border);
}

.game-card:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.game-card-image {
    aspect-ratio: 460 / 215;
    flex-shrink: 0;
    background: var(--bg-deep);
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-soft);
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: opacity 0.2s;
}

.game-card:hover .game-card-image img {
    opacity: 0.92;
}

.game-card-image .placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
}

.game-card-body {
    padding: 0.875rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
}

.game-card-title {
    font-family: var(--display);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.game-card:hover .game-card-title {
    color: var(--accent);
}

.game-card-meta {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--warm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.game-card-cat {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

html:has(.game-modal[open]) {
    overflow: hidden;
}

.game-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    overflow: hidden;
    overscroll-behavior: contain;
}

.game-modal::backdrop {
    background: rgba(18, 20, 26, 0.55);
}

.game-modal-shell {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, 94vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    background: var(--surface-raised);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.375rem 0.625rem;
    font-family: var(--font);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text);
    border-color: var(--border);
}

.modal-body {
    overflow-y: auto;
    max-height: 92vh;
    min-height: 0;
}

.modal-loading {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-soft);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-banner-wrap {
    position: relative;
    border-bottom: 2px solid var(--border);
}

.modal-banner {
    width: 100%;
    aspect-ratio: 16 / 5;
    object-fit: cover;
    display: block;
    background: var(--bg-deep);
}

.modal-banner-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--surface-raised), transparent 55%);
    pointer-events: none;
}

.modal-content {
    padding: 0 1.5rem 1.5rem;
    margin-top: -1.5rem;
    position: relative;
    z-index: 1;
}

.modal-title {
    font-family: var(--display);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin-bottom: 0.75rem;
    padding-right: 4rem;
    text-transform: uppercase;
}

.modal-lead {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.125rem;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
}

.tag {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius);
}

.tag-score {
    background: var(--accent-light);
    border-color: var(--border-soft);
    color: var(--accent);
}

.tag-warm {
    background: var(--warm-light);
    border-color: #c9a090;
    color: var(--warm);
}

.steam-line {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.steam-line a {
    font-weight: 600;
}

.detail-block {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}

.detail-block h3 {
    font-family: var(--display);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.spec-table tr {
    border-bottom: 1px solid var(--border-soft);
}

.spec-table tr:last-child {
    border-bottom: none;
}

.spec-table th,
.spec-table td {
    padding: 0.5rem 0;
    text-align: left;
    vertical-align: top;
}

.spec-table th {
    width: 36%;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    padding-right: 1rem;
}

.screenshot-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.screenshot-row img {
    height: 100px;
    width: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-soft);
    flex-shrink: 0;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-list li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 0.75rem;
    border-left: 2px solid var(--border);
}

.feature-list strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.download-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.125rem;
}

.btn-download {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    padding: 0.5625rem 1.25rem;
    background: var(--text);
    color: var(--surface-raised);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-download:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: wait;
}

.mirror-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.mirror-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mirror-list li {
    font-size: 0.8125rem;
}

.mirror-list button {
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.mirror-list button:hover:not(:disabled) {
    text-decoration: underline;
}

.mirror-list button:disabled {
    color: var(--text-tertiary);
    cursor: wait;
}

.mirror-note {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.empty-state {
    grid-column: 1 / -1;
    background: var(--surface-raised);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.site-footer {
    max-width: var(--max);
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--surface);
}

.site-footer a {
    color: var(--surface-raised);
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .search-form {
        max-width: none;
    }

    .featured-game-image {
        min-height: 220px;
        aspect-ratio: 16 / 10;
    }

    .featured-game-overlay {
        padding: 1.5rem 1.25rem;
    }

    .featured-game-title {
        max-width: 100%;
    }

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

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-content {
        padding: 0 1.125rem 1.125rem;
    }
}