/* Global Reset */
* {
    box-sizing: border-box;
}

:root {
    /* Palette - Ultra Modern Dark */
    --bg-app: #050510;
    --bg-glass: rgba(20, 20, 35, 0.6);
    --bg-glass-heavy: rgba(10, 10, 20, 0.85);

    --color-primary: #6366f1;
    /* Indigo */
    --color-accent: #8b5cf6;
    /* Violet */
    --color-neon: #00f3ff;
    /* Cyan Neon */
    --color-danger: #f43f5e;
    --color-success: #10b981;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --border-glass: 1px solid rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);

    --font-main: 'Century Gothic', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 20%);
    color: var(--text-main);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--border-glass);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.btn {
    padding: 0.6em 1.2em;
    border-radius: 8px;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9rem;
    /* Restore font size */
}

.nav-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    border-radius: 6px;
    text-transform: uppercase;
    white-space: nowrap;
    /* Prevent text wrap */
    flex-shrink: 0;
    /* Prevent button shrink */
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.6);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.2);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

.btn-secondary,
.btn-add-item {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-neon);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.btn-secondary:hover,
.btn-add-item:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.input-group {
    margin-bottom: 1rem;
}

.input-modern {
    width: 100%;
    padding: 0.8em;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Dropdown styling */
select.input-modern {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300f3ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
    background-color: rgba(0, 0, 0, 0.4);
}

select.input-modern option {
    background-color: var(--bg-app);
    color: var(--text-main);
}

/* Date Picker Dark Mode */
input[type="date"].input-modern {
    color-scheme: dark;
}

input[type="date"].input-modern::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

input[type="date"].input-modern::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Status Badge */
.nav-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.status-badge.on {
    color: #10b981;
    /* Green */
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.status-badge.off {
    color: #f43f5e;
    /* Red */
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.1);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Wrapping Grid */
    gap: 20px;
    padding-bottom: 40px;
    align-items: stretch;
}

/* Custom Scrollbar for Gallery Grid - Vertical is default on page/wrapper */
.gallery-wrapper::-webkit-scrollbar {
    width: 10px;
}

.gallery-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

.gallery-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-neon);
    border-radius: 5px;
    box-shadow: 0 0 10px var(--color-neon);
}

.gallery-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* min-width removed as grid handles it */
}

/* Loading */
.loading-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-neon);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 60px;
    margin: 1rem;
    border-radius: 12px;
    gap: 2rem;
    justify-content: space-between;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-neon);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    min-width: 120px;
    display: flex;
    /* Flex for icon + text */
    align-items: center;
    gap: 10px;
}

.nav-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-neon);
    animation: spin 10s linear infinite;
    animation-play-state: paused;
    /* Static by default */
}

.nav-logo:hover .nav-logo-icon {
    animation-play-state: running;
    /* Spin on hover */
}

