/* Global 80% scale — site designed at this zoom level */

.tier-actions-center {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.tier-color-templates {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.tier-template-creator {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.4rem 0.25rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.tier-template-creator[hidden] {
    display: none;
}

.tier-template-creator input {
    width: 200px;
    min-width: 120px;
    max-width: 260px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tier-template-creator input:focus {
    border-color: var(--bs-primary);
    box-shadow: none;
}

.tier-template-creator button {
    flex-shrink: 0;
}

.quick-tag-add-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Менші поля для назв тегів і груп у швидкому режимі */
.quick-tag-input {
    height: 32px !important;
    font-size: 0.95rem;
    padding-top: 2px;
    background: var(--bg-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

.quick-tag-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

.quick-tag-input:focus {
    background: var(--bg-primary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
}

html.app-modal-scroll-locked,
html:has(body.modal-open),
html:has(body.quiz-exit-modal-open) {
    overflow-y: hidden !important;
    scrollbar-gutter: stable !important;
}

body.modal-open { pointer-events: auto !important; overflow: hidden !important; padding-right: 0 !important; }
body.modal-open > * { pointer-events: auto !important; }
.modal { pointer-events: auto !important; }

html.item-modal-scroll-locked,
html.item-modal-scroll-locked body {
    overflow-y: hidden !important;
}

/* Основні стилі - Темна тема */
:root {
    --page-zoom: 0.8;
    --page-zoom-inverse: 1.25;
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --text-muted: #848d97;
    --border-color: #30363d;
    --accent-color: #238636;
    --accent-hover: #2ea043;
    --danger-color: #da3633;
    --warning-color: #fb8500;
    --info-color: #1f6feb;

    /* Design tokens (keep palette; unify feel across pages) */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.20);
    --shadow-md: 0 6px 18px rgba(0,0,0,0.35);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.40);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* Sidebar style primitives (reuse existing sidebar palette) */
    --sidebar-accent: #90caf9;
    --sidebar-hover-bg: rgba(40, 48, 70, 0.9);
    --sidebar-active-bg: #283046;
    --shadow-sidebar: 0 15px 35px rgba(0, 0, 0, 0.25);
    --app-navbar-height: 120px;
}

html {
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Кастомна ширина модалю - між md (500px) та lg (800px) */
.modal-custom {
    max-width: min(750px, 95vw);
}

/* Compensate Bootstrap's fixed modal overlay for body zoom: 0.8. */
.modal,
.modal-backdrop {
    width: calc(100vw * var(--page-zoom-inverse));
    height: calc(100vh * var(--page-zoom-inverse));
    top: 0;
    left: 0;
}

/* Ефект підсвічування модального вікна при hover */
.modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background-color: var(--bg-secondary);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

/* Public visibility modal: no blue hover outline */
#publicVisibilityModal .modal-content:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* Edit item modal: no blue hover outline */
#editItemModal .modal-content:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

/* Hitster exit modal: keep a stable shadow without hover glow */
#hitsterEndGameModal .modal-content:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    overflow-x: clip;
    min-height: 100%;
    min-width: 320px;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    zoom: var(--page-zoom);
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

img,
video,
canvas,
svg,
iframe {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Profile settings form inputs (match filter/search styling) */
.profile-settings-input {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.profile-settings-card {
    border: none !important;
    box-shadow: none !important;
}

.profile-description {
    color: var(--text-muted);
    line-height: 1.5;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
    white-space: pre-line;
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(1.5em * 6);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.profile-description.is-expanded {
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
}

.profile-description-toggle {
    color: var(--sidebar-accent);
}

.profile-header-row {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.profile-header-actions {
    margin-top: 0.35rem;
}

.profile-stats-row {
    margin-top: 0.75rem;
}

.profile-description {
    margin-top: 0;
}


/* Auth form inputs (login/register) */
.auth-input,
.auth-input-group-text {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* Minimal list cards (profile + public lists) */
.list-card-minimal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-card-wrapper {
    position: relative;
}

.list-card-images {
    width: 100%;
    aspect-ratio: 5 / 3;
    border-radius: var(--radius-md);
    overflow: visible;
    background: transparent;
    position: relative;
}

.list-card-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-card-description {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    transition: max-height var(--transition-normal), opacity var(--transition-normal);
}

.list-card-minimal:hover .list-card-description {
    max-height: calc(1.35em * 6);
    opacity: 1;
}

.list-description {
    color: var(--text-muted);
    line-height: 1.5;
    width: 100%;
    text-align: justify;
    text-justify: inter-word;
    white-space: pre-line;
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(1.5em * 6);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.list-description.is-expanded {
    display: block;
    line-clamp: unset;
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
}

.list-description-toggle {
    color: var(--sidebar-accent);
}

.btn-list-copy {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background: transparent;
}

.btn-list-copy:hover,
.btn-list-copy:focus,
.btn-list-copy:active,
.btn-list-copy.active,
.show > .btn-list-copy.dropdown-toggle {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

.btn-list-copy:disabled {
    color: var(--text-muted);
    border-color: var(--border-color);
    background: transparent;
    opacity: 0.5;
}

.profile-page {
    padding-bottom: 3.5rem;
}

.list-stats-row {
    margin-top: 0.75rem;
}

.list-card-count {
    background: var(--bg-tertiary);
    color: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.list-card-image-item {
    position: absolute;
    width: auto;
    height: 100%;
    max-width: 70%;
    border-radius: var(--radius-md);
    overflow: hidden;
    transform-origin: center center;
    transition: transform 0.3s ease, left 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    left: calc(var(--stack-index) * 15%);
}

.list-card-image-item:hover {
    transform: translateY(-8px) scale(1.05);
    z-index: 100 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.list-card-minimal:hover .list-card-image-item {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.list-card-minimal:hover .list-card-image-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.list-card-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.list-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.3);
}

.list-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

a:hover .list-card-title {
    color: var(--sidebar-accent);
}

/* Like pill (works with LikeManager: toggles .liked and icon classes) */
.list-like-pill {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

button.list-like-pill {
    cursor: pointer;
}

button.list-like-pill:disabled {
    opacity: 0.6;
    cursor: default;
}

.list-like-pill .fas,
.list-like-pill .far {
    color: var(--danger-color);
}

.list-like-pill.liked {
    color: var(--text-primary);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary) !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (min-width: 992px) {
    /* On list pages shift only the brand to align with content,
       keeping the navbar container centered (profile stays visible). */
    .list-page-shell .navbar-brand {
        margin-left: 40px;
        transition: margin-left var(--transition-normal);
    }

    .list-page-shell.sidebar-expanded .navbar-brand {
        margin-left: 200px;
    }

    .list-page-shell.quick-settings-open .navbar-brand {
        margin-left: 340px;
    }

    .list-page-shell.sidebar-expanded.quick-settings-open .navbar-brand {
        margin-left: 540px;
    }

    .list-page-shell.quick-settings-restoring .navbar-brand,
    .list-page-shell.sidebar-init .navbar-brand {
        transition: none;
    }
}

/* Стилі для карточок списків */
.list-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--info-color);
}

.list-card .card-title a {
    color: var(--text-primary);
    font-weight: 600;
}

.list-card .card-title a:hover {
    color: var(--info-color);
}

/* Кнопка лайка */
.like-btn {
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.like-btn:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.like-btn.liked {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Бейджі */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.badge.bg-primary {
    background-color: var(--info-color) !important;
}


/* Новий стиль для панелі фільтрів */
.filter-group-dropdown {
    margin-right: 10px;
}

.filter-group-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--bg-secondary);
    border-radius: 0.7rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition-normal), box-shadow var(--transition-normal), color var(--transition-normal);
    box-shadow: none;
    position: relative;
}


/* Prevent any transform on the group button when it becomes active */
.filter-group-btn.has-filters,
.filter-group-btn:active,
.filter-group-btn:focus {
    transform: none !important;
    box-shadow: 0 0 0 2px rgba(144, 202, 249, 0.25) !important;
}

.filter-group-btn:hover, .filter-group-btn:focus {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
    border-color: var(--sidebar-accent);
    box-shadow: none;
}

/* List/tier/tournament pages: quieter hover for tag-group titles (no frame/bg, just accent text) */
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn:hover,
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn:focus {
    background: transparent;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
    color: var(--sidebar-accent);
}

:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn:active,
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn:focus-visible,
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn:active:focus,
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn.has-filters {
    background: transparent;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
    color: var(--text-secondary);
}

/* List/tier view: when filters are active in a group, do NOT show any ring/outline */
:is(.list-view, .tier-list-view, .tournament-view) .filter-group-btn.has-filters {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    color: var(--sidebar-accent) !important;
}

.filter-clear-btn {
    min-width: 120px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.filter-clear-btn.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Карточки */
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Алерт */
.alert {
    border-radius: var(--radius-lg);
    border: none;
}

.alert-info {
    background-color: rgba(31, 111, 235, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(31, 111, 235, 0.2);
}

.alert-success {
    background-color: rgba(35, 134, 54, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(35, 134, 54, 0.2);
}

.alert-danger {
    background-color: rgba(218, 54, 51, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(218, 54, 51, 0.2);
}

.alert-warning {
    background-color: rgba(251, 133, 0, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(251, 133, 0, 0.2);
}

/* Dropdown меню */
.dropdown-menu {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color var(--transition-fast);
    color: var(--text-primary);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Кнопки */
.btn-primary {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
    color: #fff;
}

.game-filter-card__toggle,
.game-filter-card__clear,
.calendar-filter-toggle {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.game-filter-card__toggle:hover,
.game-filter-card__toggle:focus,
.game-filter-card__clear:hover,
.game-filter-card__clear:focus,
.calendar-filter-toggle:hover,
.calendar-filter-toggle:focus {
    color: var(--sidebar-accent) !important;
    background: transparent !important;
    border-color: transparent !important;
}

.game-filter-card__clear {
    min-width: auto;
    padding-inline: 0.35rem;
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover, .btn-outline-secondary:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.profile-follow-btn {
    border-width: 1px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.profile-follow-btn.is-idle {
    background: var(--info-color);
    border-color: var(--info-color);
    color: #fff;
}

.profile-follow-btn.is-idle:hover,
.profile-follow-btn.is-idle:focus {
    background: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
    color: #fff;
}

.profile-follow-btn.is-following {
    background: var(--info-color);
    border-color: var(--info-color);
    color: #fff;
}

.profile-follow-btn.is-following:hover,
.profile-follow-btn.is-following:focus {
    background: var(--sidebar-accent);
    border-color: var(--sidebar-accent);
    color: #fff;
}

.profile-follow-btn.is-friend {
    background: var(--bs-success);
    border-color: var(--bs-success);
    color: #fff;
}

.profile-follow-btn.is-friend:hover,
.profile-follow-btn.is-friend:focus {
    background: #157347;
    border-color: #157347;
    color: #fff;
}

.btn-outline-danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: rgba(218, 54, 51, 0.12);
    border-color: var(--danger-color);
    color: #ffd9d7;
}

/* Input групи */
.input-group-text {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Лейбли та текст */
.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.form-text {
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--accent-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

/* Навігація */
.navbar-dark {
    background-color: var(--bg-secondary) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
}

.nav-link:hover, .nav-link:focus {
    color: var(--text-primary) !important;
}
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Анімації */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.list-card {
    animation: fadeIn 0.5s ease-out;
}

/* Розширені налаштування списків */
.criteria-item, .calendar-item, .tag-group-item {
    transition: all 0.3s ease;
    border: 1px solid var(--bs-border-color);
}

.criteria-item:hover, .calendar-item:hover, .tag-group-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.1rem rgba(13, 110, 253, 0.25);
}

.criteria-item .btn-outline-danger,
.calendar-item .btn-outline-danger,
.tag-group-item .btn-outline-danger {
    --bs-btn-hover-bg: var(--bs-danger);
    --bs-btn-hover-border-color: var(--bs-danger);
}

#tags-preview .badge {
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Покращений вигляд карток */
.card-header h5 {
    color: var(--bs-heading-color);
    font-weight: 600;
}

.card-body .alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.2);
    color: var(--bs-info);
}

/* Стилі для форм */
.form-label {
    font-weight: 500;
    color: var(--bs-body-color);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

/* Tier list + calendar pages: keep the same primary blue focus glow as everywhere else */
.tier-list-view .form-control:focus,
.tier-list-view .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

/* Анімація кнопок */
.btn {
    font-family: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
    transform: none;
}

/* list.php: make the split add-item controls animate together */
.list-view .add-item-actions-group:hover .btn,
.list-view .add-item-actions-group:focus-within .btn {
    transform: none;
}

.btn:active {
    transform: none;
}

/* Стилі для фільтрації тегами */
.tag-filter:checked + label {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: white !important;
    font-weight: 600;
    transform: scale(0.98);
}

.tag-filter + label {
    transition: all 0.2s ease;
    border-width: 1.5px;
}

.tag-filter + label:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Анімація для активації тегів */
@keyframes tagActivate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(0.98); }
}

.tag-filter:checked + label {
    animation: tagActivate 0.3s ease;
}

/* Disable scale/animation when a tag is selected or hovered — keep visual state but no size/transform changes */
.tag-filter + label,
.tag-filter:checked + label {
    transform: none !important;
    animation: none !important;
}
.tag-filter + label:hover {
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06) !important;
}

/* Prevent unintended hover/transform effects for tag-group controls and tag badges */
.tag-group-list .btn,
.filter-group-dropdown .filter-group-btn,
.tag-filter + label,
.tag-filter:checked + label,
.tag,
.tag:hover {
    transform: none !important;
    animation: none !important;
}
.filter-group-dropdown .filter-group-btn:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
}

/* Групування тегів */
.tag-group-label {
    font-weight: 500;
    color: var(--bs-secondary);
    margin-bottom: 0.25rem;
}

/* Стилі для індикаторів завантаження */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}
.item-card {
    transition: none !important; /* Прибираємо transition для всієї картки */
    cursor: pointer;
    position: relative;
    background-color: var(--bg-primary) !important; /* Робимо фон картки як основний фон */
    border: none !important; /* Прибираємо рамку */
    box-shadow: none !important; /* Прибираємо тінь */
}

.item-card:hover {
    transform: none !important; /* Прибираємо підіймання всієї картки */
    box-shadow: none !important; /* Прибираємо тінь від всієї картки */
    border-color: transparent !important; /* Прибираємо зміну кольору рамки */
}

.item-card .card-img-top {
    transition: all 0.3s ease !important;
    border-radius: 8px !important; /* Округлюємо тільки зображення */
}

.item-card:hover .card-img-top {
    transform: scale(1.05) !important; /* Тільки зображення збільшується */
    box-shadow: 0 8px 25px rgba(0,0,0,0.6) !important; /* Тінь тільки на зображенні */
}

.item-card .card-body {
    background-color: var(--bg-primary) !important; /* Фон тексту як основний фон */
    border: none !important;
    padding: 0.75rem 0 !important; /* Зменшуємо відступи */
    overflow: hidden;
}

.item-card .card-title {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* Стилі для постерів/обкладинок */
.item-poster {
    width: 100%;
    aspect-ratio: 3/4;
    height: auto;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
}

.item-poster.square {
    aspect-ratio: 1;
    height: auto;
}

.item-poster.rectangle {
    aspect-ratio: 2/3;
    height: auto;
}

.item-poster-spacer {
    visibility: hidden;
    pointer-events: none;
}

/* Стилі для рейтингових зірок в карточках */
.item-card .rating-stars {
    font-size: 0.9rem;
}

.item-card .rating-stars .fas.fa-star,
.item-card .rating-stars .fas.fa-star-half-alt {
    color: #ffc107;
}

.item-card .rating-stars .far.fa-star {
    color: var(--border-color);
}

/* Стилі для тегів в карточках */
.item-card .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

@media (min-width: 992px) {
    .list-page-shell.quick-settings-open .item-card .card-img-top,
    .list-page-shell.quick-settings-open .item-card .item-poster {
        border-radius: 6px !important;
    }

    .list-page-shell.quick-settings-open .item-card .card-body {
        padding: 0.55rem 0 0.1rem !important;
    }

    .list-page-shell.quick-settings-open .item-card .card-title {
        font-size: 0.78rem;
        line-height: 1.25 !important;
        height: auto !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        margin-bottom: 0.2rem !important;
    }

    .list-page-shell.quick-settings-open .item-card .rating-stars {
        font-size: 0.7rem;
    }

    .list-page-shell.quick-settings-open .item-card .badge {
        font-size: 0.58rem;
        padding: 0.1rem 0.22rem;
    }

    .list-page-shell.quick-settings-open .item-card .tags-block {
        padding: 0 0.4rem 0.4rem 0.4rem !important;
        gap: 3px !important;
    }

    .list-page-shell.quick-settings-open .item-card .tags-block span {
        width: 12px !important;
        height: 12px !important;
        font-size: 12px !important;
    }

    .list-page-shell.quick-settings-open .item-card .tags-block img {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Hover ефект для карточок без можливості редагування */
.item-card.readonly {
    cursor: default;
}

.item-card.readonly:hover {
    transform: none; /* Прибираємо підіймання */
}

.item-card.readonly:hover .card-img-top {
    transform: scale(1.05); /* Тільки зображення збільшується */
    box-shadow: 0 8px 25px rgba(0,0,0,0.6); /* Тінь тільки на зображенні */
}

/* Статистичні карточки */
.stats-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
}

/* Стилі для фільтрів тегів */
.tag-filter:checked + label {
    background-color: var(--info-color) !important;
    border-color: var(--info-color) !important;
    color: white !important;
}

/* Стилі для фільтрів тегів - видалено старі конфліктуючі стилі */
/* Нові стилі визначені вище в секції .filter-group-dropdown */

.dropdown-toggle.has-filters {
    border-color: var(--bs-primary) !important;
    color: var(--bs-primary) !important;
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Стилі для панелі швидких налаштувань */
.quick-settings {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
}

.quick-settings.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стилі для порожнього списку */
.empty-list {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-list i {
    opacity: 0.5;
}

/* Стилі для рейтингів */
.rating-stars {
    color: #ffc107;
    font-size: 1.2rem;
}

.rating-stars .fas.fa-star,
.rating-stars .fas.fa-star,
.rating-stars .fas.fa-star-half-alt {
    color: #ffc107;
}

.rating-stars .far.fa-star {
    color: var(--border-color);
}

.rating-numeric {
    font-weight: bold;
    color: var(--info-color);
}

/* Стилі для тегів */
.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    border-radius: 12px;
    font-size: 0.75rem;
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.tag:hover {
    opacity: 0.8;
    color: white;
}

/* Prevent tag labels from changing size on click/active/hover
   Some browsers or existing rules applied transforms/animations
   which made the tag name plate grow when clicked. Force stable
   size, disable animation and transform for tag-name elements and
   tag-filter controls. */
.filter-group-dropdown .dropdown-item.tag-filter-item .tag-name,
.tag-filter,
.tag-filter.active,
.filter-group-dropdown .dropdown-item.tag-filter-item:active,
.filter-group-dropdown .dropdown-item.tag-filter-item:focus {
    transform: none !important;
    animation: none !important;
    transition: none !important;
    /* enforce consistent font-size to avoid layout shift */
    font-size: 0.95rem !important;
}

/* Also ensure individual tag elements don't scale when clicked */
[data-tag-id] {
    transform: none !important;
    animation: none !important;
}

/* Стилі для сортування */
.sort-controls {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
}

.sort-btn {
    margin: 0.25rem;
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-secondary);
}

.sort-btn.active {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: white;
}

.sort-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Loading стан */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Стилі для модальних вікон видалені - визначені вище */

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Додаткові стилі для темної теми */
.bg-dark {
    background-color: var(--bg-primary) !important;
}

.bg-secondary {
    background-color: var(--bg-secondary) !important;
}

.text-light {
    color: var(--text-primary) !important;
}

/* Прогрес бар */
.progress {
    background-color: var(--bg-tertiary);
}

.progress-bar {
    background-color: var(--info-color);
}

.progress-bar.bg-info {
    background-color: var(--info-color) !important;
}

/* Скролбари для webkit браузерів */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Покращений вигляд для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

/* Стилі для code блоків */
code {
    background-color: var(--bg-tertiary);
    color: var(--accent-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ===== Auth pages branding ===== */
.auth-brand-header {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.auth-brand-header .auth-brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-brand-header .auth-brand-accent {
    color: var(--info-color);
}

.auth-card {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-card .card-body {
    padding: var(--space-xl);
}

body.reset-password-page {
    min-height: 100vh;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 12% 18%, rgba(31, 111, 235, 0.24), transparent 26%),
        radial-gradient(circle at 88% 14%, rgba(46, 160, 67, 0.18), transparent 24%),
        linear-gradient(150deg, #07111d 0%, #0d1117 48%, #111827 100%);
}

body.reset-password-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 95%);
    opacity: 0.35;
}

.reset-password-shell {
    position: relative;
    z-index: 1;
}

.reset-password-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(144, 202, 249, 0.22);
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.95), rgba(13, 17, 23, 0.97));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.reset-password-panel::before,
.reset-password-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.reset-password-panel::before {
    width: 220px;
    height: 220px;
    top: -120px;
    right: -72px;
    background: radial-gradient(circle, rgba(31, 111, 235, 0.34) 0%, rgba(31, 111, 235, 0) 72%);
}

.reset-password-panel::after {
    width: 180px;
    height: 180px;
    bottom: -110px;
    left: -78px;
    background: radial-gradient(circle, rgba(46, 160, 67, 0.22) 0%, rgba(46, 160, 67, 0) 72%);
}

.reset-password-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(144, 202, 249, 0.22);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: #9ecbff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.reset-password-header {
    margin-bottom: 1.5rem;
}

.reset-password-subtitle {
    color: #a7b4c3;
    max-width: 26rem;
}

.reset-password-alert {
    border-radius: 16px;
    border-width: 1px;
    background: rgba(8, 14, 24, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.reset-password-alert-danger {
    border-color: rgba(218, 54, 51, 0.45);
    color: #ffb4ad;
}

.reset-password-alert-success {
    border-color: rgba(46, 160, 67, 0.42);
    color: #9fe8a8;
}

.reset-password-page .form-label {
    color: #d8e1ea;
    font-weight: 600;
    margin-bottom: 0.55rem;
}

.reset-password-input-icon {
    background: rgba(8, 14, 24, 0.82);
    border-color: rgba(132, 141, 151, 0.24);
    color: #7fb0ff;
}

.reset-password-input {
    background: rgba(8, 14, 24, 0.82);
    border-color: rgba(132, 141, 151, 0.24);
    color: var(--text-primary);
}

.reset-password-input::placeholder {
    color: #6f7b88;
}

.reset-password-input:focus {
    background: rgba(8, 14, 24, 0.94);
    border-color: rgba(88, 166, 255, 0.7);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.18);
}

.reset-password-hint {
    margin-top: 0.45rem;
    color: #7d8a98;
    font-size: 0.83rem;
}

.reset-password-submit {
    min-height: 3.2rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--info-color) 0%, #58a6ff 100%);
    box-shadow: 0 14px 34px rgba(31, 111, 235, 0.28);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.reset-password-submit:hover,
.reset-password-submit:focus {
    background: linear-gradient(135deg, #2f81f7 0%, #79c0ff 100%);
    box-shadow: 0 18px 40px rgba(31, 111, 235, 0.34);
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .reset-password-panel .card-body {
        padding: 1.25rem;
    }

    .reset-password-kicker {
        margin-bottom: 0.85rem;
    }
}

.auth-modal-content {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.auth-modal-alert-wrap {
    min-height: 4.25rem;
}

.auth-field-error {
    min-height: 2.2rem;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    line-height: 1.3;
    color: var(--text-muted);
}

.auth-field-error.is-error {
    color: #dc3545;
}

.guest-game-notice {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.35rem;
}

.auth-field-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.3;
    display: block;
    transition: opacity 0.15s;
}

.auth-field-hint.d-none {
    display: none !important;
}

.auth-input.is-invalid,
.auth-input.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12) !important;
}
.input-group:has(.auth-input.is-invalid) .auth-input-group-text {
    border-color: #dc3545 !important;
}

/* Password toggle button: match auth input style */
.input-group:has(.auth-input) .btn-outline-secondary {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}
.input-group:has(.auth-input) .btn-outline-secondary:hover {
    background-color: var(--bg-tertiary, #1f2937) !important;
    color: var(--text-primary) !important;
}
.input-group:has(.auth-input.is-invalid) .btn-outline-secondary {
    border-color: #dc3545 !important;
}

.auth-password-status {
    display: none;
}

.auth-footer-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.auth-footer-link:hover {
    color: var(--sidebar-accent);
}

/* Outlined info alert — border only, transparent background matches any container */
.alert-info-border {
    background: transparent;
    border: 1px solid rgba(144, 202, 249, 0.35);
    color: var(--sidebar-accent);
    font-size: 0.875rem;
}

/* ===== Improved profile header ===== */
.profile-header-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: none;
    background: transparent;
    border-radius: 0;
}

.profile-header-card .profile-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

/* ===== Public lists filter bar refinement ===== */
/* Source filter tabs (underline style like profile) */
#sourceFilter {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#sourceFilter .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border: none;
    background: transparent;
}
#sourceFilter .nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    border: none;
}
#sourceFilter .nav-link.active {
    color: #0969da;
    background: transparent;
    border: none;
    border-bottom: 2px solid #0969da;
}

.public-lists-catalog .filter-bar,
.profile-page .filter-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Unified filter controls (replaces repetitive inline styles) */
.filter-control {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.filter-control option,
.create-list-page .form-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.public-list-type-topic-group {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
    gap: 0.75rem;
}

.public-list-type-topic-group__item {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .public-list-type-topic-group {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ===== Game lobby visual refinement ===== */
.hitster-card,
.quiz-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

/* Lobby controls: tighten spacing */
.guess-controls .pairing-controls {
    gap: var(--space-md);
}

/* Start buttons across all game pages */
.btn-start {
    width: 100%;
    max-width: 320px;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.8rem 0;
}

/* ===== List page hierarchy ===== */
.list-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.list-meta-row .badge {
    font-size: 0.7rem;
}

/* ===== Stat cards on profile ===== */
.profile-page .card.text-center {
    border: 1px solid var(--border-color);
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.profile-page .card.text-center:hover {
    border-color: rgba(144, 202, 249, 0.3);
    box-shadow: var(--shadow-md);
}

.profile-page .card.text-center h4 {
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0;
}

.profile-page .card.text-center small {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ===== Section headings in game/stats pages ===== */
.section-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
}

/* Стилі для бадежів */
.badge.bg-success {
    background-color: var(--accent-color) !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
}

.badge.bg-warning {
    background-color: var(--warning-color) !important;
    color: black !important;
}

.list-page-shell {
    position: relative;
}
.list-page-shell #quickSettingsPanel {
    left: 60px;
    width: min(400px, calc(100vw * var(--page-zoom-inverse) - 76px));
    max-width: calc(100vw * var(--page-zoom-inverse) - 76px);
    overflow: hidden;
}
.list-page-shell.sidebar-expanded #quickSettingsPanel {
    left: 260px;
    width: min(400px, calc(100vw * var(--page-zoom-inverse) - 276px));
    max-width: calc(100vw * var(--page-zoom-inverse) - 276px);
}
.page-with-sidebar {
    padding-left: 60px;
    padding-right: 0;
    transition: padding-left 0.3s ease;
    box-sizing: border-box;
}
.tier-list-view .page-with-sidebar .container {
    padding-top: 2rem;
}
.tier-list-view .page-with-sidebar .container > :first-child {
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}
.tier-list-view .page-with-sidebar #tierBuilderRoot {
    margin-top: 2.5rem;
}
.list-view .page-with-sidebar .container {
    padding-top: 2rem;
}
.list-view .page-with-sidebar .container > :first-child {
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}
.list-view .list-meta-row {
    margin-top: 1rem;
    gap: 0.5rem;
}
.tournament-view .page-with-sidebar .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.tournament-view .page-with-sidebar .container > :first-child {
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}
.list-page-shell.sidebar-expanded .page-with-sidebar {
    padding-left: 260px;
}

@media (min-width: 992px) {
    .list-page-shell.quick-settings-open .page-with-sidebar {
        padding-left: 476px;
    }

    .list-page-shell.sidebar-expanded.quick-settings-open .page-with-sidebar {
        padding-left: 676px;
    }

    .list-page-shell.quick-settings-open .page-with-sidebar > .container {
        max-width: 100%;
    }
}
.list-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 60px;
    padding: 0.75rem 0.5rem 1.5rem;
    padding-top: var(--app-navbar-height, 120px);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 1040;
    transition: width 0.3s ease;
    box-shadow: var(--shadow-sidebar);
}
.list-sidebar.expanded {
    width: 260px;
}
.list-sidebar .list-sidebar-content {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 0.5rem;
}
.list-sidebar.expanded .list-sidebar-content {
    display: flex;
}
.list-sidebar .sidebar-toggle {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    aspect-ratio: 1 / 1;
    flex: 0 0 46px;
    padding: 0;
    border-radius: 50%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}
.list-sidebar .sidebar-toggle i {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
    transform: none;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.list-sidebar .sidebar-toggle .sidebar-toggle-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    flex: 0 0 22px;
    display: block;
}
.list-sidebar .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(144, 202, 249, 0.18);
}
.list-sidebar .sidebar-section {
    width: 100%;
    border-radius: 1.1rem;
    padding: 0.75rem 0.95rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}
.list-sidebar .sidebar-section--public {
    border-color: rgba(144, 202, 249, 0.45);
    box-shadow: inset 0 0 0 1px rgba(144, 202, 249, 0.12);
}
.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar--clickable {
    border: none;
    cursor: pointer;
}
.profile-avatar--clickable:hover {
    box-shadow: 0 0 0 2px rgba(144, 202, 249, 0.35);
}
.profile-avatar-link {
    text-decoration: none;
}
.profile-avatar-link:hover {
    text-decoration: none;
}
.profile-avatar-input {
    display: none;
}
.profile-avatar--header {
    width: 80px;
    height: 80px;
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.public-list-card-hover-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal), opacity var(--transition-normal);
}

.public-lists-title-wrap {
    margin-bottom: var(--space-lg);
    padding-top: var(--space-xl);
    padding-bottom: var(--space-sm);
}

.public-lists-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    color: var(--text-primary);
    font-family: inherit;
    font-size: clamp(1.65rem, 2.5vw, 2.1rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.public-lists-title__icon {
    color: var(--info-color);
    font-size: 0.8em;
    flex-shrink: 0;
}

.list-card-minimal:hover .public-list-card-hover-meta {
    max-height: 24rem;
    opacity: 1;
}

.public-list-card-hover-meta__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.public-list-card-hover-meta__row--badges {
    gap: 0.35rem 0.5rem;
}

.public-list-card-hover-meta__item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--text-muted);
}

.public-list-card-type-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: normal;
}

.public-list-card-description {
    margin-top: 0;
    margin-bottom: 0;
    display: -webkit-box;
    line-clamp: 6;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(1.35em * 6);
}

.list-card-minimal .public-list-card-hover-meta,
.list-card-minimal .public-list-card-hover-meta * {
    color: var(--text-muted);
}

.list-card-minimal:hover .public-list-card-description {
    max-height: calc(1.35em * 6);
    opacity: 1;
}

.list-card-minimal .public-list-card-type-badge,
.list-card-minimal:hover .public-list-card-type-badge {
    color: #fff;
}

@media (max-width: 767.98px) {
    .public-list-card-hover-meta__row {
        gap: 0.2rem;
    }
}
.list-sidebar .sidebar-section-heading {
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.35rem;
}
.list-sidebar .sidebar-section-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.45rem 0.9rem;
    border-radius: 0.7rem;
    border: 2px solid var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-secondary);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}
.sidebar-link-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.sidebar-link-icon svg {
    width: 1em;
    height: 1em;
    display: block;
}
.sidebar-link-text {
    flex: 1;
}
.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    border-color: var(--sidebar-accent);
    box-shadow: inset 0 0 0 1px rgba(144, 202, 249, 0.16);
}
.sidebar-link--active {
    background: var(--sidebar-active-bg);
    border-color: var(--sidebar-accent);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.sidebar-link--disabled {
    opacity: 0.6;
    pointer-events: none;
}
.sidebar-link--disabled.sidebar-link--active {
    opacity: 1;
    pointer-events: none;
}
.sidebar-link--off {
    opacity: 0.5;
}
.sidebar-link--off:hover {
    opacity: 0.75;
}
.sidebar-link-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1em 0.45em;
    border-radius: 0.4em;
    background: var(--border-color);
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
}
@media (max-width: 992px) {
    .list-sidebar {
        display: none;
    }
    .page-with-sidebar {
        padding-left: 0 !important;
    }
    .list-page-shell #quickSettingsPanel {
        left: 0;
        width: calc(100vw * var(--page-zoom-inverse) - 16px);
        max-width: calc(100vw * var(--page-zoom-inverse) - 16px);
    }
}

#quickSettingsPanel .quick-settings-panel {
    height: calc(100vh * var(--page-zoom-inverse, 1.25));
    overflow-y: auto;
    overflow-x: hidden;
}

#quickSettingsPanel .modal-body {
    overflow-x: hidden;
}

/* Стилі для модального вікна додавання об'єктів */
.image-upload-area {
    min-height: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-secondary);
    border: 2px dashed var(--border-color) !important;
}

.image-upload-area:hover {
    border-color: #4a90d9 !important;
    background-color: var(--bg-tertiary);
}

.image-upload-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px;
    justify-content: center;
    overflow-x: hidden;
}

/* Clamp gallery previews to a fixed number of rows (default: 4). */
.gallery-grid.gallery-grid--clamped {
    overflow: hidden;
    /* 4 rows * 140px + 3 gaps * 6px = 578px */
    max-height: 578px;
}

.gallery-thumb {
    position: relative;
    width: auto;
    height: 140px;
    max-width: min(100%, 280px);
    flex: 0 0 auto;
    background: #0f1318;
    border: 1px solid #1f2933;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}


.gallery-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.gallery-lightbox-dialog {
    max-width: min(95vw, 1100px);
}

.gallery-lightbox-content {
    background: transparent;
    border: none;
    box-shadow: none;
}

#galleryLightboxModal .modal-content,
#galleryLightboxModal .modal-content:hover,
#galleryLightboxModal .modal-content:focus,
#galleryLightboxModal .modal-content:focus-within {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.gallery-lightbox-body {
    background: transparent;
    text-align: center;
    position: relative;
}

.gallery-thumb img {
    width: auto;
    max-width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: saturate(0.9) contrast(1.05);
}

.gallery-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 768px) {
    .gallery-thumb {
        height: 110px;
        max-width: min(100%, 220px);
    }

    .gallery-grid.gallery-grid--clamped {
        /* 4 rows * 110px + 3 gaps * 6px = 458px */
        max-height: 458px;
    }
}

.gallery-thumb:hover {
    border-color: #1f2933;
    transform: none;
}

.gallery-nav-btn {
    position: absolute;
    top: calc(50% - 19px);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.gallery-nav-btn:hover {
    background: rgba(0, 0, 0, 0.65);
}

.gallery-nav-prev { left: 10px; }
.gallery-nav-next { right: 10px; }

#editItemModal .item-modal-nav-btn {
    position: fixed;
    top: calc(50vh - 44px);
    width: 56px;
    height: 88px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-primary) !important;
    justify-content: center;
    z-index: 1061;
    box-shadow: var(--shadow-sm);
    opacity: 0.98;
}

