.games-section {
    padding: 24px 40px 48px;
    animation: fadeIn 0.35s ease;
}

.games-platform-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(229, 169, 79, 0.10);
    border: 1px solid rgba(229, 169, 79, 0.35);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 22px;
    color: #e8c97a;
    font-size: 0.93rem;
    line-height: 1.4;
}

.games-platform-banner svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.games-platform-banner strong {
    color: var(--accent, #E5A94F);
}

.games-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.games-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    overflow: hidden;
}

.games-search input {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    background: transparent;
    border: 0;
    color: #fff;
    font: inherit;
    outline: none;
}

.games-search button,
.games-action-btn {
    height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    background: var(--accent, #E5A94F);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}

.games-search button {
    border-radius: 0;
    padding: 0 14px;
}

.games-action-btn {
    padding: 0 16px;
    white-space: nowrap;
}

.games-action-btn.secondary {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.games-search button:hover,
.games-action-btn:hover {
    transform: translateY(-1px);
    background: #C57D2E;
}

.games-action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
}

.game-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: rgba(229, 169, 79, 0.65);
    background: rgba(255, 255, 255, 0.07);
}

.game-card-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #18120D;
    object-fit: cover;
    display: block;
}

.game-card-body {
    padding: 12px;
}

.game-card-title {
    margin: 0 0 6px;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.25;
    min-height: 2.4em;
    overflow-wrap: anywhere;
}

.game-card-meta {
    margin: 0;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.78rem;
}

.games-library {
    margin-top: 28px;
}

.games-library h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.game-download-row,
.game-file-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-download-name,
.game-file-name {
    color: #fff;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.game-download-meta,
.game-file-meta {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.82rem;
}

.game-progress {
    height: 6px;
    margin-top: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
}

.game-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: #22c55e;
}

.games-empty {
    grid-column: 1 / -1;
    padding: 34px;
    text-align: center;
    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.games-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(12px);
}

.games-modal.active {
    display: flex;
}

.games-modal-panel {
    width: min(860px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: #140E0B;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 22px;
}

.games-modal-head {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.games-modal-head img {
    width: 96px;
    height: 128px;
    object-fit: cover;
    border-radius: 8px;
    background: #1C160F;
}

.games-modal-title {
    margin: 0 0 6px;
    font-size: 1.35rem;
    overflow-wrap: anywhere;
}

.games-close-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    cursor: pointer;
}

.games-magnet-input {
    width: 100%;
    min-height: 108px;
    padding: 12px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #fff;
    font-family: Consolas, monospace;
    outline: none;
}

.games-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin: 14px 0 18px;
}

@media (max-width: 760px) {
    .games-section {
        padding: 18px;
    }

    .games-toolbar {
        grid-template-columns: 1fr;
    }

    .games-modal-head {
        grid-template-columns: 72px 1fr auto;
    }

    .games-modal-head img {
        width: 72px;
        height: 96px;
    }

    .game-download-row,
    .game-file-row {
        grid-template-columns: 1fr;
    }
}

/* Web Gate for Non-Electron / Browser Clients */
.games-web-gate-container {
    position: relative;
    width: 100%;
    min-height: 68vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: #0f0a08;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.games-grid-teaser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
    width: 100%;
    height: 120%;
    position: absolute;
    top: -10%;
    left: 0;
    padding: 24px;
    opacity: 0.15;
    filter: blur(4px) grayscale(50%);
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.games-grid-teaser .game-card {
    cursor: default;
    transform: none !important;
    pointer-events: none;
}

.games-gate-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.games-gate-card {
    background: rgba(20, 14, 11, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(229, 169, 79, 0.22);
    border-radius: 16px;
    padding: 38px 28px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 50px rgba(229, 169, 79, 0.04);
    animation: scaleInGate 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleInGate {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.games-gate-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    background: rgba(229, 169, 79, 0.08);
    border: 1.5px solid rgba(229, 169, 79, 0.35);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E5A94F;
    box-shadow: 0 8px 24px rgba(229, 169, 79, 0.08);
    animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.games-gate-card h2 {
    margin: 0 0 12px;
    font-size: 1.65rem;
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.games-gate-desc {
    margin: 0 0 26px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.92rem;
    line-height: 1.6;
}

.games-gate-desc strong {
    color: #E5A94F;
    font-weight: 600;
}

.games-gate-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, #E5A94F 0%, #C57D2E 100%);
    border: 0;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(229, 169, 79, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.games-gate-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(229, 169, 79, 0.32);
    filter: brightness(1.06);
}

.games-gate-download-btn:active {
    transform: translateY(0);
}

.games-gate-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.32);
    font-size: 0.78rem;
}
