/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #fff;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
}

/* ===== LEFT SIDEBAR ===== */
.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-info.cyan {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    color: #000;
    padding: 20px;
    border-radius: 10px;
}

.game-info.cyan h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.game-info.cyan button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: none;
    border-radius: 5px;
    background: rgba(0,0,0,0.2);
    color: #000;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.game-info.cyan button:hover {
    background: rgba(0,0,0,0.4);
}

.other-games.green {
    background: linear-gradient(135deg, #00ff00, #00cc00);
    color: #000;
    padding: 20px;
    border-radius: 10px;
    flex-grow: 1;
}

.other-games.green h3 {
    margin-bottom: 15px;
}

.other-games.green button {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    border: none;
    border-radius: 5px;
    background: rgba(0,0,0,0.2);
    color: #000;
    cursor: pointer;
    font-weight: bold;
}

.footer.yellow {
    background: linear-gradient(135deg, #ffff00, #cccc00);
    color: #000;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
}

/* ===== CENTER ===== */
.center {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-bar.red {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-bar.red input {
    flex-grow: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    color: #000;
}

.search-bar.red button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.search-bar.red button:hover {
    background: rgba(0,0,0,0.5);
}

.rooms-list.pink {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 10px;
}

.room-card {
    background: linear-gradient(135deg, #ff00ff, #cc00cc);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255,0,255,0.4);
}

.room-card h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.room-card p {
    font-size: 13px;
    margin-bottom: 5px;
    opacity: 0.9;
}

.room-card .status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 10px;
}

.status.waiting { background: #00ff00; color: #000; }
.status.playing { background: #ffff00; color: #000; }
.status.full { background: #ff0000; color: #fff; }

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.user-panel.purple {
    background: linear-gradient(135deg, #9900ff, #7700cc);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.user-panel.purple button {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.user-panel.purple .user-info {
    display: none;
}

.user-panel.purple.logged-in .login-btn {
    display: none;
}

.user-panel.purple.logged-in .user-info {
    display: block;
}

.leaderboard.blue {
    background: linear-gradient(135deg, #0066ff, #0044cc);
    padding: 20px;
    border-radius: 10px;
}

.leaderboard.blue h3 {
    margin-bottom: 15px;
}

.leaderboard.blue ol {
    padding-left: 20px;
}

.leaderboard.blue li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    font-size: 14px;
}

.recent-losses.lightblue {
    background: linear-gradient(135deg, #00ccff, #0099cc);
    padding: 20px;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.recent-losses.lightblue h3 {
    margin-bottom: 15px;
}

.recent-losses.lightblue ul {
    list-style: none;
    padding: 0;
}

.recent-losses.lightblue li {
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.room-info.darkblue {
    background: linear-gradient(135deg, #003366, #002244);
    padding: 20px;
    border-radius: 10px;
    flex-grow: 1;
}

.room-info.darkblue h3 {
    margin-bottom: 15px;
}

.room-info.darkblue p {
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.room-info.darkblue button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background: #00ff00;
    color: #000;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
}

.footer.orange {
    background: linear-gradient(135deg, #ff9900, #cc7700);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 12px;
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2a2a4a;
    padding: 40px;
    border-radius: 15px;
    width: 400px;
    max-width: 90%;
}

.modal-content h2 {
    margin-bottom: 25px;
    text-align: center;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    background: rgba(255,255,255,0.9);
    color: #000;
}

.modal-content button {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

.modal-content button[type="submit"] {
    background: #00ff00;
    color: #000;
}

.modal-content button[type="button"] {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ===== GAME PAGE ===== */
.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 12px 25px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.back-btn:hover {
    background: rgba(255,255,255,0.4);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .left-sidebar,
    .right-sidebar {
        display: none;
    }
}
/* ===== GAME PAGE ===== */
.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 12px 25px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    z-index: 100;
}

.back-btn:hover {
    background: rgba(255,255,255,0.4);
}

.game-info-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    padding: 20px;
    border-radius: 10px;
    color: #fff;
    z-index: 100;
}

.game-info-overlay #playerList {
    margin-top: 15px;
}

.game-info-overlay #playerList ul {
    list-style: none;
    padding: 0;
}

.game-info-overlay #playerList li {
    padding: 5px 0;
    font-size: 14px;
}
.start-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 50px;
    background: #00ff00;
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 200;
    animation: pulse 1.5s infinite;
}

.start-btn:hover {
    background: #00cc00;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    z-index: 300;
}

.end-screen h2 {
    color: #fff;
    font-size: 48px;
    margin-bottom: 30px;
}

.end-screen button {
    padding: 15px 40px;
    background: #0066ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
}

.end-screen button:hover {
    background: #0044cc;
}

.status {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: bold;
}

.status.waiting { background: #ffff00; color: #000; }
.status.playing { background: #00ff00; color: #000; }
.status.ended { background: #ff0000; color: #fff; }

#playersList li.current-turn {
    background: rgba(0, 255, 0, 0.3);
    border-left: 3px solid #0f0;
    padding-left: 10px;
    font-weight: bold;
}

#playersList li {
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    transition: all 0.3s;
}