#editItemModal .item-modal-nav-prev {
    left: max(12px, calc(50vw - 468px));
}

#editItemModal .item-modal-nav-next {
    right: max(12px, calc(50vw - 468px));
}

#editItemModal .item-modal-nav-btn:hover {
    background: var(--bg-tertiary);
}

#editItemModal .item-modal-nav-btn i {
    font-size: 1.35rem !important;
}

/* Item modals: show full textarea content without inner scrolling */
#editItemModal textarea,
#addItemModal textarea {
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-y: hidden !important;
    resize: none !important;
}

@media (max-width: 900px) {
    #editItemModal .item-modal-nav-prev {
        left: 8px;
    }

    #editItemModal .item-modal-nav-next {
        right: 8px;
    }

    #editItemModal .item-modal-nav-btn {
        width: 48px;
        height: 76px;
        top: calc(50vh - 38px);
        border-radius: 14px;
    }
}

#editItemModal #editItemPrevBtn:focus-visible,
#editItemModal #editItemNextBtn:focus-visible,
#addItemModal .btn:focus-visible,
#addItemModal .btn-close:focus-visible,
#editItemModal .btn:focus-visible,
#editItemModal .btn-close:focus-visible,
#galleryLightboxModal .btn:focus-visible,
#addGalleryCard .btn:focus-visible,
#editGalleryCard .btn:focus-visible,
.gallery-nav-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: none;
}

