:root {
    --red-player: #E74C3C;
    --yellow-player: #F39C12;
    --board-blue: #2C3E50;
    --board-light: #34495E;
    --background: #0a0e27;
    --card-bg: #13182e;
    --text-primary: #eee;
    --text-secondary: #aaa;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --purple: #9b59b6;
    --blue: #3498db;
    --border-radius: 16px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --glow: 0 0 20px rgba(243, 156, 18, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 25%, #2d1b4e 50%, #1a1a3e 75%, #0a0e27 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 90%, white, transparent);
    background-size: 200% 200%;
    animation: starTwinkle 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.header {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(19, 24, 46, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(155, 89, 182, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.title {
    font-size: 2.2rem;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 25%, #6bcf7f 50%, #4ecdc4 75%, #a78bfa 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.header-info {
    color: var(--text-secondary);
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen.active {
    display: block;
}

.menu-card {
    max-width: 600px;
    margin: 50px auto;
    padding: 50px;
    background: rgba(19, 24, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), 0 0 50px rgba(155, 89, 182, 0.3);
    border: 2px solid rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: hidden;
}

.menu-card::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: left 0.5s;
}

.menu-card:hover::before {
    left: 100%;
}

.menu-card h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="text"], select {
    padding: 14px 18px;
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid rgba(155, 89, 182, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.4);
    background: rgba(10, 14, 39, 1);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(155, 89, 182, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #2C3E50 0%, #3498db 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.2rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    font-size: 1.3rem;
}

.btn-icon-small {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.4);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    color: var(--text-primary);
}

.btn-icon-small:hover {
    transform: scale(1.15);
    background: rgba(155, 89, 182, 0.4);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.5);
}

.divider {
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    margin: 20px 0;
    font-weight: 600;
    letter-spacing: 2px;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.game-layout {
    display: grid;
    grid-template-columns: 260px 1fr 260px;
    gap: 12px;
    align-items: start;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.sidebar {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.5);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 89, 182, 0.8);
}

@media (max-width: 1400px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-left {
        order: 2;
    }

    .game-area {
        order: 1;
    }

    .sidebar-right {
        order: 3;
    }
}

.card {
    background: rgba(19, 24, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow), 0 0 20px rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(155, 89, 182, 0.2);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(155, 89, 182, 0.1);
    transition: all 0.3s;
}

.info-item:hover {
    background: rgba(10, 14, 39, 0.8);
    border-color: rgba(155, 89, 182, 0.3);
    transform: translateX(5px);
}

.info-item .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.info-item .value {
    font-weight: 700;
    margin-left: auto;
    color: var(--purple);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(155, 89, 182, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    transition: all 0.3s;
}

.player-item:hover {
    transform: translateX(5px);
    border-color: rgba(155, 89, 182, 0.5);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.2);
}

.player-color {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    position: relative;
}

.player-color::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 40%;
    height: 40%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(3px);
}

.player-color.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, var(--red-player));
    box-shadow: 0 0 20px var(--red-player);
}

.player-color.yellow {
    background: radial-gradient(circle at 30% 30%, #ffd93d, var(--yellow-player));
    box-shadow: 0 0 20px var(--yellow-player);
}

.player-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.05rem;
}

.player-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    color: white;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.4);
}

.turn-indicator {
    text-align: center;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(19, 24, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow), 0 0 30px rgba(155, 89, 182, 0.2);
    border: 2px solid rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: hidden;
}

.turn-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: slideLight 2s infinite;
}

@keyframes slideLight {
    0% { left: -100%; }
    100% { left: 100%; }
}

.turn-message {
    font-size: 1.2rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.turn-message.red-turn {
    color: var(--red-player);
    text-shadow: 0 0 20px var(--red-player);
    animation: glow 2s ease-in-out infinite;
}

.turn-message.yellow-turn {
    color: var(--yellow-player);
    text-shadow: 0 0 20px var(--yellow-player);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.board-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.board {
    display: inline-grid;
    grid-template-columns: repeat(7, 60px);
    grid-template-rows: repeat(6, 60px);
    gap: 8px;
    padding: 18px;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), 0 0 50px rgba(52, 152, 219, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 3px solid rgba(52, 152, 219, 0.4);
}

.board::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 3px;
    background: linear-gradient(45deg, transparent, rgba(52, 152, 219, 0.5), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.cell {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(10, 14, 39, 0.9), rgba(10, 14, 39, 0.7));
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(52, 152, 219, 0.2);
}

.cell:hover {
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(155, 89, 182, 0.4);
}

.cell::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cell.red::after {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, var(--red-player), #c0392b);
    box-shadow: 0 0 25px var(--red-player), inset -3px -3px 10px rgba(192, 57, 43, 0.8), inset 3px 3px 10px rgba(255, 107, 107, 0.8);
}

.cell.yellow::after {
    background: radial-gradient(circle at 30% 30%, #ffd93d, var(--yellow-player), #d68910);
    box-shadow: 0 0 25px var(--yellow-player), inset -3px -3px 10px rgba(214, 137, 16, 0.8), inset 3px 3px 10px rgba(255, 217, 61, 0.8);
}

.cell.winning {
    animation: winPulse 0.8s ease-in-out infinite;
}

@keyframes winPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.6);
    }
    50% {
        transform: scale(1.15);
        box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 255, 255, 0.9);
    }
}

