:root,
html[data-theme="dark"] {
    --bg: #020617;
    --card-bg: #0f172a;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent-cracked: #10b981;
    --accent-hypervisor: #1e8888;
    --accent-uncracked: #ef4444;
    --accent-upcoming: #8b5cf6;
    --border: #1e293b;
    --header-gradient: linear-gradient(135deg, #1e293b 0%, #020617 100%);
    --primary: #3b82f6;
    /* Logo colors */
    --logo-red: #e11d48;
    --logo-white: #ffffff;
    --title-gradient-end: #64748b;

    /* Components */
    --input-bg: rgba(15, 23, 42, 0.95);
    --input-text: #ffffff;
    --modal-bg: rgba(15, 23, 42, 0.98);
    --modal-shadow: rgba(0, 0, 0, 0.75);
    --backdrop-bg: rgba(0, 0, 0, 0.82);
    --card-shadow: rgba(0, 0, 0, 0.8);
    --stat-bg: rgba(30, 41, 59, 0.5);
    --icon-bg: rgba(255, 255, 255, 0.08);
    --btn-bg: #1e293b;
    --btn-text: #ffffff;
    --btn-hover-bg: #ffffff;
    --btn-hover-text: #020617;
    --reset-btn-bg: rgba(255, 255, 255, 0.08);
    --reset-btn-hover-bg: rgba(255, 255, 255, 0.16);
    --overlay-bg: rgba(15, 23, 42, 0.5);
    --logo-hover-color: #ffffff;
    --img-border: rgba(255, 255, 255, 0.15);
    --img-shadow: rgba(0, 0, 0, 0.24);

    /* Scrollbar */
    --scrollbar-track: rgba(15, 23, 42, 0.45);
    --scrollbar-thumb: rgba(148, 163, 184, 0.5);
    --scrollbar-thumb-hover: rgba(148, 163, 184, 0.75);

    --modal-header-text: #ffffff;
    --modal-header-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.88) 100%);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f8fafc;
        --card-bg: #ffffff;
        --text-main: #0f172a;
        --text-dim: #64748b;
        --border: #e2e8f0;
        --header-gradient: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
        --input-bg: rgba(255, 255, 255, 0.9);
        --input-text: #0f172a;
        --modal-bg: rgba(255, 255, 255, 0.98);
        --modal-shadow: rgba(0, 0, 0, 0.15);
        --backdrop-bg: rgba(248, 250, 252, 0.82);
        --card-shadow: rgba(0, 0, 0, 0.1);
        --stat-bg: rgba(226, 232, 240, 0.8);
        --icon-bg: rgba(15, 23, 42, 0.05);
        --btn-bg: #e2e8f0;
        --btn-text: #0f172a;
        --btn-hover-bg: #0f172a;
        --btn-hover-text: #ffffff;
        --reset-btn-bg: rgba(15, 23, 42, 0.08);
        --reset-btn-hover-bg: rgba(15, 23, 42, 0.16);
        --overlay-bg: rgba(226, 232, 240, 0.5);
        --logo-white: #0f172a;
        --title-gradient-end: #475569;
        --logo-hover-color: #0f172a;
        --img-border: rgba(15, 23, 42, 0.1);
        --img-shadow: rgba(0, 0, 0, 0.1);
        --scrollbar-track: rgba(226, 232, 240, 0.45);
        --scrollbar-thumb: rgba(100, 116, 139, 0.4);
        --scrollbar-thumb-hover: rgba(100, 116, 139, 0.6);

        --modal-header-text: #0f172a;
        --modal-header-overlay: linear-gradient(180deg, rgba(248, 250, 252, 0.05) 0%, rgba(248, 250, 252, 0.95) 100%);
    }
}

