/* Global Variables */
:root {
    --bg: #1d1d1f;
    --primary-bg: #1d1d1f;
    --secondary-bg: #2c2c2e;
    --card: #2c2c2e;
    --card-border: rgba(255, 255, 255, 0.1);
    --text: #f5f5f7;
    --text-main: #f5f5f7;
    --text-dim: #8e8e93;
    --muted: rgba(255, 255, 255, 0.4);
    --accent: #0071e3;
    --accent-glow: rgba(0, 113, 227, 0.4);
    --accent-soft: rgba(0, 113, 227, 0.2);
    --glass: rgba(29, 29, 31, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #0071e3;
    --primary-glow: rgba(0, 113, 227, 0.4);
    --glow: 0 0 20px rgba(0, 113, 227, 0.3);

    --success-accent: #2ed158;
    --success-glow: rgba(46, 209, 88, 0.3);

    /* Apple specific */
    --sf-blur: saturate(180%) blur(20px);
    --apple-blue: #0071e3;
    --apple-gray: #8e8e93;
    --card-radius: 22px;
    --btn-radius: 980px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-large: 0 20px 40px rgba(0, 0, 0, 0.6);
}



/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', "SF Pro Display", "SF Pro Text", system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.022em;
}

h1 {
    font-size: 3rem;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 24px;
}


a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Header & Navigation */
.topbar {
    height: 48px;
    background: var(--glass);
    backdrop-filter: var(--sf-blur);
    -webkit-backdrop-filter: var(--sf-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.topbar.admin-mode {
    background: rgba(0, 34, 68, 0.05);
    border-bottom: 1px solid rgba(0, 34, 68, 0.1);
}



.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.logo-box {
    width: 28px;
    height: 28px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
}


.nav-desktop {
    display: flex;
    gap: 24px;
}

.nav-desktop a {
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 12px;
}

.nav-desktop a:hover,
.nav-desktop a.active {
    opacity: 1;
}



.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--apple-gray);
    border-radius: 3px;
    transition: 0.3s;
}

.second-topbar {
    height: 42px;
    background: rgb(44 44 46);
    backdrop-filter: var(--sf-blur);
    -webkit-backdrop-filter: var(--sf-blur);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 20px;
    border-bottom: 1px solid var(--glass-border);
    z-index: 999;
    position: sticky;
    top: 48px;
}

.server-ip,
.system-time {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-ip i,
.system-time i {
    color: var(--accent-soft);
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .server-ip {
        display: none;
    }
}



.country-selector {
    position: relative;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.country-selector:hover {
    background: rgba(0, 0, 0, 0.04);
}

.country-selector.active {
    background: #2c2c2e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--glass-border);
}

.country-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #2c2c2e;
    border: 0.5px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    min-width: 380px;
    z-index: 1002;
    box-shadow: var(--shadow-large);
    backdrop-filter: var(--sf-blur);
    -webkit-backdrop-filter: var(--sf-blur);
}

.country-selector.active .country-dropdown {
    display: block;
}

.country-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.country-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-arrow {
    margin-left: -2px;
    opacity: 0.4;
    transition: transform 0.3s ease;
}

.country-selector.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #0b0f1c;
    z-index: 1001;
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 80px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.mobile-nav a.mobile-logout {
    margin-top: auto;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav a.mobile-logout:hover {
    background: rgba(255, 59, 48, 0.2);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
}

.mobile-overlay.active {
    display: block;
}

/* Search Bar */
.search-container {
    position: relative;
    max-width: 800px;
    width: 100%;
    margin: 0 40px;
    flex-grow: 2;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 22px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    z-index: 10;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--secondary-bg);
    border: none;
    border-radius: var(--btn-radius);
    padding: 8px 16px 8px 44px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    background: #2c2c2e;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}



.search-input:focus+i {
    color: #ffffff;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--glass);
    backdrop-filter: var(--sf-blur);
    -webkit-backdrop-filter: var(--sf-blur);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    overflow: hidden;
    z-index: 1100;
    display: none;
    box-shadow: var(--shadow-large);
}

.search-results.active {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover,
.search-item.selected {
    background: rgba(255, 255, 255, 0.12);
}

.search-item img {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--card-border);
}

.search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.search-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-price {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Game Cards & Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
}

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

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

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

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

.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--card-radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-large);
}


