/* Общий фон с градиентом */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #fff;
    overflow-x: hidden;
}

/* Заголовки с тенью */
h2, h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 {
    font-size: 1.2rem;
}

/* Логин и игра */
#login, #game {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.5s ease-in;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Поле ввода */
input {
    padding: 10px;
    border: none;
    border-radius: 10px;
    margin: 10px 0;
    width: 200px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    outline: none;
    transition: all 0.3s;
}

    input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    input:focus {
        background: rgba(255, 255, 255, 0.3);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    }

/* Кнопки */
button {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    margin: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    }

    button:active {
        transform: translateY(0);
    }

/* Кнопка поиска игры */
#findGameBtn {
    background: linear-gradient(45deg, #4CAF50, #2E7D32);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

    #findGameBtn:hover {
        box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
    }

/* Кнопка отмены поиска */
#cancelSearchBtn {
    background: linear-gradient(45deg, #ff6b6b, #cc0000) !important;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
}

    #cancelSearchBtn:hover {
        background: linear-gradient(45deg, #cc0000, #990000) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6) !important;
    }

/* Контейнер для кнопок поиска */
.search-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

/* Статус */
#status {
    font-size: 1.2rem;
    margin: 20px 0;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Выбор скина */
.skin-selector {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.skin-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.skin-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s;
    width: 100px;
}

    .skin-option:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-5px);
    }

    .skin-option.active {
        background: rgba(76, 175, 80, 0.2);
        border: 2px solid #4CAF50;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
    }

.skin-preview {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
}

