/* ── Alpine cloak (hides x-cloak elements until Alpine initializes) ── */
[x-cloak] { display: none !important; }

/* ── Navbar ──────────────────────────────────────────────────────────── */
.gv-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 20px 10px;
    background: rgba(7, 7, 16, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gv-nav-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
}
.gv-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-right: 6px;
    white-space: nowrap;
}

/* Search */
.gv-search-wrap {
    position: relative;
    flex: 1;
    min-width: 140px;
    max-width: 340px;
}
.gv-search {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 7px 32px 7px 12px;
    color: #fff;
    font-size: .875rem;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}
.gv-search:focus { border-color: #7c3aed; }
.gv-search::placeholder { color: #4b5563; }
.gv-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: .75rem;
    padding: 2px;
}
.gv-search-clear:hover { color: #9ca3af; }

.gv-count {
    color: #4b5563;
    font-size: .8rem;
    white-space: nowrap;
}

.gv-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 7px 10px;
    color: #d1d5db;
    font-size: .8rem;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
}
.gv-select:focus {
    border-color: rgba(124,58,237,0.55);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.16);
}
.gv-select option {
    background: #111827;
    color: #f8fafc;
}

.gv-logout {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #6b7280;
    padding: 6px 12px;
    font-size: .8rem;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.gv-logout:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.gv-filter-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 31px;
    padding: 0;
}
.gv-filter-toggle.is-switching {
    opacity: .8;
    cursor: wait;
}
.gv-filter-toggle.is-switching .gv-filter-icon {
    opacity: 0;
}
.gv-filter-toggle.is-switching::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: gv-spin .7s linear infinite;
}

/* Pills row */
.gv-pills-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 1600px;
    margin: 8px auto 0;
    scrollbar-width: none;
}
.gv-pills-row::-webkit-scrollbar { display: none; }

.gv-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .73rem;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.gv-pill-sm { font-size: .7rem; padding: 3px 9px; }

.gv-pill-inactive {
    border-color: rgba(255,255,255,0.1);
    color: #6b7280;
    background: transparent;
}
.gv-pill-inactive:hover {
    border-color: rgba(255,255,255,0.25);
    color: #9ca3af;
}
.gv-pill-active {
    border-color: rgba(124,58,237,0.7);
    background: rgba(124,58,237,0.2);
    color: #c4b5fd;
}
.gv-pill-plat-active {
    border-color: rgba(59,130,246,0.7);
    background: rgba(59,130,246,0.2);
    color: #93c5fd;
}

/* ── Content area ────────────────────────────────────────────────────── */
.gv-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* ── Loading ─────────────────────────────────────────────────────────── */
.gv-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 0;
    color: #4b5563;
    gap: 12px;
}
.gv-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid #7c3aed;
    border-top-color: transparent;
    border-radius: 50%;
    animation: gv-spin .8s linear infinite;
}
@keyframes gv-spin { to { transform: rotate(360deg); } }

/* ── Card Grid ───────────────────────────────────────────────────────── */
.gv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
@media (min-width: 480px)  { .gv-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (min-width: 768px)  { .gv-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; } }
@media (min-width: 1024px) { .gv-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; } }
@media (min-width: 1400px) { .gv-grid { grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); } }

/* ── Game Card ───────────────────────────────────────────────────────── */
.gv-card {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    content-visibility: auto;
    contain-intrinsic-size: 185px 278px;
}
.gv-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 16px 40px rgba(109, 40, 217, 0.35);
    border-color: rgba(124, 58, 237, 0.5);
}

.gv-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform .3s ease;
}
.gv-card:hover .gv-card-img { transform: scale(1.06); }

.gv-no-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    opacity: .4;
}

/* Card overlay: dark at top + stronger at bottom */
.gv-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.55) 0%,
        transparent 30%,
        transparent 45%,
        rgba(0,0,0,.88) 100%
    );
}

.gv-card-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 7px 7px 8px;
}
.gv-card-title {
    font-size: .68rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 6px rgba(0,0,0,.9);
}

/* ── Platform chips (on card) ────────────────────────────────────────── */
.gv-plat-icons { display: flex; gap: 3px; flex-wrap: wrap; }
.gv-plat-chip {
    font-size: .52rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: .04em;
    line-height: 1.7;
    opacity: .92;
}