.nav-scroll {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 5px;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: var(--color-neon);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.hidden {
    display: none !important;
    opacity: 0;
}

.visible {
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 16px;
    transform: scale(0.95);
    transition: transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

/* Reference Tables */
.view-container {
    padding: 0 1rem 2rem 1rem;
    height: calc(100vh - 100px);
    overflow-y: auto;
}

.view-header {
    margin-bottom: 1.5rem;
}

.ref-table-grid {
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 1rem;
    padding: 0 1rem 2rem 1rem;
    overflow-y: scroll;
    /* Force vertical scroll */
    flex: 1;
    /* Take remaining space */
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.th {
    font-weight: bold;
    color: var(--color-accent);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.td {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    /* Fix font size mismatch for Reference Tables */
}

.input-flat {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    font-family: inherit;
}

.input-flat:focus {
    outline: none;
    border-bottom: 1px solid var(--color-primary);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-danger);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
}

.btn-icon:hover {
    opacity: 1;
}

/* Games Table */
.games-table-container {
    overflow-x: scroll !important;
    /* Force scrollbar track */
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 60px;
    /* Ensure space for scrollbar */
    width: 100%;
}

.games-table {
    display: grid;
    /* REVERTED TO REQUESTED WIDTHS */
    grid-template-columns:
        80px
        /* Cover */
        minmax(450px, 1fr)
        /* Final Title */
        200px
        /* Corrected Reduced to match Game Title */
        320px
        /* Platform */
        320px
        /* Platform Type */
        160px
        /* Status */
        200px
        /* Title */
        160px
        /* Edition */
        90px
        /* Ver */
        120px
        /* Code */
        150px
        /* ID */
        120px
        /* T Lang */
        120px
        /* V Lang */
        120px
        /* Region */
        80px
        /* Upd */
        110px
        /* Addons */
        110px
        /* Mods */
        90px
        /* Disk */
        100px
        /* Side */
        200px
        /* Authors */
        160px
        /* Port */
        250px
        /* Genres */
        110px
        /* Release */
        110px
        /* Offline */
        180px
        /* Dev */
        180px
        /* Pub */
        220px
        /* Retro (Expanded) */
        300px
        /* Link */
        300px
        /* Comment */
        300px
        /* Description */
        150px
        /* Downloads */
    ;

    min-width: 5500px;
    /* Increased total width slightly */
    font-size: 0.75rem;
}

.gt-head {
    background: rgba(99, 102, 241, 0.15);
    font-weight: bold;
    color: var(--color-neon);
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    position: sticky;
    top: 0;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    z-index: 20;

    white-space: normal;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
}

.gt-cell {
    padding: 0.4rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    white-space: normal;
    overflow: hidden;
    word-break: break-word;
    /* Break long words */
    line-height: 1.25;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.gt-cell:hover {
    background: rgba(255, 255, 255, 0.02);
    overflow: visible;
    z-index: 10;
    position: relative;
    background: #1a1a2e;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.cell-interactive {
    cursor: pointer;
    color: var(--color-neon);
    font-weight: bold;
    /* Remove underline as requested */
    text-decoration: none;
    transition: all 0.2s;
}

.cell-interactive:hover {
    color: white;
    background: rgba(99, 102, 241, 0.3) !important;
    /* transform removed */
    z-index: 15;
}

.text-center {
    justify-content: center !important;
    text-align: center;
}

/* Platform Icons */
.platform-cell-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.platform-icon {
    height: 100%;
    /* Full height of cell */
    width: auto;
    /* Maintain aspect ratio */
    max-width: 80px;
    /* Cap width just in case */
    object-fit: contain;
    flex-shrink: 0;
}

/* Modal List Styles */
.modal-list-grid {
    display: grid;
    /* 3 Columns if possible, auto-fit otherwise */
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Responsive check: if screen is narrow, reduce columns */
@media (max-width: 800px) {
    .modal-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.description-cell {
    /* Container styles - minimal needed */
    display: block !important;
    padding: 0 !important;
    /* Allow inner to fill */
    cursor: pointer;
}

.description-inner {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    width: 100%;
}

.description-cell:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 500px) {
    .modal-list-grid {
        grid-template-columns: 1fr;
    }
}

.modal-list-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    /* Compact font */
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-list-item:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

/* Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Allow scroll if screen is too small */
    gap: 0.8rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-label {
    font-size: 0.6rem;
    /* Smaller Font */
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.filter-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 140px;
    font-size: 0.8rem;
}

/* Widen Search Title specifically */
input[type="text"].filter-input {
    min-width: 320px;
}

.filter-input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.filter-tag-container {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    max-width: 300px;
}

.filter-tag {
    font-size: 0.7rem;
    background: var(--color-primary);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    600:
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.full-width {
    grid-column: 1 / -1;
}

.dynamic-list-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.game-cover-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.game-cover-thumb:hover {
    transform: scale(1.1);
    border-color: var(--color-neon);
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.gallery-cover-wrap {
    width: 200px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border: 2px solid var(--color-neon);
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.5);
}

.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--color-neon);
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.drop-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    margin-top: 1rem;
    display: block;
}

/* IMPORTANT: Form Helper Colors with high specificity */
.input-modern.bg-red-soft {
    background-color: rgba(244, 63, 94, 0.15) !important;
    border-color: rgba(244, 63, 94, 0.3) !important;
}

.input-modern.bg-green-soft {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Delete Confirmation Styling */
.confirm-content {
    text-align: center;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Auth Views */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.auth-panel {
    width: 100%;
    max-width: 400px;
    padding: 3rem 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-shadow: 0 0 50px rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.9), rgba(10, 10, 20, 0.95));
}

.auth-title {
    text-align: center;
    color: var(--color-neon);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.auth-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
    letter-spacing: 1px;
}

.auth-input {
    background: rgba(0, 0, 0, 0.4);
    font-size: 1rem;
    padding: 1rem;
}

.auth-btn {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-link {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.link-text {
    color: var(--color-primary);
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}

.link-text:hover {
    color: var(--color-neon);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
}

.auth-error {
    background: rgba(244, 63, 94, 0.1);
    color: var(--color-danger);
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(244, 63, 94, 0.3);
    text-align: center;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Badge - Premium Neon Override */
.status-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge.on {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2), inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.status-badge.on::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 0 10px #34d399;
    opacity: 0;
    animation: pulse-green 2s infinite;
}

.status-badge.off {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2), inset 0 0 10px rgba(239, 68, 68, 0.1);
}

@keyframes pulse-green {
    0% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.1;
    }
}

/* Aggressive Reset for Navbar Buttons to kill "Grey Square" */
.nav-right button,
.nav-right .status-badge {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
}

/* Layout Updates for Scrolling */
.view-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    /* Lowered 10px as requested */
    overflow: visible;
    /* Prevent body scroll */
}

/* Action Bar fixed at top */
.action-bar {
    flex-shrink: 0;
    z-index: 20;
    background: #0d0d1a;
    width: 100%;
    padding: 10px;
    border-bottom: 1px solid var(--color-primary);
}

/* Table Container scrolls independently */
/* Table Container scrolls independently */
.games-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    /* Allow scroll if needed (forced by content) */
    position: relative;
    padding-bottom: 30px;
    width: 100%;
}



/* Sticky Headers */
.gt-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #0d0d1a;
    /* Match bg to cover scrolling content */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    /* Ensure border bottom is visible */
    border-bottom: 2px solid var(--color-neon);
}

/* Ensure filter wrapper doesn't overflow */
.filter-wrapper {
    overflow-x: auto;
    scrollbar-width: thin;
}

/* Custom Scrollbar for Webkit (Chrome, Edge, Safari) */
/* Custom Scrollbar for Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: #0d0d1a;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 7px;
    border: 3px solid #0d0d1a;
    /* Creates floating pill effect */
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-neon);
    border: 3px solid #0d0d1a;
    background-clip: content-box;
}