.preview-piece {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Стили для разных скинов шашек */

/* Классический скин (стандартный) */
.piece.classic.player1 {
    background: linear-gradient(45deg, #ff0000, #cc0000);
    border: 2px solid #990000;
}

.piece.classic.player2 {
    background: linear-gradient(45deg, #0000ff, #000099);
    border: 2px solid #000066;
}

/* Новогодний скин */
.piece.christmas.player1 {
    background: linear-gradient(45deg, #ff3333, #ff6666);
    border: 2px solid #cc0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.piece.christmas.player2 {
    background: linear-gradient(45deg, #33ff33, #66ff66);
    border: 2px solid #00cc00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.piece.christmas.king {
    border: 3px solid gold;
    box-shadow: 0 0 20px gold, 0 0 10px rgba(255, 215, 0, 0.5);
}

    .piece.christmas.king::after {
        content: '🎄';
        font-size: 18px;
        color: #ff0000;
        text-shadow: 0 0 3px white;
    }

/* Космический скин */
.piece.galaxy.player1 {
    background: linear-gradient(45deg, #ff00ff, #9900ff);
    border: 2px solid #6600cc;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.7);
}

.piece.galaxy.player2 {
    background: linear-gradient(45deg, #00ffff, #0099ff);
    border: 2px solid #0066cc;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

.piece.galaxy.king {
    border: 3px solid #ffcc00;
    box-shadow: 0 0 25px #ffcc00, 0 0 15px rgba(255, 204, 0, 0.5);
}

    .piece.galaxy.king::after {
        content: '★';
        font-size: 20px;
        color: #ffcc00;
        text-shadow: 0 0 5px #fff, 0 0 10px #ffcc00;
    }

/* Превью скинов */
.preview-piece.player1.classic {
    background: linear-gradient(45deg, #ff0000, #cc0000);
}

.preview-piece.player2.classic {
    background: linear-gradient(45deg, #0000ff, #000099);
}

.preview-piece.player1.christmas {
    background: linear-gradient(45deg, #ff3333, #ff6666);
}

.preview-piece.player2.christmas {
    background: linear-gradient(45deg, #33ff33, #66ff66);
}

.preview-piece.player1.galaxy {
    background: linear-gradient(45deg, #ff00ff, #9900ff);
}

.preview-piece.player2.galaxy {
    background: linear-gradient(45deg, #00ffff, #0099ff);
}

/* Доска */
#board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 2px;
    border: 5px solid #8b4513;
    border-radius: 10px;
    width: fit-content;
    margin: 20px auto;
    background: #8b4513;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    perspective: 1000px;
}

/* Клетки */
.cell {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .cell::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), transparent);
        opacity: 0;
        transition: opacity 0.3s;
    }

    .cell:hover::before {
        opacity: 1;
    }

    .cell.white {
        background: linear-gradient(45deg, #f0d9b5, #e6c49a);
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    }

    .cell.black {
        background: linear-gradient(45deg, #b58863, #8b4513);
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
    }

    .cell.selected {
        animation: pulse 1s infinite;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.cell.possible {
    background: linear-gradient(45deg, #90ee90, #32cd32);
    animation: glow 0.5s ease-in-out;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 0 rgba(144, 238, 144, 0.7);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(144, 238, 144, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(144, 238, 144, 0);
    }
}

/* Шашки */
.piece {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.piece.king {
    border: 3px solid gold;
    box-shadow: 0 0 20px gold;
}

    .piece.king::after {
        content: '♔';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 20px;
        color: gold;
    }

/* Мобильная адаптация */
@media (max-width: 600px) {
    #board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }

    .cell {
        width: 40px;
        height: 40px;
    }

    .piece {
        width: 30px;
        height: 30px;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Добавь в конец style.css */
#authMessage {
    margin-top: 10px;
    color: #ff6b6b;
    font-size: 0.9rem;
}

#registerBtn {
    margin-top: 10px;
}

/* Кнопка гостя */
#guestBtn {
    background: linear-gradient(45deg, #9C27B0, #7B1FA2);
    margin-top: 5px;
}

    #guestBtn:hover {
        background: linear-gradient(45deg, #7B1FA2, #6A1B9A);
    }

/* Новые стили для чата и интерфейса */

.game-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.left-panel {
    flex: 3;
}

.right-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Чат */
.chat-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    height: 400px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.message {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

    .message.system-message {
        background: rgba(255, 215, 0, 0.1);
        border-left: 3px solid gold;
    }

.system-text {
    color: gold;
    font-weight: bold;
}

.message-sender {
    font-weight: bold;
    color: #4CAF50;
    margin-right: 5px;
}

    .message-sender.my-message {
        color: #2196F3;
    }

.message-text {
    color: #fff;
}

.message-time {
    float: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.chat-input {
    display: flex;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.9rem;
}

    #chatInput::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    #chatInput:focus {
        outline: none;
        border-color: #4CAF50;
        box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    }

#sendMessageBtn {
    padding: 12px 20px;
    background: linear-gradient(45deg, #2196F3, #1976D2);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

    #sendMessageBtn:hover {
        background: linear-gradient(45deg, #1976D2, #0D47A1);
        transform: translateY(-2px);
    }

/* Информация об игре */
.game-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#playerInfo {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

    #playerInfo p {
        margin: 8px 0;
        font-size: 1rem;
    }

    #playerInfo span {
        font-weight: bold;
        color: #4CAF50;
    }

/* История ходов */
#moveHistory {
    max-height: 200px;
    overflow-y: auto;
}

#historyList {
    margin-top: 10px;
}

.history-move {
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 3px solid #4CAF50;
}

.history-player {
    font-weight: bold;
    color: #FF9800;
    margin-right: 5px;
}

/* Подсветка возможных ходов */
.cell.possible-move {
    position: relative;
    animation: pulse-move 1.5s infinite;
}

@keyframes pulse-move {
    0% {
        box-shadow: inset 0 0 0 3px rgba(76, 175, 80, 0.7);
    }

    50% {
        box-shadow: inset 0 0 0 3px rgba(76, 175, 80, 1);
    }

    100% {
        box-shadow: inset 0 0 0 3px rgba(76, 175, 80, 0.7);
    }
}

.cell.possible-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.5);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }
}

/* Полоса прокрутки */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #4CAF50, #2E7D32);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(45deg, #2E7D32, #1B5E20);
    }

/* Адаптивность */
@media (max-width: 1000px) {
    .game-container {
        flex-direction: column;
    }

    .right-panel {
        width: 100%;
    }

    #board {
        grid-template-columns: repeat(8, 50px);
        grid-template-rows: repeat(8, 50px);
    }

    .cell {
        width: 50px;
        height: 50px;
    }

    .piece {
        width: 35px;
        height: 35px;
    }

    .search-buttons {
        flex-direction: column;
        align-items: center;
    }

    .skin-options {
        flex-direction: column;
        align-items: center;
    }

    .skin-option {
        width: 80%;
        max-width: 200px;
    }
}

@media (max-width: 600px) {
    #board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }

    .cell {
        width: 40px;
        height: 40px;
    }

    .piece {
        width: 30px;
        height: 30px;
    }

    .chat-container {
        height: 300px;
    }
}

/* Таймер */
.timer-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #fff;
}

    .timer-label i {
        color: #4CAF50;
    }

#timerText {
    font-weight: bold;
    font-size: 1.2rem;
    color: #4CAF50;
}

.timer-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.timer-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(45deg, #4CAF50, #2E7D32);
    transition: width 1s linear, background 0.3s;
    border-radius: 10px;
}

    .timer-progress.warning {
        background: linear-gradient(45deg, #ffa500, #ff8c00) !important;
    }

    .timer-progress.expired {
        background: linear-gradient(45deg, #ff6b6b, #ff0000) !important;
        animation: pulse-red 0.5s infinite;
    }

@keyframes pulse-red {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

/* Эмодзи */
.emoji-bar {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.emoji-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .emoji-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px) scale(1.1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }

/* Цвет игрока */
#playerColor {
    font-weight: bold;
    color: #FF5722;
}

/* Адаптивность для таймера */
@media (max-width: 768px) {
    .timer-container {
        padding: 10px;
    }

    .timer-label {
        font-size: 0.9rem;
    }

    #timerText {
        font-size: 1rem;
    }

    .emoji-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}
