/* RepackCity UI system — editorial game library */
:root {
    color-scheme: dark;
    --bg: #090b11;
    --bg-soft: #0d1018;
    --surface: #131824;
    --surface-2: #181e2b;
    --surface-3: #20283a;
    --surface-hover: #242c40;
    --text: #f5f7ff;
    --text-soft: #d5dcf2;
    --muted: #a4aec9;
    --subtle: #7f8aa9;
    --border: rgba(161, 174, 215, 0.15);
    --border-strong: rgba(171, 155, 255, 0.42);
    --primary: #a995ff;
    --primary-strong: #7661d6;
    --primary-soft: rgba(169, 149, 255, 0.13);
    --accent: #76a9ff;
    --success: #66d6a4;
    --warning: #f0bd78;
    --danger: #ff7d8d;
    --info: #77b8ff;
    --focus: #c4b6ff;
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.38);
    --header-height: 72px;
    --content-width: 1720px;
    --sidebar-width: 248px;
    --page-gutter: 40px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: clip;
    background:
        radial-gradient(circle at 88% -10%, rgba(105, 84, 190, 0.12), transparent 34rem),
        linear-gradient(180deg, var(--bg-soft), var(--bg) 22rem);
    color: var(--text-soft);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

body.nav-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="radio"],
input[type="file"] {
    cursor: pointer;
}

button,
a,
input,
select,
textarea,
[tabindex] {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--primary);
    text-underline-offset: 0.2em;
}

a:hover {
    color: #c7baff;
}

img,
svg {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    color: var(--text);
    line-height: 1.18;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 2.8vw, 3.35rem);
    letter-spacing: -0.045em;
}

h2 {
    font-size: clamp(1.45rem, 1.9vw, 2rem);
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.08rem;
}

::selection {
    background: rgba(169, 149, 255, 0.32);
    color: #fff;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 10000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    font-weight: 750;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.muted {
    color: var(--muted);
}

/* Header and global navigation */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: rgba(9, 11, 17, 0.96);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}