::-webkit-scrollbar-corner {
    background: #0d0d1a;
}

/* FINAL FORCE SCROLLBAR */
.games-table {
    min-width: 5500px !important;
    width: 5500px !important;
}

/* RESTORED STYLES */
.btn-stack {
    display: flex;
    flex-direction: column !important;
    gap: 10px;
    align-items: flex-end;
    /* Align to Right Edge */
    justify-content: center;
    margin-top: 5px;
}

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.game-detail-card {
    background: #1a1a2e;
    border: 1px solid var(--color-neon);
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.3);
    overflow: hidden;
}

.game-detail-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.game-detail-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--color-neon);
}

.game-detail-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.game-detail-cover {
    width: 350px;
    background: #000;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.game-det.gallery-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full visibility */
    background: #000;
}

.game-detail-info {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.version-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.version-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.version-title-row h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
    flex: 1;
}

.version-actions {
    display: flex;
    gap: 10px;
}

.version-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-item.interactive {
    cursor: pointer;
    background: rgba(0, 243, 255, 0.05);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px dashed rgba(0, 243, 255, 0.3);
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-val {
    font-size: 0.95rem;
    color: #eee;
}

/* FIXES FOR MODAL, COVER, DESC */
.modal-overlay {
    z-index: 20000 !important;
    /* Above Game Overlay */
}

.gallery-cover {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    /* Force Full Image */
    background: transparent;
}

.description-text.collapsed {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    color: var(--color-neon);
}

.description-text {
    cursor: pointer;
    margin-top: 5px;
    line-height: 1.4;
}

/* Better Toggle Button */
.btn-toggle {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-neon);
    color: var(--color-neon);
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}


