* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --red: #ff4757;
    --gold: #ffd32a;
    --green: #26de81;
    --blue: #4facfe;
    --purple: #a855f7;
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border: rgba(255, 255, 255, 0.1);
    --glow: 0 0 30px rgba(255, 71, 87, 0.3);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    position: relative;
}

/* Фоновый градиент */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at top right, rgba(255, 71, 87, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom center, rgba(79, 172, 254, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Снежинки */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: snowfall linear infinite;
    opacity: 0.8;
}

@keyframes snowfall {
    0% { transform: translateY(-20px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}

/* Контейнер */
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Заголовок */
.header {
    text-align: center;
    padding: 40px 20px 30px;
}

.header .logo {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Карточка */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 20px;
}

.card h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.3rem;
    color: var(--text);
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Кнопки */
.btn {
    display: block;
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red), #ff6b81);
    color: white;
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 71, 87, 0.5);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #ffdd59);
    color: #1a1a2e;
    box-shadow: 0 10px 30px rgba(255, 211, 42, 0.3);
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 211, 42, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Табы */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.tab.active {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Сообщения */
.message {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.message-error {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff6b81;
}

.message-success {
    background: rgba(38, 222, 129, 0.15);
    border: 1px solid rgba(38, 222, 129, 0.3);
    color: var(--green);
}

.message-info {
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid rgba(79, 172, 254, 0.3);
    color: var(--blue);
}

/* Рулетка */
.roulette-container {
    text-align: center;
    padding: 10px 0;
}

.drinks-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(79, 172, 254, 0.2));
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.wheel-wrapper {
    position: relative;
    width: 320px;
    height: 360px;
    margin: 0 auto 25px;
}

.wheel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    z-index: 10;
    filter: drop-shadow(0 0 15px rgba(255, 71, 87, 0.8));
}

#wheel-canvas {
    margin-top: 35px;
    border-radius: 50%;
    box-shadow: 
        0 0 0 6px rgba(255, 215, 42, 0.8),
        0 0 0 10px rgba(168, 85, 247, 0.5),
        0 0 60px rgba(168, 85, 247, 0.3);
}

.spin-btn {
    animation: glow 2s ease-in-out infinite;
}

.spin-btn:disabled {
    animation: none;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 10px 30px rgba(255, 71, 87, 0.4); }
    50% { box-shadow: 0 10px 50px rgba(255, 71, 87, 0.7); }
}

/* Результат */
.result-card {
    background: linear-gradient(135deg, rgba(255, 215, 42, 0.1), rgba(255, 71, 87, 0.1));
    border: 2px solid var(--gold);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(transparent, rgba(255, 215, 42, 0.1), transparent 30%);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.result-card h3 {
    position: relative;
    color: var(--gold);
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.result-item {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item .icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.result-item .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-item .value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

/* Навигация */
.nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.nav a {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--purple);
    transform: translateY(-2px);
}

/* Таблица участников */
.participants-table {
    width: 100%;
    border-collapse: collapse;
}

.participants-table th,
.participants-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.participants-table th {
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.participants-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Карточки участников */
.participant-cards {
    display: none;
}

.participant-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
}

.participant-card .name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text);
}

.participant-card .drink {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Админ-панель */
.admin-section {
    margin-bottom: 25px;
}

.admin-section h3 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drink-list {
    list-style: none;
}

.drink-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}

.drink-item span {
    font-weight: 500;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
    width: auto;
}

.btn-danger {
    background: rgba(255, 71, 87, 0.2);
    color: var(--red);
    border: 1px solid rgba(255, 71, 87, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

/* Конфетти */
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Адаптивность */
@media (max-width: 768px) {
    .header h1 { font-size: 1.6rem; }
    .header .logo { font-size: 3rem; }
    .card { padding: 20px; border-radius: 20px; }
    
    .participants-table { display: none; }
    .participant-cards { display: block; }
    
    .tabs { flex-direction: column; }
    .nav { flex-direction: column; }
}

@media (max-width: 480px) {
    .container { padding: 15px; }
    .header { padding: 30px 15px 20px; }
    .header h1 { font-size: 1.4rem; }
    
    .btn { padding: 14px 20px; font-size: 1rem; }
    .form-group input { padding: 14px 16px; }
    
    .wheel-wrapper { width: 280px; height: 320px; }
    #wheel-canvas { width: 260px !important; height: 260px !important; }
}

/* Logout */
.logout-link {
    display: block;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 10px;
    transition: color 0.3s;
}

.logout-link:hover {
    color: var(--red);
}

/* Декорации */
.decoration {
    position: fixed;
    font-size: 2rem;
    opacity: 0.15;
    z-index: 0;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

.decoration-1 { top: 10%; left: 5%; animation-delay: 0s; }
.decoration-2 { top: 20%; right: 8%; animation-delay: 0.5s; }
.decoration-3 { bottom: 25%; left: 8%; animation-delay: 1s; }
.decoration-4 { bottom: 10%; right: 5%; animation-delay: 1.5s; }


/* Админ - список участников */
.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    gap: 15px;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text);
}

.admin-user-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 1rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.btn-icon-danger:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: rgba(255, 71, 87, 0.3);
}

/* Кнопка danger полная */
.btn-danger {
    background: rgba(255, 71, 87, 0.2);
    color: var(--red);
    border: 1px solid rgba(255, 71, 87, 0.3);
    width: 100%;
}

.btn-danger:hover {
    background: var(--red);
    color: white;
}

/* Мобильная адаптация админки */
@media (max-width: 480px) {
    .admin-user-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-user-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--border);
    }
    
    .admin-user-details {
        white-space: normal;
    }
}
