:root {
    color-scheme: light;
    --bg: #f5f4f0;
    --bg-spot-1: rgba(31, 122, 140, 0.14);
    --bg-spot-2: rgba(243, 186, 102, 0.22);
    --surface: #ffffff;
    --surface-muted: #f7f9fa;
    --border: rgba(21, 33, 54, 0.12);
    --text: #1b2430;
    --text-muted: #6b7280;
    --primary: #1f7a8c;
    --primary-strong: #155d69;
    --coin-gold: #ffc107;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 14px 28px rgba(15, 23, 42, 0.12);
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: calc(15px * var(--font-scale, 1));
    line-height: 1.55;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 450px at 8% -10%, var(--bg-spot-1), transparent 60%),
        radial-gradient(700px 420px at 92% 0%, var(--bg-spot-2), transparent 65%),
        linear-gradient(180deg, #f7f3ea 0%, #f4f6f8 45%, #eef3f7 100%);
    animation: pageFade 0.35s ease-out;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
    text-decoration: none;
}

h1 {
    font-size: clamp(1.4em, 2.2vw, 1.8em);
    letter-spacing: -0.01em;
}

h2 {
    font-size: clamp(1.2em, 1.8vw, 1.5em);
}

h4,
.h4-text {
    font-size: clamp(1.05em, 1.6vw, 1.25em);
}

.full-with-button {
    width: 100%;
}

.small-grey-text {
    font-size: 0.8em;
    color: var(--text-muted);
}

.user-list-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    flex: 0 0 32px;
}

.user-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-list-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-list-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-list-meta-row {
    display: block;
    margin-top: 2px;
    line-height: 1.2;
}

.member-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.member-role i {
    font-size: 0.9em;
}

.member-role-admin {
    border-color: rgba(29, 78, 216, 0.35);
    background: rgba(29, 78, 216, 0.16);
    color: #1d4ed8;
}

.member-role-moderator {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.16);
    color: #0f766e;
}

.member-role-registered {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.16);
    color: #16a34a;
}

.member-role-crown {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.channel-item {
    transition: all 0.2s ease;
    max-height: 200px;
}

.channel-item.filtered-out {
    opacity: 0;
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

#searchStatus {
    font-size: 0.875rem;
    pointer-events: none;
}

.games-page .games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.games-page .games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.game-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: rgba(31, 122, 140, 0.25);
}

.game-item summary {
    list-style: none;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(31, 122, 140, 0.12), rgba(255, 193, 7, 0.08));
    position: relative;
}

.game-item summary::-webkit-details-marker {
    display: none;
}

.game-item[open] summary {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(31, 122, 140, 0.18), rgba(255, 193, 7, 0.12));
}

.game-item summary::after {
    content: "▾";
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.9em;
    transition: transform 0.2s ease;
}

.game-item[open] summary::after {
    transform: rotate(-180deg);
}

.game-body {
    padding: 14px 16px 16px;
    background: var(--surface);
}

.game-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: var(--shadow-sm);
}

.game-pill i {
    font-size: 1.05em;
}

.game-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px dashed var(--border);
    background: rgba(31, 122, 140, 0.1);
    color: var(--text);
    font-size: 0.85em;
}

.game-block {
    margin-bottom: 12px;
}

.game-block-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.game-list {
    padding-left: 1.1rem;
    margin: 0;
}

.game-commands {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.game-commands li {
    margin-bottom: 4px;
}

.game-commands li:last-child {
    margin-bottom: 0;
}

.game-table {
    overflow-x: auto;
}

.game-table .table {
    margin-bottom: 0;
    font-size: 0.85em;
}

.register-hint-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.register-hint-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.help-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.game-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.game-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1em;
    box-shadow: var(--shadow-sm);
}

.game-title {
    font-weight: 700;
}

.game-section-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.game-list {
    padding-left: 1.1rem;
    margin: 0 0 10px;
}