/* FORCE CARD LAYOUT */
.game-detail-content {
    display: flex !important;
    flex-direction: row !important;
}

.game-detail-cover {
    width: 350px !important;
    min-width: 350px !important;
    background: #000;
    flex-shrink: 0;
    order: 0;
}

.game-detail-info {
    flex: 1;
    order: 1;
}

.game-detail-cover img {
    object-fit: contain !important;
}


.detail-cover-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: transparent;
}

/* Grid Separators */
.game-detail-body {
    display: flex;
    /* Side by side */
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.game-detail-right-col {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 80vh;
    /* Allow Grid Scrolling */
    padding-right: 5px;
}

.version-card {
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 25px;
    /* More spacing */
    border-radius: 4px;
    border: 1px solid var(--color-neon);
    /* Neon Border */
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(0, 243, 255, 0.05);
    /* Glow */
    overflow: hidden;
    position: relative;
}

.version-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.version-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-detail-cover {
    width: 300px;
    flex-shrink: 0;
    text-align: center;
}

.game-detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* More compact */
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    /* Even smaller padding */
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.65rem;
    /* Smaller */
    color: var(--color-neon);
    font-weight: bold;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.detail-value {
    font-size: 0.8rem;
    /* Smaller */
    color: #e0e0e0;
    line-height: 1.1;
}

/* Scrollbar for right col */
.game-detail-right-col::-webkit-scrollbar {
    width: 6px;
}

.game-detail-right-col::-webkit-scrollbar-thumb {
    background: var(--color-neon);
    border-radius: 3px;
}


/* Breadcrumbs */
.gallery-breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-neon);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.crumb-part {
    cursor: pointer;
    transition: color 0.3s, text-shadow 0.3s;
}

.crumb-part:hover {
    color: #fff;
    text-shadow: 0 0 10px #fff;
    text-decoration: underline;
}

.crumb-sep {
    color: var(--color-neon);
    margin: 0 10px;
    font-weight: normal;
}

.btn-back-cool {
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-neon);
    border: 1px solid var(--color-neon);
    border-radius: 4px;
    padding: 8px 16px;
    margin-left: 20px;
    /* Added margin to prevent cutoff */
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.btn-back-cool:hover {
    background: var(--color-neon);
    color: #000;
    box-shadow: 0 0 15px var(--color-neon), 0 0 30px var(--color-neon);
    transform: translateX(-3px);
}

/* Pointer for links */
.detail-value.link {
    cursor: pointer;
    transition: opacity 0.2s;
}

.detail-value.link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Table Style Notification (Blue/Purple Bar) */
.table-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /* Right aligned */
    left: auto;
    transform: translateY(100px);
    background: linear-gradient(90deg, #6a5acd, #8a2be2);
    /* Purple/Blue Gradient */
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 20000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27);
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-notification.show {
    transform: translateY(0);
}

/* Custom Notification */
.copy-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--color-neon);
    padding: 15px;
    border-radius: 8px;
    z-index: 20000;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    display: block;
}

.copy-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Auth Box Positioning */
#login-modal,
#register-modal,
.auth-modal,
.auth-container,
.login-container {
    top: 55% !important;
    /* Slightly lower than center */
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    position: fixed !important;
}

/* Global Form Labels */
.form-label {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
    text-transform: uppercase;
    /* Optional polsh */
    letter-spacing: 0.5px;
}