html[data-theme="light"] {
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --border: #e2e8f0;
    --header-gradient: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-text: #0f172a;
    --modal-bg: rgba(255, 255, 255, 0.98);
    --modal-shadow: rgba(0, 0, 0, 0.15);
    --backdrop-bg: rgba(248, 250, 252, 0.82);
    --card-shadow: rgba(0, 0, 0, 0.1);
    --stat-bg: rgba(226, 232, 240, 0.8);
    --icon-bg: rgba(15, 23, 42, 0.05);
    --btn-bg: #e2e8f0;
    --btn-text: #0f172a;
    --btn-hover-bg: #0f172a;
    --btn-hover-text: #ffffff;
    --reset-btn-bg: rgba(15, 23, 42, 0.08);
    --reset-btn-hover-bg: rgba(15, 23, 42, 0.16);
    --overlay-bg: rgba(226, 232, 240, 0.5);
    --logo-white: #0f172a;
    --title-gradient-end: #475569;
    --logo-hover-color: #0f172a;
    --img-border: rgba(15, 23, 42, 0.1);
    --img-shadow: rgba(0, 0, 0, 0.1);
    --scrollbar-track: rgba(226, 232, 240, 0.45);
    --scrollbar-thumb: rgba(100, 116, 139, 0.4);
    --scrollbar-thumb-hover: rgba(100, 116, 139, 0.6);

    --modal-header-text: #0f172a;
    --modal-header-overlay: linear-gradient(180deg, rgba(248, 250, 252, 0.05) 0%, rgba(248, 250, 252, 0.95) 100%);
}

theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    padding: 8px;
    background: var(--stat-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    --theme-switch-icon-color: var(--text-main);
    transition: all 0.3s ease;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

theme-switch:hover {
    transform: scale(1.05) translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 700px) {
    theme-switch {
        top: auto;
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 20px;
    }

    /* Posun doľava, ak je viditeľná šípka na hlavnej stránke (iba ak nie je otvorený modal) */
    body.has-scroll-top:not(.modal-active) theme-switch {
        right: 74px;
    }

    /* Posun doľava, ak je viditeľná šípka v modálnom okne */
    body.has-modal-scroll-top theme-switch {
        right: 74px;
    }
}


body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- MODERN HERO HEADER --- */
.hero-header {
    background: var(--header-gradient);
    padding: 55px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.skeleton-icon {
    width: 55px;
    height: 55px;
    fill: var(--logo-red);
    filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.5));
}

h1 {
    margin: 0;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    background: linear-gradient(to right, var(--logo-white), var(--title-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- STATS BADGES IN HEADER --- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 0;
    flex-wrap: wrap;
    overflow: hidden;
    max-height: 0;
    /* Skryté na začiatku */
    opacity: 0;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-top 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                margin-bottom 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.8s ease;
}

/* Trieda, ktorú pridáme cez JS po načítaní dát */
.stats-bar.visible {
    max-height: 500px;
    /* Dostatočná výška pre viacero riadkov badgeov na mobile */
    margin-top: 10px;
    margin-bottom: 20px;
    opacity: 1;
}

.stat-item {
    background: var(--stat-bg);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-10px);
    opacity: 0;
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.stats-bar.visible .stat-item {
    transform: translateY(0);
    opacity: 1;
}

.stat-item b {
    font-size: 0.9rem;
}

/* Specific colors for stat bubbles */
.stat-db {
    border-left: 4px solid var(--text-dim);
}

.stat-cracked {
    border-left: 4px solid var(--accent-cracked);
    color: var(--accent-cracked);
}

.stat-hypervisor {
    border-left: 4px solid var(--accent-hypervisor);
    color: var(--accent-hypervisor);
}

.stat-uncracked {
    border-left: 4px solid var(--accent-uncracked);
    color: var(--accent-uncracked);
}

.stat-upcoming {
    border-left: 4px solid var(--accent-upcoming);
    color: var(--accent-upcoming);
}

/* --- SEARCH BOX --- */
.search-container {
    max-width: 650px;
    margin: 0px auto 0 auto;
    /* Znížte horný margin, stats si pridajú svoj */
    transition: margin-top 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Plynulý posun */
}

.search-field {
    position: relative;
}

#gameSearch {
    width: 100%;
    padding: 20px 30px 20px 30px;
    padding-right: 68px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    box-shadow: 0 10px 30px var(--card-shadow);
}

#gameSearch:focus {
    border-color: var(--logo-red);
    box-shadow: 0 0 0 5px rgba(225, 29, 72, 0.2);
    transform: scale(1.01);
}