.game-commands {
    list-style: none;
    padding: 8px 12px;
    margin: 0 0 10px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.game-commands li {
    margin-bottom: 4px;
}

.game-commands li:last-child {
    margin-bottom: 0;
}

.game-table {
    overflow-x: auto;
}

.game-table .table {
    margin-bottom: 0;
}

.text-muted,
.form-text,
.small.text-muted,
small.text-muted {
    color: var(--text-muted) !important;
}

.main-logo {
    width: 72px;
    display: block;
    margin: auto;
}

.navbar {
    margin-bottom: 6px !important;
    padding-bottom: 6px !important;
    padding-top: 6px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
    overflow: visible;
}

.navbar .container {
    gap: 12px;
    overflow: visible;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand img {
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.chat-channel-display {
    flex: 0 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #4b5563;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-channel-icon {
    display: inline-flex;
    align-items: center;
}

.chat-channel-icon img {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.chat-channel-display i {
    font-size: 0.9em;
}

.chat-channel-text {
    display: inline-block;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: #4b5563;
    font-size: 0.72rem;
    text-transform: lowercase;
    letter-spacing: 0.03em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-channel-text .chat-channel-icon {
    display: inline-flex;
    align-items: center;
    margin-right: -1px;
}

.chat-channel-name {
    display: inline-flex;
    align-items: center;
}

.chat-navbar .container {
    flex-wrap: nowrap;
}

.chat-navbar .navbar-brand {
    margin-right: 8px;
}

@media (max-width: 576px) {
    .chat-channel-display {
        gap: 2px;
        max-width: 140px;
    }

    .chat-channel-text {
        padding: 2px 6px;
        font-size: 0.65rem;
    }

    .chat-navbar .navbar-brand {
        margin-right: 4px;
    }
}

.chat-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-left: auto;
    overflow: visible;
}

.chat-navbar {
    position: relative;
    z-index: 1050;
}

.chat-navbar .nav-actions .dropdown {
    position: relative;
}

.chat-navbar .dropdown-menu {
    z-index: 2000;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.chat-navbar .nav-actions .btn {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px !important;
    line-height: 1 !important;
    padding: 0 10px;
    vertical-align: middle;
    border-radius: 10px !important;
}

.chat-navbar .nav-actions .btn i {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.navbar .btn i {
    font-size: 1.25em;
}

.navbar .btn i.nav-icon-lg {
    font-size: 1.4em;
}

.chat-navbar .nav-actions .btn-group {
    display: inline-flex;
    align-items: center;
    height: 32px;
}

.chat-navbar .nav-actions.nav-actions-overflow {
    display: none;
}

.header-layout-overflow .nav-actions.nav-actions-overflow {
    display: flex;
}

.header-layout-overflow .nav-actions.nav-actions-full {
    display: none;
}

.header-layout-pill .nav-actions-full,
.header-layout-pill .nav-actions-admin {
    padding: 4px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.header-layout-pill .nav-actions-full .btn,
.header-layout-pill .nav-actions-admin .btn {
    border-radius: 999px;
    padding: 6px 10px;
}

.header-layout-sticky {
    position: sticky;
    top: 0;
    z-index: 1050;
}

.header-layout-sticky .container {
    padding-top: 4px;
    padding-bottom: 4px;
}

.container {
    max-width: 760px;
    padding-left: clamp(0.8em, 3vw, 1.6em);
    padding-right: clamp(0.8em, 3vw, 1.6em);
}

.message-block {
    padding: 0;
    margin-bottom: 6px;
    display: grid;
    gap: 8px;
}

.chat-card {
    margin-bottom: 0 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.chat-card-body {
    padding: clamp(0.533em, 1.6vw, 0.8em) clamp(0.667em, 2vw, 0.933em) !important;
}

.chat-message-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: 0 0 36px;
    background: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: 600;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.chat-message-content {
    flex: 1 1 auto;
    min-width: 0;
}

.chat-sys-text {
    font-style: italic;
    font-size: 0.867em;
    color: var(--text-muted);
}

.chat-time-text {
    color: var(--text-muted);
    font-size: 0.733em;
    margin-left: 4px;
}

.chat-message-text {
    line-height: 1.55;
}

.chat-grouped-row {
    margin-top: 0.12rem;
    margin-bottom: 0.12rem;
    padding-left: 26px;
    position: relative;
}

.chat-card-body.chat-avatars-enabled .chat-grouped-row {
    padding-left: 0;
}

.chat-grouped-lead {
    margin-bottom: 0.12rem;
}

.chat-grouped-row .chat-time-text {
    font-size: 0.65em;
}

.chat-footer-meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1;
}

.chat-footer-meta .chat-time-text {
    margin-left: 4px;
}

.chat-footer-icon,
.chat-footer-emoji {
    display: inline-flex;
    align-items: center;
}

.chat-footer-icon {
    font-size: 12px;
}

.chat-footer-meta i {
    line-height: 1;
}

.emoji-preview {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f9fa;
}

.emoji-preview-large {
    width: auto;
    height: auto;
    max-width: 250px;
    max-height: 250px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 1px solid var(--border);
    display: inline-block;
}

@media (max-width: 576px) {
    .emoji-preview-large {
        max-width: 180px;
        max-height: 180px;
    }
}

.nav-icon-lg {
    font-size: 1.4em;
    line-height: 1;
}

.ti-coin {
    color: var(--coin-gold);
}

.badge .ti-coin {
    color: #ffffff;
}

.nav-icon-coin {
    color: var(--coin-gold);
}

.nav-icon-btn.nav-coin-btn {
    border-color: var(--coin-gold) !important;
    color: var(--coin-gold) !important;
}

.nav-icon-btn.nav-coin-btn:hover {
    background-color: rgba(255, 193, 7, 0.18);
    border-color: var(--coin-gold) !important;
    color: var(--coin-gold) !important;
}

.nav-icon-btn.nav-coin-btn:focus {
    box-shadow: 0 0 0 0.15rem rgba(255, 193, 7, 0.25);
}
.nav-icon-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: 10px !important;
}

@media (min-width: 992px) {
    .nav-icon-btn.d-none.d-lg-inline-block {
        display: inline-flex !important;
    }
}

.nav-icon-btn i {
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px;
}

.nav-online-btn {
    width: auto !important;
    min-width: 32px;
    padding: 0 8px !important;
    gap: 4px;
    white-space: nowrap;
}

.nav-online-btn i {
    font-size: 1em;
}

.nav-online-btn .online-counter {
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.chat-gif {
    display: inline-block;
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 4px;
}

.gif-picker {
    display: none;
    margin-top: 6px;
}

.gif-picker.is-open {
    display: block;
}

.gif-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.gif-title {
    font-size: 0.8em;
    color: var(--text-muted);
}

.gif-preview-wrapper {
    display: flex;
    justify-content: center;
}

.gif-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gif-error {
    color: #dc2626;
    font-size: 0.8em;
}

.nick {
    color: #1c658c;
    cursor: pointer;
}

.nick:hover {
    color: #154260;
}

.nick-red {
    color: #d93434 !important;
}

.nick-green {
    color: #2b8a3e;
}

.nick-blue {
    color: #2a6fdb;
}

.nick-pink {
    color: #e88080 !important;
}

.nick-red:hover {
    color: #c02424 !important;
}

.nick-green:hover {
    color: #1f6b2e;
}

.nick-blue:hover {
    color: #1f5ab3;
}

.nick-pink:hover {
    color: #d46f6f !important;
}

.pm-icon {
    position: relative;
    bottom: 1px;
}

.grid {
    --cell-size: 22px;
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-gap: 2px;
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    text-align: center;
    vertical-align: middle;
    line-height: var(--cell-size);
    border: 1px solid #9ec5fe;
    border-radius: 4px;
    font-size: clamp(0.8em, 2.6vw, 0.933em);
    background: #f8fafc;
}

.correct-cell {
    background-color: #198754;
    color: white;
}

.btn {
    font-size: 0.933em;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 7px 14px;
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease,
        border-color 0.2s ease, color 0.2s ease;
}

.btn:focus {
    box-shadow: 0 0 0 0.15rem rgba(31, 122, 140, 0.18);
}

.btn-sm {
    font-size: 0.8em;
    padding: 6px 10px;
    border-radius: 10px;
}

.badge {
    color: #ffffff !important;
}

.badge.bg-primary,
.badge.bg-warning,
.badge.bg-success,
.badge.bg-info,
.badge.bg-secondary,
.badge.bg-danger {
    background-color: var(--coin-gold) !important;
    border-color: var(--coin-gold) !important;
    color: #ffffff !important;
}

.badge.bg-success.badge-keep-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(31, 122, 140, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-strong);
    border-color: var(--primary-strong);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.alert {
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.867em;
    border-radius: var(--radius);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #f0fbf3;
    border-color: rgba(34, 197, 94, 0.25);
    color: #14532d;
}

.alert-primary {
    background: #ecf7f8;
    border-color: rgba(31, 122, 140, 0.25);
    color: #124654;
}

.alert-danger {
    background: #fdf1f2;
    border-color: rgba(239, 68, 68, 0.25);
    color: #991b1b;
}

.list-group {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.list-group-item {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    padding: 8px 12px;
    font-size: 0.933em;
}

.message-preview {
    white-space: pre-wrap;
    word-break: break-word;
}

.channels-list .list-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.channels-list .channel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    color: inherit;
}

.channels-list .channel-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.channels-list .channel-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.06);
    color: #6c757d;
    flex-shrink: 0;
    overflow: hidden;
}

.channels-list .channel-icon img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.channels-list .channel-icon.is-pinned {
    background: rgba(255, 193, 7, 0.15);
    color: #b58100;
}

.channel-logo-preview {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-logo-image {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

.channel-logo-placeholder {
    font-weight: 700;
    font-size: 1.4rem;
    color: #6c757d;
}

.channel-logo-inline {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 6px;
    vertical-align: -3px;
}

.channels-list .channel-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channels-list .channel-title {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channels-list .channel-desc {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.channels-list .channel-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6c757d;
}

.channels-list .channel-meta .badge {
    font-size: 0.7rem;
}

.badge-owner,
.badge-moderator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
}

.badge-owner {
    border-color: rgba(29, 78, 216, 0.35);
    background: rgba(29, 78, 216, 0.16);
    color: #1d4ed8;
}

.badge-moderator {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.16);
    color: #0f766e;
}

.badge-owner i,
.badge-moderator i {
    font-size: 0.9em;
}

.channels-list .channel-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid rgba(25, 135, 84, 0.25);
    background: rgba(25, 135, 84, 0.12);
    color: #198754;
}

.channels-list .channel-flag-registered {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.16);
    color: #16a34a;
}

.channels-list .channel-flag-manage {
    border-color: rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.18);
    color: #0ea5e9;
}

.channels-list .channel-manage-inline {
    cursor: pointer;
}

.channels-list .channel-flag-private {
    border-color: rgba(108, 117, 125, 0.3);
    background: rgba(108, 117, 125, 0.12);
    color: #6c757d;
}

.channels-list .channel-flag-password {
    border-color: rgba(219, 39, 119, 0.35);
    background: rgba(219, 39, 119, 0.16);
    color: #db2777;
}

.channels-list .channel-badge {
    flex: 0 0 auto;
}

.channels-list .channel-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

.channel-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.channel-filter-count {
    font-weight: 600;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    font-size: 0.933em;
    background-color: var(--surface);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(31, 122, 140, 0.4);
    box-shadow: 0 0 0 0.15rem rgba(31, 122, 140, 0.18);
}

#messageBox {
    font-size: 0.933em;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
}

#chatSuggestions,
.chat-suggestions {
    display: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
}

.chat-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9em;
}

.chat-suggestion-label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-suggestion-item.active,
.chat-suggestion-item:hover {
    background: var(--surface-muted);
}

.chat-suggestion-emoji img {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    object-fit: contain;
    display: block;
}

#messageBox::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
}