.card .info,
.card .title,
.card .price-current {
    color: white !important;
}

.card .info {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.card .title {
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.5em;
    color: var(--text);
    letter-spacing: -0.01em;
}


.card .prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.card .price-current {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
}

.card .price-old {
    color: var(--text-dim);
    text-decoration: line-through;
    font-size: 0.9rem;
}


.card .cover {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.15);
}

.card .cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.card:hover .cover img {
    transform: scale(1.1);
}

.card.is-upcoming .cover img {
    filter: grayscale(0.8) brightness(0.7) contrast(0.9);
    transition: filter 0.3s ease;
}

.card.is-upcoming:hover .cover img {
    filter: grayscale(0.4) brightness(0.85) contrast(1);
}



/* Badges & Pills */
.badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--btn-radius);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: var(--sf-blur);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    color: var(--text-main);
}



.card .badge.upcoming {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    top: 50px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 1.15rem;
}

.badge.price-increased {
    background: rgba(239, 68, 68, 0.25);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fff;
    top: 55px;
    left: 15px;
    right: auto;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
    padding: 4px 10px;
    z-index: 3;
}

.price-increase-pill {
    padding: 4px 12px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--btn-radius);
    background: #ff3b30;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.discount-pill {
    padding: 4px 12px;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--btn-radius);
    background: #34c759;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}


@keyframes flame-move {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Buttons */
.btn {
    padding: 10px 22px;
    border-radius: var(--btn-radius);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--apple-blue);
    color: white;
}

.btn-primary:hover {
    background: #0077ed;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.4);
}



/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    background: var(--secondary-bg);
    padding: 60px 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 80px;
}



.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.empty {
    padding: 60px 0;
    text-align: center;
    color: var(--muted);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: background 150ms ease;
}

.page-link:hover {
    background: var(--card-border);
}

.page-link.active {
    background: var(--accent);
    color: white;
}

/* Admin Specific */
.admin-card {
    background: var(--secondary-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    padding: 32px;
}

/* Mobile Responsive Utility */
@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }

    .nav-desktop {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .logo-text {
        display: none;
    }
}

/* --- Page Specific: Index (Home) --- */
.swiper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding-top: 50px;
    padding-bottom: 50px;
}

.swiper-slide.traditional-card {
    width: 300px;
    height: auto;
    border-radius: 30px;
    background: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text);
}

.swiper-slide.traditional-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: var(--secondary-bg);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.swiper-slide.traditional-card:hover .card-cover img {
    transform: scale(1.05);
}

.store-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.card-info {
    padding: 12px 4px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-title {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em;
}

.card-prices {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.current-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}

.old-price {
    color: #86868b;
    text-decoration: line-through;
    font-size: 0.9rem;
}


.discount-badge {
    align-self: flex-start;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 0.75rem;
    border-radius: 999px;
    background: linear-gradient(-45deg, #22c55e, #10b981, #059669, #22c55e);
    background-size: 300% 300%;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: flame-move 3s ease infinite;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.discount-badge::before {
    content: "↓";
    font-size: 1.1em;
    font-weight: 900;
}

/* --- Page Specific: Discounts & All Games --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
}

.header small {
    display: block;
    color: var(--muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.meta {
    text-align: right;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.filters {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filters label {
    font-weight: 600;
    color: var(--text);
}

.filters input[type="text"],
.filters input[type="number"],
.filters select {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.filters button {
    padding: 8px 16px;
    height: 40px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    transition: background 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.filters button:hover {
    background: #0059b2;
}

.filter-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.filter-toggle:active {
    transform: scale(0.98);
}

.filter-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.filter-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .filter-toggle {
        display: flex;
    }

    .filters {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .filters.is-active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    .filters>* {
        width: 100%;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clean-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 150ms ease;
}

.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text);
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* --- Page Specific: Game Detail --- */
/* Game Detail Specific Styles */
.game-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
    align-items: flex-start;
}

.game-icon {
    width: 200px;
    height: 200px;
    border-radius: 32px;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-info h1 {
    margin: 0;
    font-size: 3.5rem;
    /* Updated */
    font-weight: 700;
    /* Updated */
    line-height: 1.1;
    color: var(--text);
    /* Updated */
    letter-spacing: -0.02em;
    /* Added */
    /* Removed background gradient for clean typography */
    /* Removed -webkit-background-clip, background-clip, -webkit-text-fill-color */
}

.price {
    display: flex;
    align-items: baseline;
    gap: 15px;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}


.price span[style*="line-through"] {
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    opacity: 0.6;
}

.price span[style*="background"] {
    font-size: 0.9rem !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    text-transform: uppercase;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 20px;
    margin-top: 10px;
}



.meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 700;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}


.actions {
    margin-top: 10px;
}

.media-section {
    background: transparent;
    border-top: 1px solid var(--glass-border);
    border-radius: 0;
    padding: 40px 0;
    margin-bottom: 40px;
}

.screenshot-carousel-container,
.video-carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 10px;
}

.screenshot-carousel-track,
.video-carousel-track {
    display: flex;
    gap: 12px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.screenshot-card {
    flex: 0 0 calc((100% - 24px) / 3);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    transition: transform 0.3s ease;
}

.screenshot-card:hover {
    transform: scale(1.02);
}

.screenshot-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 9;
    flex: 0 0 calc((100% - 16px) / 2);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.video-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-frame:hover img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.video-frame:hover .play-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.play-overlay i {
    font-size: 3.5rem;
    color: white;
    opacity: 0.9;
    transition: all 0.3s;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8));
}