@keyframes drop {
    0% {
        transform: translate(-50%, -1000%);
    }
    60% {
        transform: translate(-50%, -40%);
    }
    80% {
        transform: translate(-50%, -55%);
    }
    100% {
        transform: translate(-50%, -50%);
    }
}

.cell.just-placed::after {
    animation: drop 0.7s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.column-indicators {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.column-indicator {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(44, 62, 80, 0.6);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    font-size: 1.2rem;
    color: transparent;
    border: 2px solid rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.column-indicator::before {
    content: '▼';
    position: absolute;
    font-size: 1.8rem;
    opacity: 0;
    transition: all 0.3s;
}

.column-indicator:hover:not(.disabled) {
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    transform: translateY(-8px);
    color: white;
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.5), 0 0 30px rgba(243, 156, 18, 0.3);
    border-color: var(--yellow-player);
}

.column-indicator:hover:not(.disabled)::before {
    opacity: 1;
    transform: translateY(-5px);
}

.column-indicator.disabled {
    cursor: not-allowed;
    opacity: 0.2;
}

.column-indicator.disabled:hover {
    background: rgba(44, 62, 80, 0.6);
    transform: none;
}

.game-message {
    text-align: center;
    margin-top: 15px;
    padding: 15px;
    background: rgba(19, 24, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 700;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(155, 89, 182, 0.3);
    box-shadow: var(--shadow), 0 0 30px rgba(155, 89, 182, 0.2);
}

.game-message.winner-red {
    background: linear-gradient(135deg, var(--red-player), #c0392b);
    color: white;
    animation: winnerFlash 1s ease-in-out infinite;
    box-shadow: 0 0 50px var(--red-player);
}

.game-message.winner-yellow {
    background: linear-gradient(135deg, var(--yellow-player), #d68910);
    color: white;
    animation: winnerFlash 1s ease-in-out infinite;
    box-shadow: 0 0 50px var(--yellow-player);
}

@keyframes winnerFlash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-message.draw {
    background: linear-gradient(135deg, var(--board-blue), var(--purple));
    color: white;
    box-shadow: 0 0 40px var(--purple);
}

.chat-card {
    display: flex;
    flex-direction: column;
    height: 250px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.chat-message {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(19, 24, 46, 0.9);
    border-radius: 10px;
    animation: slideInChat 0.4s ease;
    border: 1px solid rgba(155, 89, 182, 0.2);
    transition: all 0.3s;
}

.chat-message:hover {
    background: rgba(19, 24, 46, 1);
    transform: translateX(5px);
    border-color: rgba(155, 89, 182, 0.4);
}

@keyframes slideInChat {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-message-header {
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 5px;
}

.chat-message-text {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chat-input-container {
    display: flex;
    gap: 6px;
}

.chat-input-container input {
    flex: 1;
    min-width: 0;
}

.chat-input-container .btn {
    padding: 10px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.move-history {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(19, 24, 46, 0.9);
    border-radius: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    transition: all 0.3s;
}

.history-item:hover {
    background: rgba(19, 24, 46, 1);
    transform: translateX(5px);
    border-color: rgba(155, 89, 182, 0.4);
}

.history-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.history-icon.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, var(--red-player));
    box-shadow: 0 0 10px var(--red-player);
}

.history-icon.yellow {
    background: radial-gradient(circle at 30% 30%, #ffd93d, var(--yellow-player));
    box-shadow: 0 0 10px var(--yellow-player);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(19, 24, 46, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 2px solid rgba(155, 89, 182, 0.4);
    box-shadow: 0 0 60px rgba(155, 89, 182, 0.4);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(155, 89, 182, 0.1);
}

.modal-header h2 {
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid rgba(231, 76, 60, 0.4);
    color: var(--danger);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    font-weight: 700;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
    box-shadow: 0 0 20px var(--danger);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 18px 26px;
    background: rgba(19, 24, 46, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(155, 89, 182, 0.4);
    border: 2px solid rgba(155, 89, 182, 0.4);
    transform: translateX(500px);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
    max-width: 350px;
    font-weight: 600;
}

.toast.active {
    transform: translateX(0);
}

.spectator-badge {
    background: linear-gradient(135deg, var(--text-secondary), var(--board-light));
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Confetti Canvas */
#confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Emoji Reactions */
.emoji-reaction {
    position: absolute;
    font-size: 3rem;
    animation: floatUp 2s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0);
    }
    50% {
        transform: translateY(-100px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.5);
    }
}

/* Theme Selector */
.theme-selector {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.theme-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.theme-option:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px currentColor;
}

.theme-option.active {
    border-color: white;
    box-shadow: 0 0 20px currentColor;
}

.theme-default {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.theme-ocean {
    background: linear-gradient(135deg, #2E3192, #1BFFFF);
}

.theme-sunset {
    background: linear-gradient(135deg, #FF416C, #FF4B2B);
}

.theme-forest {
    background: linear-gradient(135deg, #134E5E, #71B280);
}

/* Avatar Selection */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.avatar-option {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.avatar-option:hover {
    transform: scale(1.15);
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.5);
}

.avatar-option.selected {
    border-color: var(--yellow-player);
    box-shadow: 0 0 20px var(--yellow-player);
}

/* Timer Display */
.timer-display {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 15px;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 12px;
    border: 2px solid rgba(155, 89, 182, 0.3);
    margin: 15px 0;
}

.timer-display.warning {
    color: var(--danger);
    animation: timerPulse 1s infinite;
    border-color: var(--danger);
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Particle Container */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 14, 39, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-radius: 5px;
    transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    box-shadow: 0 0 10px var(--purple);
}

/* Emoji Reactions Panel */
.emoji-reactions-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Achievements */
.achievement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(155, 89, 182, 0.2);
    opacity: 0.5;
    transition: all 0.3s;
}

.achievement.unlocked {
    opacity: 1;
    border-color: var(--yellow-player);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
    animation: achievementUnlock 0.6s ease;
}

@keyframes achievementUnlock {
    0% {
        transform: scale(0.8) rotate(-10deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.achievement-icon {
    font-size: 1.8rem;
}

.achievement-text {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Stats Modal Content */
#statsContent {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stat-card {
    background: rgba(10, 14, 39, 0.6);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid rgba(155, 89, 182, 0.3);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(155, 89, 182, 0.6);
    box-shadow: 0 0 25px rgba(155, 89, 182, 0.3);
}

.stat-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--yellow-player), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Emoji Reaction Animation */
.emoji-float {
    position: fixed;
    font-size: 3rem;
    pointer-events: none;
    z-index: 10000;
    animation: emojiFloat 2s ease-out forwards;
}

@keyframes emojiFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    50% {
        transform: translateY(-100px) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) scale(0.8) rotate(360deg);
    }
}

/* Loading Animation */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(155, 89, 182, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pulse Animation for Important Elements */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Shake Animation for Errors */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 30px currentColor;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px currentColor; }
    50% { box-shadow: 0 0 40px currentColor; }
}

/* Particle Effects */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--yellow-player);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFall 2s ease-out forwards;
}

@keyframes particleFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(500px) rotate(720deg);
    }
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-winner {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: badgeShine 2s ease-in-out infinite;
}

@keyframes badgeShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.badge-streak {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.badge-perfect {
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    color: white;
}

/* Tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(19, 24, 46, 0.98);
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(10, 14, 39, 0.6);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--blue));
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

/* Notification Dot */
.notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    animation: notificationPulse 2s ease-in-out infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sidebar {
        max-height: none;
    }

    .sidebar-left,
    .sidebar-right {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 10px;
        margin-bottom: 10px;
    }

    .title {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .header-info {
        font-size: 0.7rem;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 10px;
        max-height: none;
    }

    .sidebar {
        max-height: none;
        overflow: visible;
    }

    .sidebar-left,
    .sidebar-right {
        display: block;
    }

    .board {
        grid-template-columns: repeat(7, 45px);
        grid-template-rows: repeat(6, 45px);
        gap: 6px;
        padding: 12px;
    }

    .cell {
        width: 45px;
        height: 45px;
    }

    .cell::after {
        width: 38px;
        height: 38px;
    }

    .column-indicator {
        width: 45px;
        height: 35px;
        font-size: 1rem;
    }

    .column-indicators {
        gap: 6px;
    }

    .turn-indicator {
        padding: 10px;
        margin-bottom: 10px;
    }

    .turn-message {
        font-size: 1rem;
    }

    .game-message {
        font-size: 0.95rem;
        padding: 10px;
        min-height: 40px;
        margin-top: 10px;
    }

    .card {
        padding: 8px;
        margin-bottom: 8px;
    }

    .card h3 {
        font-size: 0.85rem;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .voice-controls {
        gap: 6px;
    }

    .voice-btn {
        padding: 8px;
    }

    .voice-icon {
        font-size: 1.2rem;
    }

    .voice-label {
        font-size: 0.65rem;
    }

    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .action-btn {
        padding: 6px 4px;
        font-size: 0.75rem;
    }

    .action-icon {
        font-size: 1.2rem;
    }

    .action-label {
        font-size: 0.65rem;
    }

    .chat-card {
        height: 250px;
    }

    .move-history {
        max-height: 200px;
    }

    #statsContent {
        grid-template-columns: 1fr;
    }

    .avatar-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .menu-card {
        padding: 30px 20px;
        margin: 20px auto;
    }

    .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }

    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.2rem;
    }

    .board {
        grid-template-columns: repeat(7, 38px);
        grid-template-rows: repeat(6, 38px);
        gap: 4px;
        padding: 10px;
    }

    .cell {
        width: 38px;
        height: 38px;
    }

    .cell::after {
        width: 32px;
        height: 32px;
    }

    .column-indicator {
        width: 38px;
        height: 30px;
        font-size: 0.9rem;
    }

    .column-indicators {
        gap: 4px;
        margin-bottom: 8px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .sidebar-left,
    .sidebar-right {
        grid-template-columns: 1fr;
    }

    .emoji-reactions-panel {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Lobby Styles */
.lobby-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.lobby-room {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lobby-room:hover {
    border-color: var(--purple);
    background: rgba(155, 89, 182, 0.15);
    transform: translateX(5px);
}

.lobby-room-info {
    flex: 1;
}

.lobby-room-code {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--purple);
    margin-bottom: 5px;
}

.lobby-room-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.lobby-room-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.lobby-room-status.waiting {
    background: var(--success);
    color: white;
}

.lobby-room-status.playing {
    background: var(--warning);
    color: white;
}

.lobby-room-status.finished {
    background: var(--text-secondary);
    color: white;
}

.lobby-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.lobby-empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(155, 89, 182, 0.3);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modern Action Buttons */
.actions-card .action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 8px 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.action-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.action-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.action-label {
    font-size: 0.7rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Specific button colors */
.action-btn-info:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(41, 128, 185, 0.2));
    border-color: rgba(52, 152, 219, 0.5);
}

.action-btn-stats:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(39, 174, 96, 0.2));
    border-color: rgba(46, 204, 113, 0.5);
}

.action-btn-trophy:hover {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.3), rgba(243, 156, 18, 0.2));
    border-color: rgba(241, 196, 15, 0.5);
}

.action-btn-profile:hover {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(142, 68, 173, 0.2));
    border-color: rgba(155, 89, 182, 0.5);
}

.action-btn-reset:hover {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.3), rgba(211, 84, 0, 0.2));
    border-color: rgba(230, 126, 34, 0.5);
}

.action-btn-leave:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.2));
    border-color: rgba(231, 76, 60, 0.5);
}

