/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #1a1a2e;
    padding: 30px;
    min-height: 100vh;
}

/* Profile header */
.profile-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-header-start {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.usage-guide-btn.help-btn {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}

.profile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.profile-brand:hover {
    color: #a78bfa;
}

.profile-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-brand-title {
    font-size: 22px;
    font-weight: 600;
    white-space: nowrap;
}

.profile-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-nav-item {
    position: relative;
    width: 160px;
}

.profile-nav-dropdown-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
}

.profile-nav-dropdown-wrap > .profile-nav-trigger {
    width: 100%;
    box-sizing: border-box;
}

.profile-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 160px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    justify-content: space-between;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.profile-nav-trigger:hover,
.is-open .profile-nav-trigger,
.profile-nav-trigger.is-active {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.4);
    color: #a78bfa;
}

.profile-nav-chevron {
    font-size: 12px;
    opacity: 0.7;
}

.profile-nav-dropdown-wrap.is-open .profile-nav-chevron,
.profile-user-menu.is-open .profile-nav-chevron {
    transform: rotate(180deg);
}

.profile-nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 5px 0;
    gap: 5px;
    flex-direction: column;
    border-radius: 12px;
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 100;
    overflow: hidden;
}

.is-open .profile-nav-dropdown {
    display: flex;
}

.profile-nav-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-nav-dropdown-item:hover,
.profile-nav-dropdown-item.is-active {
    background: rgba(79, 70, 229, 0.2);
    color: #a78bfa;
}

.profile-user-menu {
    position: relative;
    flex-shrink: 0;
}

.profile-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    max-width: 240px;
}

.is-open .profile-user-trigger,
.profile-user-trigger:hover {
    background: rgba(79, 70, 229, 0.2);
    border-color: rgba(79, 70, 229, 0.4);
    color: #a78bfa;
}

.profile-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
}

.profile-user-avatar-img {
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

.profile-user-avatar-placeholder {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.profile-user-menu:not(.is-loading) .profile-user-avatar-placeholder[hidden],
.profile-user-avatar-img[hidden] {
    display: none;
}

.profile-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.profile-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 100%;
    padding: 5px 0;
    gap: 5px;
    flex-flow: column;
    border-radius: 12px;
    background: #16213e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 100;
    overflow: hidden;
}

.is-open .profile-user-dropdown {
    display: flex;
}

.profile-user-dropdown-item[hidden],
#profile-admin-link[hidden] {
    display: none !important;
}

.profile-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-user-dropdown-item:hover,
.profile-user-dropdown-item.is-active {
    background: rgba(79, 70, 229, 0.2);
    color: #a78bfa;
}

.profile-user-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.settings-nav-panel {
    display: none;
}

.settings-nav-panel.block {
    padding: 12px;
}

.settings-nav-panel .block-heading-with-icon {
    padding: 12px;
    padding-bottom: 0;
}

.settings-nav-panel.is-active {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 150px);
    overflow: hidden;
}

.settings-nav-panel.is-active > .content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    padding-top: 0;
}