.gallery-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.gallery-empty {
    padding: 10px;
    border: 1px dashed #27313a;
    border-radius: 8px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
}

/* Стилі для рейтингових слайдерів */
.rating-input {
    padding: 10px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.rating-input input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

.rating-input .rating-value {
    color: var(--info-color);
    font-size: 1.1em;
}

/* Стилі для відображення поточного рейтингу в модалях */
.rating-display {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
    transition: all 0.3s ease;
}

.rating-display:hover {
    border-color: var(--info-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.1);
}

.rating-display .text-muted {
    color: var(--text-secondary) !important;
}

.rating-display .text-primary {
    color: var(--info-color) !important;
}

.rating-display .text-warning,
.rating-display .text-white {
    color: #ffc107 !important;
}

/* Загальні стилі для всіх зірок */
.fas.fa-star,
.fas.fa-star-half-alt,
.far.fa-star {
    margin-right: 1px;
}

/* Стилі для модальних вікон */
/* Стилі для модальних вікон видалені - визначені вище */

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal#exitTournamentModal .modal-content {
    background: #161B22;
    border-color: #23272b;
}

/* Стилі для форм в модальних вікнах */
.modal .form-control {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal .form-control:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--info-color);
    box-shadow: none !important;
    color: var(--text-primary);
}

