* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(145deg, #0b0e17 0%, #0f121c 100%);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

:root {
    --bg-opacity: 0.15;
    --bg-blur: 0px;
}

.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: var(--bg-opacity);
    filter: blur(var(--bg-blur));
    transition: opacity 0.5s ease;
}

.randomizer-card {
    position: relative;
    z-index: 1;
    max-width: 750px;
    width: 100%;
    background: rgba(20, 24, 36, 0.75);
    backdrop-filter: blur(16px);
    border-radius: 48px;
    padding: 32px 28px 36px;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.randomizer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 48px;
    z-index: -1;
    pointer-events: none;
}

.randomizer-card {
    max-width: 750px;
    width: 100%;
    background: rgba(20, 24, 36, 0.75);
    backdrop-filter: blur(16px);
    border-radius: 48px;
    padding: 32px 28px 36px;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-btn {
    background: #0f111a;
    border: 1px solid #232837;
    border-radius: 40px;
    padding: 8px 14px;
    cursor: pointer;
    color: #8f9bcb;
    transition: 0.2s;
    font-size: 14px;
}

.settings-btn:hover {
    background: #1e253e;
    color: #5f7ef2;
    border-color: #5f7ef2;
}

h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #f0f2fa 0%, #b9c2e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 i {
    color: #a5b4db;
    font-size: 28px;
}

.lang-switch {
    display: flex;
    gap: 8px;
    background: #0f111a;
    padding: 4px;
    border-radius: 60px;
    border: 1px solid #232837;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 6px 18px;
    border-radius: 40px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: #7b84a6;
    transition: 0.2s;
}

.lang-btn.active {
    background: #5f7ef2;
    color: white;
}

.sub {
    color: #7b84a6;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
    border-left: 3px solid #3a4468;
    padding-left: 14px;
}

.mode-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: #0f111a;
    padding: 6px;
    border-radius: 60px;
    border: 1px solid #232837;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    border-radius: 40px;
    color: #7b84a6;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-btn.active {
    background: #1e253e;
    color: white;
}

.mode-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.pool-btn {
    width: 100%;
    background: #1e253e;
    border: 1px solid #3a4468;
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #b9c2de;
    border-radius: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    transition: 0.2s;
}

.pool-btn:hover {
    background: #2a3150;
    border-color: #5f7ef2;
    color: white;
}

.pool-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Компактные фильтры */
.filters-group {
    margin-bottom: 20px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #0f111a;
    padding: 8px 12px;
    border-radius: 60px;
    border: 1px solid #232837;
}

.roulette-filters {
    margin-bottom: 20px;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #1e253e;
    border-radius: 40px;
    color: #b9c2de;
    font-size: 13px;
    font-weight: 500;
}

.filter-chip i {
    font-size: 12px;
    color: #8f9bcb;
}

.filter-chip.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.filter-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    margin-left: 6px;
}

.filter-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2f44;
    transition: 0.25s;
    border-radius: 34px;
}

.filter-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #bdc3e0;
    transition: 0.25s;
    border-radius: 50%;
}

input:checked + .filter-slider {
    background-color: #5f7ef2;
}

input:checked + .filter-slider:before {
    transform: translateX(16px);
    background-color: white;
}

.control-group {
    background: #0f111a;
    border-radius: 28px;
    padding: 6px;
    margin-bottom: 20px;
    border: 1px solid #232837;
}

.players-selector {
    display: flex;
    gap: 8px;
}

.player-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    border-radius: 24px;
    color: #7b84a6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-btn.active {
    background: #1e253e;
    color: white;
}

.player-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.timer-group {
    background: #0f111a;
    border-radius: 28px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid #232837;
    display: none;
}

.timer-group.visible {
    display: block;
}

.timer-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6a729b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.timer-btn {
    background: #181e2e;
    border: 1px solid #2a314b;
    border-radius: 40px;
    padding: 8px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #b9c2de;
    cursor: pointer;
}

.timer-btn.active {
    background: #5f7ef2;
    border-color: #5f7ef2;
    color: white;
}

.timer-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.roulette-container {
    background: #090b10;
    border-radius: 32px;
    padding: 24px 16px;
    margin-bottom: 20px;
    border: 1px solid #262d44;
    text-align: center;
    display: none;
}

.roulette-container.visible {
    display: block;
}

.slot-machine {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    margin-bottom: 24px;
    background: #0b0e17;
    border: 2px solid #2a314b;
}

.slot-track {
    display: flex;
    flex-wrap: nowrap;
    will-change: transform;
}

.slot-item {
    flex-shrink: 0;
    width: 140px;
    text-align: center;
    padding: 16px 12px;
    background: #0f111a;
    border-right: 1px solid #2a314b;
}