.site-header-inner {
    width: min(100% - var(--page-gutter), var(--content-width));
    min-height: var(--header-height);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto auto minmax(220px, 420px) auto;
    align-items: center;
    gap: clamp(14px, 2vw, 32px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-decoration: none;
    white-space: nowrap;
}

.site-brand:hover {
    color: #c7baff;
}

.site-brand-mark {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(178, 161, 255, 0.5);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg, rgba(169, 149, 255, 0.24), rgba(118, 169, 255, 0.08));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
    object-fit: cover;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.primary-nav a {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.primary-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.primary-nav a[aria-current="page"] {
    background: var(--primary-soft);
    color: #d8d0ff;
}

.global-search {
    position: relative;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.global-search:focus-within {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 4px rgba(169, 149, 255, 0.09);
}

.global-search > i {
    margin-left: 14px;
    color: var(--subtle);
    font-size: 0.88rem;
}

.global-search input {
    min-width: 0;
    height: 100%;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 8px 0 10px;
    color: var(--text);
    font-size: 0.9rem;
}

.global-search input::placeholder {
    color: var(--subtle);
}

.global-search > button {
    width: 36px;
    height: 34px;
    margin-right: 4px;
    border: 0;
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--muted);
}

.global-search > button:hover {
    background: var(--primary-strong);
    color: #fff;
}

.account-link {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.87rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.account-link:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.08rem;
}

.mobile-overlay {
    visibility: hidden;
    position: fixed;
    inset: 0;
    z-index: 970;
    border: 0;
    background: rgba(3, 5, 10, 0.7);
    opacity: 0;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.mobile-overlay.show {
    visibility: visible;
    opacity: 1;
}

/* Search suggestions */
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1100;
    max-height: min(420px, 70vh);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: #121722;
    box-shadow: var(--shadow-lg);
}

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

.search-dropdown-item {
    min-height: 60px;
    padding: 9px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-soft);
    text-decoration: none;
}

.search-dropdown-item:hover,
.search-dropdown-item:focus-visible {
    background: var(--surface-hover);
    color: #fff;
}

.search-result-media {
    width: 72px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    background: var(--surface-3);
    color: var(--subtle);
}

.search-result-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.search-dropdown-item strong,
.search-dropdown-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-dropdown-item strong {
    color: var(--text);
    font-size: 0.9rem;
}

.search-dropdown-item small {
    color: var(--subtle);
    font-size: 0.76rem;
}

.search-dropdown-message {
    padding: 18px 14px;
    color: var(--muted);
    text-align: center;
    font-size: 0.86rem;
}

/* App layout and catalog navigation */
.layout {
    width: min(100% - var(--page-gutter), var(--content-width));
    min-height: calc(100vh - var(--header-height));
    margin: 0 auto;
    padding: 28px 0 var(--space-7);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: relative;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(18, 23, 34, 0.94);
    box-shadow: var(--shadow-sm);
}

.sidebar-mobile-head,
.sidebar-primary-mobile {
    display: none;
}

.sidebar-section {
    padding: 8px 3px 15px;
}

.sidebar-section + .sidebar-section {
    border-top: 1px solid var(--border);
    padding-top: 17px;
}

.sidebar-section-title {
    min-height: 32px;
    padding: 0 8px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-section-title h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    text-transform: uppercase;
}

.sidebar-section-title h2 i {
    color: var(--primary);
}

.sidebar-section-title > a {
    min-height: 24px;
    padding: 3px 0;
    display: inline-flex;
    align-items: center;
    color: var(--subtle);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-section-title > a:hover {
    color: var(--text);
}

.category-list,
.admin-menu {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    list-style: none;
}

.category-list a,
.admin-menu a,
.sidebar-primary-mobile a {
    min-height: 39px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 620;
    text-decoration: none;
}

.category-list a i,
.admin-menu a i,
.sidebar-primary-mobile a i {
    width: 20px;
    flex: 0 0 auto;
    color: #9e8bf2;
    text-align: center;
}

.category-list a:hover,
.admin-menu a:hover,
.sidebar-primary-mobile a:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.category-list a[aria-current="page"],
.admin-menu a[aria-current="page"] {
    border-color: rgba(169, 149, 255, 0.2);
    background: var(--primary-soft);
    color: #ddd7ff;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag,
.tag-sm {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 680;
    line-height: 1.2;
    text-decoration: none;
}

.tag {
    padding: 6px 10px;
}

.tag-sm {
    padding: 5px 9px;
}

a.tag:hover,
a.tag[aria-current="page"] {
    border-color: var(--border-strong);
    background: var(--primary-soft);
    color: #ddd6ff;
}

.sidebar-footer {
    padding: 12px 4px 4px;
    border-top: 1px solid var(--border);
}

.mobile-close-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1rem;
}

/* Buttons and alerts */
.button,
.btn-primary,
.btn-secondary,
.magnet-btn,
.btn-danger {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.87rem;
    font-weight: 740;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.magnet-btn:hover,
.btn-danger:hover {
    color: #fff;
    transform: translateY(-1px);
}

.button-primary,
.btn-primary {
    border-color: rgba(196, 182, 255, 0.26);
    background: var(--primary-strong);
    color: #fff;
    box-shadow: 0 8px 20px rgba(82, 65, 164, 0.25);
}

.button-primary:hover,
.btn-primary:hover {
    background: #705acb;
}

.button-secondary,
.btn-secondary,
.magnet-btn {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text-soft);
}

.button-secondary:hover,
.btn-secondary:hover,
.magnet-btn:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

.button-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.button-ghost:hover {
    background: var(--surface-2);
}

.button-block {
    width: 100%;
}

.btn-danger,
.button-danger {
    border-color: rgba(255, 125, 141, 0.35);
    background: rgba(255, 125, 141, 0.1);
    color: #ffacb7;
}

.button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.reaction-btn:disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}

.alert-success {
    border-color: rgba(102, 214, 164, 0.32);
    background: rgba(102, 214, 164, 0.09);
    color: #a6e9ca;
}

.alert-error {
    border-color: rgba(255, 125, 141, 0.34);
    background: rgba(255, 125, 141, 0.1);
    color: #ffc0c8;
}

/* Shared headings, breadcrumbs and empty states */
.breadcrumbs {
    min-width: 0;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--subtle);
    font-size: 0.79rem;
}

.breadcrumbs a {
    min-height: 24px;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text);
}

.breadcrumbs > i {
    color: #525c78;
    font-size: 0.62rem;
}