@media (max-width: 1100px) {
    .profile-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .profile-nav {
        justify-content: flex-start;
    }

    .profile-user-menu {
        justify-self: end;
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .profile-brand-title {
        font-size: 18px;
    }

    .profile-nav-trigger {
        padding: 8px 10px;
        font-size: 13px;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Two-column grid layout */
.main-grid {
    display: grid;
    grid-template-columns: 600px 1fr;
    gap: 30px;
    align-items: start;
}

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.settings-subsection {
    margin: 20px 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.theme-panel-header h4 {
    margin: 0;
}

.theme-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.theme-panel-toggle .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.2s ease;
}

.theme-panel.open .theme-panel-toggle .bi {
    transform: rotate(180deg);
}

.theme-panel-body {
    display: none;
    margin-top: 14px;
}

.theme-panel.open .theme-panel-body {
    display: block;
}

.theme-panel-actions {
    display: flex;
    justify-content: center;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-16 {
    margin-bottom: 16px !important;
}

.mb-32 {
    margin-bottom: 32px !important;
}

.mt-16 {
    margin-top: 16px !important;
}

.mt-18 {
    margin-top: 18px !important;
}

.mt-20 {
    margin-top: 20px !important;
}

.pb-16 {
    padding-bottom: 16px !important;
}

.text-right {
    text-align: right !important;
}

.align-center {
    align-content: center !important;
}

.align-end {
    align-content: end !important;
}

.hour-timer-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.row-actions-balanced {
    margin: 12px 0 0;
    align-items: center;
}

.roulette-actions-row {
    margin-bottom: 16px;
}

.roulette-categories-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.roulette-categories-modal.open {
    display: flex;
}

.roulette-categories-modal-content {
    background: linear-gradient(145deg, #16213e, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 760px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.roulette-categories-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roulette-categories-modal-header h3 {
    color: #fff;
    font-size: 16px;
    margin: 0;
}

.roulette-categories-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.roulette-categories-modal-close:hover {
    color: #fff;
}

.roulette-categories-modal-body {
    max-height: calc(85vh - 64px);
    overflow-y: auto;
    padding: 20px;
}

.raffle-enabled-row,
.raffle-toggle-row {
    margin: 12px 0 16px;
}

.raffle-enabled-row > span,
.raffle-exclude-winner-row > span,
.raffle-elimination-mode-row > span {
    font-size: 14px;
    color: #e2e8f0;
}

[data-panel-id="widget-twitch-raffle"].raffle-disabled .content .raffle-controlled {
    opacity: 0.8;
}

[data-panel-id="widget-twitch-raffle"].raffle-disabled .raffle-toggle-row {
    opacity: 0.8;
}

[data-panel-id="widget-twitch-raffle"].raffle-disabled .content .raffle-controlled,
[data-panel-id="widget-twitch-raffle"].raffle-disabled .content .raffle-controlled *,
[data-panel-id="widget-twitch-raffle"].raffle-disabled .raffle-toggle-row,
[data-panel-id="widget-twitch-raffle"].raffle-disabled .raffle-toggle-row * {
    cursor: not-allowed !important;
}

.theme-reset-btn {
    padding: 10px 40px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.theme-reset-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.settings-subsection h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.settings-subsection-title {
    color: #cbd5e1;
    font-size: 13px;
    text-align: center;
    font-weight: 600;
    margin: 0 0 10px 0;
}

input[type="color"] {
    width: 100%;
    height: 45px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Общие стили блока */
.block {
    background: linear-gradient(145deg, #16213e, #1a1a2e);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.block .content {
    display: block;
}

.block h2 {
    position: relative;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.block h2.widget-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.widget-heading-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 12px;
    margin-bottom: 20px;
    padding-bottom: 0;
}

.widget-heading-text {
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.widget-how-btn.help-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.widget-heading-main .widget-how-btn.help-btn {
    margin-left: 4px;
}

.help-widget-list {
    margin: 8px 0 16px;
    padding-left: 20px;
    color: #94a3b8;
}

.help-widget-list li {
    margin: 6px 0;
    line-height: 1.5;
}

.help-modal-body .help-section-title {
    color: #fff;
    font-size: 14px;
    margin: 18px 0 8px;
}

.help-modal-body .help-section-title:first-of-type {
    margin-top: 0;
}

.widget-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
}

.widget-icon .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

.widget-icon-progress {
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.35);
    color: #a78bfa;
}

.widget-icon-top {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.widget-icon-infinity {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.widget-icon-roulette {
    background: rgba(236, 72, 153, 0.2);
    border: 1px solid rgba(236, 72, 153, 0.35);
    color: #f472b6;
}

.widget-icon-bot {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

.uuid-input-with-button .uuid-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

.uuid-input-with-button .uuid-input-wrap input {
    width: 100%;
    padding-right: 46px;
    margin-bottom: 0;
}

.uuid-eye-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #cbd5e1;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.uuid-eye-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.roulette-multi-spin-row {
    padding: 0 4px;
}

.roulette-multi-spin-row > span {
    font-size: 14px;
    color: #e2e8f0;
}

.raffle-exclude-winner-row > span,
.raffle-elimination-mode-row > span {
    font-size: 14px;
    color: #e2e8f0;
}

.roulette-category {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.roulette-category-header {
    margin-bottom: 10px;
}

.roulette-category-meta {
    font-size: 18px;
    display: block;
}

.roulette-category-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.roulette-rarity-field {
    flex: 1;
    min-width: 0;
}

.roulette-rarity-field label {
    display: block;
    margin-bottom: 6px;
}

.roulette-rarity-field select {
    width: 100%;
}

.roulette-remove-card {
    margin-bottom: 16px;
    width: 37px !important;
    height: 37px !important;
    border-radius: 10px !important;
}

.roulette-remove-category {
    margin-bottom: 16px;
    width: 45px !important;
    height: 45px !important;
    border-radius: 10px !important;
}

.roulette-remove-category:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.roulette-cards-panel {
    margin-top: 4px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.roulette-cards-panel .theme-panel-header h4 {
    font-size: 14px;
    color: #e2e8f0;
}

.roulette-cards-panel .roulette-add-card {
    margin-top: 8px;
}

.roulette-cards-list {
    margin-bottom: 0;
}

.roulette-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.roulette-card-row input {
    flex: 1;
    min-width: 0;
    padding: 8px !important;
}

.delete-btn.roulette-remove-category {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
}

.delete-btn.roulette-remove-card {
    flex-shrink: 0;
    width: 37px !important;
    height: 37px !important;
    padding: 0;
}

.delete-btn.roulette-remove-card:hover,
.delete-btn.roulette-remove-category:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.widget-icon-settings {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.35);
    color: #94a3b8;
}

.widget-icon-donations {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
}

.widget-icon-stats {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.widget-icon-integrations {
    background: rgba(20, 184, 166, 0.2);
    border: 1px solid rgba(20, 184, 166, 0.35);
    color: #2dd4bf;
}

.block-heading-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

[data-panel-id="widget-twitch-raffle"] .raffle-enabled-row {
    margin-top: 0;
}

.block .donations-toolbar-title.block-heading-with-icon {
    margin: 0;
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    padding-bottom: 0;
}

.block-header h2 {
    margin-bottom: 0;
}

.block-title-with-help {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* Стили для label и input */
label {
    display: block;
    margin-bottom: 6px;
    color: #a0a0a0;
    font-size: 13px;
    font-weight: 500;
}

select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.3s ease;
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus {
    border-color: #4f46e5;
    outline: none;
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

select {
    padding: 11px 16px;
}

select option {
    background-color: #1a1a2e;
}

input:disabled,
input[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стили для кнопки */
.link {
    text-decoration: none;
    width: 100%;
    display: block;
    padding: 14px;
    text-align: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.link.reset {
    padding: 13px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: none;
}

.link.reset:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    transform: none;
    box-shadow: none;
}

.hour-timer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
    transition: all 0.2s ease;
}

.hour-timer-toggle-icon {
    font-size: 1.05em;
    line-height: 1;
}

.hour-timer-toggle.is-running {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
}

.hour-timer-toggle.is-running:hover {
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.14);
    transform: none;
    box-shadow: none;
}

.hour-timer-toggle.is-paused {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.08);
}

.hour-timer-toggle.is-paused:hover {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(74, 222, 128, 0.14);
    transform: none;
    box-shadow: none;
}

.link:not(.reset):not(.hour-timer-toggle):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.raffle-ticket-btn {
    width: 45px;
    min-width: 45px;
    height: 45px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
}

.raffle-participant-item {
    gap: 12px;
}

.raffle-participant-item .donation-info {
    min-width: 0;
}

.raffle-participant-item .donation-name,
.raffle-participant-item .donation-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.raffle-participant-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.raffle-participant-actions .raffle-ticket-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 18px;
}

.raffle-ticket-btn .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

#tl_last_reset {
    font-weight: 600;
    font-size: 16px;
    color: #a0a0a0;
    text-align: center;
}

#tl_last_reset div {
    color: #ff6b6b;
}

/* Row layout */
.row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.col {
    flex: 1;
}

.col select {
    margin-bottom: 0;
}

/* Status grid */
.status-grid {
    justify-content: space-between;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #fff;
    font-size: 14px;
}

.status-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.status-item-meta {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
    margin-top: 4px;
    flex-shrink: 0;
}

.status-indicator.connected {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-indicator.connecting {
    background: #b98910;
    box-shadow: 0 0 10px rgba(185, 137, 16, 0.5);
}

.status-indicator.error {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.status-indicator.disconnected {
    background: #666;
}

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle input:checked+.slider {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.toggle input:checked+.slider:before {
    transform: translateX(24px);
}

/* Stats */
.stats-period {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.stats-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.donations-toolbar-search input,
#donations-search,
#stats-donor-search {
    width: 100%;
    margin-bottom: 0;
    border-radius: 8px;
    font-size: 15px;
    padding: 6px 16px;
}

#donations-search {
    width: 300px;
}

#stats-donor-search {
    width: 190px;
}

@media (max-width: 900px) {
    .stats-period {
        flex-direction: column;
        align-items: stretch;
    }
}

.period-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
}

.period-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.period-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: transparent;
    color: #fff;
}

#stats-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    color: #fff;
}

.stat-row .platform {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-row .amount {
    font-weight: 600;
    color: #10b981;
}

.stat-row .count {
    font-size: 12px;
    color: #666;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.custom-select.open .custom-select-trigger {
    border-color: #4f46e5;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-trigger .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 16px;
    color: #888;
    transition: transform 0.3s ease;
}

.custom-select.open .custom-select-trigger .bi {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #16213e;
    border: 1px solid #4f46e5;
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.custom-select.open .custom-options {
    max-height: 200px;
    opacity: 1;
    overflow-y: auto;
}

.custom-option {
    padding: 12px 16px;
    color: #ccc;
    font-size: 14px;
    transition: all 0.2s ease;
}

.custom-option:hover {
    background: rgba(79, 70, 229, 0.3);
    color: #fff;
}

.custom-option.selected {
    background: rgba(79, 70, 229, 0.5);
    color: #fff;
}

/* Scrollbar for custom options */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.custom-options::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 3px;
}

.help-btn {
    padding: 4px 10px;
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    border-radius: 6px;
    color: #a78bfa;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-btn:hover {
    background: rgba(79, 70, 229, 0.4);
    color: #fff;
}

/* Help Modal */
.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.help-modal.open {
    display: flex;
}

.help-modal-content {
    background: linear-gradient(145deg, #16213e, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.help-modal-header h3 {
    color: #fff;
    font-size: 16px;
    margin: 0;
}

.help-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.help-modal-close:hover {
    color: #fff;
}

.help-modal-body {
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.7;
}

.help-modal-body h4 {
    color: #fff;
    font-size: 14px;
    margin: 16px 0 8px 0;
}

.help-modal-body h4:first-child {
    margin-top: 0;
}

.admin-edit-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0 10px;
}

.help-modal-body ol,
.help-modal-body ul {
    margin: 8px 0;
    padding-left: 20px;
}

.help-modal-body li {
    margin: 6px 0;
}

.help-modal-body code {
    background: rgba(79, 70, 229, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #a78bfa;
    font-size: 12px;
}

.help-modal-body a {
    color: #4f46e5;
    text-decoration: none;
}

.help-modal-body a:hover {
    text-decoration: underline;
}

.help-modal-body .note {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
}

.help-guide-lead {
    color: #e2e8f0;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.help-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 8px;
}

.help-guide-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.help-guide-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.help-guide-step h4 {
    margin: 0 0 6px 0;
    color: #fff;
    font-size: 14px;
}

.help-guide-step p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.55;
}

.help-guide-step p strong {
    color: #c4b5fd;
    font-weight: 600;
}

/* Save Button */
.save-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: linear-gradient(135deg, #5b52f0, #8b4cf6);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.save-btn:active {
    transform: translateY(0);
}

.save-btn .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

.save-btn.saving {
    pointer-events: none;
    opacity: 0.7;
}

.save-btn.saved {
    background: linear-gradient(135deg, #10b981, #059669);
}

.save-btn.saved .bi {
    animation: checkmark 0.3s ease;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.toast {
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.toast .message {
    color: #878787;
}

.toast .title {
    justify-content: space-between;
    display: flex;
    gap: 12px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-error {
    border-color: rgba(239, 68, 68, 0.5);
    border-left: 3px solid #ef4444;
}

.toast-warning {
    border-color: rgba(245, 158, 11, 0.5);
    border-left: 3px solid #f59e0b;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.5);
    border-left: 3px solid #10b981;
}

.toast-info {
    border-color: rgba(59, 130, 246, 0.5);
    border-left: 3px solid #3b82f6;
}

.toast-close {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #fff;
}

/* Input with button (save progress, copy URL) */
.input-with-button {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.input-with-button input {
    flex: 1;
    margin-bottom: 0;
    min-width: 0;
    box-sizing: border-box;
}

.input-with-button .save-btn {
    flex-shrink: 0;
    width: 48px;
    min-width: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin: 0;
}

.save-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

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

.save-btn.saving {
    opacity: 0.7;
    pointer-events: none;
}

/* Delete donation button */
.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: #ef4444;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.delete-btn .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}

/* Donation list */
.donations-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.block .donations-toolbar-title {
    margin: 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.donations-toolbar-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-height: 34px;
}

.donations-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.donations-page-btn:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.18);
    border-color: rgba(124, 58, 237, 0.35);
    color: #fff;
}

.donations-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.donations-page-info {
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .donations-toolbar {
        grid-template-columns: 1fr;
    }

    .donations-toolbar-pagination {
        justify-content: flex-start;
    }
}

.donations-list {
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: scroll;
}

.donation-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.donation-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(124, 58, 237, 0.3);
}

.donation-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.donation-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
}

.donation-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.donation-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.donation-platform {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.donation-platform.DA {
    background: rgba(244, 172, 54, 0.2);
    color: #f4ac36;
}

.donation-platform.DX {
    background: rgba(172, 0, 225, 0.25);
    color: #e9b3ff;
}

.donation-platform.DP {
    background: rgba(99, 179, 237, 0.2);
    color: #63b3ed;
}

.donation-platform.SE {
    background: rgba(72, 187, 120, 0.2);
    color: #48bb78;
}

.donation-amount {
    font-weight: 700;
    font-size: 16px;
    color: #7c3aed;
    margin-right: 8px;
}

.donation-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.frame-info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
}

.frame-container {
    display: flex;
    width: 100%;
}

iframe {
    justify-content: center;
    outline: none;
    border: none;
    margin: 0 auto 16px;
}

.donation-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.preview-recommend,
.preview-height,
.preview-width {
    color: #ffffff;
}

.preview-height,
.preview-width {
    font-weight: 600;
}

.preview-height span,
.preview-width span {
    color: #a78bfa;
}

.help-modal-body::-webkit-resizer,
.roulette-categories-modal-body::-webkit-resizer,
.donations-list::-webkit-resizer,
.settings-nav-panel.is-active > .content::-webkit-resizer {
    background-repeat: no-repeat;
    width: 5px;
    height: 0;
    border-radius: 5px;
}

.help-modal-body::-webkit-scrollbar,
.roulette-categories-modal-body::-webkit-scrollbar,
.donations-list::-webkit-scrollbar,
.settings-nav-panel.is-active > .content::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    border-radius: 5px;
}

.help-modal-body::-webkit-scrollbar-track,
.roulette-categories-modal-body::-webkit-scrollbar-track,
.donations-list::-webkit-scrollbar-track,
.settings-nav-panel.is-active > .content::-webkit-scrollbar-track {
    background-color: transparent;
}

.help-modal-body::-webkit-scrollbar-thumb,
.roulette-categories-modal-body::-webkit-scrollbar-thumb,
.donations-list::-webkit-scrollbar-thumb,
.settings-nav-panel.is-active > .content::-webkit-scrollbar-thumb {
    background: linear-gradient(18deg, #4f46e5, #7c3aed);;
    border-radius: 5px;
}

.help-modal-body::-webkit-scrollbar-button,
.roulette-categories-modal-body::-webkit-scrollbar-button,
.donations-list::-webkit-scrollbar-button,
.settings-nav-panel.is-active > .content::-webkit-scrollbar-button {
    background-repeat: no-repeat;
    width: 5px;
    height: 0;
    border-radius: 5px;
}

#raffle-history-list,
#raffle-participants-list {
    gap: 5px;
    margin-top: 16px;
    max-height: 200px;
}