.modal .form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.modal .form-text {
    color: var(--text-secondary);
}

/* Create/Edit list page: match object create/edit field colors */
.create-list-page .form-control,
.create-list-page .form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.create-list-page .form-control:focus,
.create-list-page .form-select:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--info-color);
    box-shadow: none !important;
    color: var(--text-primary);
}

.create-list-page .form-control::placeholder {
    color: var(--text-muted);
}

.create-list-shell {
    max-width: 1220px;
}

.create-list-page .create-list-layout {
    --bs-gutter-x: 1.25rem;
}

.create-list-page .create-list-nav-col {
    align-self: flex-start;
}

.create-list-page .create-list-sticky-nav {
    position: static;
}

@media (min-width: 992px) {
    .create-list-page .create-list-sticky-nav {
        position: fixed;
        top: calc(var(--app-navbar-height, 62px) + 12px);
        left: var(--create-list-nav-left, auto);
        right: auto;
        z-index: 1020;
        width: var(--create-list-nav-width, 190px);
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - var(--app-navbar-height, 62px) - 24px);
        overflow-y: auto;
    }
}

@media (min-width: 1400px) {
    .create-list-page .create-list-sticky-nav {
        top: calc(var(--app-navbar-height, 62px) + 16px);
    }
}

.create-list-page .create-list-sticky-nav .card {
    border-radius: 14px;
    overflow: hidden;
}