.breadcrumbs span {
    max-width: min(100%, 460px);
    overflow: hidden;
    color: var(--subtle);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eyebrow,
.section-kicker {
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #b6a8ff;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
}

a.eyebrow {
    min-height: 24px;
    padding-block: 2px;
}

.content-header {
    min-width: 0;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.content-header h1,
.content-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-header h1 {
    font-size: clamp(1.75rem, 2.4vw, 2.65rem);
}

.content-header h2 {
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
}

.content-header h1 i,
.content-header h2 i {
    color: var(--primary);
    font-size: 0.8em;
}

.empty-state {
    min-height: 320px;
    padding: clamp(32px, 7vw, 72px) 24px;
    border: 1px dashed rgba(169, 149, 255, 0.25);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(169, 149, 255, 0.06), rgba(19, 24, 36, 0.6));
    text-align: center;
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.4rem;
}

.empty-state h1,
.empty-state h2 {
    margin-bottom: 10px;
}

.empty-state p {
    max-width: 580px;
    margin-bottom: 22px;
    color: var(--muted);
}

/* Home */
.home-hero {
    min-height: 330px;
    margin-bottom: var(--space-7);
    padding: clamp(28px, 5vw, 58px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.65fr);
    align-items: end;
    gap: var(--space-6);
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 20%, rgba(118, 169, 255, 0.17), transparent 19rem),
        radial-gradient(circle at 18% 120%, rgba(169, 149, 255, 0.16), transparent 24rem),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.home-hero-copy {
    max-width: 760px;
}

.home-hero h1 {
    max-width: 680px;
    margin-bottom: 16px;
}

.home-hero-copy > p {
    max-width: 680px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.12rem);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-hero-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.home-hero-facts > div {
    min-height: 116px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: rgba(9, 11, 17, 0.38);
}

.home-hero-facts strong {
    color: var(--text);
    font-size: clamp(1.6rem, 2.4vw, 2.25rem);
    line-height: 1;
}

.home-hero-facts span {
    margin-top: 8px;
    color: var(--subtle);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.catalog-section {
    padding-top: 4px;
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.popular-sections {
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.catalog-section + .catalog-section {
    margin-top: 14px;
}

/* Cards and listings */
.repack-grid {
    min-width: 0;
    margin-bottom: 38px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 18px;
}

.card {
    min-width: 0;
    min-height: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    color: var(--text-soft);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    border-color: rgba(169, 149, 255, 0.42);
    background: #161c28;
    color: var(--text-soft);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    transform: translateY(-3px);
}

.card:focus-visible {
    outline-offset: 4px;
}

.card-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(169, 149, 255, 0.08), rgba(118, 169, 255, 0.04)),
        var(--surface-3);
}

.card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.24s ease;
}

.card:hover .card-preview img {
    transform: scale(1.025);
}

.card-image-fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: #64708f;
    font-size: 1.8rem;
}

.card-preview.image-missing .card-image-fallback,
.card-preview:not(:has(img)) .card-image-fallback {
    display: flex;
}

.card-category {
    position: absolute;
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 5px 9px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(9, 11, 17, 0.86);
    color: #e8eaff;
    font-size: 0.67rem;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-content {
    min-width: 0;
    padding: 15px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.card-title {
    min-height: 2.55em;
    margin-bottom: 10px;
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 760;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.card-desc {
    min-width: 0;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px 11px;
    color: var(--subtle);
    font-size: 0.74rem;
}

.card-desc span {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.card-desc i {
    color: #9e8bf2;
    font-size: 0.82em;
}

.card-tags {
    min-height: 27px;
    margin-bottom: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-open {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 740;
}

.card:hover .card-open {
    color: #c8bcff;
}

.listing-header {
    margin-bottom: 22px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    background: var(--surface);
}

.listing-heading {
    min-width: 0;
}

.listing-heading h1 {
    margin-bottom: 8px;
    font-size: clamp(1.9rem, 2.6vw, 2.8rem);
}

.listing-heading p {
    margin: 0;
    color: var(--subtle);
    font-size: 0.86rem;
}

.listing-heading p strong {
    color: var(--text-soft);
}

.sort-bar {
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-soft);
}

.sort-label {
    padding: 0 8px;
    color: var(--subtle);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sort-bar a {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.sort-bar a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sort-bar a[aria-current="page"] {
    background: var(--primary-soft);
    color: #ddd6ff;
}

.rw-pagination {
    width: max-content;
    max-width: 100%;
    margin: 42px auto 10px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: rgba(18, 23, 34, 0.9);
    box-shadow: var(--shadow-sm);
}

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

.rw-pagination a {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 720;
    text-decoration: none;
}

.rw-pagination a:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    color: var(--text);
}

.rw-pagination a[aria-current="page"] {
    border-color: var(--primary-strong);
    background: var(--primary-strong);
    color: #fff;
}

.rw-pagination .pagination-direction {
    padding-inline: 15px;
}

.pagination-ellipsis {
    min-width: 24px;
    color: var(--subtle);
    text-align: center;
    font-size: 0.86rem;
    font-weight: 800;
}

/* Repack detail */
.repack-header {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: clamp(220px, 27vw, 320px) minmax(0, 1fr);
    align-items: center;
    gap: clamp(22px, 3vw, 38px);
    background:
        radial-gradient(circle at 95% 10%, rgba(169, 149, 255, 0.09), transparent 24rem),
        var(--surface);
}

.repack-header-icon {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-3);
}

.repack-header-icon > a,
.repack-header-icon img,
.repack-poster-fallback {
    width: 100%;
    height: 100%;
}

.repack-header-icon img {
    object-fit: cover;
}

.repack-poster-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--subtle);
    font-size: 2rem;
}

.repack-header-icon.image-missing .repack-poster-fallback,
.repack-header-icon:not(:has(img)) .repack-poster-fallback {
    display: flex;
}

.repack-header-info {
    min-width: 0;
    padding-right: clamp(0px, 3vw, 30px);
}

.repack-header-info h1 {
    margin: 3px 0 12px;
    font-size: clamp(2rem, 3.4vw, 3.8rem);
    overflow-wrap: anywhere;
}

.repack-summary {
    max-width: 820px;
    margin-bottom: 17px;
    color: var(--muted);
}

.repack-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.repack-header-meta span {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(9, 11, 17, 0.34);
    color: var(--muted);
    font-size: 0.78rem;
}

.repack-header-meta i {
    color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
    gap: 22px;
}

.detail-card,
.info-panel,
.page-container,
.stat-box,
.form-card,
.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.detail-card {
    margin-bottom: 18px;
    padding: clamp(20px, 3vw, 30px);
}

.detail-card h2,
.info-panel h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.detail-card h2 {
    margin-bottom: 20px;
    font-size: 1.32rem;
}

.detail-card h2 i,
.info-panel h2 i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.78em;
}

.description {
    max-width: 82ch;
    color: #bdc6dd;
    font-size: 0.98rem;
    line-height: 1.78;
}

.description > :last-child {
    margin-bottom: 0;
}

.screenshots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.screenshot {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-3);
}

