:root {
    --bg-primary: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-badge: #0284c7;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.25), 0 8px 10px -6px rgb(0 0 0 / 0.25);
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.nav-main-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-name {
    white-space: nowrap;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-icon-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Catalog Hero & Filters */
.catalog-hero {
    margin-bottom: 2.5rem;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.hero-stat-highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    background-color: var(--bg-surface);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.search-box {
    flex: 1 1 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.search-input:focus {
    border-color: var(--accent-primary);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-select {
    padding: 0.6rem 2rem 0.6rem 0.85rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

/* Complexity Range Slider Filter */
.complexity-filter-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    min-width: 190px;
    flex: 0 1 210px;
}

.complexity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.complexity-display-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary, #818cf8);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}

.dual-range-container {
    position: relative;
    width: 100%;
    height: 26px;
    display: flex;
    align-items: center;
}

.dual-range-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background-color: var(--border-color, #334155);
    border-radius: 9999px;
}

.dual-range-highlight {
    position: absolute;
    height: 6px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 9999px;
    pointer-events: none;
}

.dual-range-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.dual-range-input:focus {
    outline: none;
}

.dual-range-input::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--accent-primary, #6366f1);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease, background-color 0.15s ease;
}

.dual-range-input::-webkit-slider-thumb:hover,
.dual-range-input::-webkit-slider-thumb:active {
    transform: scale(1.2);
    background-color: #f1f5f9;
}

.dual-range-input::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--accent-primary, #6366f1);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s ease;
}

.dual-range-input::-moz-range-thumb:hover,
.dual-range-input::-moz-range-thumb:active {
    transform: scale(1.2);
}

/* Sort Dropdown & Clean Popover */
.sort-dropdown-container {
    position: relative;
    display: inline-block;
}

.sort-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid #475569;
    background-color: #334155;
    color: #f8fafc !important;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sort-icon-btn:hover {
    background-color: #475569;
    border-color: var(--accent-primary, #6366f1);
    color: #ffffff !important;
}

.sort-svg-icon {
    display: block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
    stroke: #f8fafc !important;
    color: #f8fafc !important;
}

.sort-popover {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 60;
    width: 200px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    padding: 0.75rem 0.85rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sort-popover-title {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    font-weight: 500;
}

.sort-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.sort-radio-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.sort-radio-item:hover .sort-radio-label {
    color: var(--text-primary);
}

.sort-radio-dot {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1.5px solid #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    background: transparent;
}

.sort-radio-item:hover .sort-radio-dot {
    border-color: #94a3b8;
}

.sort-radio-dot.selected {
    border-color: var(--accent-primary, #6366f1);
    border-width: 2px;
}

.sort-radio-dot.selected::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-primary, #6366f1);
}

.sort-radio-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 400;
}

.sort-popover-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0 0.65rem;
}

.sort-direction-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sort-dir-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.sort-dir-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sort-dir-btn.active {
    border-color: var(--accent-primary, #6366f1);
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary, #818cf8);
    font-weight: 500;
}


/* Floating Back to Top Glass Button */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.6);
    color: #ffffff;
    box-shadow: 0 10px 25px -2px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.back-to-top-btn:active {
    transform: translateY(0);
}

.back-to-top-icon {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
    border: 1px solid transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.btn-warning {
    background-color: var(--warning);
    color: #1e293b;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

/* Grid & Cards */
.grid-header {
    margin-bottom: 1rem;
}

/* Grid Section Headers */
.grid-section-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 0 0.5rem;
    margin-top: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    scroll-margin-top: 90px;
}

.grid-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.grid-section-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

/* Quick Jump Rail */
.quick-jump-rail {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.quick-jump-pill {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 3px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    scrollbar-width: none;
}

.quick-jump-pill::-webkit-scrollbar {
    display: none;
}

.quick-jump-item {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    min-width: 22px;
    height: 20px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.quick-jump-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    transform: scale(1.15);
}

.quick-jump-item.active {
    color: #ffffff;
    background: var(--accent-primary, #6366f1);
    font-weight: 700;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

@media (max-width: 640px) {
    .quick-jump-rail {
        right: 4px;
    }
    .quick-jump-pill {
        padding: 4px 2px;
        max-height: calc(100vh - 140px);
    }
    .quick-jump-item {
        font-size: 0.62rem;
        min-width: 19px;
        height: 18px;
        padding: 0 2px;
    }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
}

.game-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: #475569;
}

.card-media {
    position: relative;
    height: 240px;
    background-color: #0b0f19;
    overflow: hidden;
}

.card-media-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    cursor: pointer;
}

.game-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.game-card:hover .game-cover {
    transform: scale(1.04);
}

.card-qr-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 4px 10px -1px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.card-qr-btn:hover {
    background: var(--accent-primary, #6366f1);
    border-color: var(--accent-primary, #6366f1);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 12px -2px rgba(99, 102, 241, 0.5);
}

.card-qr-btn:active {
    transform: scale(0.95);
}

.qr-btn-svg {
    display: block;
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-header {
    margin-bottom: 1.25rem;
}

.game-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.players-badge {
    background-color: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(2, 132, 199, 0.4);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.card-actions .btn-primary {
    flex: 1;
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 1rem;
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* Stickers Page & Toolbar */
.stickers-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    background-color: var(--bg-surface);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.toolbar-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.toolbar-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sticker-search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 220px;
}

.sticker-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.85rem;
}

.sticker-search-input {
    width: 100%;
    padding: 0.45rem 0.75rem 0.45rem 2.2rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease;
}

.sticker-search-input:focus {
    border-color: var(--accent-primary);
}

.size-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.size-selector select {
    padding: 0.45rem 0.75rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
}

.sticker-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.selection-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.print-instruction {
    background-color: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(2, 132, 199, 0.3);
    color: #e0f2fe;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Printable Sticker Sheet (Screen Layout) */
.stickers-grid {
    display: grid;
    gap: 1rem;
}

.stickers-grid.size-standard {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}

.stickers-grid.size-compact {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.stickers-grid.size-large {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.sticker-item {
    position: relative;
    background-color: #ffffff;
    color: #0f172a;
    border: 1.5px dashed #94a3b8;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    box-shadow: var(--shadow-sm);
    page-break-inside: avoid;
    break-inside: avoid;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sticker-item.sticker-selected {
    border-color: var(--accent-primary);
    background-color: #fafcff;
}

.sticker-select-box {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
}

.sticker-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.sticker-inner {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
}

.sticker-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sticker-qr {
    width: 110px;
    height: 110px;
    display: block;
}

.sticker-scan-text {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #475569;
    margin-top: 4px;
    text-align: center;
}

.sticker-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-width: 0;
}

.sticker-title {
    width: 100%;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.sticker-players {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #f1f5f9;
    color: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: auto;
}

.sticker-footer {
    display: flex;
    justify-content: flex-end;
}

.sticker-brand {
    font-size: 9px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.backup-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    background-color: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.backup-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.backup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.backup-table th, .backup-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.backup-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.code-cell {
    font-family: monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: #a7f3d0;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fecaca;
}

.htmx-indicator {
    display: none;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.htmx-indicator.htmx-request,
.htmx-request.htmx-indicator,
.htmx-request .htmx-indicator {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
}

div.htmx-indicator.htmx-request,
div.htmx-request.htmx-indicator {
    display: flex !important;
}

@keyframes bgtags-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-icon {
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: bgtags-spin 0.75s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

.bgg-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-primary, #6366f1);
    border-radius: 50%;
    animation: bgtags-spin 0.75s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ==========================================================================
   PRINT SPECIFIC STYLES FOR STICKER LABELS
   ========================================================================== */
@media print {
    @page {
        margin: 0.25in;
        size: letter portrait;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-family: var(--font-family);
        margin: 0 !important;
        padding: 0 !important;
    }

    .no-print, header, .navbar, .stickers-toolbar, .print-instruction, #modal-container {
        display: none !important;
    }

    .main-content {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .stickers-page {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 2 columns of 4" x 2.5" labels per 8.5" x 11" page */
    .stickers-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.15in !important;
        width: 100% !important;
    }

    .sticker-item {
        border: 1px dashed #cbd5e1 !important;
        border-radius: 6px !important;
        padding: 8px 12px !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        background: #ffffff !important;
        box-sizing: border-box !important;
    }

    .sticker-qr {
        width: 100px !important;
        height: 100px !important;
    }

    .sticker-title {
        color: #000000 !important;
    }

    .sticker-scan-text {
        color: #333333 !important;
    }

    .sticker-select-box {
        display: none !important;
    }

    body.printing-selected .sticker-item:not(.sticker-selected) {
        display: none !important;
    }
}

/* Additional badge and sticker styles */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.complexity-badge {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.rating-badge {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.sticker-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 6px;
    margin-bottom: 6px;
    width: 100%;
}

.sticker-complexity {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: #fef3c7;
    color: #92400e;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.sticker-rating {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    background-color: #d1fae5;
    color: #065f46;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
}

.sticker-middle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 4px 0;
    width: 100%;
}

.sticker-checks {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.checks-label {
    font-size: 8px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.check-boxes {
    display: grid;
    grid-template-columns: repeat(5, 11px);
    grid-template-rows: repeat(2, 11px);
    gap: 2.5px 3px;
}

.chk {
    display: inline-block;
    width: 11px;
    height: 11px;
    border: 1px solid #94a3b8;
    border-radius: 2px;
    background: #ffffff;
    box-sizing: border-box;
}

@media print {
    .sticker-complexity {
        background-color: #f1f5f9 !important;
        color: #000000 !important;
        border: 1px solid #cbd5e1 !important;
    }
    .chk {
        border-color: #000000 !important;
    }
}

/* ==========================================================================
   RULES LANDING HUB STYLES (/games/{id}/rules)
   ========================================================================== */
.rules-hub-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.rules-hub-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.btn-back:hover {
    color: var(--primary);
}

.rules-hub-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rules-hero {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.rules-hero-cover-wrap {
    flex-shrink: 0;
}

.rules-hero-cover {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.rules-hero-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.rules-hero-title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0;
}

.rules-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.bgg-hub-link {
    font-size: 0.85rem;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s ease;
}

.bgg-hub-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.rules-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rules-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rules-section-header .rules-section-title {
    margin-bottom: 0;
}

.btn-toggle-expansions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-expansions:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-toggle-expansions.active {
    background-color: rgba(139, 92, 246, 0.18);
    border-color: rgba(139, 92, 246, 0.5);
    color: #c4b5fd;
}

.expansion-files-container {
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.2s ease-in-out;
}

.expansion-files-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.expansion-files-divider-text {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.expansion-files-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
}

.expansion-files-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
}

.expansion-files-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.expansion-files-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.doc-cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.doc-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.doc-card-primary {
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--bg-primary) 100%);
}

.doc-icon-col {
    font-size: 1.75rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-info-col {
    flex: 1;
    min-width: 0;
}

.doc-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.doc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.doc-primary-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: var(--primary);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
}

.doc-filename {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
    display: block;
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-action-col {
    flex-shrink: 0;
}

.doc-open-btn {
    min-width: 110px;
    text-align: center;
}

.expansions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.85rem;
}

.expansion-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.85rem;
    transition: border-color 0.15s ease;
}

.expansion-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.exp-card-header {
    width: 100%;
}

.exp-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.exp-title-link:hover .exp-title {
    color: var(--accent-primary);
}

.exp-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
    word-break: break-word;
}

.exp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.exp-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.expansion-card .btn {
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.share-qr-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background-color: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.share-qr-card:hover {
    border-color: var(--accent-primary, #6366f1);
    background-color: rgba(99, 102, 241, 0.04);
}

.share-qr-img {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background: #ffffff;
    padding: 3px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: transform 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.share-qr-card:hover .share-qr-img {
    transform: scale(1.05);
}

.share-qr-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1;
}

.share-qr-text strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* QR Code Modal Dialog (Native HTML5 Dialog in Top Layer) */
.qr-modal-dialog {
    border: none;
    background: transparent;
    padding: 0;
    margin: auto;
    max-width: min(92vw, 420px);
    max-height: 92dvh;
    overflow: visible;
    box-shadow: none;
    color: inherit;
}

.qr-modal-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.qr-modal-card {
    position: relative;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg, 16px);
    padding: 1.75rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    animation: qrScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.qr-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.qr-modal-close:hover {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.qr-modal-header {
    margin-bottom: 1.25rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
}

.qr-modal-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.qr-modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
}

.qr-modal-img-wrap {
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-modal-img {
    width: min(280px, 64vw, 40dvh);
    height: min(280px, 64vw, 40dvh);
    display: block;
    image-rendering: pixelated;
}

.qr-modal-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes qrFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes qrScaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
    .filters-bar {
        gap: 0.75rem;
    }
    .search-box {
        order: 1;
        width: 100%;
        flex: 1 1 100%;
    }
    .filter-group:not(.complexity-filter-group) {
        order: 2;
        flex: 1 1 auto;
    }
    .sort-dropdown-container {
        order: 3;
        margin-left: auto;
    }
    .complexity-filter-group {
        order: 4;
        width: 100%;
        flex: 1 1 100%;
    }
    .sort-popover {
        right: 0;
        left: auto;
    }
    .rules-hero {
        flex-direction: column;
        text-align: center;
    }
    .rules-badges-row {
        justify-content: center;
    }
    .doc-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .doc-name-row {
        justify-content: center;
    }
    .doc-action-col {
        width: 100%;
    }
    .doc-open-btn {
        width: 100%;
    }
    .share-qr-card {
        flex-direction: column;
        text-align: center;
    }

    /* Mobile QR Dialog Centering & Sizing */
    .qr-modal-dialog {
        max-width: min(92vw, 360px);
    }

    .qr-modal-card {
        padding: 1.25rem 1rem 1rem;
        border-radius: 14px;
    }

    .qr-modal-header {
        margin-bottom: 0.75rem;
        padding-right: 1.75rem;
        padding-left: 0.5rem;
    }

    .qr-modal-title {
        font-size: 1.15rem;
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }

    .qr-modal-subtitle {
        font-size: 0.78rem;
    }

    .qr-modal-img-wrap {
        padding: 8px;
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }

    .qr-modal-img {
        width: min(240px, 64vw, 38dvh);
        height: min(240px, 64vw, 38dvh);
    }

    .qr-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    .qr-modal-hint {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }
}

@media (max-height: 520px) {
    .qr-modal-card {
        padding: 0.75rem 1rem 0.6rem;
        max-width: 340px;
    }

    .qr-modal-header {
        margin-bottom: 0.4rem;
        padding-right: 1.5rem;
    }

    .qr-modal-title {
        font-size: 1rem;
        margin-bottom: 0;
    }

    .qr-modal-subtitle {
        display: none;
    }

    .qr-modal-img-wrap {
        padding: 6px;
        margin-bottom: 0.4rem;
    }

    .qr-modal-img {
        width: min(180px, 48dvh);
        height: min(180px, 48dvh);
    }

    .qr-modal-hint {
        display: none;
    }
}

@media (max-width: 480px) {
    .exp-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .expansion-card .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Admin Control Panel & Auth Styles
   ========================================================================== */

.nav-auth-section {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.nav-user {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-login, .nav-logout {
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.6rem 1rem;
    }
    .nav-main-row {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .nav-auth-section {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.4rem;
        margin-top: 0.15rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-user {
        max-width: 180px;
        font-size: 0.8rem;
    }
    .nav-item {
        font-size: 0.82rem;
        padding: 0.25rem 0.45rem;
    }
}

.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.admin-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.admin-tab-btn:hover {
    color: var(--text-primary);
}

.admin-tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.admin-table th {
    color: var(--text-secondary);
    font-weight: 600;
    background: rgba(15, 23, 42, 0.4);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: #111;
}

.admin-game-title {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.admin-bgg-link {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.admin-bgg-link:hover {
    text-decoration: underline;
}

.admin-docs-list {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.admin-doc-name {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.admin-doc-del-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.8rem;
}

.admin-doc-del-btn:hover {
    color: #f87171;
}

.admin-actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-control[type="file"] {
    padding: 0.4rem;
    background: transparent;
    cursor: pointer;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