.video-frame:hover .play-overlay i {
    opacity: 1;
    transform: scale(1.15);
    color: var(--accent);
}

/* Video Modal Specific */
.video-modal-container {
    width: 90%;
    max-width: 1000px;
    aspect-ratio: 16 / 9;
    background: black;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.video-modal-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.carousel-nav,
.video-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.carousel-nav:hover,
.video-nav:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev,
.video-nav.prev {
    left: 10px;
}

.carousel-nav.next,
.video-nav.next {
    right: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot.active {
    background: var(--accent);
    width: 28px;
    border-radius: 10px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.description-wrapper {
    position: relative;
    margin-top: 18px;
}

.description {
    line-height: 1.55;
    color: var(--text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    transition: all 0.3s ease;
}

.description.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
    display: none;
    align-items: center;
    gap: 4px;
}

.show-more-btn:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 980px;
    text-decoration: none;
    color: var(--text);
    background: var(--secondary-bg);
    font-weight: 500;
    margin-bottom: 32px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    border: 1px solid var(--card-border);
}

.back-link i {
    transition: transform 0.2s ease;
    font-size: 0.85em;
}

.back-link:hover {
    background: #e5e5e7;
    transform: translateY(-1px);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
}

.back-link:hover i {
    transform: translateX(-3px);
}

.chart-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 40px;
}

.chart-container h2 {
    margin: 0 0 30px 0;
    font-size: 1.5rem;
    text-align: left;
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 3001;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    transform: scale(1.1) rotate(90deg);
    color: var(--accent);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 24px;
    padding: 16px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 3001;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    user-select: none;
}

.modal-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 89, 178, 0.4);
}

.modal-prev {
    left: 40px;
}

.modal-next {
    right: 40px;
}

