:root {
    --twitch-purple: #9146ff;
    --twitch-purple-dark: #772ce8;
    --twitch-purple-light: #af85ff;
    --twitch-dark: #0e0e10;
    --twitch-dark-light: #18181b;
    --twitch-dark-lighter: #1f1f23;
    --twitch-gray: #2d2d2d;
    --twitch-gray-light: #3a3a3d;
    --twitch-text: #efeff1;
    --twitch-text-secondary: #adadb8;
    --twitch-text-tertiary: #7a7a8c;
    
    --roulette-gold: #ffd700;
    --roulette-gold-dark: #e6c300;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #f39c12;
    --warning-dark: #e67e22;
    
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.3);
    --shadow-purple: 0 4px 20px rgba(145, 70, 255, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--twitch-dark) 0%, var(--twitch-dark-light) 100%);
    color: var(--twitch-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.app-header {
    margin-bottom: 30px;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.header-gradient {
    background: linear-gradient(
        135deg,
        #8b5cf6 0%,
        #a855f7 25%,
        #c084fc 50%,
        #d946ef 75%,
        #ec4899 100%
    );
    padding: 20px 30px;
    position: relative;
    overflow: hidden;
}

.header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #8b5cf6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.logo-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.version-badge {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b5cf6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.glass-panel {
    background: rgba(24, 24, 27, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 24px;
    height: 100%;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: rgba(145, 70, 255, 0.3);
    box-shadow: var(--shadow-lg);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header i {
    color: var(--twitch-purple);
    font-size: 1.2rem;
}

.panel-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--twitch-text);
}

.winner-header {
    justify-content: space-between;
}

.winner-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.winner-title i {
    color: var(--roulette-gold);
}

.winner-badge {
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    color: var(--twitch-dark);
    padding: 0px 0px;
    border-radius: 0px;
    font-size: 0rem;
    font-weight: 100;
    text-transform: uppercase;
    letter-spacing: 0px;
}

.participants-count {
    background: var(--twitch-purple);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--twitch-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group label i {
    width: 16px;
    color: var(--twitch-purple);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    color: var(--twitch-text-tertiary);
    z-index: 1;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--twitch-dark-lighter);
    border: 2px solid var(--twitch-gray);
    border-radius: var(--border-radius);
    color: var(--twitch-text);
    font-size: 14px;
    transition: var(--transition);
    font-weight: 500;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--twitch-purple);
    background: var(--twitch-dark-light);
    box-shadow: 0 0 0 3px rgba(145, 70, 255, 0.1);
}

.input-with-icon input::placeholder {
    color: var(--twitch-text-tertiary);
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin: 24px 0;
    align-items: stretch;
}


.button-group button {
    flex: 1;
    min-width: 0;
    padding: 12px 10px;
    font-size: 13px;
}

.button-group button span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* FM button */
.btn-fm {
    flex: 0 0 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, var(--twitch-gray-light), var(--twitch-gray));
    color: var(--twitch-text-secondary);
    border: 2px solid var(--twitch-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.btn-fm::before { display: none; }

.btn-fm .fm-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--twitch-text-secondary);
    transition: var(--transition);
}

.btn-fm:hover {
    border-color: var(--twitch-purple);
    background: linear-gradient(135deg, var(--twitch-gray), var(--twitch-dark-lighter));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(145, 70, 255, 0.2);
}

.btn-fm:hover .fm-label { color: var(--twitch-purple-light); }

.btn-fm.active {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    border-color: var(--twitch-purple-light);
    box-shadow: 0 0 15px rgba(145, 70, 255, 0.4);
}

.btn-fm.active .fm-label { color: white; }

.btn-fm.active:hover { box-shadow: 0 0 20px rgba(145, 70, 255, 0.6); }


/* SUB button */
.btn-sub {
    flex: 0 0 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, var(--twitch-gray-light), var(--twitch-gray));
    color: var(--twitch-text-secondary);
    border: 2px solid var(--twitch-gray);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.btn-sub::before { display: none; }