#sendButton {
    font-size: 0.933em;
    padding: 9px 12px;
}

.chat-input-readonly {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.chat-input-readonly i {
    font-size: 0.95rem;
}

.chat-input-wrapper.is-readonly {
    opacity: 0.8;
}

#quizBox {
    padding: 8px 10px;
    margin-bottom: 6px;
}

/* User Menu Dropdown */
.user-menu-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0;
    position: relative;
    height: 32px !important;
    width: 32px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 10px !important;
    line-height: 1 !important;
}

.user-menu-btn::after {
    display: none !important;
}

.user-menu-btn i {
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}


.user-menu-icon {
    font-size: 1em;
    line-height: 1;
    width: 1rem;
    text-align: center;
}

.user-menu-icon-user {
    display: none;
}

.user-menu-name {
    display: inline-block;
    max-width: 140px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .user-menu-name {
        max-width: 110px;
    }
}

@media (max-width: 420px) {
    .user-menu-name {
        display: none !important;
    }

    .user-menu-icon-at {
        display: none;
    }

    .user-menu-icon-user {
        display: inline-block;
    }
}

.user-menu-dropdown {
    min-width: 17.5rem;
    padding: 0.5rem 0;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.user-menu-dropdown .dropdown-header {
    font-size: 0.6875em;
    text-transform: uppercase;
    font-weight: 600;
    color: #6c757d;
    padding: 0.5rem 1rem 0.25rem;
}

.user-menu-dropdown .dropdown-item-text {
    padding: 0.375rem 1rem;
    font-size: 0.8125em;
}

.user-menu-dropdown .dropdown-item-text strong {
    font-size: 0.875em;
    color: #212529;
}

.user-menu-dropdown .dropdown-divider {
    margin: 0.375rem 0;
}

.user-menu-dropdown .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.8125em;
}