.create-list-page .create-list-sticky-nav .list-group-item {
    background-color: transparent;
    border: 0;
    color: var(--text-primary);
    padding: 0.72rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

.create-list-page .create-list-sticky-nav .list-group-item:hover,
.create-list-page .create-list-sticky-nav .list-group-item:focus {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.create-list-page .create-list-sticky-nav .card-header,
.create-list-page .create-list-sticky-nav .list-group-item {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.create-list-icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 1;
}

.create-list-icon-btn i {
    display: block;
    line-height: 1;
    font-size: 0.75rem;
}

.create-list-icon-danger-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.create-list-icon-danger-btn i {
    display: block;
    line-height: 1;
    font-size: 0.75rem;
}

.create-list-icon-danger-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.create-inline-delete-confirm {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
    color: var(--text-primary);
}

.create-inline-delete-confirm .btn {
    min-width: 64px;
}

.item-delete-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-delete-action .create-inline-delete-confirm {
    min-width: 220px;
}

/* Стилі для швидких налаштувань */
#quickSettingsModal .nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

/* Autocomplete suggestions shared style */
.autocomplete-suggestions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.2rem 0;
    width: 100%;
}
.autocomplete-suggestion {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.autocomplete-suggestion:hover {
    background: var(--bg-tertiary);
}
.autocomplete-suggestion small {
    opacity: 0.65;
    white-space: nowrap;
}


#quickSettingsModal .nav-tabs .nav-link {
    color: var(--text-secondary);
    border: 1px solid transparent;
    background-color: transparent;
}

#quickSettingsModal .nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: var(--border-color);
    background-color: var(--bg-tertiary);
}

#quickSettingsModal .nav-tabs .nav-link.active {
    color: var(--info-color);
    border-color: var(--border-color) var(--border-color) var(--bg-secondary);
    background-color: var(--bg-secondary);
}

#quickSettingsModal .card {
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
}

#quickSettingsModal .card-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

#quickSettingsModal .form-check-input:checked {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

#quickSettingsModal .form-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

#quickSettingsModal .form-select:focus {
    border-color: var(--info-color);
    box-shadow: none !important;
}

/* Кастомна сітка для 7 колонок в рядку */
#itemsContainer {
    --cards-per-row-xl: 7;
    --cards-per-row-lg: 6;
    --cards-per-row-md: 5;
    --cards-per-row-sm: 4;
    --cards-per-row-xs: 3;
    --cards-per-row-xxs: 2;
    --cards-per-row-xl-open: 8;
    --cards-per-row-lg-open: 7;
    --cards-per-row-md-open: 6;
}

.col-7-grid {
    flex: 0 0 auto;
    width: calc(100% / var(--cards-per-row-xl, 7) - 0.5rem);
    margin: 0 0.25rem 1rem 0.25rem;
    container-type: inline-size;
    container-name: item-col;
}

/* Scale down rating badge when cards are narrow (many columns) */
@container item-col (max-width: 105px) {
    .item-card .rating-block .badge {
        font-size: 0.62rem;
        padding: 0.1rem 0.22rem;
    }
    .item-card .card-title {
        font-size: 0.72rem;
    }
    .item-card .tags-block {
        padding: 0 0.4rem 0.4rem 0.4rem !important;
        gap: 3px !important;
    }
    .item-card .tags-block span {
        width: 12px !important;
        height: 12px !important;
        font-size: 12px !important;
    }
    .item-card .tags-block img {
        width: 12px !important;
        height: 12px !important;
    }
}
@container item-col (max-width: 80px) {
    .item-card .rating-block .badge {
        font-size: 0.5rem;
        padding: 0.08rem 0.15rem;
    }
    .item-card .card-title {
        font-size: 0.6rem;
    }
    .item-card .tags-block {
        padding: 0 0.25rem 0.25rem 0.25rem !important;
        gap: 2px !important;
    }
    .item-card .tags-block span {
        width: 9px !important;
        height: 9px !important;
        font-size: 9px !important;
    }
    .item-card .tags-block img {
        width: 9px !important;
        height: 9px !important;
    }
}

@media (max-width: 1400px) {
    .col-7-grid {
        width: calc(100% / var(--cards-per-row-lg, 6) - 0.5rem); /* 6 колонок на менших екранах */
    }
}

@media (max-width: 1200px) {
    .col-7-grid {
        width: calc(100% / var(--cards-per-row-md, 5) - 0.5rem); /* 5 колонок */
    }
}

@media (max-width: 992px) {
    .col-7-grid {
        width: calc(100% / var(--cards-per-row-sm, 4) - 0.5rem); /* 4 колонки */
    }
}

@media (min-width: 1400px) {
    .list-page-shell.quick-settings-open #itemsContainer .col-7-grid {
        width: calc(100% / var(--cards-per-row-xl-open, 8) - 0.35rem) !important;
        margin: 0 0.175rem 0.75rem 0.175rem !important;
    }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
    .list-page-shell.quick-settings-open #itemsContainer .col-7-grid {
        width: calc(100% / var(--cards-per-row-lg-open, 7) - 0.35rem) !important;
        margin: 0 0.175rem 0.75rem 0.175rem !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .list-page-shell.quick-settings-open #itemsContainer .col-7-grid {
        width: calc(100% / var(--cards-per-row-md-open, 6) - 0.35rem) !important;
        margin: 0 0.175rem 0.75rem 0.175rem !important;
    }
}

@media (max-width: 768px) {
    .col-7-grid {
        width: calc(100% / var(--cards-per-row-xs, 3) - 0.5rem); /* 3 колонки */
    }
}

@media (max-width: 576px) {
    .col-7-grid {
        width: calc(100% / var(--cards-per-row-xxs, 2) - 0.5rem); /* 2 колонки на мобілці */
    }
}
/* Явне відображення кастомного dropdown-меню */
.dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
}