.btn-sub .sub-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--twitch-text-secondary);
    transition: var(--transition);
}

.btn-sub:hover {
    border-color: var(--roulette-gold);
    background: linear-gradient(135deg, var(--twitch-gray), var(--twitch-dark-lighter));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.btn-sub:hover .sub-label { color: var(--roulette-gold); }

.btn-sub.active {
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    border-color: var(--roulette-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-sub.active .sub-label { color: var(--twitch-dark); }

.btn-sub.active:hover { box-shadow: 0 0 20px rgba(255, 215, 0, 0.6); }

.sub-badge {
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    color: var(--twitch-dark);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: var(--transition);
}

button:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    color: white;
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(145, 70, 255, 0.4);
}

.btn-secondary {
    background: var(--twitch-gray-light);
    color: var(--twitch-text);
    border: 1px solid var(--twitch-gray);
}

.btn-secondary:hover {
    background: var(--twitch-gray);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00a085);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 184, 148, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 184, 148, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-dark));
    color: white;
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(243, 156, 18, 0.4);
}

.btn-success:disabled,
.btn-warning:disabled {
    background: var(--twitch-gray-light);
    color: var(--twitch-text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.stat-card {
    background: var(--twitch-dark-lighter);
    padding: 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.stat-card:hover {
    border-color: var(--twitch-purple);
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--twitch-text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--twitch-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-message {
    padding: 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-message.connected {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: var(--success);
}

.status-message.disconnected {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: var(--danger);
}

.status-message.info {
    background: rgba(52, 152, 219, 0.1);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.messages-container {
    height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--twitch-purple) var(--twitch-dark);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    justify-content: flex-start; 
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: var(--twitch-dark);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--twitch-purple);
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--twitch-purple-dark);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    height: 100%;
    color: var(--twitch-text-tertiary);
    text-align: center;
    padding: 40px 20px;
    width: 100%; 
}

.messages-container:not(.empty-state),
.participants-list:not(.empty-state) {
    justify-content: flex-start;
    align-items: stretch; 
}

.messages-container.empty-state,
.participants-list.empty-state {
    justify-content: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.winner-message {
    padding: 16px;
    margin-bottom: 0;
    background: rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--roulette-gold);
    transition: var(--transition);
    width: 97%;
    text-align: left;
}

.winner-message:hover {
    background: rgba(255, 215, 0, 0.08);
    transform: translateX(4px);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.username {
    font-weight: 700;
    color: var(--roulette-gold);
    font-size: 0.9rem;
}

.timestamp {
    font-size: 0.75rem;
    color: var(--twitch-text-tertiary);
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--twitch-text);
    text-align: left;
    word-break: break-word;
}

.participants-list {
    height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--twitch-dark-lighter);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    transition: var(--transition);
    width: 97%; 
    margin-bottom: 0;
}

.user-item:hover {
    border-color: var(--twitch-purple);
    transform: translateX(4px);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.app-footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    text-align: center;
    color: var(--twitch-text-tertiary);
    font-size: 0.9rem;
}

.footer-content i {
    color: #e74c3c;
    margin: 0 4px;
}

.roulette-modal,
.vase-roulette-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.roulette-container,
.vase-container {
    width: 100%;
    max-width: 900px;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.roulette-header,
.vase-header {
    text-align: center;
    margin-bottom: 30px;
}

.roulette-header h3,
.vase-header h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--twitch-text), var(--twitch-purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.roulette-header p,
.vase-header p {
    color: var(--twitch-text-secondary);
    font-size: 1.1rem;
}

.roulette-wheel-container {
    position: relative;
    height: 200px;
    background: var(--twitch-dark-lighter);
    border-radius: var(--border-radius-lg);
    margin: 40px 0;
    overflow: hidden;
    border: 2px solid var(--twitch-gray);
}

.roulette-wheel {
    display: flex;
    height: 100%;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.22, 0.99);
}

.roulette-item {
    min-width: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--twitch-dark-light), var(--twitch-dark-lighter));
    border-right: 1px solid var(--twitch-gray);
    padding: 20px;
    text-align: center;
}