.screenshot a,
.screenshot img {
    width: 100%;
    height: 100%;
}

.screenshot img {
    object-fit: cover;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.screenshot a:hover img {
    opacity: 0.9;
    transform: scale(1.02);
}

.screenshot.image-missing {
    display: grid;
    place-items: center;
}

.screenshot.image-missing a {
    display: none;
}

.screenshot.image-missing::after {
    content: "Screenshot unavailable";
    color: var(--subtle);
    font-size: 0.75rem;
    font-weight: 700;
}

.requirements {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.req-col {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}

.req-col h3 {
    margin-bottom: 14px;
}

.req-col dl {
    margin-bottom: 0;
}

.req-col dl > div {
    padding: 9px 0;
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
}

.req-col dt {
    color: var(--subtle);
    font-size: 0.76rem;
    font-weight: 700;
}

.req-col dd {
    color: var(--text-soft);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.feature-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding: 9px 0 9px 22px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 800;
}

.sidebar-right {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-panel {
    padding: 18px;
}

.info-panel h2 {
    margin-bottom: 14px;
    font-size: 1rem;
}

.reactions-pill {
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-soft);
}

.reaction-btn {
    min-height: 42px;
    padding: 8px 7px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 720;
}

.reaction-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.reaction-btn.active-reaction {
    background: var(--primary-strong);
    color: #fff;
}

.similar-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.similar-card {
    min-width: 0;
    min-height: 56px;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    text-decoration: none;
}

.similar-card:hover {
    border-color: var(--border);
    background: var(--surface-hover);
    color: #fff;
}

.similar-card img,
.similar-placeholder {
    width: 72px;
    height: 40px;
    border-radius: 8px;
    flex: 0 0 auto;
}

.similar-card img {
    object-fit: cover;
}

.similar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--subtle);
}