/* When dropdown-menu is moved to body by Popper, ensure our tag-group menus keep the same size limits */
.dropdown-menu.filter-group-menu {
    width: min(320px, 80vw) !important;
    max-width: 360px !important;
    overflow-y: auto !important;
    max-height: min(320px, 60vh) !important;
}
/* Dropdown поверх скролл-області груп тегів */
.tag-group-list {
    position: relative;
}

/* Strong override: prevent any scaling/animation/transition inside tag groups,
   tag dropdowns and tag badges to avoid layout shifting when a tag is clicked. */
.tag-group-list, .tag-group-list *,
.filter-group-dropdown, .filter-group-dropdown *,
.tags-block, .tags-block * {
    transform: none !important;
    animation: none !important;
    transition: none !important;
    /* keep font-size stable */
    font-size: inherit !important;
}

/* Prevent dropdown items from changing spacing when icons appear */
.filter-group-dropdown .dropdown-item.tag-filter-item {
    min-width: 200px; /* ensure stable width to avoid visual jump */
    white-space: nowrap;
}

/* Стилі для dropdown меню груп тегів */
.filter-group-dropdown {
    position: relative;
    display: inline-block;
}

.filter-group-dropdown .dropdown-menu {
    position: absolute !important;
    display: none;
    top: calc(100% + 0.35rem);
    left: 0;
    /* Adaptive fixed-like width for tag-group dropdown: up to 320px, fits small screens */
    width: min(320px, 80vw);
    max-width: 360px;
    padding: 0.5rem 0;
    margin: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9999 !important;
    /* If there are many tags, enable vertical scroll */
    overflow-y: auto;
    /* Limit height to 320px or 60% of viewport, whichever is smaller */
    max-height: min(320px, 60vh);
    list-style: none;
}

.filter-group-dropdown .dropdown-menu.show {
    display: block !important;
}

.cross-list-selector-dropdown {
    display: block;
    width: 100%;
    margin-right: 0;
}

.cross-list-selector-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.cross-list-selector-dropdown .filter-group-btn {
    width: 100%;
    justify-content: space-between;
}

.cross-list-selector-dropdown .dropdown-menu {
    width: 100% !important;
    max-width: none !important;
}

.cross-list-selector-item .filter-state {
    width: 24px;
    text-align: center;
}

.cross-list-selector-item .filter-state i,
.cross-list-selector-item .comparison-selector-icon {
    color: var(--text-secondary) !important;
}

.cross-list-selector-item:not(.is-selected) .filter-state i {
    opacity: 0.72;
}

.cross-list-selector-item.is-selected {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.cross-list-selector-item.is-selected:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.cross-list-selector-item.is-selected .tag-name {
    color: var(--text-primary) !important;
}

.cross-list-selector-item.is-selected .filter-state i {
    color: var(--sidebar-accent) !important;
}

.cross-list-comparison-panels {
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
    align-items: stretch;
    margin-bottom: 1.25rem;
}

.cross-list-comparison-panels .comparison-panel {
    height: auto;
    align-self: start;
    width: 100%;
    margin: 0 0 0.45rem 0 !important;
    animation: comparisonPanelSlideIn 0.28s ease;
    transform-origin: top center;
}

.cross-list-comparison-panels .comparison-panel.is-removing {
    animation: comparisonPanelSlideOut 0.28s ease forwards;
}

.cross-list-comparison-panels .comparison-panel:last-child {
    margin-bottom: 0 !important;
}

.comparison-panel-list-title {
    line-height: 1.2;
    opacity: 0.78;
}

@keyframes comparisonPanelSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes comparisonPanelSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

@media (max-width: 991.98px) {
    .cross-list-comparison-panels {
        margin-bottom: 1.25rem;
    }
}

.filter-group-dropdown .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-group-dropdown .dropdown-header {
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.tag-group-search {
    padding: 0 0.65rem 0.5rem;
}

.tag-group-search input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    height: 32px;
}

.tag-group-empty {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-group-dropdown .dropdown-item.tag-filter-item {
    padding: 0.6rem 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.filter-group-dropdown .dropdown-item.tag-filter-item:hover {
    background-color: var(--bg-tertiary) !important;
}

.filter-group-dropdown .dropdown-item.tag-filter-item .tag-name {
    flex: 1 !important;
    font-size: 0.95rem !important;
    color: var(--text-primary) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-right: 1rem !important;
    display: block !important;
    line-height: 1.5 !important;
}

.filter-group-dropdown .dropdown-item.tag-filter-item .filter-state {
    flex-shrink: 0 !important;
    width: 24px !important;
    text-align: center !important;
    display: block !important;
}

.filter-group-dropdown .dropdown-item.tag-filter-item .filter-state i {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Стилі для активних фільтрів
   Default: blue background for pages that still rely on it.
   List/tier views: text-only accent (like hover), no ring/bg. */
body:not(.list-view):not(.tier-list-view):not(.tournament-view):not(.stats-view) .filter-group-btn.has-filters {
    background: var(--info-color) !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.3);
}

body.list-view .filter-group-btn.has-filters,
body.tier-list-view .filter-group-btn.has-filters,
body.tournament-view .filter-group-btn.has-filters {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
    color: var(--sidebar-accent) !important;
}


/* Горизонтальний скролл для груп тегів */
.tag-group-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    gap: 0.5rem;
    padding-bottom: 4px;
}

.tag-group-list .filter-group-dropdown {
    flex: 0 0 auto;
}

.tag-group-list .filter-group-btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

/* Make tag-group titles closer together on list/tier pages */
body.list-view .tag-group-list,
body.tier-list-view .tag-group-list {
    gap: 0;
}

body.list-view .filter-group-dropdown,
body.tier-list-view .filter-group-dropdown {
    margin-right: 0;
}

body.list-view .filter-group-btn,
body.tier-list-view .filter-group-btn {
    padding: 0.4rem 0.75rem;
}

/* ===== Friends invite dropdown (games) ===== */
.friends-invite-dropdown {
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 320px;
    overflow-y: auto;
    padding: 0.35rem 0;
}
.friends-invite-dropdown .friend-invite-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text-primary);
}
.friends-invite-dropdown .friend-invite-item:hover {
    background: rgba(255,255,255,0.06);
}
.friends-invite-dropdown .friend-invite-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.friends-invite-dropdown .friend-invite-item .friend-invite-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
}
.friends-invite-dropdown .friend-invite-item .friend-invite-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.friends-invite-dropdown .friend-invite-item.invited .friend-invite-status {
    color: #22c55e;
}
.friends-invite-dropdown .friend-invite-empty {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.friends-invite-dropdown .friend-merge-invite-item.active {
    background: rgba(255,255,255,0.08);
}

/* ===== Merge friends picker (inline, DOM-based) ===== */
.merge-friends-container {
    max-height: 320px;
    overflow-y: auto;
    margin: 0 -0.25rem;
}
.merge-friend-entry {
    border-radius: 10px;
    margin-bottom: 0.25rem;
    transition: background 0.15s;
}
.merge-friend-entry:last-child {
    margin-bottom: 0;
}
.merge-friend-entry.open {
    background: rgba(255,255,255,0.04);
}
.merge-friend-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    border-radius: 10px;
    user-select: none;
    transition: background 0.15s;
}
.merge-friend-row:hover {
    background: rgba(255,255,255,0.06);
}
.merge-friend-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.merge-friend-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.merge-friend-chevron {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.merge-friend-entry.open .merge-friend-chevron {
    transform: rotate(180deg);
}
.merge-friend-search {
    padding: 0 0.4rem 0.4rem;
}
.merge-friend-search-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.38rem 0.65rem;
    font-size: 0.82rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}