.user-menu-dropdown .dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

.user-menu-dropdown .dropdown-item.text-danger:hover {
    background-color: #dc3545;
    color: white !important;
}

/* Shop Styles */
.shop-filters-sticky {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
}

.shop-card-compact .card-body {
    padding: 0.75rem;
}

.nickname-color-preview {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    display: inline-block;
}

.nickname-color-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nickname-color-picker {
    width: 44px;
    height: 32px;
    padding: 0.125rem;
}

.nickname-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nickname-font-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.nickname-font-select {
    min-width: 140px;
    flex: 1 1 160px;
}

.nickname-font-preview {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    font-size: 0.85em;
    white-space: nowrap;
}

.nickname-color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 0;
    cursor: pointer;
}

.nickname-color-swatch:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.custom-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.733em;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--primary);
}

.custom-badge i {
    font-size: 0.8em;
}

.custom-badge-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.custom-badge-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-badge-icon-btn.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(31, 122, 140, 0.2);
}

.custom-badge-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-icons-grid .icon-card {
    padding: 0.5rem;
}

.shop-icons-grid .icon-title {
    font-size: 0.75em;
}

.shop-icons-grid .icon-preview {
    font-size: 18px;
}

.shop-icons-grid .badge {
    font-size: 0.625em;
}

.shop-icons-grid .btn {
    font-size: 0.6875em;
    padding: 0.1875rem 0.375rem;
}