/* Hide broken/incomplete features */
.music-control {
    display: none !important;
}

.level-up-notification {
    display: none !important;
}

/* Enhanced Card Styling */
.card {
    background: rgba(19, 24, 46, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    padding: 10px;
    margin-bottom: 8px;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.card h3 {
    color: var(--purple);
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 2px solid rgba(155, 89, 182, 0.3);
    padding-bottom: 8px;
}

/* Quick Reactions Panel */
.emoji-reactions-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.emoji-reactions-panel .btn-icon-small {
    font-size: 1.5rem;
    padding: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.emoji-reactions-panel .btn-icon-small:hover {
    transform: scale(1.2) rotate(10deg);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Player Items */
.player-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.player-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Stats Items */
.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-item .value {
    color: var(--purple);
    font-weight: 700;
    font-size: 1rem;
}

/* Move History */
.move-history {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(3px);
}

.history-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-icon.red {
    background: var(--red-player);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.history-icon.yellow {
    background: var(--yellow-player);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

/* Scrollbar Styling */
.move-history::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.lobby-list::-webkit-scrollbar {
    width: 6px;
}

.move-history::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.lobby-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.move-history::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.lobby-list::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.5);
    border-radius: 10px;
}

.move-history::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.lobby-list::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 89, 182, 0.8);
}

/* Voice Chat Controls */
.voice-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.voice-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.voice-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.voice-btn:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(39, 174, 96, 0.2));
    border-color: rgba(46, 204, 113, 0.5);
    transform: translateY(-2px);
}

.voice-btn.active {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(192, 57, 43, 0.2));
    border-color: rgba(231, 76, 60, 0.5);
}

.voice-btn.muted {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.3), rgba(211, 84, 0, 0.2));
    border-color: rgba(230, 126, 34, 0.5);
}

.voice-icon {
    font-size: 1.5rem;
}

.voice-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

/* Collapsible Sections */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
}

.collapsible-header:hover {
    opacity: 0.8;
}

.collapsible-toggle {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--purple);
}

.collapsible-toggle.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}