.search-reset-btn {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--reset-btn-bg);
    color: var(--input-text);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, background 0.2s ease, transform 0.2s ease;
    display: grid;
    place-items: center;
    line-height: 1;
    padding: 0;
}

.search-reset-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.search-reset-btn:hover {
    background: var(--reset-btn-hover-bg);
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--text-dim);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.search-field:focus-within .search-icon {
    color: var(--logo-red);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.search-icon svg {
    width: 100%;
    height: 100%;
}

.search-icon.hidden {
    opacity: 0;
    transform: translateY(-50%) scale(0.5);
    visibility: hidden;
}

/* --- MAIN CONTENT --- */
.container {
    max-width: 1300px;
    margin: 60px auto;
    padding: 0 30px;
}

/* section { margin-bottom: 100px; } */

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* --- CARD DESIGN --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-12px);
    border-color: var(--text-dim);
    box-shadow: 0 25px 50px -12px var(--card-shadow);
}

.card-image {
    width: 100%;
    height: 190px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.badge {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 6px 16px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    overflow: hidden;
}

.badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.25),
            transparent);
    animation: shimmer-swipe 3s infinite;
}

@keyframes shimmer-swipe {
    0% {
        transform: translateX(-100%);
    }

    25%,
    100% {
        transform: translateX(200%);
    }
}

.card-content {
    padding: 28px;
    flex-grow: 1;
}

.game-title {
    font-size: 1.4rem;
    margin: 0 0 20px 0;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    overflow-wrap: break-word;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    gap: 12px;
}

