body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
    background: linear-gradient(135deg, #1a1025 0%, #311b4d 100%);
    color: #ffffff;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-container {
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    /* Важно для Canvas */
}

.btn {
    padding: 16px 20px;
    margin: 10px 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    border-radius: 14px;
    border: none;
    background: #8b5cf6;
    color: white;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #5b21b6;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #5b21b6;
}

.btn-success {
    background: #10b981;
    box-shadow: 0 4px 0 #047857;
}

.btn-success:active {
    box-shadow: 0 0 0 #047857;
}

.input-text {
    padding: 16px;
    font-size: 18px;
    border-radius: 14px;
    border: 2px solid #4c1d95;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-text:focus {
    border-color: #8b5cf6;
}

#loginArea,
#lobbyArea,
#questionArea,
#votingArea,
#resultsArea {
    display: none;
}

.active-screen {
    display: block !important;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#timerBarContainer {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    margin: 0 0 20px 0;
    display: none;
}

#timerBar {
    width: 100%;
    height: 100%;
    background: #10b981;
    transform-origin: left;
    transition: transform 0.1s linear;
}

.players-list {
    z-index: 2;
    position: relative;
}

.player-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
    border-radius: 12px;
    font-weight: bold;
    position: relative;
}

.disconnected {
    opacity: 0.5;
    text-decoration: line-through;
}

.spectator {
    color: #cf6679;
    border: 1px solid #cf6679;
}

#roomBadge {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    display: none;
    transition: all 0.2s;
    z-index: 100;
}

#roomBadge:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.large-text {
    margin-top: 0;
    font-size: 22px;
}

.success-text {
    display: none;
    color: #10b981;
    font-weight: bold;
}


/* Настройки для Тьмы */

.results-wrapper {
    position: relative;
    min-height: 250px;
}

#darknessCanvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 24px 24px;
}


/* Добавить в конец style.css */

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }
    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }
    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }
    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }
    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }
    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }
    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }
    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }
    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }
    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }
    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.player-avatar {
    font-size: 24px;
    margin-right: 10px;
    vertical-align: middle;
}

.clickable-avatar {
    cursor: pointer;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
    display: inline-block;
}

.clickable-avatar:hover {
    transform: scale(1.3) rotate(10deg);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.clickable-avatar:active {
    transform: scale(0.9);
}