/* ── Genre badge (on card + modal) ──────────────────────────────────── */
.gv-card-badge-pos {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 1;
}
.gv-genre-badge {
    display: inline-block;
    font-size: .58rem;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(109, 40, 217, 0.65);
    color: #e9d5ff;
    border: 1px solid rgba(167,139,250,.4);
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* ── Rating badge (on card) ──────────────────────────────────────────── */
.gv-rating-badge {
    position: absolute;
    top: 7px; right: 7px;
    font-size: .6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(0,0,0,.6);
    color: #fcd34d;
    border: 1px solid rgba(251,191,36,.25);
    backdrop-filter: blur(4px);
    transition: right .15s;
}
.gv-card:hover .gv-rating-badge { right: 36px; }

/* ── Favorite heart (on card) ────────────────────────────────────────── */
.gv-heart-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,.45);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    color: rgba(255,255,255,.8);
    transition: opacity .15s, color .15s, background .15s;
    backdrop-filter: blur(4px);
    z-index: 2;
}
.gv-card:hover .gv-heart-btn { opacity: 1; }
.gv-heart-btn.is-fav          { opacity: 1 !important; color: #f43f5e; }
.gv-heart-btn:hover            { color: #f43f5e; background: rgba(0,0,0,.65); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.gv-empty {
    text-align: center;
    padding: 80px 0;
}

/* ── Modal backdrop ──────────────────────────────────────────────────── */
.gv-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(5px);
}

/* ── Modal card ──────────────────────────────────────────────────────── */
.gv-modal {
    background: #0f0f1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(0,0,0,.9);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2d2d4e transparent;
}

.gv-modal-hero {
    position: relative;
    height: 210px;
    background-size: cover;
    background-position: center 25%;
    background-color: #1a1a2e;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.gv-modal-hero-grad {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.2) 0%, rgba(15,15,26,.97) 100%);
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.gv-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    width: 30px; height: 30px;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.gv-modal-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.gv-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.8);
    line-height: 1.2;
}

.gv-modal-body { padding: 18px 20px 22px; }

.gv-modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.gv-modal-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}
.gv-plat-badge {
    font-size: .72rem;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid;
    font-weight: 500;
}
.gv-trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.35);
    color: #fca5a5;
    text-decoration: none;
    transition: background .15s;
    margin-left: auto;
    white-space: nowrap;
}
.gv-trailer-btn:hover { background: rgba(239,68,68,.28); }

.gv-modal-desc {
    color: #9ca3af;
    font-size: .85rem;
    line-height: 1.65;
}

/* ── Modal transitions ───────────────────────────────────────────────── */
.gv-fade-enter  { transition: opacity .18s ease; }
.gv-fade-from   { opacity: 0; }
.gv-fade-to     { opacity: 1; }
.gv-scale-enter { transition: opacity .2s ease, transform .2s ease; }
.gv-scale-from  { opacity: 0; transform: scale(.94) translateY(10px); }
.gv-scale-to    { opacity: 1; transform: scale(1) translateY(0); }

.gv-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    color: #d1d5db;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-edit-btn:hover { background: rgba(255,255,255,.13); }

.gv-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #fca5a5;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-delete-btn:hover { background: rgba(239,68,68,.25); }