.label {
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.value {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
    overflow-wrap: anywhere;
}

.description {
    margin-top: 18px;
    font-size: 0.88rem;
    color: var(--text-dim);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.description * {
    margin: 0;
    padding: 0;
    display: inline;
}

/* --- STATUS COLORS --- */
.bg-cracked {
    background: var(--accent-cracked);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.bg-hypervisor {
    background: var(--accent-hypervisor);
    box-shadow: 0 0 20px rgba(41, 94, 94, 0.3);
}

.bg-uncracked {
    background: var(--accent-uncracked);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.bg-upcoming {
    background: var(--accent-upcoming);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.border-cracked {
    border-top: 6px solid var(--accent-cracked);
}

.border-hypervisor {
    border-top: 6px solid var(--accent-hypervisor);
}

.border-uncracked {
    border-top: 6px solid var(--accent-uncracked);
}

.border-upcoming {
    border-top: 6px solid var(--accent-upcoming);
}

.hidden {
    display: none !important;
}

.no-results {
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
    grid-column: 1/-1;
    font-weight: 600;
    font-size: 1.1rem;
}

/* --- BUTTONS --- */
.show-more-container {
    text-align: center;
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}

.btn-show-more {
    background: var(--btn-bg);
    border: 1px solid var(--border);
    color: var(--btn-text);
    padding: 14px 30px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: 0.3s;
    letter-spacing: 0.1em;
}

.btn-show-more:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--card-shadow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.card {
    cursor: pointer;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--backdrop-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    backdrop-filter: blur(12px);
    animation: backdropFade 0.4s ease-out forwards;
}

.modal-backdrop.hidden {
    display: none;
}

.modal-card {
    box-sizing: border-box;
    width: min(1080px, calc(100vw - 48px));
    height: 90dvh;
    max-height: 90dvh;
    overflow-y: auto;
    /* Zjednotený scrollbar */
    background: var(--modal-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 40px 100px var(--modal-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    animation: modalEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-body {
    overflow-y: visible;
    /* Vnútorný obsah sa scroluje s rodičom */
    min-height: auto;
}

.modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 340px);
    gap: 24px;
    padding: 40px 32px 0;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 0;
}

.modal-grid.no-sidebar {
    grid-template-columns: 1fr;
    padding-bottom: 40px;
}

.modal-requirements {
    padding: 0 32px 32px;
    min-width: 0;
    margin-top: 28px;
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 300;
}

.modal-scroll-top {
    position: absolute;
    right: 20px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    z-index: 3;
}

.page-scroll-top {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

/* Zjednotený štýl pre všetky akčné okrúhle tlačidlá (vrátane prepínača tém) */
.modal-close-btn,
.modal-scroll-top,
.page-scroll-top,
theme-switch {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--stat-bg);
    color: var(--text-main);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1;
}

theme-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    padding: 8px;
    --theme-switch-icon-color: var(--text-main);
}

.modal-close-btn {
    font-size: 2rem;
    padding-bottom: 10px;
}

.modal-scroll-top,
.page-scroll-top {
    font-size: 1.25rem;
    padding-bottom: 4px;
}

.modal-close-btn:hover,
.modal-scroll-top:hover,
.page-scroll-top:hover,
theme-switch:hover {
    transform: scale(1.05) translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 700px) {
    theme-switch {
        top: auto;
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 20px;
    }

    /* Posun doľava, ak je viditeľná šípka na hlavnej stránke (iba ak nie je otvorený modal) */
    body.has-scroll-top:not(.modal-active) theme-switch {
        right: 74px;
    }

    /* Posun doľava, ak je viditeľná šípka v modálnom okne */
    body.has-modal-scroll-top theme-switch {
        right: 74px;
    }
}

.modal-scroll-top.visible,
.page-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.modal-header {
    position: relative;
    /* Zrušíme min-height, aby to bralo výšku podľa obsahu */
    padding-top: 20px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    /* Zmenili sme tieň, aby plynulejšie prechádzal do tmavej farby pozadia */
    box-shadow: inset 0 -40px 50px var(--card-bg);
}

.modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--modal-header-overlay);
    z-index: 0;
}

.modal-header-content {
    position: relative;
    z-index: 1;
    padding: 28px 32px;
    width: 100%;
}

.modal-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    max-width: 860px;
    width: 100%;
    align-items: center;
}

.modal-summary-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-summary-image {
    width: 170px;
    min-width: 170px;
    height: 120px;
    border-radius: 22px;
    object-fit: cover;
    border: 1px solid var(--img-border);
    box-shadow: 0 18px 40px var(--img-shadow);
    background: rgba(255, 255, 255, 0.04);
}

.modal-summary-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.modal-header-content h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    max-width: 95%;
    color: var(--modal-header-text);
}

.modal-header-content .status-pill {
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    background: var(--icon-bg);
    color: var(--modal-header-text);
    border: 1px solid var(--border);
    text-transform: uppercase;
}

.section-icon,
.info-icon,
.modal-store-link svg {
    width: 1.3em;
    height: 1.3em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon {
    margin-right: 0.75rem;
}

.modal-main h3,
.modal-sidebar h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.steam-link-icon {
    display: inline-flex;
    width: 1.1em;
    height: 1.1em;
    color: currentColor;
}

.req-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.req-icon {
    display: inline-flex;
    width: 28px;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--icon-bg);
    color: var(--text-main);
}

.req-meta {
    display: grid;
    gap: 4px;
}

.req-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-dim);
    font-weight: 700;
}

.req-value {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
}

.req-line {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.section-icon,
.info-icon {
    background: var(--icon-bg);
    border-radius: 10px;
    padding: 0.4em;
    color: var(--text-main);
}

.icon-svg {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.info-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.modal-store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 32px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--icon-bg);
    color: var(--accent-cracked);
    text-decoration: none;
    transition: all 0.2s ease;
}

.modal-store-link:hover {
    border-color: var(--accent-cracked);
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-2px);
}

.steam-logo {
    width: 100px;
    height: 28px;
    background-color: var(--accent-cracked);
    -webkit-mask: url('steam_logo.svg') no-repeat center;
    mask: url('steam_logo.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
    transition: background-color 0.2s ease;
}

.modal-store-link:hover .steam-logo {
    background-color: var(--logo-hover-color);
}

.modal-main,
.modal-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: visible;
}

.modal-main {
    padding: 28px;
    min-height: 0;
    overflow: visible;
}

.modal-requirements .modal-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
}