@media (max-width: 768px) {
    .modal-nav {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .modal-prev {
        left: 15px;
    }

    .modal-next {
        right: 15px;
    }

    .video-frame {
        flex: 0 0 calc((100% - 16px) / 2);
    }
}

@media (max-width: 480px) {
    .video-frame {
        flex: 0 0 100%;
    }
}

/* --- Admin Generic Styles --- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 2.3rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
}

.admin-card {
    background: var(--secondary-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 30px;
}

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

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 12px;
}

.game-icon-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.apple-btn {
    color: #fff;
    opacity: 0.6;
    transition: 0.2s;
}

.apple-btn:hover {
    opacity: 1;
    color: var(--accent);
}

th {
    text-align: left;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
}

.status-success,
.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-error,
.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-running {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: white;
}

.edit-btn {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    border: none;
}

.edit-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    opacity: 0.9;
}

.delete-btn {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    border: none;
}

.delete-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    opacity: 0.9;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: rotate 2s linear infinite;
}

.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.progress-content {
    background: var(--secondary-bg);
    padding: 24px 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    border: 1px solid var(--glass-border);
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-large {
    max-width: 1000px;
    width: 95%;
}

.output-console {
    background: #000;
    color: #10b981;
    padding: 20px;
    border-radius: 12px;
    height: 250px;
    width: 100%;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    margin-bottom: 20px;
    border: 1px solid #10b98133;
    white-space: pre-wrap;
    word-break: break-all;
}

.close-progress {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.stop-progress {
    background: rgba(217, 0, 31, 0.1);
    color: #ef4444;
    border: 1px solid rgba(217, 0, 31, 0.2);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.stop-progress:hover {
    background: rgba(0, 89, 178, 0.2);
    border-color: rgba(0, 89, 178, 0.4);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

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

.stat-box {
    background: #000000;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-added {
    color: #22c55e;
}

.stat-updated {
    color: #3b82f6;
}

.stat-timer {
    color: #f59e0b;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
}

.run-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    height: 42px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
    border: none;
    text-decoration: none;
    background: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    box-sizing: border-box;
}

.run-btn:hover {
    transform: translateY(-3px);
    scale: 1.02;
    opacity: 0.9;
}

/* Toggle Styles */
.form-group .toggle-container,
.toggle-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer;
    margin-bottom: 0 !important;
    /* Remove bottom margin from .form-group label */
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d1d6;
    transition: .4s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #3b82f6;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}

input:checked~.toggle-label {
    color: var(--text);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.u-admin-input,
.admin-search-input,
.u-admin-input-full,
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.u-admin-input:focus,
.admin-search-input:focus,
.u-admin-input-full:focus,
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    background: #2c2c2e;
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.search-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 30px;
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* --- Admin: Login --- */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--secondary-bg);
    margin: 0;
    font-family: 'Inter', sans-serif;
}

.ambient-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.05) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.login-card {
    background: #2c2c2e;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
    animation: fadeIn 0.4s ease-out;
}

.login-card .header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1d1d1f;
    color: white;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 4px 12px;
    border-radius: 8px;
    margin: 0;
    letter-spacing: 0.3px;
}