.gv-add-btn {
    display: inline-flex;
    align-items: center;
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(124,58,237,.25);
    border: 1px solid rgba(124,58,237,.5);
    color: #c4b5fd;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-add-btn:hover { background: rgba(124,58,237,.4); }

/* ── Manual Add modal ───────────────────────────────────────────────────── */
.gv-manual-add-wrap {
    background: #111120;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    width: 700px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
.gv-manual-add-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 32px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.gv-manual-add-close {
    display: none;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.gv-manual-add-body {
    display: flex;
    flex-direction: row;
    gap: 28px;
    padding: 28px 32px;
    overflow-y: auto;
    flex: 1;
}
.gv-manual-cover-wrap {
    width: 240px;
    flex-shrink: 0;
}
.gv-manual-cover-img {
    width: 240px;
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a2e;
}
.gv-manual-cover-ph {
    width: 240px;
    height: 320px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 2px dashed rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    font-size: 2.5rem;
}
.gv-manual-add-footer {
    padding: 16px 32px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

/* ── Add Games modal ─────────────────────────────────────────────────────── */
.gv-add-games-backdrop {
    z-index: 60;
    align-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 8%, rgba(20,184,166,.16), transparent 30%),
        radial-gradient(circle at 86% 4%, rgba(124,58,237,.18), transparent 32%),
        rgba(0,0,0,.78);
}
.gv-add-games-panel {
    background: rgba(12,13,24,.96);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.04);
    width: 100%;
    max-width: 980px;
    max-height: calc(100vh - 48px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(18px);
}
.gv-add-games-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0));
}
.gv-add-games-heading {
    min-width: 0;
}
.gv-add-games-eyebrow {
    display: block;
    color: #5eead4;
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}
.gv-add-games-title {
    color: #f8fafc;
    font-size: 1.55rem;
    line-height: 1.25;
    font-weight: 800;
    margin: 0;
}
.gv-add-games-kpis {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.gv-add-games-kpis span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #a7b0bf;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: .78rem;
    line-height: 1;
}
.gv-add-games-kpis strong {
    color: #f8fafc;
    font-size: .82rem;
}
.gv-add-games-close {
    background: rgba(255,255,255,.075);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    line-height: 1;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.gv-add-games-close:hover { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.13); }