.merge-friend-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.merge-friend-search-input:focus {
    border-color: rgba(251,191,36,0.4);
}
.merge-lists-panel {
    padding: 0.15rem 0.5rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.merge-list-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.42rem 0.6rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.merge-list-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(251,191,36,0.3);
}
.merge-list-btn.sent {
    border-color: rgba(34,197,94,0.3);
    pointer-events: none;
    opacity: 0.7;
}
.merge-list-title {
    flex: 1;
    min-width: 0;
    font-size: 0.83rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.merge-list-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.merge-list-btn.sent .merge-list-status {
    color: #22c55e;
}
.merge-lists-empty,
.merge-lists-loading {
    font-size: 0.8rem;
}

/* Legacy merge dropdown styles (kept for compat) */
.invite-friend-btn {
    border-color: rgba(251,191,36,0.5) !important;
    color: #fbbf24 !important;
}
.invite-friend-btn:hover {
    background: rgba(251,191,36,0.12) !important;
    border-color: #fbbf24 !important;
}

/* ===== Game invite toast notifications ===== */
.game-invite-toast {
    min-width: 280px;
    max-width: 360px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    color: var(--text-primary);
}
.game-invite-toast .toast-header {
    border-bottom: 1px solid var(--border-color);
}
.game-invite-toast .toast-body {
    font-size: 0.9rem;
}

/* ===== Navbar Notifications Dropdown ===== */
.nav-notif-wrapper {
    position: relative;
}
.nav-notif-bell {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    font-size: 1.15rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.15s;
    border-radius: var(--radius-sm, 6px);
}
.nav-notif-bell:hover {
    color: var(--text-primary, #e2e8f0);
    background: rgba(255,255,255,0.06);
}
.nav-notif-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: #ef4444;
    border-radius: 999px;
    pointer-events: none;
}
.nav-notif-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 370px;
    max-height: 480px;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: var(--radius-md, 10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.nav-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-color, #334155);
    flex-shrink: 0;
}
.nav-notif-header-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary, #e2e8f0);
}
.nav-notif-mark-all {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm, 6px);
    transition: color 0.15s, background 0.15s;
}
.nav-notif-mark-all:hover {
    color: var(--info-color, #60a5fa);
    background: rgba(96,165,250,0.1);
}
.nav-notif-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nav-notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
}
.notif-item {
    display: flex;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    cursor: default;
}
.notif-item:last-child {
    border-bottom: none;
}
.notif-item:hover {
    background: rgba(255,255,255,0.04);
}
.notif-item.notif-unread {
    background: rgba(96,165,250,0.06);
    border-left: 3px solid var(--info-color, #60a5fa);
}
.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    margin-top: 2px;
}
.notif-item-body {
    flex: 1;
    min-width: 0;
}
.notif-item-message {
    font-size: 0.85rem;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.4;
    word-wrap: break-word;
}
.notif-item-message strong {
    color: var(--info-color, #60a5fa);
}
.notif-user-link {
    color: inherit;
    text-decoration: none;
}
.notif-user-link:hover {
    text-decoration: underline;
}
.notif-user-link strong {
    color: var(--info-color, #60a5fa);
}
.notif-list-name {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.8rem;
}
.notif-game-label {
    display: inline-block;
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}
.notif-item-actions {
    margin-top: 0.35rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}
.notif-action-btn {
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}
.notif-action-btn:disabled {
    opacity: 0.5;
    cursor: default;
}
.notif-btn-primary {
    background: rgba(96,165,250,0.18);
    color: #60a5fa;
}
.notif-btn-primary:hover:not(:disabled) {
    background: rgba(96,165,250,0.3);
}
.notif-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary, #94a3b8);
}
.notif-btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.12);
}
.notif-action-done {
    font-size: 0.75rem;
    color: #34d399;
    font-weight: 500;
}
.notif-item-time {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.2rem;
}

@media (max-width: 480px) {
    .nav-notif-dropdown {
        width: calc(100vw - 1rem);
        right: -3rem;
    }
}

/* ===== Shared game lobby player board ===== */
.game-lobby-board {
    width: 100%;
    margin: 0.5rem auto 0;
    max-width: 720px;
}
.game-lobby-board__header {
    text-align: center;
    margin-bottom: 0.9rem;
}
.game-lobby-board__title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8f9fa;
    letter-spacing: 0.03em;
}
.game-lobby-board__subtitle {
    margin-top: 0.3rem;
    font-size: 0.88rem;
    color: var(--bs-secondary-color, #adb5bd);
    font-weight: 600;
}
.game-lobby-board__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.game-lobby-player-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #161B22;
    border-radius: 14px;
    padding: 14px 18px;
    border: 1px solid #23272b;
    animation: gamePlayerFadeIn 0.3s ease;
}
@keyframes gamePlayerFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.game-lobby-player-rank {
    min-width: 42px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.game-lobby-player-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex: 0 0 46px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}