.shop-icons-grid .form-select,
.shop-icons-grid .form-control {
    font-size: 0.6875em;
    padding: 0.25rem 0.375rem;
}

.shop-pagination {
    gap: 0.5rem;
}

/* Language Switcher */
.lang-switcher {
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75em;
    font-weight: 600;
}

.lang-switcher-active {
    background: #1f7a8c;
    color: white;
}

.lang-switcher-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Utility Classes */
.font-size-11 {
    font-size: 0.6875em;
}

.font-size-12 {
    font-size: 0.75em;
}

.font-size-16 {
    font-size: 1em;
}

.font-size-18 {
    font-size: 1.125em;
}

.display-none {
    display: none;
}

.pm-counter {
    display: none;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .navbar .container {
        gap: 8px;
    }

    .navbar .d-flex {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
    }

    .chat-navbar .nav-actions {
        gap: 4px;
    }

    .chat-navbar .nav-actions .btn {
        height: 30px;
        padding: 0 8px;
    }

    .nav-icon-btn {
        width: 30px;
    }

    .nav-icon-lg {
        font-size: 1.25em;
    }

    .header-layout-pill .nav-actions-full,
    .header-layout-pill .nav-actions-admin {
        padding: 3px;
    }

    .navbar-brand {
        font-size: 0.933em;
    }

    .navbar-brand img {
        width: 28px;
        height: 28px;
    }

    .btn {
        padding: 6px 10px;
    }

    .btn-sm {
        font-size: 0.733em;
        padding: 5px 8px;
    }

    .chat-card-body {
        padding: 8px 10px !important;
    }

    .chat-gif {
        max-width: 100%;
        max-height: 240px;
    }

    .alert ul {
        padding-left: 16px;
        margin-bottom: 6px;
    }

    .grid {
        --cell-size: 18px;
    }

    .shop-filters-sticky {
        top: 0.5rem;
    }

    .shop-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .shop-pagination .btn {
        width: 100%;
    }

    .shop-icons-grid .icon-title {
        font-size: 0.6875em;
    }
}

@media (max-width: 768px) {
    input,
    textarea,
    select,
    .form-control,
    .form-select,
    #messageBox {
        font-size: 1.067em !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* VIP highlight */
.vip-highlight {
    position: relative;
    border-left: 3px solid rgba(246, 195, 67, 0.9);
    box-shadow: 0 0 0 1px rgba(246, 195, 67, 0.18);
    overflow: hidden;
}

.vip-highlight::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(246, 195, 67, 0.14), rgba(246, 195, 67, 0));
    pointer-events: none;
    z-index: 0;
}

.vip-highlight .chat-card-body {
    position: relative;
    z-index: 1;
}

/* Shop theme */
.shop-page .nav-tabs {
    border-bottom: 1px solid var(--border);
    gap: 6px;
}

.shop-page .nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    background: transparent;
    padding: 6px 12px;
}

.shop-page .nav-tabs .nav-link:hover {
    color: var(--primary);
    background: var(--surface-muted);
    border-color: var(--border);
}

.shop-page .nav-tabs .nav-link.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.shop-page .card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    color: var(--text);
}

.shop-page .list-group-item {
    border-color: var(--border);
    background: transparent;
}

.shop-page .badge.bg-primary,
.shop-page .btn.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.shop-page .btn.btn-primary:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

.shop-page .btn.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.shop-page .btn.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.shop-page .badge.bg-warning,
.shop-page .badge.bg-success,
.shop-page .badge.bg-info {
    background: var(--primary);
    color: #ffffff;
}

.shop-page .btn.btn-success {
    background: var(--primary);
    border-color: var(--primary);
}

.shop-page .btn.btn-success:hover {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

.shop-page .form-control,
.shop-page .form-select {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.shop-page .form-control:focus,
.shop-page .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.08);
}

.shop-page .alert {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

/* Shop navbar */
.shop-page .navbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
}

/* Shop navbar text */
.shop-page .navbar-light .navbar-brand,
.shop-page .navbar-light .navbar-nav .nav-link,
.shop-page .navbar-light .navbar-text {
    color: var(--text) !important;
}

.shop-page .navbar-light .navbar-nav .nav-link:hover,
.shop-page .navbar-light .navbar-nav .nav-link:focus {
    color: var(--primary) !important;
}