.similar-card > span:last-child {
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 700;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Information pages */
.page-container {
    padding: clamp(24px, 4vw, 54px);
}

.page-container > h1 {
    max-width: 900px;
    margin-bottom: 28px;
}

.prose {
    color: var(--muted);
}

.prose h2 {
    max-width: 28ch;
    margin-top: 38px;
    margin-bottom: 13px;
    color: var(--text);
    font-size: 1.35rem;
}

.prose p,
.prose ul,
.prose ol {
    max-width: 78ch;
}

.prose p {
    margin-bottom: 16px;
}

.prose li {
    margin-bottom: 7px;
}

.prose strong {
    color: var(--text-soft);
}

.page-container.info-page {
    padding: 0;
    overflow: hidden;
}

.info-page-header {
    padding: clamp(26px, 4vw, 48px);
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(circle at 92% 8%, rgba(169, 149, 255, 0.13), transparent 25rem),
        linear-gradient(145deg, rgba(32, 40, 58, 0.8), rgba(18, 23, 34, 0.98));
}

.info-page-title {
    max-width: 900px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.info-page-title > div {
    min-width: 0;
}

.info-page-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border: 1px solid rgba(169, 149, 255, 0.28);
    border-radius: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.35rem;
}

.info-page-title h1 {
    margin: 0;
}

.info-page-title p {
    max-width: 70ch;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.info-page-meta {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--subtle);
    font-size: 0.74rem;
    font-weight: 680;
}

.info-page-meta i {
    color: var(--primary);
}

.info-page-tabs {
    padding: 11px clamp(18px, 4vw, 48px);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    background: rgba(9, 11, 17, 0.34);
    scrollbar-width: none;
}

.info-page-tabs::-webkit-scrollbar {
    display: none;
}

.info-page-tabs a {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 720;
    text-decoration: none;
    white-space: nowrap;
}

.info-page-tabs a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.info-page-tabs a[aria-current="page"] {
    background: var(--primary-soft);
    color: #ddd6ff;
}

.info-page-sections {
    padding: clamp(18px, 3vw, 32px);
    display: grid;
    gap: 14px;
}

.info-section {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(9, 11, 17, 0.28);
}

.info-section-heading {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-section-heading > span {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.info-section h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.2rem;
}

.info-section p {
    max-width: 78ch;
    margin: 0 0 13px;
    color: var(--muted);
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
}

.info-list li {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: var(--surface);
}

.info-list li > i {
    margin-top: 3px;
    color: var(--success);
    font-size: 0.78rem;
}

.info-list li div {
    min-width: 0;
}

.info-list strong,
.info-list span {
    display: block;
}

.info-list strong {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.info-list span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.79rem;
}

.info-note {
    max-width: 78ch;
    margin-top: 17px;
    padding: 13px 14px;
    border: 1px solid rgba(118, 169, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(118, 169, 255, 0.07);
    color: var(--muted);
    font-size: 0.8rem;
}

.info-note i {
    margin-top: 2px;
    color: var(--info);
}

/* Login */
.login-page {
    background:
        radial-gradient(circle at 50% 8%, rgba(169, 149, 255, 0.13), transparent 28rem),
        var(--bg);
}

.auth-page {
    min-height: 100vh;
    padding: 28px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: min(100%, 420px);
    padding: clamp(24px, 6vw, 42px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 820;
    text-decoration: none;
}

.auth-heading h1 {
    margin-bottom: 26px;
    font-size: clamp(2rem, 8vw, 2.7rem);
}

.auth-heading p {
    margin-bottom: 26px;
    color: var(--muted);
}

.auth-form {
    margin-top: 0;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--subtle);
    font-size: 0.75rem;
}

.auth-footer span,
.auth-footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-footer a {
    min-height: 28px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

/* Forms */
.form-group {
    min-width: 0;
    margin-bottom: 18px;
}

.form-group label {
    margin-bottom: 7px;
    display: block;
    color: var(--muted);
    font-size: 0.81rem;
    font-weight: 720;
}

.form-group input,
.form-group select,
.form-group textarea,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.admin-main select,
.admin-main textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: var(--bg-soft);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group textarea,
.admin-main textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.admin-main input::placeholder,
.admin-main textarea::placeholder {
    color: #66718e;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.admin-main input:focus,
.admin-main select:focus,
.admin-main textarea:focus {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 4px rgba(169, 149, 255, 0.09);
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary-strong);
}

.form-grid {
    margin: 20px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-row {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.form-card {
    margin-bottom: 24px;
    padding: clamp(18px, 3vw, 28px);
}

.btn-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Admin */
.admin-layout {
    grid-template-columns: 236px minmax(0, 1fr);
}

.admin-sidebar {
    padding-top: 12px;
}

.admin-side-heading {
    margin: 2px 4px 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-soft);
}

.admin-side-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary);
}

.admin-side-heading strong,
.admin-side-heading span {
    display: block;
}

.admin-side-heading strong {
    color: var(--text);
    font-size: 0.86rem;
}

.admin-side-heading span {
    color: var(--subtle);
    font-size: 0.68rem;
}

.admin-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-main {
    min-width: 0;
}

.admin-main > .section {
    display: block !important;
}

.admin-main .content-header {
    min-height: 62px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.admin-main .content-header h1 {
    font-size: clamp(1.7rem, 2.3vw, 2.5rem);
}

.admin-main .content-header > div,
.admin-main .content-header > form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-toolbar {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 14px;
    background: var(--surface);
}

.admin-toolbar label {
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--subtle);
    font-size: 0.72rem;
    font-weight: 740;
}

.admin-toolbar-search {
    max-width: 420px;
}

.admin-toolbar-filters,
.admin-bulkbar > div:last-child {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-toolbar-filters label {
    min-width: 170px;
}

.admin-bulkbar {
    min-height: 60px;
    padding: 12px 4px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-bulkbar > div:first-child i {
    margin-right: 6px;
    color: var(--primary);
}

.stats-grid {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.stat-card {
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    background: var(--surface);
}

.stat-icon {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(169, 149, 255, 0.2);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.15rem;
}

.stat-content {
    min-width: 0;
}

.stat-content h3 {
    margin-bottom: 3px;
    color: var(--text);
    font-size: 1.5rem;
}

.stat-content p {
    margin: 0;
    color: var(--subtle);
    font-size: 0.78rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stat-box {
    min-width: 0;
    margin-bottom: 18px;
    padding: 20px;
}

.stat-box h3 {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 1rem;
}

.stat-box h3 i {
    color: var(--primary);
}

.table-wrapper {
    max-width: 100%;
    margin-bottom: 24px;
    padding: 8px;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--subtle);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    color: var(--text-soft);
    font-size: 0.82rem;
}

tbody tr:hover {
    background: rgba(169, 149, 255, 0.035);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.btn-icon {
    width: 36px;
    height: 36px;
    margin: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--primary);
}

.btn-icon:hover {
    border-color: var(--border-strong);
    background: var(--primary-soft);
    color: #ded7ff;
}

.btn-icon.delete:hover {
    border-color: rgba(255, 125, 141, 0.35);
    background: rgba(255, 125, 141, 0.1);
    color: var(--danger);
}

.version-badge,
.tag-chip {
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.chart-filters {
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 11px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    background: var(--bg-soft);
}

.filter-btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    color: var(--subtle);
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
}

.filter-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.filter-btn.active {
    background: var(--primary-soft);
    color: #ddd6ff;
}

.map-container {
    position: relative;
    min-height: 220px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}

.map-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(102, 214, 164, 0.7);
}

.image-gallery-grid {
    min-width: 0;
}

.media-page-header {
    align-items: center !important;
}

.media-page-header > div {
    display: block !important;
}

.media-page-header p {
    margin: 5px 0 0;
    color: var(--subtle);
    font-size: 0.86rem;
}

.media-count {
    min-width: 94px;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.76rem;
    text-align: center;
}

.media-count strong {
    margin-right: 4px;
    color: var(--text);
    font-size: 1rem;
}

.media-upload-panel {
    margin-bottom: 18px;
    padding: clamp(16px, 2vw, 22px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    background: var(--surface);
}

.media-upload-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.media-upload-icon {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(169, 149, 255, 0.22);
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--primary-soft);
    color: var(--primary);
}

.media-upload-copy h2 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.media-upload-copy p {
    margin: 2px 0 0;
    color: var(--subtle);
    font-size: 0.78rem;
}

.media-upload-form,
.media-bulk-actions,
.media-bulk-actions form {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.media-file-picker {
    max-width: 260px;
}

.media-file-picker > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-file-picker input,
.media-icon-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.media-toolbar {
    min-height: 62px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-block: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
}

.media-select-all {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.media-select-all input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.media-select-all span span {
    color: var(--subtle);
    font-weight: 500;
}

.media-selected-count {
    color: var(--subtle);
    font-size: 0.78rem;
}

.media-bulk-actions {
    margin-left: auto;
}

.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
    align-items: start;
    justify-content: start;
    gap: 16px;
}

.media-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.media-card:hover {
    border-color: rgba(169, 149, 255, 0.3);
    transform: translateY(-2px);
}

.media-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(169, 149, 255, 0.35), var(--shadow-sm);
}

.media-card-select {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.media-card-select input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.media-card-select span {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 11, 17, 0.82);
    color: transparent;
    backdrop-filter: blur(8px);
}

.media-card-select input:focus-visible + span {
    outline: 3px solid rgba(196, 182, 255, 0.26);
    outline-offset: 2px;
}

.media-card-select input:checked + span {
    border-color: var(--primary);
    background: var(--primary-strong);
    color: #fff;
}

.media-card-preview {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
}

.media-card-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.media-card-preview > span {
    position: absolute;
    right: 9px;
    bottom: 9px;
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(9, 11, 17, 0.82);
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.media-card-preview:hover > span,
.media-card-preview:focus-visible > span {
    opacity: 1;
    transform: none;
}

.media-card-meta {
    padding: 11px 12px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.media-card-meta p {
    min-width: 0;
    margin: 0;
    flex: 1;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-actions,
.media-card-actions form {
    margin: 0;
    display: flex;
}

.media-icon-button {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--subtle);
}

.media-icon-button:hover {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text);
}

.media-icon-button.danger:hover {
    border-color: rgba(255, 125, 141, 0.3);
    background: rgba(255, 125, 141, 0.08);
    color: var(--danger);
}

.media-empty {
    grid-column: 1 / -1;
    width: min(100%, 620px);
    min-height: 250px;
    justify-self: center;
}

.media-empty > span {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.2rem;
}

.gallery-pagination {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.gallery-page-button {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
}

.gallery-page-button:hover:not(:disabled),
.gallery-page-button.active {
    border-color: var(--border-strong);
    background: var(--primary-soft);
    color: var(--text);
}

.gallery-page-ellipsis {
    color: var(--subtle);
}

.autopost-check,
.autopost-truth-note {
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 11px;
    background: var(--bg-soft);
}

.autopost-check input {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--primary);
}

.autopost-check span {
    display: flex;
    flex-direction: column;
}

.autopost-check small,
.autopost-truth-note span {
    color: var(--subtle);
    font-size: 0.76rem;
}

.autopost-truth-note {
    border-color: rgba(102, 214, 164, 0.24);
    background: rgba(102, 214, 164, 0.06);
}

.autopost-truth-note > i {
    margin-top: 3px;
    color: var(--success);
}

.autopost-truth-note div {
    display: flex;
    flex-direction: column;
}

.autopost-manual-run {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--surface-2);
}

.autopost-manual-run h3 {
    color: var(--text);
}

.autopost-manual-run p,
.steam-candidates-head p {
    color: var(--subtle);
    font-size: 0.8rem;
}

.steam-candidates-head {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.steam-candidates-head h3,
.steam-candidates-head p {
    margin: 0;
}

.steam-candidates-head > span {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.steam-candidates td strong,
.steam-candidates td small {
    display: block;
}

.steam-candidates td small {
    color: var(--subtle);
    font-size: 0.68rem;
}

.candidate-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(118, 169, 255, 0.1);
    color: var(--info);
    font-size: 0.68rem;
    font-weight: 750;
    white-space: nowrap;
}

.candidate-status.waiting {
    background: rgba(240, 189, 120, 0.1);
    color: var(--warning);
}

.empty-state.compact {
    min-height: 180px;
}

.category-list-admin,
.all-tag-item,
.popular-tag-item,
.cat-item {
    min-width: 0;
}

.skeleton,
.skel-line,
.skeleton-box,
.table-skel-line,
.dash-skel-line {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s linear infinite;
}

@keyframes skeleton-loading {
    to { background-position: -200% 0; }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: #080a0f;
}

.site-footer-grid,
.site-footer-bottom {
    width: min(100% - var(--page-gutter), var(--content-width));
    margin: 0 auto;
}

.site-footer-grid {
    padding: 46px 0 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(150px, 0.5fr) minmax(150px, 0.5fr);
    gap: clamp(30px, 6vw, 90px);
}

.site-footer-brand p {
    max-width: 600px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.site-footer-brand .site-footer-note {
    color: var(--subtle);
    font-size: 0.75rem;
}

.site-footer-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.site-footer-nav h2 {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-footer-nav a {
    min-height: 30px;
    color: var(--muted);
    font-size: 0.82rem;
    text-decoration: none;
}

.site-footer-nav a:hover {
    color: var(--text);
}

.site-footer-bottom {
    min-height: 64px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--subtle);
    font-size: 0.73rem;
}

.site-footer-bottom nav {
    display: flex;
    gap: 18px;
}

.site-footer-bottom a {
    min-height: 24px;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    color: var(--subtle);
    text-decoration: none;
}

.admin-main input[type="checkbox"],
.admin-main input[type="radio"],
.admin-main button,
.admin-main a {
    min-width: 24px !important;
    min-height: 24px !important;
}

.admin-main a {
    display: inline-flex;
    align-items: center;
}

.scroll-top {
    visibility: hidden;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 850;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.scroll-top.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* External UI overrides */
.sl-overlay,
.fancybox__backdrop {
    background: #06080d !important;
}

.jvm-tooltip {
    padding: 6px 9px !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: 8px !important;
    background: var(--surface-2) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text) !important;
    font-family: inherit !important;
    font-size: 0.76rem !important;
}

/* Responsive */
@media (max-width: 1240px) {
    .site-header-inner {
        grid-template-columns: auto auto minmax(200px, 1fr) auto;
        gap: 14px;
    }

    .home-hero {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
    }
}

@media (max-width: 1024px) {
    :root {
        --header-height: 68px;
    }

    .site-header-inner {
        grid-template-columns: auto auto minmax(180px, 1fr) auto;
    }

    .js .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .primary-nav {
        display: none;
    }

    .layout,
    .admin-layout {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 22px;
    }

    .js .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 980;
        width: min(330px, calc(100vw - 44px));
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        padding: 12px;
        border-width: 0 1px 0 0;
        border-radius: 0 20px 20px 0;
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    .js .sidebar::-webkit-scrollbar {
        display: none;
    }

    .js .sidebar.show {
        transform: translateX(0);
    }

    .js .sidebar-mobile-head {
        position: sticky;
        top: -12px;
        z-index: 2;
        min-height: 68px;
        margin: -12px -12px 10px;
        padding: 11px 12px 11px 18px;
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #121722;
    }

    html:not(.js) .sidebar {
        position: static;
        width: auto;
        max-height: none;
    }

    .sidebar-mobile-title {
        color: var(--text);
        font-weight: 800;
    }

    .sidebar-primary-mobile {
        margin-bottom: 12px;
        padding: 4px 4px 14px;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .sidebar-primary-mobile a {
        min-height: 44px;
    }

    .home-hero {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar-right {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    :root {
        --header-height: 116px;
        --page-gutter: 24px;
    }

    .site-header-inner {
        min-height: var(--header-height);
        padding: 10px 0;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-rows: 44px 44px;
        gap: 8px 10px;
    }

    .site-brand {
        overflow: hidden;
    }

    .site-brand > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .global-search {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .account-link {
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .account-link span {
        display: none;
    }

    .layout,
    .admin-layout {
        padding-top: 18px;
        gap: 18px;
    }

    .home-hero {
        min-height: auto;
        margin-bottom: 36px;
        padding: 28px 22px;
        grid-template-columns: minmax(0, 1fr);
    }

    .home-hero-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-hero-facts > div {
        min-height: 96px;
        padding: 14px;
    }

    .listing-header {
        padding: 20px;
        align-items: stretch;
        flex-direction: column;
    }

    .info-page-header {
        padding: 26px 22px;
    }

    .info-page-tabs {
        padding-inline: 16px;
    }

    .info-page-sections {
        padding: 16px;
    }

    .sort-bar {
        width: 100%;
        overflow-x: auto;
    }

    .sort-label {
        margin-right: auto;
    }

    .repack-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .repack-header-icon {
        max-width: none;
    }

    .repack-header-info {
        padding: 4px 2px 8px;
    }

    .requirements,
    .feature-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar-right {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-row {
        grid-column: 1;
    }

    .admin-main .content-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-main .content-header > div {
        width: 100%;
    }

    .admin-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-toolbar-search {
        max-width: none;
    }

    .admin-toolbar-filters label {
        flex: 1 1 180px;
    }

    .admin-bulkbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-main [style*="display:flex"] {
        max-width: 100%;
        flex-wrap: wrap;
    }

    .media-upload-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .media-upload-form {
        width: 100%;
        justify-content: flex-start;
    }

    .media-toolbar {
        align-items: center;
        flex-wrap: wrap;
    }

    .media-bulk-actions {
        width: 100%;
        margin-left: 0;
    }

    .autopost-manual-run,
    .steam-candidates-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 24px;
    }

    .site-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .site-brand {
        font-size: 0.98rem;
    }

    .site-brand-mark {
        width: 32px;
        height: 32px;
    }

    .repack-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .card {
        border-radius: 15px;
    }

    .card-content {
        padding: 14px;
    }

    .content-header {
        align-items: flex-start;
    }

    .content-header .button {
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.76rem;
    }

    .home-hero-facts {
        gap: 8px;
    }

    .home-hero-facts strong {
        font-size: 1.45rem;
    }

    .screenshots {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-card,
    .page-container {
        border-radius: var(--radius-md);
    }

    .info-page-title {
        align-items: flex-start;
        gap: 13px;
    }

    .info-page-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 1.1rem;
    }

    .info-page-title h1 {
        font-size: clamp(1.65rem, 9vw, 2.25rem);
    }

    .info-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .req-col dl > div {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .rw-pagination {
        width: 100%;
        padding: 8px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .pagination-pages {
        grid-column: 1 / -1;
        grid-row: 1;
        flex-wrap: wrap;
    }

    .rw-pagination .pagination-direction {
        width: 100%;
        margin-top: 1px;
    }

    .rw-pagination .pagination-prev {
        grid-column: 1;
        grid-row: 2;
    }

    .rw-pagination .pagination-next {
        grid-column: 2;
        grid-row: 2;
    }

    .auth-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-footer-brand {
        grid-column: auto;
    }

    .site-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .media-page-header {
        align-items: flex-start !important;
    }

    .media-upload-copy {
        align-items: flex-start;
    }

    .media-upload-form {
        align-items: stretch;
        flex-direction: column;
    }

    .media-file-picker {
        max-width: none;
    }

    .media-bulk-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-bulk-actions form,
    .media-bulk-actions .button {
        width: 100%;
    }

    .image-gallery-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .media-card-preview > span {
        opacity: 1;
        transform: none;
    }

    .scroll-top {
        right: 14px;
        bottom: 14px;
    }
}

@media (max-width: 370px) {
    .site-brand > span:last-child {
        max-width: 118px;
    }

    .home-hero-facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-actions .button {
        width: 100%;
    }

    .sort-label {
        display: none;
    }

    .sort-bar a {
        flex: 1 0 auto;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