.game-lobby-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-lobby-player-initials {
    font-size: 0.9rem;
    font-weight: 700;
    color: #90caf9;
    text-transform: uppercase;
}
.game-lobby-player-main {
    flex: 1;
    min-width: 0;
    text-align: left;
}
.game-lobby-player-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.game-lobby-player-meta {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    color: var(--bs-secondary-color, #adb5bd);
}
.game-lobby-player-badges {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.game-lobby-player-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: #d7dee6;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.game-lobby-player-pill--me {
    color: #fff;
}
.game-lobby-player-pill--host {
    color: #9bd5ff;
    border-color: rgba(155,213,255,0.24);
    background: rgba(155,213,255,0.08);
}
.game-lobby-player-pill--ready {
    color: #b8f7c5;
    border-color: rgba(86, 204, 242, 0.22);
    background: rgba(39, 174, 96, 0.12);
}
.game-lobby-player-pill--turn {
    color: #90caf9;
    border-color: rgba(144,202,249,0.24);
    background: rgba(144,202,249,0.08);
}
@media (max-width: 575.98px) {
    .game-lobby-player-row {
        gap: 12px;
        padding: 12px 14px;
    }
    .game-lobby-player-rank {
        min-width: 34px;
        font-size: 0.92rem;
    }
    .game-lobby-player-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
    .game-lobby-player-name {
        font-size: 0.95rem;
    }
}

/* Shared room code block styling */
.room-code-block {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.room-code-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.room-code-input {
    width: clamp(150px, 26vw, 220px);
    flex: 0 0 auto;
}

/* Shared start button */
.btn-start {
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.55rem 2.2rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

/* Fix: prevent hover/active translate that causes elements to appear to drop
   (some generic .btn or :hover rules lift elements -1px, then on click they return
   to translateY(0), producing a visible downward 'jump'). Force no transform
   for tag/group controls and the dropdown items used for tags. */
.filter-group-btn,
.filter-group-btn:hover,
.filter-group-btn:active,
.filter-group-btn:focus,
.tag,
.tag:hover,
.dropdown-item.tag-filter-item,
.dropdown-item.tag-filter-item:hover,
.dropdown-item.tag-filter-item:active,
.dropdown-item.tag-filter-item:focus,
.filter-group-dropdown .dropdown-item.tag-filter-item .tag-name {
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Shared pairing controls (tournament / guess-who) */
.pairing-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.pairing-control {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pairing-control--compact {
    flex: 0 0 auto;
}

.pairing-control--centered {
    align-items: center;
    text-align: center;
}

.pairing-control label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa4b3;
}

.pairing-select {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary, #f5f5f5);
    padding: 8px 10px;
    font-size: 0.9rem;
    width: 100%;
}

.pairing-input {
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary, #f5f5f5);
    padding: 8px 10px;
    font-size: 0.9rem;
    width: 90px;
    max-width: 90px;
}

.pairing-input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

.pairing-input:focus-visible {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

.pairing-select:focus,
.pairing-select:focus-visible {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

.pairing-input--centered {
    margin: 0 auto;
}

/* Tier builder layout */
.tier-builder-root {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
    box-shadow: none;
}

.tier-builder-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tier-actions-left,
.tier-actions-right {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tier-add-row-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tier-add-row-control input {
    width: 70px;
    min-width: 60px;
    max-width: 90px;
    text-align: center;
    background: rgba(13, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #f5f5f5);
    border-radius: 10px;
    padding: 0.25rem 0.45rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tier-add-row-control input:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

.tier-add-row-control input::-webkit-inner-spin-button,
.tier-add-row-control input::-webkit-outer-spin-button,
.pairing-input::-webkit-inner-spin-button,
.pairing-input::-webkit-outer-spin-button {
    filter: invert(72%) sepia(0%) saturate(0%) hue-rotate(180deg) brightness(80%) contrast(90%);
}

.tier-actions-center {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.tier-template-save {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tier-template-save input {
    width: 190px;
    min-width: 140px;
    max-width: 250px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tier-template-save input:focus {
    border-color: var(--bs-primary);
    box-shadow: none !important;
}

.tier-template-save button {
    white-space: nowrap;
}

.tier-color-template {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.25rem;
    min-width: 68px;
    min-height: 44px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tier-color-template.active {
    border-color: var(--info-color);
    box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.45);
}

.tier-color-template.locked::after {
    content: "\f023";
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.75rem;
    color: #ffd166;
}

.tier-color-preview {
    display: flex;
    gap: 0.15rem;
    width: 100%;
}

.tier-color-preview span {
    flex: 1;
    height: 32px;
    border-radius: 5px;
}

.tier-builder-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    position: relative;
    min-height: 360px;
    overflow: visible;
}

.tier-board {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    background: var(--bg-primary);
    max-width: 96%;
    width: 96%;
    margin-left: auto;
    margin-right: auto;
}
.tier-board.tier-builder-exporting .tier-builder-export-title {
    display: block;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.05;
    padding: 0.1rem 0 0.2rem;
    margin: 0 0 0.7rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.tier-board.tier-builder-exporting .tier-row {
    margin-top: 0.25rem;
}

.tier-board.tier-builder-exporting .tier-row-label {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tier-row {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    position: relative;
    overflow: visible;
}

.tier-row-end {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    align-self: stretch;
    justify-content: flex-end;
    background: transparent;
}

.tier-row-label-column {
    width: 110px;
    min-width: 110px;
    flex: 0 0 110px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.tier-row-label-column-has-image {
    align-items: center;
}

.tier-row-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    flex-shrink: 0;
}

.tier-row-label {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 110px;
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    box-shadow: none;
    border: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.1;
    cursor: pointer;
    gap: 0.45rem;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.tier-board.tier-builder-exporting .tier-row-label-column {
    width: 110px !important;
    min-width: 110px !important;
    flex: 0 0 110px !important;
}

.tier-row-label-has-image {
    padding: 0;
    min-height: 0;
    justify-content: center;
    align-items: stretch;
    overflow: hidden;
}

.tier-row-label-media {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    border-radius: 6px;
    overflow: hidden;
    line-height: 1;
}

.tier-row-label-image {
    position: static;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0;
    display: block;
    box-shadow: none;
}

.tier-row-label-text {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.1;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tier-row-label-has-image .tier-row-label-text {
    max-width: 100%;
    margin: 0;
    padding: 0.4rem 0.45rem 0.5rem;
    border-radius: 0;
    background: transparent;
    text-shadow: none;
    position: static;
}

.tier-inline-input {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    width: 100%;
    outline: none;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.1;
    padding: 0;
}

.tier-row-controls,
.tier-row-btn,
.tier-row-handle {
    display: none;
}

.tier-row-actions {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
    background: transparent;
    border-left: none;
    padding: 0;
    min-height: auto;
    align-self: center;
}

.tier-row-actions .tier-row-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 0;
    font-size: 1rem;
}

.tier-row-actions .tier-row-btn .fas {
    line-height: 1;
}

.tier-board.tier-builder-exporting .tier-row-actions {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    width: 0 !important;
    border-left: none !important;
    padding: 0 !important;
}

.tier-board.tier-builder-exporting .tier-row-end {
    gap: 0 !important;
}


.tier-row-actions .tier-row-btn:hover {
    border-color: var(--info-color);
    color: var(--text-primary);
}
.tier-trash-inline {
    position: absolute;
    top: 50%;
    right: -190px;
    transform: translateY(-50%);
    width: 170px;
    padding: 0.75rem;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    gap: 0.35rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.tier-trash-inline i {
    font-size: 1rem;
}
.tier-trash-inline .tier-trash-inline-inner {
    pointer-events: none;
}
.tier-trash-inline--active {
    border-color: var(--danger-color);
    color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(218, 54, 51, 0.2);
    background: rgba(218, 54, 51, 0.06);
}
.tier-row-trash-visible .tier-trash-inline {
    opacity: 1;
    pointer-events: auto;
}
.tier-row-items {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 110px;
    padding: 0;
    border-radius: 0;
    background: var(--bg-secondary);
}

.tier-row-accent {
    display: block;
    flex-shrink: 0;
    width: 6px;
    border-radius: 0 3px 3px 0;
    align-self: stretch;
}

.tier-edit-row-wrapper {
    margin-top: 1rem;
    width: 100%;
}

.tier-edit-row-wrapper .tier-row {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tier-edit-row-wrapper .tier-row-edit-dropzone {
    min-height: 120px;
}

.tier-row-edit {
    background: rgba(255, 255, 255, 0.02);
}

.tier-row-edit .tier-row-label {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.tier-row-edit .tier-row-accent {
    background: var(--sidebar-accent);
}

.tier-row-edit-dropzone {
    flex: 1;
    min-height: 130px;
    border: 1px dashed var(--border-color);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--bg-secondary);
    text-align: center;
}

.tier-row-edit-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.3;
}

.tier-row-edit-link-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.tier-row-edit-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tier-row-edit-dropzone.tier-row-edit-with-card {
    justify-content: flex-start;
    align-items: flex-start;
}

.tier-row-edit-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.tier-row-edit-card {
    flex: none;
}

.tier-row-edit-card .tier-card {
    width: auto;
}

.tier-row-edit-item {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tier-row-edit-link {
    color: var(--info-color);
    font-weight: 600;
    text-decoration: none;
}

.tier-row-edit-link:hover {
    text-decoration: underline;
}

.tier-color-modal {
    pointer-events: none;
}
.tier-color-modal .modal-dialog {
    pointer-events: auto;
    max-width: 360px;
    width: min(360px, calc(100vw - 2rem));
}

.tier-color-modal .modal-content {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
}

.tier-color-modal .modal-body {
    background: transparent;
    padding: 1rem 1.25rem;
}

.tier-color-modal .form-control,
.tier-color-modal .form-control-sm {
    background: #0d1117;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.tier-color-modal .form-control-color {
    height: 3.2rem;
    padding: 0;
}

.tier-color-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    max-width: 300px;
    margin: 0 auto;
    width: 100%;
}

.tier-color-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
}

.tier-color-item .form-control-color {
    width: 100%;
}

.tier-image-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tier-image-preview {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tier-image-preview img {
    width: 100%;
    max-width: 200px;
    max-height: 110px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.color-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.tier-column-empty {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tier-column-hover {
    border-color: rgba(13, 110, 253, 0.8) !important;
    background: rgba(13, 110, 253, 0.03);
}

.tier-row-over {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
}

.tier-pool-wrapper {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.tier-pool-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.tier-pool-header-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tier-pool-header-controls select {
    min-width: 160px;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    transition: border-color 0.2s ease;
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
}
.tier-pool-header-controls select:hover,
.tier-pool-header-controls select:focus,
.tier-pool-header-controls select:focus-visible {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
    outline: none;
    box-shadow: none;
    transform: translateY(-1px);
}
.tier-pool-header-controls select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.tier-item-pool {
    border: none;
    padding: 0;
    min-height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    background: transparent;
}

.tier-item-pool {
    min-height: 180px;
    padding: 0.5rem;
    border-radius: 6px;
    background: var(--bg-primary);
    align-items: center;
    justify-content: flex-start;
}

.tier-item-pool.empty {
    justify-content: center;
}

.tier-card {
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.tier-card.dragging {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
    transform: scale(1.01);
}

.tier-item-pool .tier-pool-empty {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tier-card-image {
    width: 100%;
    height: 110px;
    overflow: hidden;
    border-radius: inherit;
    display: flex;
    justify-content: center;
    align-items: stretch;
    background: transparent;
}
.tier-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tier-card.tier-card--original .tier-card-image img {
    object-fit: contain;
    max-width: 100%;
}

.tier-builder-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}

.tier-builder-footer-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.tier-publish-inline {
    margin-top: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    align-self: flex-end;
    width: min(420px, 100%);
}

.tier-publish-inline p {
    margin: 0;
    font-size: 0.85rem;
    text-align: right;
}

.tier-publish-inline .btn {
    font-size: 0.85rem;
}

.tier-dropdown {
    width: min(320px, 80vw);
    max-width: 360px;
    position: absolute;
    padding: 0.5rem 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

.tier-template-search {
    padding: 0 1rem 0.25rem;
}

.tier-template-search input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-primary);
    height: 32px;
}

.tier-template-list {
    max-height: min(320px, 60vh);
    overflow-y: auto;
}

.tier-template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.tier-template-row:last-child {
    border-bottom: none;
}

.tier-template-row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.3rem;
}

.tier-template-actions {
    display: flex;
    gap: 0.35rem;
}

.tier-template-name {
    font-weight: 600;
    color: var(--text-primary);
}

.tier-template-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tier-template-row-end {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tier-template-lock-icon {
    margin-left: 0.35rem;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.tier-template-row.active,
.tier-template-row:hover {
    background: var(--bg-tertiary);
}

.tier-template-row.active {
    font-weight: 600;
    color: var(--text-primary);
}

.tier-template-row.active .tier-template-name {
    font-weight: 600;
    color: var(--text-primary);
}

.tier-template-row button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

.tier-template-empty {
    padding: 0.5rem;
    text-align: center;
    color: var(--text-muted);
}

.tier-published-library-wrapper {
    margin-top: 1.5rem;
}

.tier-published-library-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tier-published-sort-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tier-published-sort-select {
    min-width: 180px;
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.tier-published-sort-order-btn {
    width: 42px;
    height: 36px;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tier-published-sort-order-btn:hover {
    border-color: var(--info-color);
}

.tier-published-own-toggle {
    min-width: 120px;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    text-align: center;
    margin-left: auto;
}


.tier-published-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1200px) {
    .tier-published-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .tier-published-library-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.tier-published-board {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.tier-published-board:hover {
    border-color: var(--info-color);
    transform: translateY(-3px);
}

.tier-published-board-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tier-published-board-title {
    font-weight: 600;
    font-size: 1rem;
}

.tier-published-board-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tier-published-persons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
    font-size: 0.8rem;
}
.tier-published-person-link {
    color: var(--text-primary);
    text-decoration: underline;
}

.tier-published-board-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.tier-published-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    align-items: center;
}
.tier-published-row-label {
    border-radius: 999px;
    padding: 0.2rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.25rem;
}

.tier-published-row-label-has-image {
    border-radius: 14px;
    padding: 0.3rem 0.75rem;
}

.tier-published-row-label-image {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: contain;
    display: block;
}

.tier-published-row-label-text {
    display: inline-block;
}
.tier-published-row-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 2.25rem;
}
.tier-published-item-thumb {
    width: 44px;
    height: 66px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    display: flex;
}
.tier-published-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tier-published-item-empty {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f1f1;
}
.tier-published-delete-confirm {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
}
.tier-published-items-more {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.tier-published-row-overflow .tier-published-row-label {
    background: transparent;
    color: var(--text-muted);
}
.tier-published-row-overflow .tier-published-row-items {
    justify-content: flex-start;
}
.tier-published-overflow-indicator {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.4em;
}