.roulette-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    border: 3px solid var(--twitch-purple);
    box-shadow: var(--shadow-purple);
}

.roulette-username {
    font-size: 1rem;
    font-weight: 600;
    color: var(--twitch-text);
}

.roulette-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: var(--roulette-gold);
    font-size: 2rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, -50%);
    }
    40% {
        transform: translate(-50%, -60%);
    }
    60% {
        transform: translate(-50%, -55%);
    }
}

.roulette-controls,
.vase-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 30px;
}

.roulette-controls button,
.vase-controls button {
    min-width: 160px;
}

.roulette-winner,
.vase-winner-display {
    display: none;
    text-align: center;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.winner-celebration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 20px;
    background: var(--roulette-gold);
    top: -20px;
    animation: confettiFall 5s linear infinite;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.5s; background: var(--twitch-purple); }
.confetti:nth-child(3) { left: 30%; animation-delay: 1s; background: var(--success); }

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

.winner-avatar,
.vase-winner-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    border: 5px solid var(--roulette-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 40px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(255, 215, 0, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 40px rgba(255, 215, 0, 0.5); }
}

.winner-info {
    margin-top: 20px;
}

.winner-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--roulette-gold);
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.winner-text {
    font-size: 1.3rem;
    color: var(--twitch-text);
    font-weight: 600;
}

.vases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin: 30px 0;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
}

.vase-item {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    perspective: 1000px;
}

.vase {
    width: 90px;
    height: 110px;
    border-radius: 8px 8px 35px 35px;
    position: relative;
    margin: 0 auto;
    transition: var(--transition);
    transform-style: preserve-3d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.vase::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 4px 4px 25px 25px;
    background: inherit;
    filter: brightness(1.2);
}

.vase::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 20px;
    right: 20px;
    height: 25px;
    border-radius: 50%;
    background: inherit;
    filter: brightness(0.8);
}