.shop-page .navbar-light .navbar-toggler {
    border-color: var(--border);
}

.shop-page .bg-light {
    background-color: var(--surface) !important;
}

/* Shop text contrast */
.shop-page {
    color: var(--text);
}

.shop-page .list-group-item,
.shop-page .form-label,
.shop-page .form-check-label {
    color: var(--text);
}

.shop-page .text-muted,
.shop-page .small.text-muted {
    color: var(--text-muted) !important;
}

.shop-buy-card {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.shop-buy-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.shop-buy-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    color: var(--primary);
    flex-shrink: 0;
}

.shop-buy-title {
    font-weight: 600;
}

.shop-buy-section-title {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.shop-buy-pack-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-buy-pack {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    background: var(--surface-muted);
}

.shop-buy-pack-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shop-buy-pack-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.shop-buy-pack-actions form {
    margin: 0;
}

.shop-buy-pack-price {
    font-weight: 600;
}

.shop-buy-steps {
    margin: 0;
    padding-left: 18px;
}

.shop-buy-steps li + li {
    margin-top: 4px;
}

.shop-buy-notes {
    display: grid;
    gap: 4px;
}

.shop-buy-actions {
    margin-top: auto;
}

.payment-status-modal .modal-dialog {
    max-width: 420px;
}

.payment-status-modal {
    --payment-glow: rgba(255, 214, 98, 0.55);
    --payment-glow-soft: rgba(255, 214, 98, 0.35);
    --payment-glow-secondary: rgba(110, 205, 255, 0.35);
    --payment-icon: var(--primary);
}

.payment-status-modal[data-status="cancel"] {
    --payment-glow: rgba(255, 107, 107, 0.55);
    --payment-glow-soft: rgba(255, 133, 95, 0.35);
    --payment-glow-secondary: rgba(255, 173, 115, 0.3);
    --payment-icon: #e03131;
}

.payment-status-modal .modal-content {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    overflow: hidden;
}

.payment-modal-hero {
    position: relative;
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, var(--payment-glow-soft), transparent 60%),
                radial-gradient(circle at 80% 0%, var(--payment-glow-secondary), transparent 50%),
                var(--surface-muted);
}

.payment-modal-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--payment-glow), rgba(255, 214, 98, 0));
    filter: blur(20px);
    animation: paymentGlow 2.8s ease-in-out infinite;
}

.payment-modal-image {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    background: #fff;
    padding: 8px;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    animation: paymentPop 0.5s ease-out both;
}

.payment-modal-icon {
    position: absolute;
    bottom: 18px;
    right: 18px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--payment-icon);
    font-size: 0.85rem;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

.payment-status-modal .modal-body {
    text-align: center;
    padding: 20px 24px 10px;
}

.payment-modal-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.payment-modal-message {
    margin-bottom: 6px;
}

.payment-modal-sub {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 0;
}

.payment-status-modal .modal-footer {
    border-top: 0;
    padding-top: 0;
    padding-bottom: 18px;
}

@keyframes paymentGlow {
    0% {
        transform: scale(0.92);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(0.92);
        opacity: 0.6;
    }
}

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

.account-page .avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.account-page .avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: #f1f3f5;
    color: #6c757d;
}

.account-avatar-page .avatar-preview,
.account-avatar-page .avatar-choice img,
.account-avatar-page .avatar-choice-placeholder,
.account-avatar-page .avatar-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.account-avatar-page .avatar-placeholder,
.account-avatar-page .avatar-choice-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f1f3f5;
    color: #6c757d;
}

.account-avatar-page .avatar-choice-placeholder {
    width: 64px;
    height: 64px;
    font-size: 14px;
}

.account-avatar-page .avatar-preview {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.account-avatar-page .avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.account-avatar-page .avatar-choice {
    display: block;
    cursor: pointer;
}

.account-avatar-page .avatar-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-avatar-page .avatar-choice-body {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 10px 8px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.account-avatar-page .avatar-choice input:checked + .avatar-choice-body {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
    transform: translateY(-2px);
}

.account-avatar-page .avatar-choice input:focus-visible + .avatar-choice-body {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.account-avatar-page .avatar-choice-label {
    font-size: 12px;
    color: #6c757d;
}

.profile-page .badge.bg-success {
    background-color: #198754 !important;
    border-color: #198754 !important;
}

.profile-page .badge.bg-info {
    background-color: #0dcaf0 !important;
    border-color: #0dcaf0 !important;
}

.profile-page .badge.bg-warning {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
}

.profile-page .badge.bg-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
}

.profile-page .profile-avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.profile-page .profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    font-size: 48px;
}

.profile-page .profile-stat-icon {
    font-size: 24px;
}

.profile-page .profile-stat-icon-wins {
    color: #10b981;
}

.profile-page .profile-stat-icon-time {
    color: #3b82f6;
}

.profile-page .profile-icon-card {
    min-width: 80px;
}

.profile-page .profile-icon {
    font-size: 32px;
}

.avatar-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    grid-template-areas: "controls preview";
}