.login-card h1 {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.login-card .subtitle {
    color: #86868b;
    font-size: 0.9rem;
    margin: 10px 0 0;
    font-weight: 400;
    flex-basis: 100%;
}

.login-card .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-card label {
    display: block;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-card .input-wrapper {
    position: relative;
    background: var(--secondary-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.login-card .input-wrapper:focus-within {
    background: #2c2c2e;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    border-color: var(--accent);
}

.login-card .input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 0.9rem;
}

.login-card input {
    width: 100%;
    background: transparent !important;
    border: none !important;
    padding: 12px 14px 12px 40px !important;
    color: var(--text) !important;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    box-shadow: none !important;
}

.login-btn {
    width: 100%;
    background: #0071e3;
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.captcha-container {
    background: var(--secondary-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.captcha-container:hover {
    background: #f0f0f2;
    border-color: rgba(0, 0, 0, 0.15);
}

.captcha-text {
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
}

.checkbox-mock {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.login-card .checkbox-mock i {
    display: none;
    color: #86868b;
    /* Visible gray for spinner */
    font-size: 0.8rem;
}

.captcha-container.verified .checkbox-mock {
    border-color: #28cd41;
    background: #28cd41;
}

.login-card .captcha-container.verified .checkbox-mock i {
    display: block;
    color: white;
    /* White check on green background */
}

.captcha-logo {
    color: #86868b;
    opacity: 0.8;
}


.login-btn:hover:not(:disabled) {
    background: #0059b2;
}

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

.login-card .footer-links {
    text-align: center;
    margin-top: 24px;
}

.login-card .footer-links a {
    color: #8e8d96;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.login-card .footer-links a:hover {
    color: white;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Cards */
.games-card,
.history-card {
    background: #2c2c2e;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    margin-bottom: 40px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.admin-search-input {
    flex: 1;
}


/* --- Home Page Specific --- */
section {
    margin-bottom: 80px;
}

h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text);
}

.swiper {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding-top: 50px;
    padding-bottom: 50px;
}

/* Unified Swiper and Grid Layouts */

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.grid-card {
    background: #2c2c2e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 14px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.grid-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.grid-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: var(--secondary-bg);
}

.grid-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-card:hover .grid-cover img {
    transform: scale(1.05);
}

.grid-info {
    padding: 12px 4px 6px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.grid-title {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6em;
}

.grid-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    flex-wrap: wrap;
}

.grid-price .current-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}

.grid-price .old-price {
    color: #86868b;
    text-decoration: line-through;
    font-size: 0.9rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #f5c518;
    font-size: 0.9rem;
    font-weight: 500;
}

.rating span {
    color: #86868b;
    font-size: 0.85rem;
}


@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .swiper {
        padding-bottom: 40px;
    }

    .swiper-slide {
        width: 46%;
        height: 380px;
        max-width: 320px;
        border-radius: 20px;
    }

    .card-cover {
        height: 210px;
    }

    .card-info {
        padding: 15px;
        gap: 8px;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .current-price {
        font-size: 1.2rem;
    }

    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .grid-card {
        padding: 10px;
        border-radius: 16px;
    }

    .grid-title {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        height: 2.6em;
    }

    /* Game Detail Mobile Adjustments */
    .game-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
        margin-bottom: 30px;
    }

    .game-icon {
        width: 140px;
        height: 140px;
        border-radius: 24px;
    }

    .game-info h1 {
        font-size: 2rem;
    }

    .price {
        font-size: 1.8rem;
        justify-content: center;
    }

    .meta-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 16px;
    }

    .media-section,
    .chart-container {
        padding: 20px;
        margin-bottom: 24px;
    }

    .screenshot-card {
        flex: 0 0 calc(100% - 10px);
        /* 1 item per view in very small screens */
    }

    .video-frame {
        flex: 0 0 100%;
    }
}

/* Specific for iPhone 6.1" (roughly 390px - 430px) and similar */
@media (max-width: 480px) {
    .game-info h1 {
        font-size: 1.75rem;
    }

    .screenshot-card {
        flex: 0 0 100%;
    }

    .screenshot-carousel-track {
        gap: 0;
    }

    .meta-grid {
        gap: 12px;
    }

    .related-swiper .grid-card,
    .refined-swiper .grid-card {
        padding: 6px;
    }
}

/* Header Refactoring */
.logout-link {
    color: #ff4d4d;
}

.dropdown-arrow {
    margin-left: 4px;
}

/* Global Utility Classes */
.u-flex-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.u-flex {
    display: flex;
}

.u-justify-end {
    justify-content: flex-end;
}

.u-m-bottom-20 {
    margin-bottom: 20px;
}

.u-m-bottom-25 {
    margin-bottom: 25px;
}

.u-m-bottom-30 {
    margin-bottom: 30px;
}

.u-m-top-30 {
    margin-top: 30px;
}

.u-gap-15 {
    gap: 15px;
}

.u-clickable-weight {
    font-weight: 600;
    cursor: pointer;
}

.u-rating-meta {
    color: var(--muted);
    font-size: 0.7rem;
    margin-left: 4px;
}

.u-font-bold {
    font-weight: 700;
}

.u-badge-adj {
    font-size: 0.75rem;
    margin-top: 4px;
}

.u-full-center {
    width: 100%;
    text-align: center;
}

.u-text-center {
    text-align: center !important;
}

.u-text-success {
    color: #22c55e;
    font-weight: 600;
}

.u-text-info {
    color: #3b82f6;
    font-weight: 600;
}

.u-hidden {
    display: none;
}

.u-w-150 {
    width: 150px;
}

.u-w-50 {
    width: 50px;
}

.admin-empty-msg {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
}

/* Component Specific Refactors */
.game-detail-old-price {
    color: var(--muted);
    text-decoration: line-through;
    font-size: 1.1rem;
    font-weight: 400;
}

.game-detail-badge {
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-left: auto;
}

.game-detail-rating-count {
    font-weight: 400;
    color: var(--muted);
}

/* Admin Utility Classes */
.u-admin-help-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 5px;
}

.u-admin-btn-save {
    background: #3b82f6;
}

.u-admin-btn-cancel {
    background: #e5e5e7 !important;
    color: #1d1d1f !important;
    box-shadow: none !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.u-admin-btn-cancel:hover {
    background: #d2d2d7 !important;
}

/* Cron Editor Modal Refinement */
.u-admin-modal-width {
    max-width: 480px;
    width: 90%;
    padding: 30px !important;
}

.cron-input-group {
    background: var(--secondary-bg);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.cron-field-input {
    display: block !important;
    height: 38px !important;
    max-width: 60px;
    margin: 0 auto;
    font-size: 0.9rem !important;
    padding: 5px !important;
    background: #86868b !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 6px !important;
    color: var(--text) !important;
}

#cronPreset {
    height: 42px;
    font-size: 0.95rem;
    border-radius: 8px;
    color: var(--text);
}

#cronExpressionDisplay {
    background: var(--secondary-bg) !important;
    color: hsl(0, 0%, 100%) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    text-shadow: none !important;
    padding: 15px !important;
    border-radius: 12px;
}

#cronHumanReadable {
    color: #86868b !important;
    font-weight: 500;
}

.u-admin-btn-info {
    background: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.u-admin-btn-success {
    background: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.u-admin-btn-danger {
    background: #ff3b30 !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
    color: white !important;
}

.u-admin-btn-danger:hover {
    background: #0059b2 !important;
    transform: translateY(-3px) scale(1.02);
    opacity: 0.9;
}

.u-admin-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.u-admin-mono {
    font-family: monospace;
}

.u-admin-gap-10 {
    gap: 10px;
}

.u-admin-gap-15 {
    gap: 15px;
}

.u-admin-padding-10-0 {
    padding: 10px 0;
}

.u-admin-m-top-25 {
    margin-top: 25px;
}

.u-admin-m-bottom-25 {
    margin-bottom: 25px;
}

.u-admin-flex-2 {
    flex: 2;
}

.u-admin-flex-1 {
    flex: 1;
}

.u-text-dim {
    color: var(--text-dim);
}

.u-admin-modal-width {
    max-width: 500px;
}

.u-flex-center-gap-15 {
    display: flex;
    align-items: center;
    gap: 15px;
}

.u-flex-center-gap-5 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.u-m-0 {
    margin: 0;
}

.u-w-auto {
    width: auto;
}

.u-justify-center {
    justify-content: center;
}

.u-admin-modal-icon {
    color: #3b82f6;
    font-size: 1.5rem;
}

.u-is-me-row {
    background: rgba(59, 130, 246, 0.05);
}

.u-admin-section-title {
    margin-top: 0;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.u-admin-meta-small {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.u-text-accent {
    color: var(--accent);
}

.u-w-140 {
    width: 140px;
}

.u-w-120 {
    width: 120px;
}

.u-w-100 {
    width: 100px;
}

.u-w-80 {
    width: 80px;
}

.u-p-8 {
    padding: 8px;
}

.u-font-600 {
    font-weight: 600;
}

.u-admin-card-large {
    margin-bottom: 40px;
    padding: 30px;
}

.u-admin-input-full {
    flex: 1;
}

.u-admin-badge-error {
    color: #ef4444;
    font-size: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.u-admin-btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
}

.u-admin-btn-small-info {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    background: #3b82f6;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.u-admin-btn-small-warning {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    background: #facc15;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.3);
    color: #1d1d1f !important;
}

.u-admin-btn-small-success {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    background: #28cd41;
    box-shadow: 0 4px 15px rgba(40, 205, 65, 0.3);
}

.u-admin-btn-small-sky {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    width: 100%;
    justify-content: center;
    background: #5ac8fa;
    box-shadow: 0 4px 15px rgba(90, 200, 250, 0.3);
    color: white !important;
}

.u-admin-old-price-small {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: line-through;
}

.u-m-bottom-20 {
    margin-bottom: 20px;
}

.u-m-top-10 {
    margin-top: 10px;
}

.u-m-top-5 {
    margin-top: 5px;
}

.u-resize-v {
    resize: vertical;
}

.u-flex-column-end {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 15px;
}

.u-p-bottom-12 {
    padding-bottom: 12px;
}

.u-admin-checkbox-inline {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: 42px; /* Matches standard input height */
    white-space: nowrap;
    cursor: pointer;
}

.u-admin-checkbox-inline label {
    margin: 0 !important;
    cursor: pointer;
    font-weight: 500 !important;
    line-height: 1 !important;
}

.u-admin-checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 !important;
    cursor: pointer;
}


.u-f-size-09 {
    font-size: 0.9rem;
}

.u-p-10 {
    padding: 10px;
}

.u-space-between {
    justify-content: space-between;
}

.u-modal-large {
    width: 95%;
    max-width: 900px;
}

.u-admin-badge-update {
    font-size: 0.85rem;
    color: var(--text-dim);
    background: var(--glass);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.u-admin-grid-desc {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-top: 10px;
}

.u-admin-history-table {
    max-height: 400px;
    overflow-y: auto;
}

.u-admin-loading-card {
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.u-admin-price-input {
    width: 80px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
}

.u-align-items-end {
    align-items: flex-end;
}

.u-align-items-start {
    align-items: flex-start;
}

.u-w-full {
    width: 100%;
}

.u-gap-10 {
    gap: 10px;
}

.u-gap-15 {
    gap: 15px;
}

.u-flex-1 {
    flex: 1;
}

.u-flex-2 {
    flex: 2;
}

/* Related Games Swiper */
.related-swiper,
.refined-swiper {
    padding-bottom: 50px;
    margin: 20px 0;
    width: 100% !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.related-swiper .swiper-slide,
.refined-swiper .swiper-slide,
.genre-swiper .swiper-slide,
.main-swiper .swiper-slide {
    height: auto;
    display: flex;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    width: 100%;
}

.related-swiper .grid-card,
.refined-swiper .grid-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.related-swiper .grid-price,
.refined-swiper .grid-price {
    margin-top: auto;
    /* Aligns prices to bottom when titles are different lengths */
    padding-bottom: 5px;
}

.related-swiper .swiper-button-next,
.related-swiper .swiper-button-prev,
.refined-swiper .swiper-button-next,
.refined-swiper .swiper-button-prev {
    color: var(--accent);
    transform: scale(1.1);
    background: rgba(11, 15, 28, 0.6);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.related-swiper .swiper-button-next::after,
.related-swiper .swiper-button-prev::after,
.refined-swiper .swiper-button-next::after,
.refined-swiper .swiper-button-prev::after {
    font-size: 20px;
    font-weight: 900;
}

.related-swiper .swiper-pagination-bullet-active,
.refined-swiper .swiper-pagination-bullet-active {
    background: var(--accent);
}

@media (max-width: 768px) {

    .related-swiper .swiper-button-next,
    .related-swiper .swiper-button-prev,
    .refined-swiper .swiper-button-next,
    .refined-swiper .swiper-button-prev {
        display: flex;
        /* Keep arrows on mobile but maybe smaller */
    }
}

/* Crawler Dashboard Mobile Refinement */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }

    .dashboard-header h1 {
        margin-bottom: 5px;
        font-size: 2rem;
    }

    .dashboard-header .u-flex-center {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    #cronCountdownContainer {
        margin-right: 0 !important;
        margin-bottom: 5px;
        width: 100%;
        justify-content: center;
    }

    .u-mobile-stack {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }

    .u-mobile-stack .u-flex-center {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Error States */
.u-full-center-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-card {
    text-align: center;
    background: var(--card);
    padding: 50px 30px;
    border-radius: 28px;
    max-width: 500px;
    width: 95%;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-large);
    margin: 40px auto;
}

.error-icon {
    font-size: 4.5rem;
    color: #ff3b30;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(255, 59, 48, 0.2));
}

.error-card h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text);
    line-height: 1.2;
}

.error-card p {
    color: var(--text-dim);
    margin-bottom: 32px;
    line-height: 1.6;
    font-size: 1.1rem;
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #e8e8ed;
}

/* Unpublished Games Style */
.grid-card.is-unpublished,
.card.is-unpublished,
.swiper-slide.is-unpublished {
    color: var(--text-dim) !important;
    opacity: 0.8 !important;
}

.is-unpublished img {
    filter: grayscale(1) !important;
    -webkit-filter: grayscale(1) !important;
}

.is-unpublished .current-price,
.is-unpublished .grid-title,
.is-unpublished .card-title,
.is-unpublished .grid-info,
.is-unpublished .rating span {
    color: var(--text-dim) !important;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5ea;
    transition: .4s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

input:checked+.slider {
    background-color: #34c759;
}

input:focus+.slider {
    box-shadow: 0 0 1px #34c759;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}