.modal-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-height: 0;
}

.sidebar-block {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.sidebar-block h3 {
    margin: 0 0 18px 0;
    font-size: 0.98rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.modal-sidebar .section-icon {
    display: none;
}

.modal-main img,
.modal-main iframe,
.modal-main video,
.modal-main embed,
.modal-main object {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.modal-main table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto;
}

.modal-main th,
.modal-main td {
    word-break: break-word;
}

.modal-main pre,
.modal-main code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.modal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px;
    min-height: 0;
    overflow: visible;
}

.sidebar-block {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.sidebar-block+.sidebar-block {
    margin-top: 20px;
}

.modal-grid,
.modal-main,
.modal-sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

body::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 3px solid var(--scrollbar-track);
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.modal-grid::-webkit-scrollbar,
.modal-main::-webkit-scrollbar,
.modal-sidebar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-grid::-webkit-scrollbar-track,
.modal-main::-webkit-scrollbar-track,
.modal-sidebar::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

.modal-grid::-webkit-scrollbar-thumb,
.modal-main::-webkit-scrollbar-thumb,
.modal-sidebar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
}

.modal-grid::-webkit-scrollbar-thumb:hover,
.modal-main::-webkit-scrollbar-thumb:hover,
.modal-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.steam-requirements {
    display: grid;
    gap: 18px;
}

.steam-requirement-windows {
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 22px;
}

.steam-requirement-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.steam-requirement-header .section-icon {
    background: var(--icon-bg);
    color: var(--text-main);
    border-radius: 14px;
    padding: 0.55em;
}

.steam-requirement-title {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-main);
    letter-spacing: 0.16em;
}