.avatar-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.avatar-controls-card {
    grid-area: controls;
}

.avatar-preview-card {
    grid-area: preview;
}

.avatar-builder-layout .avatar-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.avatar-builder-layout .avatar-preview svg {
    width: min(150px, 100%);
    height: auto;
    max-height: 150px;
}

.avatar-controls {
    display: grid;
    gap: 8px;
}

.avatar-control-group {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 6px 10px;
    background: #f8f9fb;
}

.avatar-control-summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avatar-control-summary::after {
    content: "v";
    font-size: 12px;
    color: #6c757d;
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.avatar-control-group[open] .avatar-control-summary::after {
    transform: rotate(180deg);
}

.avatar-control-summary::-webkit-details-marker {
    display: none;
}

.avatar-control-group[open] .avatar-control-summary {
    color: #343a40;
}

.avatar-control-body {
    margin-top: 6px;
}

.avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.avatar-status {
    font-size: 13px;
    margin-top: 6px;
    color: #6c757d;
}

.avatar-saved-preview {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8f9fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

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

.logo-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    grid-template-areas: "controls preview";
}

.logo-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.logo-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0 16px;
}

.logo-mode-button {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    background: #f8f9fb;
}

.logo-mode-button.is-active {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.manage-channel-nav .nav-link {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.logo-preview-card {
    grid-area: preview;
    padding: 12px;
}

.logo-controls-card {
    grid-area: controls;
}

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.logo-preview svg {
    width: min(160px, 100%);
    height: auto;
}

.logo-controls {
    display: grid;
    gap: 10px;
}

.logo-control-group label {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin-bottom: 4px;
}

.logo-palette-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.logo-palette {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--bg);
    position: relative;
    padding: 0;
}

.logo-palette::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--accent);
    position: absolute;
    right: 6px;
    bottom: 6px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.logo-palette.is-active {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.2);
}

.logo-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.logo-option {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f8f9fb;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

.logo-option.is-active {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.logo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.logo-status {
    font-size: 13px;
    margin-top: 6px;
    color: #6c757d;
}

.logo-current {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.channel-logo-preview {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.channel-logo-image {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.channel-logo-placeholder {
    font-weight: 700;
    font-size: 1.1rem;
    color: #6c757d;
}

.logo-upload-card {
    margin-top: 16px;
}

.logo-upload-preview {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-upload-preview img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
}

.logo-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    z-index: 2000;
}

.logo-modal.is-open {
    display: flex;
}

.logo-modal-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    width: min(360px, 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    text-align: center;
}

.logo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.logo-modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: #6b7280;
}

.logo-modal-preview {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 8px auto 12px;
}

.logo-modal-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-modal-footer {
    margin-top: 8px;
}

#manageChannelTabs .nav-link {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.hide-list-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
}

#welcomeMessagePreview {
    white-space: pre-line;
}

.autocomplete-results {
    top: 100%;
    z-index: 1000;
}

#editPollLockedNotice {
    display: none;
}

.poll-results-progress {
    height: 5px;
}

.onboarding-info-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.onboarding-info-title {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
}

.onboarding-actions.is-compact {
    margin-top: 0;
}

.shop-balance-icon {
    font-size: 48px;
    color: #ffc107;
}

@media (max-width: 768px) {
    .avatar-builder-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "preview"
            "controls";
    }

    .avatar-preview-card {
        position: sticky;
        top: 12px;
        z-index: 2;
    }

    .avatar-builder-layout .avatar-preview {
        min-height: 120px;
    }

    .avatar-builder-layout .avatar-preview svg {
        width: min(130px, 100%);
        max-height: 130px;
    }

    .logo-builder-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "preview"
            "controls";
    }

    .logo-preview-card {
        position: sticky;
        top: 12px;
        z-index: 2;
    }

    .logo-preview {
        min-height: 110px;
    }

    .logo-preview svg {
        width: min(120px, 100%);
    }

    .logo-builder-nav {
        display: none;
    }

    .channel-logo-preview {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .channel-logo-image {
        border-radius: 10px;
    }

    .channel-logo-placeholder {
        font-size: 0.95rem;
    }

    .logo-upload-preview img {
        width: 96px;
        height: 96px;
        border-radius: 10px;
    }

    .logo-modal-preview {
        width: 120px;
        height: 120px;
        border-radius: 12px;
    }
}

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    margin: 0 auto;
    max-width: 620px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    border-radius: var(--radius, 14px);
    border: 1px solid var(--border, rgba(21, 33, 54, 0.12));
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md, 0 14px 28px rgba(15, 23, 42, 0.12));
    z-index: 2000;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cookie-banner--ready {
    opacity: 1;
    transform: translateY(0);
}