.vase-number {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 25px;
    height: 25px;
    background: var(--twitch-purple);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    border: 2px solid var(--twitch-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.vase-color-1 { background: linear-gradient(135deg, #8B4513, #A0522D); } /* Классический коричневый */
.vase-color-2 { background: linear-gradient(135deg, #2E8B57, #3CB371); } /* Зеленый */
.vase-color-3 { background: linear-gradient(135deg, #4169E1, #6495ED); } /* Синий */
.vase-color-4 { background: linear-gradient(135deg, #9932CC, #BA55D3); } /* Фиолетовый */
.vase-color-5 { background: linear-gradient(135deg, #FF6347, #FF7F50); } /* Красный */
.vase-color-6 { background: linear-gradient(135deg, #FFD700, #FFEC8B); } /* Золотой */
.vase-color-7 { background: linear-gradient(135deg, #20B2AA, #40E0D0); } /* Бирюзовый */
.vase-color-8 { background: linear-gradient(135deg, #FF69B4, #FFB6C1); } /* Розовый */
.vase-color-9 { background: linear-gradient(135deg, #808080, #A9A9A9); } /* Серый */
.vase-color-10 { background: linear-gradient(135deg, #D2691E, #CD853F); } /* Шоколадный */
.vase-color-11 { background: linear-gradient(135deg, #4682B4, #87CEEB); } /* Стальной синий */
.vase-color-12 { background: linear-gradient(135deg, #32CD32, #90EE90); } /* Лаймовый */

.vase-item:hover .vase {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.vase-item.broken .vase {
    animation: breakVase 0.8s ease forwards;
}

.vase-winner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.95);
    color: var(--twitch-dark);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-weight: 800;
    font-size: 0.8rem;
    text-align: center;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
    animation: fadeInUp 0.5s ease 0.5s both;
    min-width: 70px;
    line-height: 1.2;
}

@keyframes breakVase {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    20% {
        transform: translateY(-15px) rotate(-8deg) scale(1.05);
        opacity: 0.9;
    }
    40% {
        transform: translateY(0) rotate(8deg) scale(1.1);
        opacity: 0.7;
    }
    60% {
        transform: translateY(-8px) rotate(-4deg) scale(1.05);
        opacity: 0.5;
    }
    80% {
        transform: translateY(4px) rotate(4deg) scale(0.95);
        opacity: 0.3;
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(0);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes numberBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.3);
    }
    60% {
        transform: scale(1.1);
    }
}

.control-section .glass-panel,
.chat-section .glass-panel,
.participants-section .glass-panel {
    height: 850px;
    display: flex;
    flex-direction: column;
}

.messages-container,
.participants-list {
    height: calc(840px - 120px) !important; 
    min-height: 530px;
    flex: 1;
    overflow-y: auto;
}

.messages-container.empty-state,
.participants-list.empty-state {
    height: calc(840px - 120px) !important;
    min-height: 530px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .vases-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .vase {
        width: 70px;
        height: 90px;
    }
    
    .vase-number {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        top: -3px;
        right: -3px;
    }
}

@media (max-width: 480px) {
    .vases-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .vase {
        width: 60px;
        height: 80px;
    }
    
    .vase::after {
        top: -10px;
        left: 15px;
        right: 15px;
        height: 20px;
    }
}

@media (max-width: 1200px) {
    .app-main {
        grid-template-columns: 1fr 1fr;
    }
    
    .chat-section {
        grid-column: 1 / -1;
        order: 3;
        margin-top: 24px;
    }
    
    .chat-section .glass-panel {
        height: 500px;
    }
    
    .chat-section .messages-container {
        height: calc(500px - 120px) !important;
        min-height: 380px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 16px;
    }
    
    .app-main {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .logo {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .roulette-controls,
    .vase-controls {
        flex-direction: column;
    }
    
    .roulette-controls button,
    .vase-controls button {
        min-width: auto;
    }
    
    .roulette-container,
    .vase-container {
        padding: 24px;
    }
    
    .roulette-item {
        min-width: 150px;
    }
    
    .roulette-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .winner-name {
        font-size: 2rem;
    }
    
    .header-gradient {
        padding: 15px 20px;
    }
    
    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .logo-text h1 {
        font-size: 2rem;
    }
    
    .control-section .glass-panel,
    .chat-section .glass-panel,
    .participants-section .glass-panel {
        height: auto;
        min-height: 500px;
    }
    
    .messages-container,
    .participants-list {
        height: 400px !important;
        min-height: 400px;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 1.8rem;
    }
    
    .glass-panel {
        padding: 20px;
    }
    
    .roulette-header h3,
    .vase-header h3 {
        font-size: 1.5rem;
    }
    
    .winner-name {
        font-size: 1.5rem;
    }
    
    .winner-text {
        font-size: 1.1rem;
    }
    
    .header-gradient {
        padding: 12px 15px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-text h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
}
#startVaseRouletteBtn {
    margin-top: 15px;
}

.cs-roulette-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.cs-container {
    width: 100%;
    max-width: 1200px;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.cs-header {
    text-align: center;
    margin-bottom: 25px;
}

.cs-header h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--twitch-text), #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cs-header p {
    color: var(--twitch-text-secondary);
    font-size: 1.1rem;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: var(--twitch-dark-lighter);
    border-radius: var(--border-radius);
    border: 1px solid var(--twitch-gray);
    max-height: 300px;
    overflow-y: auto;
}

.participant-cell {
    padding: 12px 8px;
    background: var(--twitch-dark-light);
    border: 1px solid var(--twitch-gray);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--twitch-text);
    transition: var(--transition-fast);
    word-break: break-word;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.participant-cell.active {
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    color: white;
    border-color: var(--twitch-purple-light);
    box-shadow: var(--shadow-purple);
    transform: scale(1.05);
}

.participant-cell.winner {
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    color: var(--twitch-dark);
    border-color: var(--roulette-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

.cs-content {
    display: flex;
    align-items: center;
    gap: 20px; 
    margin: 25px 0;
    min-height: 400px;
}

.cs-video-container {
    flex: 0 0 50%
    position: relative;
    background: var(--twitch-dark);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 2px solid var(--twitch-gray);
    max-width: 500px; 
    margin: 0 auto;
}

.cs-video {
    width: 100%;
    height: auto;
    display: block;
}

.cs-teams {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
}

.team-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    max-width: 200px;
}

.team-header {
    text-align: center;
    padding: 8px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.team-terrorist .team-header {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
}

.team-counter .team-header {
    background: linear-gradient(135deg, #4682B4, #87CEEB);
    color: white;
}

.team-player {
    flex: 1;
    padding: 12px;
    background: var(--twitch-dark-lighter);
    border: 1px solid var(--twitch-gray);
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-player.winner {
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    color: var(--twitch-dark);
    border-color: var(--roulette-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.cs-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 25px;
}

.cs-controls button {
    min-width: 160px;
}

.cs-winner-display {
    display: none;
    text-align: center;
    margin-top: 30px;
    animation: fadeInUp 0.8s ease;
}

.cs-winner-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin: 0 auto 20px;
    border: 4px solid var(--roulette-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.selection-animation {
    animation: highlightSelection 0.3s ease;
}

@keyframes highlightSelection {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}


@media (max-width: 1200px) {
    .participants-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .cs-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .cs-teams {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .team-column {
        width: 48%;
    }
}

@media (max-width: 768px) {
    .participants-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .participant-cell {
        padding: 10px 6px;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .cs-container {
        padding: 20px;
    }
    
    .cs-header h3 {
        font-size: 1.5rem;
    }
    
    .cs-teams {
        flex-direction: column;
    }
    
    .team-column {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .participants-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .participant-cell {
        padding: 8px 4px;
        font-size: 0.75rem;
        min-height: 36px;
    }
    
    .cs-controls {
        flex-direction: column;
    }
    
    .cs-controls button {
        min-width: auto;
    }
}


.btn-cs {
    background: linear-gradient(135deg, #8B4513, #A0522D);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.3);
    margin-top: 15px;
}

.btn-cs:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 69, 19, 0.4);
}

.btn-cs:disabled {
    background: var(--twitch-gray-light);
    color: var(--twitch-text-tertiary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.team-player.dimmed {
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.team-player.dimmed.winner {
    opacity: 1 !important; 
}


.marker-animation {
    animation: markerPulse 0.5s ease;
}

@keyframes markerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.player-with-marker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.player-marker {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--twitch-purple), var(--twitch-purple-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    border: 2px solid var(--twitch-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.team-terrorist .player-marker {
    background: linear-gradient(135deg, #8B4513, #A0522D);
}

.team-counter .player-marker {
    background: linear-gradient(135deg, #4682B4, #87CEEB);
}



.player-marker.active {
    animation: markerPulse 0.5s ease;
}

@keyframes markerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.roulette-active-notice {
    background: rgba(255, 215, 0, 0.1) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    border-radius: var(--border-radius) !important;
    padding: 8px 12px !important;
    margin-top: 10px !important;
    font-size: 0.8rem !important;
    color: var(--roulette-gold) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.winner-wait-time {
    margin-left: 8px;
    font-size: 1.3rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.winner-wait-time.counting {
}

.winner-wait-time.final {
    color: var(--success);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}


@media (max-width: 768px) {
    .winner-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .winner-wait-time {
        margin-left: 0;
        font-size: 0.8rem;
    }
}

.cs-winner-display-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 20;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: fadeInUp 0.8s ease;
}

.cs-winner-avatar-overlay {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--roulette-gold), var(--roulette-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 20px;
    border: 5px solid var(--roulette-gold);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    animation: pulse 2s infinite;
}

.winner-info-overlay {
    text-align: center;
    background: rgba(24, 24, 27, 0.9);
    padding: 30px;
    border-radius: var(--border-radius-xl);
    border: 2px solid var(--roulette-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
}

.winner-name-overlay {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--roulette-gold);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.winner-text-overlay {
    font-size: 1.4rem;
    color: var(--twitch-text);
    font-weight: 600;
    line-height: 1.4;
}

.winner-username {
    color: var(--roulette-gold);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.cs-video-container {
    flex: 0 0 50%;
    position: relative;
    background: var(--twitch-dark);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 2px solid var(--twitch-gray);
    max-width: 500px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .cs-winner-avatar-overlay {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }
    
    .winner-name-overlay {
        font-size: 1.6rem;
    }
    
    .winner-text-overlay {
        font-size: 1.1rem;
    }
    
    .winner-info-overlay {
        padding: 20px;
        margin: 0 15px;
    }
}
/* Кнопка битвы кубов */
.btn-cube {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 50%, #6c3483 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 12px;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.btn-cube:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
    background: linear-gradient(135deg, #a569bd 0%, #9b59b6 50%, #7d3c98 100%);
}

.btn-cube:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #555;
    box-shadow: none;
}

.btn-cube i {
    font-size: 20px;
}

/* Модальное окно битвы кубов */
.cube-battle-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    font-family: 'Russo One', sans-serif;
}

.cube-battle-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.cube-battle-modal .modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cube-battle-container {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 50%, #16213e 100%);
    border-radius: 20px;
    border: 3px solid #9b59b6;
    box-shadow: 0 0 60px rgba(155, 89, 182, 0.4), inset 0 0 60px rgba(155, 89, 182, 0.1);
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.cube-battle-header {
    padding: 5px 10px;
    text-align: center;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.cube-battle-header h3 {
    color: #9b59b6;
    font-size: 32px;
    margin: 0 0 8px 0;
    text-shadow: 0 0 20px rgba(155, 89, 182, 0.6);
    font-weight: 900;
    letter-spacing: 2px;
}

.cube-battle-header p {
    color: #aaa;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.cube-battle-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Orbitron', monospace;
}

.alive-count {
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.eliminated-count {
    color: #e74c3c;
    text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.cube-battle-arena {
    flex: 1;
    position: relative;
    background: #050508;
    overflow: hidden;
}

#cubeBattleCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

#cubeBattleCanvas:active {
    cursor: grabbing;
}

.battle-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    pointer-events: none;
    z-index: 10;
}

.battle-controls-hint {
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    color: #888;
    border: 1px solid #333;
    font-family: 'Orbitron', monospace;
}

.battle-controls-hint .key {
    display: inline-block;
    background: linear-gradient(135deg, #333 0%, #444 100%);
    padding: 3px 8px;
    border-radius: 4px;
    margin: 0 3px;
    color: #fff;
    font-weight: bold;
    border: 1px solid #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.cube-battle-controls {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    border-top: 2px solid rgba(155, 89, 182, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.btn-start-battle {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    font-size: 20px !important;
    padding: 16px 40px !important;
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.5) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 30px rgba(231, 76, 60, 0.5); }
    50% { box-shadow: 0 0 50px rgba(231, 76, 60, 0.8); }
}

.cube-battle-winner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%);
    border: 4px solid #f1c40f;
    border-radius: 25px;
    padding: 50px 70px;
    text-align: center;
    box-shadow: 0 0 80px rgba(241, 196, 15, 0.6), inset 0 0 50px rgba(241, 196, 15, 0.1);
    z-index: 100;
    animation: winnerAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 400px;
}

@keyframes winnerAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.cube-winner-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 50%, #e67e22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin: 0 auto 25px;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.6);
    border: 4px solid #fff;
    animation: winnerPulse 2s infinite;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(241, 196, 15, 0.6); }
    50% { transform: scale(1.05); box-shadow: 0 0 60px rgba(241, 196, 15, 0.9); }
}

#cubeWinnerName {
    font-size: 36px;
    color: #f1c40f;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
    letter-spacing: 2px;
}

.cube-battle-winner .winner-text {
    color: #aaa;
    font-size: 16px;
    margin-bottom: 15px;
}

.winner-stats {
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Orbitron', monospace;
}

/* Конфетти */
.winner-celebration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 15px;
    height: 15px;
    background: #f1c40f;
    animation: confetti-fall 3s linear infinite;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: #e74c3c; }
.confetti:nth-child(2) { left: 30%; animation-delay: 0.5s; background: #3498db; }
.confetti:nth-child(3) { left: 50%; animation-delay: 1s; background: #2ecc71; }
.confetti:nth-child(4) { left: 70%; animation-delay: 1.5s; background: #9b59b6; }
.confetti:nth-child(5) { left: 90%; animation-delay: 2s; background: #f39c12; }

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .cube-battle-container {
        width: 98%;
        height: 95vh;
    }
    
    .cube-battle-header h3 {
        font-size: 24px;
    }
    
    .cube-battle-stats {
        flex-direction: column;
        gap: 8px;
        font-size: 14px;
    }
    
    .cube-battle-winner {
        min-width: 300px;
        padding: 30px 40px;
    }
    
    #cubeWinnerName {
        font-size: 24px;
    }
    
    .cube-winner-avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
}

.header-banner-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 0px;
    transition: transform 0.3s ease;
}

.header-banner-link:hover {
    transform: scale(1.05);
}

.header-banner {
    width: 300px;
    height: 100px;
    object-fit: cover;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .header-banner {
        width: 200px;
        height: 47px;
    }
    
    .header-banner-link {
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-banner {
        width: 150px;
        height: 35px;
    }
}

/* ============================================
   TWITCH USER INFO MODAL STYLES
   ============================================ */

.twitch-user-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.twitch-user-info-modal.active {
    display: flex;
}

.twitch-user-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.twitch-user-info-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: linear-gradient(135deg, #18181b 0%, #1f1f23 100%);
    border: 1px solid rgba(145, 70, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(145, 70, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: twitchModalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes twitchModalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.twitch-user-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(145, 70, 255, 0.15), rgba(145, 70, 255, 0.05));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.twitch-user-info-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #9146ff;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(145, 70, 255, 0.3);
}

.twitch-user-info-header-text {
    flex: 1;
    min-width: 0;
}

.twitch-user-info-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #efeff1;
    margin: 0 0 4px 0;
    word-break: break-word;
}

.twitch-user-info-id {
    font-size: 0.8rem;
    color: #adadb8;
    margin: 0 0 8px 0;
}

.twitch-user-info-created {
    font-size: 0.85rem;
    color: #adadb8;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.twitch-user-info-created .age-badge {
    background: rgba(145, 70, 255, 0.2);
    color: #af85ff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.twitch-user-info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #adadb8;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.twitch-user-info-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #efeff1;
    transform: rotate(90deg);
}

.twitch-user-info-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.twitch-user-info-description {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #adadb8;
    line-height: 1.5;
    word-break: break-word;
}

.twitch-user-info-description:empty::before {
    content: 'Нет описания';
    opacity: 0.5;
}

.twitch-user-info-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.twitch-user-info-stat {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.twitch-user-info-stat:hover {
    border-color: rgba(145, 70, 255, 0.2);
    background: rgba(145, 70, 255, 0.05);
}

.twitch-user-info-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #9146ff;
    display: block;
    margin-bottom: 4px;
}

.twitch-user-info-stat-label {
    font-size: 0.75rem;
    color: #adadb8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.twitch-user-info-follow-check {
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.1), rgba(0, 184, 148, 0.05));
    border: 1px solid rgba(0, 184, 148, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.twitch-user-info-follow-check.not-following {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(231, 76, 60, 0.05));
    border-color: rgba(231, 76, 60, 0.2);
}

.twitch-user-info-follow-check i {
    font-size: 1.5rem;
    color: #00b894;
}

.twitch-user-info-follow-check.not-following i {
    color: #e74c3c;
}

.twitch-user-info-follow-check-text {
    flex: 1;
}

.twitch-user-info-follow-check-text strong {
    color: #efeff1;
    display: block;
    margin-bottom: 2px;
}

.twitch-user-info-follow-check-text span {
    color: #adadb8;
    font-size: 0.85rem;
}

.twitch-user-info-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #efeff1;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.twitch-user-info-section-title i {
    color: #9146ff;
}

.twitch-user-info-follows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
}

.twitch-user-info-follows-grid::-webkit-scrollbar {
    width: 4px;
}

.twitch-user-info-follows-grid::-webkit-scrollbar-track {
    background: transparent;
}

.twitch-user-info-follows-grid::-webkit-scrollbar-thumb {
    background: #9146ff;
    border-radius: 2px;
}

.twitch-user-info-follow-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.twitch-user-info-follow-card:hover {
    border-color: rgba(145, 70, 255, 0.3);
    background: rgba(145, 70, 255, 0.08);
    transform: translateY(-2px);
}

.twitch-user-info-follow-card img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.twitch-user-info-follow-card .follow-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #efeff1;
    margin-bottom: 2px;
    word-break: break-word;
    max-width: 100%;
}

.twitch-user-info-follow-card .follow-date {
    font-size: 0.7rem;
    color: #7a7a8c;
}

.twitch-user-info-follow-card .live-badge {
    background: #ff0000;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.twitch-user-info-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.twitch-user-info-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(145, 70, 255, 0.2);
    border-top-color: #9146ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.twitch-user-info-loading p {
    color: #adadb8;
    font-size: 1rem;
}

.twitch-user-info-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
}

.twitch-user-info-error i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.twitch-user-info-follows-count {
    font-size: 0.85rem;
    color: #adadb8;
    margin-bottom: 12px;
}

.twitch-user-info-follows-count strong {
    color: #efeff1;
}

/* Кликабельный никнейм победителя */
.winner-username-clickable {
    cursor: pointer;
    color: #ffd700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 215, 0, 0.5);
    text-underline-offset: 3px;
    transition: all 0.2s ease;
    position: relative;
}

.winner-username-clickable:hover {
    color: #ffec8b;
    text-decoration-color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.winner-username-clickable::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7em;
    margin-left: 6px;
    opacity: 0.6;
    vertical-align: middle;
}

.winner-username-clickable:hover::after {
    opacity: 1;
}

/* Адаптивность модалки */
@media (max-width: 600px) {
    .twitch-user-info-content {
        width: 95%;
        max-height: 90vh;
    }

    .twitch-user-info-header {
        padding: 16px;
        gap: 12px;
    }

    .twitch-user-info-avatar {
        width: 60px;
        height: 60px;
    }

    .twitch-user-info-name {
        font-size: 1.2rem;
    }

    .twitch-user-info-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .twitch-user-info-follows-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .twitch-user-info-body {
        padding: 16px;
    }
}
.first-msg-badge {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a1a;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}
@media (max-width: 768px) {
    .button-group { gap: 6px; }
    .button-group button { padding: 10px 8px; font-size: 12px; }
    .btn-fm, .btn-sub {
        flex: 0 0 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
    }
    .btn-fm .fm-label { font-size: 11px; }
    .btn-sub .sub-label { font-size: 9px; }
}

@media (max-width: 480px) {
    .button-group { gap: 5px; }
    .button-group button { padding: 10px 6px; font-size: 11px; }
    .button-group button i { font-size: 13px; }
    .btn-fm, .btn-sub {
        flex: 0 0 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
    }
    .btn-fm .fm-label { font-size: 10px; }
    .btn-sub .sub-label { font-size: 8px; }
}