.steam-requirement-tag {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.steam-requirement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.steam-breakdown {
    border-radius: 20px;
    background: var(--icon-bg);
    border: 1px solid var(--border);
    padding: 18px 18px 14px;
    overflow-wrap: anywhere;
}

.steam-subtitle {
    margin: 0 0 14px 0;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.steam-breakdown ul {
    margin: 0;
    padding-left: 21px;
}

.steam-breakdown li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.steam-breakdown strong,
.steam-breakdown b {
    color: var(--text-main);
    font-weight: 800;
}

.steam-breakdown p,
.steam-breakdown li {
    color: var(--text-main);
    margin: 0;
}

.modal-main h3 {
    margin-top: 0;
}

.modal-description {
    max-width: 100%;
    overflow-wrap: break-word;
    line-height: 1.8;
    color: var(--text-main);
}

.detail-row-modal,
.info-row-modal {
    align-items: center;
}

.modal-description {
    max-width: 100%;
    overflow-wrap: break-word;
}

/* --- MOBILE COMPACT REQUIREMENTS --- */
@media (max-width: 700px) {

    .modal-backdrop {
        padding: 0;
    }

    .modal-card {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
    }

    .modal-header {
        min-height: auto;
        max-height: none;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 18px;
        padding-bottom: 20px;
        flex-shrink: 0;
        overflow: hidden;
    }

    .modal-body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }

    .modal-header-content {
        padding-top: calc(24px + env(safe-area-inset-top));
        padding-bottom: 12px;
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .modal-summary {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 16px;
        align-items: center;
        margin-top: 0;
    }

    .modal-summary-media {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .modal-summary-image {
        width: 110px;
        min-width: 110px;
        height: 88px;
        border-radius: 18px;
    }

    .modal-summary-copy {
        min-width: 0;
    }

    .modal-header-content .status-pill {
        position: static;
        margin: 0;
        padding: 10px 14px;
        font-size: 0.75rem;
        white-space: normal;
        align-self: center;
    }

    .logo-wrapper {
        gap: 12px;
    }

    .skeleton-icon {
        width: 72px;
        height: 72px;
    }

    h1 {
        font-size: 3rem;
    }

    .modal-summary-copy {
        flex: 1;
        min-width: 0;
    }

    .modal-header-content h2 {
        font-size: clamp(1.8rem, 6vw, 2.4rem);
    }

    .modal-grid {
        gap: 18px;
        padding: 16px 18px 18px;
        grid-template-columns: 1fr;
    }

    .modal-main,
    .modal-sidebar {
        padding: 18px;
        max-height: none;
    }

    .modal-sidebar {
        gap: 14px;
    }

    .modal-requirements {
        padding: 0 18px 18px;
        margin-top: 0 !important;
    }
}

.modal-section {
    margin-bottom: 24px;
}

.modal-section h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-dim);
}

.modal-section p,
.modal-section li,
.modal-section dd {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 0.95rem;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-row-modal,
.info-row-modal {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row-modal:last-child,
.info-row-modal:last-child {
    border-bottom: none;
}

.info-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.info-value {
    font-size: 0.93rem;
    font-weight: 700;
    text-align: right;
    color: var(--text-main);
}

.modal-description {
    margin-bottom: 14px;
    color: var(--text-main);
}

.modal-sidebar .sidebar-block {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-sidebar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--icon-bg);
    color: var(--accent-cracked);
    font-weight: 800;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.modal-sidebar a:hover {
    border-color: #ff5400;
    background: rgba(255, 84, 0, 0.08);
    transform: translateY(-1px);
}

.steam-requirements {
    display: grid;
    gap: 18px;
}


.modal-status-text {
    color: var(--text-main);
    font-size: 0.88rem;
    margin-top: 10px;
    opacity: 0.8;
}

.modal-header-content .modal-status-text {
    color: var(--modal-header-text);
    opacity: 0.9;
}

.modal-error {
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.22);
    background: rgba(248, 113, 113, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-top: 12px;
}

/* --- LOADING SPINNER --- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    /* Solid card background */
    z-index: 500;
    border-radius: 28px;
    gap: 24px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(16, 185, 129, 0.1);
    border-top-color: var(--accent-cracked);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: inline-block;
}

.modal-loading-text {
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- ANIMATIONS & TRANSITIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes backdropFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulseLogo {
    0% {
        filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.4));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(225, 29, 72, 0.7));
        transform: scale(1.05);
    }

    100% {
        filter: drop-shadow(0 0 12px rgba(225, 29, 72, 0.4));
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-icon {
    animation: pulseLogo 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.skeleton-icon:hover {
    transform: rotate(5deg) scale(1.1);
}

.stat-item {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.card {
    will-change: transform, opacity;
    opacity: 1;
    /* Default to visible if no animation class */
}

.card.animate-in {
    animation: fadeInUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Search Loading State */
.search-loading-overlay {
    grid-column: 1/-1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
    background: var(--overlay-bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    margin-top: 20px;
    animation: fadeIn 0.3s ease-out;
}

.search-loading-text {
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.progress-bar-container {
    width: 200px;
    height: 4px;
    background: var(--icon-bg);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--accent-cracked);
    border-radius: 99px;
    animation: progressLoop 1.5s infinite ease-in-out;
}

@keyframes progressLoop {
    0% {
        left: -30%;
        width: 30%;
    }

    50% {
        width: 60%;
    }

    100% {
        left: 100%;
        width: 30%;
    }
}

.video-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--overlay-bg);
    gap: 12px;
    z-index: 10;
    border-radius: 16px;
}

.video-loading-text {
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

/* Improved Smoothness */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn-show-more,
.modal-close-btn,
.search-reset-btn,
#gameSearch,
.card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fade-in {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 480px) {
    .hero-header {
        padding: 36px 16px 32px;
    }

    .skeleton-icon {
        width: 40px;
        height: 40px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .logo-wrapper {
        gap: 10px;
    }

    .stats-bar {
        gap: 8px;
        margin-top: 20px;
    }

    .stat-item {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .stat-item b {
        font-size: 0.8rem;
    }

    #gameSearch {
        padding: 14px 48px 14px 18px;
        font-size: 0.95rem;
        border-radius: 16px;
    }

    .container {
        margin: 36px auto;
        padding: 0 14px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .card-content {
        padding: 18px;
    }

    .game-title {
        font-size: 1.15rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .btn-show-more {
        padding: 12px 22px;
        font-size: 0.75rem;
    }
}