.cookie-banner--hide {
    opacity: 0;
    transform: translateY(10px);
}

.cookie-banner--chat {
    bottom: calc(72px + env(safe-area-inset-bottom));
}

.cookie-banner__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--primary, #1f7a8c);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.cookie-banner__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.cookie-banner__text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.cookie-banner__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.cookie-banner__link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__link:hover {
    color: var(--primary, #1f7a8c);
}

.cookie-banner__accept {
    font-weight: 600;
}

@media (max-width: 576px) {
    .cookie-banner {
        grid-template-columns: auto 1fr;
    }

    .cookie-banner__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: none;
        transform: none;
    }

    .cookie-banner--ready {
        transform: none;
    }
}

.site-footer {
    margin-top: 18px;
    padding: 14px 0 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: center;
}

.site-footer__links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.site-footer__links a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer__links a:hover {
    color: var(--primary, #1f7a8c);
}

.site-footer__dot {
    color: var(--text-muted);
    margin: 0 4px;
}

.support-page .support-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.support-page .support-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: grid;
    gap: 6px;
}

.support-page .support-contact-label {
    display: inline-block;
    min-width: 140px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.support-page .support-section-title {
    margin-top: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.landing-page .landing-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.landing-page .landing-brand-name {
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
}

.landing-page .landing-nav-cta {
    font-weight: 600;
    padding: 0.45rem 1rem;
}

.landing-main {
    padding: 20px 0 30px;
}

.landing-hero {
    padding: clamp(28px, 6vw, 72px) 0 20px;
}

.landing-hero-grid {
    display: grid;
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
}

.landing-hero-copy {
    max-width: 540px;
}

.landing-kicker {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.landing-title {
    font-size: clamp(1.8rem, 3.8vw, 2.8rem);
    line-height: 1.15;
    margin: 0 0 12px;
}

.landing-subtitle {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 1rem;
}

.landing-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(31, 122, 140, 0.2);
    background: rgba(31, 122, 140, 0.1);
    color: var(--primary-strong);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.landing-points {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: grid;
    gap: 10px;
}

.landing-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
}

.landing-points i {
    color: var(--primary);
    margin-top: 2px;
}

.landing-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.landing-cta-btn {
    padding: 0.6rem 1.4rem;
    font-weight: 600;
}

.landing-hero-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 6px);
    padding: 22px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.landing-hero-card::before {
    content: '';
    position: absolute;
    top: -45%;
    right: -20%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(31, 122, 140, 0.25), transparent 65%);
}

.landing-panel {
    position: relative;
    z-index: 1;
}

.landing-panel-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.landing-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.landing-panel-channel {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 12px 0 6px;
}

.landing-panel-text {
    color: var(--text-muted);
    margin: 0 0 18px;
}

.landing-preview {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.landing-preview-bubble {
    height: 38px;
    border-radius: 18px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.landing-preview-bubble.is-left {
    width: 78%;
}

.landing-preview-bubble.is-right {
    width: 64%;
    margin-left: auto;
    background: rgba(31, 122, 140, 0.08);
    border-color: rgba(31, 122, 140, 0.2);
}

.landing-preview-bubble.is-mid {
    width: 58%;
}

.landing-features {
    padding: 16px 0 56px;
}

.landing-section-header {
    max-width: 520px;
    margin-bottom: 20px;
}

.landing-section-header h2 {
    margin-bottom: 8px;
}

.landing-section-header p {
    margin: 0;
    color: var(--text-muted);
}

.landing-feature-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.landing-feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.landing-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 122, 140, 0.12);
    color: var(--primary-strong);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.landing-feature-card h3 {
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.landing-feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.landing-cta {
    padding: 10px 0 60px;
}

.landing-cta-card {
    background: linear-gradient(135deg, rgba(31, 122, 140, 0.12), rgba(243, 186, 102, 0.18));
    border: 1px solid rgba(31, 122, 140, 0.16);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-md);
}

.landing-cta-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.landing-cta-card p {
    margin: 0;
    color: var(--text-muted);
}

.landing-cta-card .btn {
    font-weight: 600;
    padding: 0.6rem 1.3rem;
}

@media (min-width: 992px) {
    .landing-hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }
}

@media (max-width: 576px) {
    .landing-hero {
        padding-bottom: 8px;
    }

    .landing-hero-card {
        padding: 18px;
    }

    .landing-preview-bubble {
        height: 32px;
    }

    .landing-cta-card {
        padding: 20px;
    }
}