.slot-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.slot-item .hero-name {
    font-size: 13px;
    font-weight: 500;
    color: #b9c2de;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #5f7ef2;
    z-index: 10;
    box-shadow: 0 0 16px #5f7ef2;
    pointer-events: none;
}

.slot-pointer::before {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: #5f7ef2;
    font-size: 14px;
}

.slot-pointer::after {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: #5f7ef2;
    font-size: 14px;
}

.spin-btn {
    background: #5f7ef2;
    border: none;
    padding: 12px 32px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: white;
    border-radius: 60px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    transition: 0.2s;
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.result-name {
    font-size: 20px;
    font-weight: 700;
    color: #eceffa;
    text-align: center;
    padding: 12px;
    background: #11141f;
    border-radius: 60px;
    border-left: 4px solid #5f7ef2;
}

.result-skills {
    font-size: 14px;
    font-weight: 500;
    color: #8f9bcb;
    margin-top: 8px;
    min-height: 26px;
    transition: all 0.3s ease;
}

.result-skills.hidden {
    display: none;
}

.randomize-btn {
    width: 100%;
    background: #5f7ef2;
    border: none;
    padding: 14px 0;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: white;
    border-radius: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.randomize-btn.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.result-panel {
    background: #090b10;
    border-radius: 32px;
    padding: 20px 24px;
    border: 1px solid #262d44;
    min-height: 140px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6f7a9f;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #eceffa;
    background: #11141f;
    padding: 10px 16px;
    border-radius: 24px;
    border-left: 4px solid #5f7ef2;
}

.hero-item-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 10px;
    background: #0b0e17;
    border: 1px solid #2a314b;
}

.hero-item-text {
    flex: 1;
}

.empty-state {
    color: #4e5679;
    text-align: center;
    padding: 24px 12px;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #0f121c;
    border-radius: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid #2a314b;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2a314b;
}

.modal-header h3 {
    color: #eceffa;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: #7b84a6;
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: #ff4d6d;
}

.modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.hero-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.hero-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #11141f;
    border-radius: 12px;
    cursor: pointer;
}

.hero-checkbox-item img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 8px;
}

.hero-checkbox-item span {
    color: #dfe3f5;
    font-size: 13px;
    font-weight: 500;
}

.hero-checkbox-item input {
    margin-left: auto;
    cursor: pointer;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #2a314b;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 40px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.modal-btn-primary {
    background: #5f7ef2;
    border: none;
    color: white;
}

.modal-btn-secondary {
    background: #1e253e;
    border: 1px solid #3a4468;
    color: #b9c2de;
}

.widget-settings-modal .param-row {
    margin-bottom: 20px;
}

.widget-settings-modal .param-row label {
    display: block;
    color: #dfe3f5;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

.widget-settings-modal .toggle-group {
    display: flex;
    gap: 12px;
    background: #0f111a;
    padding: 6px;
    border-radius: 60px;
    border: 1px solid #232837;
}

.widget-settings-modal .toggle-option {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 0;
    border-radius: 40px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    color: #7b84a6;
    transition: 0.2s;
    text-align: center;
}

.widget-settings-modal .toggle-option.active {
    background: #5f7ef2;
    color: white;
}

.widget-url {
    background: #0b0e17;
    padding: 12px 16px;
    border-radius: 28px;
    margin: 16px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 12px;
    color: #8f9bcb;
    border: 1px solid #2a314b;
}

.copy-btn {
    background: #5f7ef2;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: #4c6de0;
}

.obs-instructions {
    font-size: 13px;
    color: #b9c2de;
    line-height: 1.6;
}

.obs-instructions code {
    background: #0b0e17;
    padding: 2px 8px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 12px;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e253e;
    color: #eceffa;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border: 1px solid #5f7ef2;
}

.toast.show {
    opacity: 1;
}

.footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #232837;
    text-align: center;
    font-size: 13px;
    color: #6a729b;
}

.footer a {
    color: #8f9bcb;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.footer a:hover {
    color: #5f7ef2;
}

.footer .heart {
    color: #ff6b9d;
}

.footer .developers {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.footer .developer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer i {
    font-size: 12px;
}

.twitch-auth-section {
    margin-bottom: 20px;
    text-align: center;
}

.twitch-auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #11141f;
    padding: 12px 20px;
    border-radius: 40px;
    margin-bottom: 16px;
    color: #b9c2de;
    font-size: 13px;
}

.twitch-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #5f7ef2;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s;
    width: 100%;
}

.twitch-auth-btn:hover {
    background: #4c6de0;
    transform: scale(0.98);
}

.streamer-id-display {
    background: #0b0e17;
    padding: 10px 16px;
    border-radius: 28px;
    font-family: monospace;
    font-size: 13px;
    color: #8f9bcb;
    border: 1px solid #2a314b;
    word-break: break-all;
}