.gv-add-games-columns,
.gv-add-games-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) minmax(190px, 230px);
    gap: 14px;
    align-items: center;
}
.gv-add-games-columns {
    padding: 12px 34px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: #7c8492;
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.gv-add-games-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 12px;
    background: rgba(2,6,23,.25);
}
.gv-add-games-row {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 12px;
    background: rgba(255,255,255,.043);
    margin-bottom: 10px;
    transition: opacity .16s ease, border-color .16s ease, background .16s ease;
}
.gv-add-games-row:last-child {
    margin-bottom: 0;
}
.gv-add-games-row:hover {
    border-color: rgba(255,255,255,.15);
    background: rgba(255,255,255,.062);
}
.gv-add-games-row.is-skipped {
    opacity: .48;
    background: rgba(255,255,255,.025);
}
.gv-add-games-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #7c3aed;
    justify-self: center;
}
.gv-add-games-game {
    min-width: 0;
}
.gv-add-games-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.gv-add-games-name {
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.25;
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.gv-add-games-status-pill {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.gv-add-games-status-pill.is-new {
    color: #bfdbfe;
    background: rgba(59,130,246,.16);
    border: 1px solid rgba(96,165,250,.28);
}
.gv-add-games-status-pill.is-update {
    color: #bbf7d0;
    background: rgba(34,197,94,.14);
    border: 1px solid rgba(74,222,128,.26);
}
.gv-add-games-status {
    color: #94a3b8;
    font-size: .8rem;
    line-height: 1.35;
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}
.gv-add-games-platform-wrap {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.gv-add-games-platform-wrap > span {
    color: #7c8492;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}
.gv-add-games-platform {
    appearance: none;
    width: 100%;
    min-width: 0;
    background:
        linear-gradient(45deg, transparent 50%, #94a3b8 50%) right 15px center / 6px 6px no-repeat,
        linear-gradient(135deg, #94a3b8 50%, transparent 50%) right 10px center / 6px 6px no-repeat,
        rgba(15,23,42,.92);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    padding: 10px 32px 10px 12px;
    color: #f8fafc;
    font-size: .92rem;
    font-weight: 650;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
}
.gv-add-games-platform:focus {
    border-color: rgba(45,212,191,.72);
    box-shadow: 0 0 0 3px rgba(45,212,191,.16);
}
.gv-add-games-platform option {
    background: #111827;
    color: #f8fafc;
}
.gv-add-games-footer {
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    background: rgba(8,10,20,.95);
}
.gv-add-games-saving {
    color: #9ca3af;
    font-size: .9rem;
}
.gv-add-games-spacer { flex: 1; }
.gv-add-games-action {
    font-size: .9rem;
    padding: 10px 18px;
    justify-content: center;
    min-width: 104px;
}
.gv-add-games-primary {
    margin-left: 0;
    background: linear-gradient(135deg, rgba(20,184,166,.28), rgba(124,58,237,.28));
    border-color: rgba(94,234,212,.34);
    color: #dffcf7;
}
.gv-add-games-primary:hover {
    background: linear-gradient(135deg, rgba(20,184,166,.38), rgba(124,58,237,.38));
}
.gv-add-games-action:disabled,
.gv-add-games-close:disabled {
    opacity: .5;
    cursor: default;
}

/* ── Game modal ──────────────────────────────────────────────────────────── */
.gv-modal-inner {
    background: #0e0e1a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    width: 92vw;
    max-width: 1400px;
    height: 88vh;
    display: flex;          /* MUST be in class, not inline — x-show wipes inline display */
    overflow: hidden;
    position: relative;
}
.gv-modal-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    gap: 10px;
    border-right: 1px solid rgba(255,255,255,.07);
}
.gv-media-view {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #050510;
    border-radius: 10px;
    overflow: hidden;
}
.gv-media-view iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.gv-media-view .gv-ss-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.gv-no-media {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.gv-thumb-strip {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    height: 76px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.gv-thumb-btn {
    flex-shrink: 0;
    width: 120px;
    height: 72px;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    border: 2px solid rgba(255,255,255,.15);
    background: #1a1a2e;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .15s;
}
.gv-thumb-btn.is-active,
.gv-thumb-btn:hover { border-color: #7c3aed; box-shadow: 0 0 0 1px #7c3aed; }
.gv-modal-right {
    width: 420px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Mobile modal header (hidden on desktop) ─────────────────────────────── */
.gv-action-close {
    display: none;
}

.gv-modal-mobile-header {
    display: none;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #0e0e1a;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

/* ── Mobile layout ───────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Cards: heart always visible, rating badge permanently shifted left */
    .gv-heart-btn    { opacity: 1; }
    .gv-rating-badge { right: 36px; }

    /* Hide desktop-only nav arrows */
    .gv-modal-nav-arrow { display: none !important; }

    /* Full-screen modal */
    .gv-modal-backdrop { padding: 0; align-items: flex-start; }
    .gv-modal-inner {
        flex-direction: column;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    /* Show mobile header, hide desktop equivalents */
    .gv-modal-mobile-header   { display: flex; }
    .gv-modal-desktop-close   { display: none !important; }
    .gv-modal-desktop-title   { display: none; }
    .gv-action-close          { display: flex; }

    /* Media panel: no padding, media fills width at 16:9 */
    .gv-modal-left  { border-right: none; padding: 0; gap: 0; flex: 0 0 auto; }
    .gv-media-view  { flex: 0 0 auto; height: auto; aspect-ratio: 16 / 9; border-radius: 0; }

    /* Thumbnail strip: smaller thumbs so 3-4 peek at once */
    .gv-thumb-strip { height: 60px; padding: 5px 10px; gap: 6px; }
    .gv-thumb-btn   { width: 84px; height: 50px; }

    /* Info panel: scrollable, fills remaining height */
    .gv-modal-right { width: auto; flex: 1; min-height: 0; padding: 14px 16px 0; gap: 14px; }

    /* Action bar: sticky at bottom of scroll panel */
    .gv-modal-actions {
        position: sticky;
        bottom: 0;
        padding-bottom: 20px;
        background: #0e0e1a;
        z-index: 5;
    }

    /* Reorder action bar: delete | edit | spacer | close | favorite */
    .gv-action-delete  { order: 1; }
    .gv-action-edit    { order: 2; }
    .gv-action-spacer  { order: 3; }
    .gv-action-close   { order: 4; }
    .gv-action-fav     { order: 5; }

    /* Manual Add modal: full-screen, stacked layout */
    .gv-manual-add-wrap {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }
    .gv-manual-add-header { padding: 16px 16px 14px; }
    .gv-manual-add-close  { display: block; }
    .gv-manual-add-body {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }
    .gv-manual-cover-wrap {
        width: 100%;
        order: -1;
    }
    .gv-manual-cover-img {
        width: 100%;
        height: 200px;
        border-radius: 0;
    }
    .gv-manual-cover-ph {
        width: 100%;
        height: 120px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }
    .gv-manual-add-body > div:last-child {
        padding: 16px;
    }
    .gv-manual-add-footer { padding: 12px 16px 28px; }

    /* Add Games modal: full-screen, readable rows */
    .gv-add-games-backdrop {
        padding: 0;
        align-items: flex-start;
        background: rgba(0,0,0,.86);
    }
    .gv-add-games-panel {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .gv-add-games-header {
        padding: 16px 16px 14px;
        align-items: center;
        gap: 12px;
    }
    .gv-add-games-title {
        font-size: 1.25rem;
    }
    .gv-add-games-eyebrow {
        font-size: .66rem;
        margin-bottom: 4px;
    }
    .gv-add-games-kpis {
        gap: 6px;
        margin-top: 9px;
    }
    .gv-add-games-kpis span {
        padding: 5px 8px;
        font-size: .72rem;
    }
    .gv-add-games-columns {
        display: none;
    }
    .gv-add-games-list {
        padding: 10px;
    }
    .gv-add-games-row {
        grid-template-columns: 26px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 14px;
        border-radius: 14px;
    }
    .gv-add-games-check {
        margin-top: 2px;
    }
    .gv-add-games-name-line {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 7px;
    }
    .gv-add-games-name {
        width: 100%;
        font-size: .98rem;
    }
    .gv-add-games-status {
        font-size: .76rem;
    }
    .gv-add-games-platform-wrap,
    .gv-add-games-platform {
        grid-column: 2;
    }
    .gv-add-games-platform-wrap {
        margin-top: 2px;
    }
    .gv-add-games-platform {
        font-size: .92rem;
        min-height: 42px;
    }
    .gv-add-games-footer {
        padding: 12px 12px max(16px, env(safe-area-inset-bottom));
        gap: 10px;
        flex-wrap: wrap;
    }
    .gv-add-games-saving {
        width: 100%;
        order: -1;
    }
    .gv-add-games-spacer {
        display: none;
    }
    .gv-add-games-action {
        flex: 1;
        justify-content: center;
        margin-left: 0;
    }
}

/* ── Discover nav button ─────────────────────────────────────────────────── */
.gv-discover-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(124,58,237,.15);
    border: 1px solid rgba(124,58,237,.35);
    color: #c4b5fd;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-discover-nav-btn:hover { background: rgba(124,58,237,.3); }

/* ── Discover view shell ─────────────────────────────────────────────────── */
.gv-discover-view {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: #070710;
}

/* ── Discover card — direct flex child of the discover view column ───────── */
.gv-discover-card {
    flex: 1 1 0% !important;   /* grow to fill space between header and footer */
    min-height: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;   /* overrides the mobile 100dvh from .gv-modal-inner */
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden !important;
    cursor: grab;
    user-select: none;
}
.gv-discover-card:active { cursor: grabbing; }

/* ── Discover right panel — mirrors .gv-modal-right exactly ─────────────── */
.gv-discover-panel {
    width: 420px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background: #0e0e1a;
    border-left: 1px solid rgba(255,255,255,.07);
    scrollbar-width: thin;
    scrollbar-color: #2d2d4e transparent;
}
.gv-disc-title  { padding: 24px 24px 0; }
.gv-disc-fixed  { padding: 12px 24px 0; }
.gv-disc-scroll { padding: 12px 24px 0; }
.gv-disc-edit {
    padding: 16px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
/* action bar: sticky at bottom of the scrolling panel — same as .gv-modal-actions on mobile */
.gv-disc-actions {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    z-index: 2;
    padding: 12px 24px 16px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    gap: 8px;
    align-items: center;
    background: #0e0e1a;
}

/* Mobile footer: hidden on desktop, flex on mobile */
.gv-disc-mobile-footer { display: none; }
.gv-discover-rating-bar { display: none !important; }
.gv-discover-platform-row { display: none; }

@media (max-width: 767px) {
    .gv-discover-card {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        touch-action: pan-y;
    }
    .gv-discover-card .gv-modal-left {
        flex: 0 0 auto;
        min-height: 0;
    }
    .gv-discover-card .gv-modal-right {
        flex: 1 1 auto;
        min-height: 0;
        width: auto;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 16px;
    }
    .gv-discover-card .gv-modal-right > div[x-show] {
        min-height: 100%;
    }
    .gv-discover-card .gv-modal-right p {
        overflow-wrap: anywhere;
    }
    .gv-discover-rating-row {
        align-items: center !important;
        margin-bottom: 10px !important;
        min-width: 0;
    }
    .gv-discover-rating-row > span:first-child {
        flex: 0 0 auto;
        font-size: 1.35rem !important;
        line-height: 1;
    }
    .gv-discover-rating-row > span:nth-child(2) {
        flex: 0 0 auto;
    }
    .gv-discover-rating-bar {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 76px;
        margin-left: 6px;
    }
    .gv-discover-rating-bar-legacy {
        display: none !important;
    }
    .gv-discover-rating-labels {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
        padding-bottom: 8px;
    }
    .gv-discover-rating-labels > div {
        flex: 0 1 auto;
        min-width: 0;
        gap: 3px !important;
    }
    .gv-discover-rating-labels > div > div {
        width: 7px !important;
        height: 7px !important;
        flex: 0 0 7px;
    }
    .gv-discover-rating-labels span {
        min-width: 0;
        font-size: clamp(.55rem, 2.5vw, .68rem) !important;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .gv-discover-platform-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-width: 0;
    }
    .gv-discover-platform-row > p {
        flex: 0 0 auto;
        margin: 0 !important;
    }
    .gv-discover-platform-row > div {
        justify-content: flex-end;
        min-width: 0;
    }
    .gv-discover-platform-stack {
        display: none !important;
    }
    /* Mirror .gv-modal-right mobile: flex:1, min-height:0, scrollable */
    .gv-discover-panel { width: auto; flex: 1; min-height: 0; padding: 0; }
    .gv-disc-title  { padding: 12px 16px 0; }
    .gv-disc-fixed  { padding: 10px 16px 0; }
    .gv-disc-scroll { padding: 10px 16px 12px; }
    .gv-disc-edit   { padding: 12px 16px 12px; gap: 12px; }
    /* Action bar hidden on mobile — gv-disc-mobile-footer handles it */
    .gv-disc-actions { display: none !important; }
    /* Mobile footer: flex child of discover view, below the card, always visible */
    .gv-disc-mobile-footer {
        display: flex;
        flex-direction: row;
        flex-shrink: 0;
        gap: 8px;
        align-items: stretch;
        padding: 10px 12px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255,255,255,.07);
        background: #0e0e1a;
        z-index: 10;
    }
    .gv-disc-mobile-tools,
    .gv-disc-mobile-actions,
    .gv-disc-mobile-edit-actions {
        display: flex;
        gap: 8px;
        align-items: center;
        min-width: 0;
    }
    .gv-disc-mobile-tools {
        flex: 1 1 auto;
        justify-content: stretch;
    }
    .gv-disc-mobile-actions > button,
    .gv-disc-mobile-edit-actions > button {
        flex: 1 1 0;
        justify-content: center;
        min-width: 0;
    }
    .gv-disc-mobile-tools > button {
        flex: 1 1 0;
        justify-content: center;
        min-width: 0;
    }
    .gv-disc-mobile-footer button {
        min-height: 36px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ── Like / Dislike buttons ─────────────────────────────────────────────── */
.gv-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 14px;
    border-radius: 8px;
    background: rgba(74,222,128,.12);
    border: 1px solid rgba(74,222,128,.35);
    color: #86efac;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-like-btn:hover:not(:disabled) { background: rgba(74,222,128,.25); }
.gv-like-btn:disabled { opacity: .4; cursor: default; }

.gv-dislike-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 5px 14px;
    border-radius: 8px;
    background: rgba(248,113,113,.1);
    border: 1px solid rgba(248,113,113,.3);
    color: #fca5a5;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.gv-dislike-btn:hover:not(:disabled) { background: rgba(248,113,113,.22); }
.gv-dislike-btn:disabled { opacity: .4; cursor: default; }

/* ── Discover action bar: desktop/mobile button visibility ───────────────── */
.gv-disc-mobile-only { display: none !important; }

@media (max-width: 767px) {
    .gv-disc-desktop-only { display: none !important; }
    .gv-disc-mobile-only  { display: inline-flex !important; }
}

/* Auth screens */
#login-screen {
    position: fixed;
    inset: 0;
    z-index: 180;
    overflow: auto;
}
body.gv-auth-loading,
body.gv-auth-login {
    overflow: hidden;
}

.gv-load-library-prompt {
    max-width: 1600px;
    margin: 0 auto;
    padding: 48px 16px 0;
}
.gv-load-library-panel {
    max-width: 420px;
    margin: 0 auto;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    text-align: center;
}
.gv-load-library-title {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
}
.gv-load-library-copy {
    margin: 7px 0 16px;
    color: #8b93a3;
    font-size: .9rem;
}
.gv-load-library-btn {
    min-width: 150px;
    justify-content: center;
}
