*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: oklch(13% 0.028 261.692);
    --bg-elevated: oklch(27.8% 0.033 256.848)101321;
    --bg-elevated-soft: oklch(13% 0.028 261.692)5192a;
    --accent: oklch(85.5% 0.138 181.071);
    --accent-soft: oklch(37.3% 0.034 259.733);
    --accent-strong: #00ffa3;
    --text: #e4e8f5;
    --muted: #8890aa;
    --border: #222638;
    --danger: #ff4a6a;
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.4);
    --radius-xl: 18px;
    --radius-lg: 12px;
    --transition-fast: 0.18s ease-out;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    ;
    --scrollbarflex: rgba(255, 255, 255, 0.6);
}


/* Body & layout */

body.theme-dark {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #141b33 0, #05070d 55%);
    color: var(--text);
    font-family: var(--font-main);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Top bar */

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 28px;
    background: rgba(5, 7, 13, 0.92);
    border-bottom: 1px solid #181b26;
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 10;
     
}

.logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.logo-pixel {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */

.btn {
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background: none;
    color: var(--text);
    transition: background var(--transition-fast), transform var(--transition-fast),
        box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn-primary {
    background: white;
    color: #020308;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.8);
}

.btn-ghost {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
}

.btn.small {
    padding: 4px 10px;
    font-size: 13px;
}

/* Main layout */

.layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 24px 40px;
}

.sidebar {
    background: rgba(10, 13, 26, 0.92);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 16px 16px 18px;
    box-shadow: var(--shadow-soft);
}

.sidebar-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;

}

/* Filters */

.filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.filters label {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

input[type='text'],
input[type='date'],
input[type='number'],
input[type='url'],
input[type='password'],
textarea,
select {
    background: rgba(6, 9, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 6px 9px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition-fast),
        box-shadow var(--transition-fast), background var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.4);
}

textarea {
    resize: vertical;
}

/* Categories */

.categories {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 10px;
}

.categories h3 {
    margin: 0 0 6px;
    font-size: 14px;
}

.hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--muted);
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.category-pill {
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: background var(--transition-fast), border-color var(--transition-fast),
        color var(--transition-fast), transform var(--transition-fast);
}

.category-pill:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-1px);
}

/* Content */

.content {
    background: rgba(8, 11, 23, 0.95);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 18px 18px 28px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
     
    height: 105vh;
}

.page-title {
    margin: 0 0 4px;
    font-size: 22px;
}

.page-subtitle {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--muted);
}

/* Game cards */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.game-card {
    background: radial-gradient(circle at top left, #1f2541 0, #101320 52%, #090b15 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.5);
    position: relative;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
        border-color var(--transition-fast);
}

.game-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(135deg,
            rgba(0, 212, 255, 0.5),
            transparent 40%,
            transparent 60%,
            rgba(0, 255, 163, 0.5)) border-box;
    mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 212, 255, 0.35);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card--clickable {
    cursor: pointer;
}

.game-card--clickable:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.game-header {
    display: flex;
    gap: 8px;
}

.game-cover {
    width: 76px;
    height: 76px;
    border-radius: 12px;
    object-fit: cover;
    background: #181b2a;
    flex-shrink: 0;
}

.game-main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-title {
    font-size: 16px;
    font-weight: 600;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 12px;
    color: var(--muted);
}

.game-chip {
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
}

.game-sales {
    font-size: 12px;
    color: var(--accent-strong);
}

.game-open-hint {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent);
    opacity: 0.9;
}

/* Extra blocks on pages */

.game-description {
    font-size: 13px;
    color: #cfd5eb;
}

.game-facts {
    font-size: 12px;
    color: var(--muted);
}

.game-screens {
    display: flex;
    gap: 5px;
    margin-top: 4px;
}

.game-screenshot {
    flex: 1;
    border-radius: 8px;
    height: 60px;
    object-fit: cover;
    background: #151827;
}

/* Empty state */

.empty-state {
    text-align: center;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
}

/* Footer */

.footer {
    padding: 10px 24px 16px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}

/* Admin */

.admin-layout {
    padding: 18px 24px 40px;
}

.auth-card {
    max-width: 380px;
    margin: 40px auto;
}

.card {
    background: rgba(8, 11, 23, 0.95);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 16px 18px 20px;
    box-shadow: var(--shadow-soft);
    overflow-y: auto;
}

.form-grid {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.error-msg {
    margin-top: 8px;
    color: var(--danger);
    font-size: 13px;
}

.success-msg {
    margin-top: 8px;
    color: var(--accent-strong);
    font-size: 13px;
}

.admin-wrapper {
    max-width: 1200px;
    margin: 18px auto 0;
}

.admin-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 16px;
}

.admin-games-list {
    max-height: 580px;
     
    padding-right: 6px;
}

.admin-game-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 6px 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.admin-game-meta {
    display: flex;
    flex-direction: column;
}

.admin-game-title {
    font-weight: 500;
}

.admin-game-sub {
    color: var(--muted);
    font-size: 12px;
}

.admin-game-actions {
    display: flex;
    gap: 6px;
}

/* Image inputs (admin) */

.image-input {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.image-preview {
    width: 110px;
    height: 110px;
    border-radius: 12px;
    object-fit: cover;
    background: #151827;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.image-input-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-input input[type='file'] {
    font-size: 12px;
}

/* Game page */

.game-page {
    padding: 18px 24px 40px;
    display: grid;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.game-page-header .game-page-hero {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 10px;
}


.game-page-cover {
    width: 180px;
    height: auto;
    border-radius: 16px;
    object-fit: cover;
    background: #181b2a;
    flex-shrink: 0;
}

.game-page-hero-info h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.game-page-body h2,
.game-page-body h3 {
    margin-top: 14px;
    margin-bottom: 6px;
}

svg {
    height: 36px;
    width: 36px;
}

.game-page-screens {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.game-page-screenshot {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    background: #151827;
}

/* Utils */

.hidden {
    display: none !important;
}

/* Responsive */

@media (max-width: 960px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        order: 2;
    }

    .content {
        order: 1;
    }

    .admin-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .game-page {
        padding-inline: 12px;
    }

    .game-page-header .game-page-hero {
        flex-direction: column;
    }

    .game-page-cover {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 640px) {
    .top-bar {
        padding-inline: 14px;
    }

    .layout,
    .admin-layout {
        padding-inline: 12px;
    }

    .content,
    .sidebar,
    .card {
        border-radius: 14px;
    }

    .image-input {
        grid-template-columns: minmax(0, 1fr);
    }

    .image-preview {
        width: 100%;
        height: 160px;
    }
}