/* ========== ОБЩИЕ СТИЛИ ========== */
:root {
    --color-dark: #1E1C2F;
    --color-primary: #3E0866;
    --color-secondary: #2D1E36;
    --color-accent: #501A5E;
    --color-text: #E2DAEB;
    --color-success: #00B894;
    --color-warning: #FDCB6E;
    --color-danger: #FF4757;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-dark);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ========== НАВИГАЦИЯ ========== */
.navbar {
    background: linear-gradient(135deg, var(--color-dark), var(--color-primary)) !important;
    border-bottom: 2px solid var(--color-accent) !important;
    padding: 15px 0;
}

.navbar-brand {
    color: white !important;
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    color: #D0C7E8 !important;
    transition: all 0.3s ease;
    margin: 0 10px;
}

    .nav-link:hover {
        color: white !important;
        transform: translateY(-2px);
    }

/* ========== ГЛАВНАЯ СТРАНИЦА ========== */
.main-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.welcome-card {
    background: linear-gradient(145deg, var(--color-secondary), var(--color-dark));
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-primary);
    text-align: center;
}

    .welcome-card h1 {
        font-size: 3rem;
        margin-bottom: 20px;
        background: linear-gradient(45deg, #9D4EDD, var(--color-accent));
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    .welcome-card p {
        font-size: 1.2rem;
        color: #B8A9D6;
        max-width: 700px;
        margin: 0 auto 30px;
    }

/* Кнопки главной страницы */
.buttons-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

.game-option {
    background: linear-gradient(145deg, var(--color-primary), var(--color-secondary));
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 600px;
    border: 2px solid var(--color-accent);
    transition: all 0.3s ease;
}

    .game-option:hover {
        transform: translateY(-10px);
        box-shadow: 0 20px 40px rgba(94, 26, 94, 0.3);
        border-color: #9D4EDD;
    }

    .game-option h3 {
        text-align: center;
        color: white;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .game-option p {
        text-align: center;
        color: #C9B8E8;
        margin-bottom: 20px;
    }

/* Кнопки */
.btn {
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--color-accent), #9D4EDD);
    color: white;
}

    .btn-primary:hover {
        background: linear-gradient(45deg, #9D4EDD, var(--color-accent));
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(157, 78, 221, 0.5);
    }

.btn-secondary {
    background: linear-gradient(45deg, var(--color-secondary), #5A4FCF);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, var(--color-success), #00CEA9);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #FFD166, #FF9E00); /* Желто-оранжевая */
    color: white;
}

.btn-info {
    background: linear-gradient(45deg, #4CC9F0, #4361EE); /* Голубая */
    color: white;
}

    .btn-warning:hover,
    .btn-info:hover,
    .btn-secondary:hover {
        color: black;
    }

/* Ссылка игры */
.game-link-container {
    background: rgba(45, 30, 54, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid var(--color-accent);
}

.link-input {
    background: var(--color-dark);
    border: 2px solid var(--color-primary);
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    width: 100%;
    margin: 10px 0;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

    /* Плейсхолдер должен быть виден */
    .link-input::placeholder {
        color: #B8A9D6;
        opacity: 0.8;
        font-size: 1rem;
    }

    .link-input:focus {
        outline: none;
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.3), inset 0 2px 10px rgba(0, 0, 0, 0.3);
    }

/* Если нужно сделать поле пошире */
.input-group {
    width: 100%;
}

    .input-group .link-input {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: none;
    }

    .input-group .btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border-left: none;
    }

/* ========== СТРАНИЦА ИГРЫ ========== */
.game-container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
}

/* Шапка игры */
.game-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid var(--color-accent);
    box-shadow: 0 10px 25px rgba(62, 8, 102, 0.4);
}

.game-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 25px;
}

.game-id, .game-status {
    background: rgba(30, 28, 47, 0.7);
    padding: 15px 30px;
    border-radius: 15px;
    border: 2px solid var(--color-accent);
    min-width: 280px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.game-id {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Игроки */
.players-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 20px;
}

.player {
    background: linear-gradient(145deg, var(--color-secondary), var(--color-dark));
    padding: 20px;
    border-radius: 12px;
    width: 45%;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

    .player.active {
        border-color: var(--color-accent);
        background: linear-gradient(145deg, var(--color-primary), var(--color-secondary));
        box-shadow: 0 0 25px rgba(157, 78, 221, 0.4);
        transform: translateY(-5px);
    }

.player-color {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.player1 .player-color {
    background: radial-gradient(circle at 30% 30%, #FF6B9D, #FF4757);
}

.player2 .player-color {
    background: radial-gradient(circle at 30% 30%, #2ED573, #1E8449);
}

/* Jconfirm стиль */
.jconfirm {
    color: black;
}

.player-name {
    font-weight: bold;
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: white;
}

.player-status {
    color: #B8A9D6;
    font-size: 0.95rem;
}

/* Доска */
.board-container {
    background: linear-gradient(145deg, var(--color-dark), var(--color-secondary));
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--color-primary);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.board-title {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Колонки */
.board-columns {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    gap: 10px;
}

.column {
    text-align: center;
}

.column-btn {
    width: 70px;
    height: 50px;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-dark));
    color: white;
    border: none;
    border-radius: 15px 15px 0 0;
    cursor: pointer;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid var(--color-accent);
}

    .column-btn:hover {
        background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
        transform: translateY(-5px) scale(1.1);
    }

/* Игровая доска */
.board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr); /* 6 рядов */
    grid-gap: 10px;
    background: linear-gradient(145deg, var(--color-primary), #2A0B4D);
    padding: 25px;
    border-radius: 15px;
    border: 4px solid var(--color-accent);
    max-width: 700px;
    margin: 0 auto;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.cell {
    width: 75px;
    height: 75px;
    background: radial-gradient(circle at 30% 30%, var(--color-dark), #1A1529);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid rgba(157, 78, 221, 0.3);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

    .cell:hover {
        transform: scale(1.05);
        border-color: var(--color-accent);
        box-shadow: 0 0 25px rgba(157, 78, 221, 0.5);
    }

    .cell.player1 {
        background: radial-gradient(circle at 30% 30%, #FF6B9D, #D63031);
        border-color: #FF6B9D;
        box-shadow: 0 0 20px rgba(255, 107, 157, 0.6);
    }

    .cell.player2 {
        background: radial-gradient(circle at 30% 30%, #2ED573, #1E8449);
        border-color: #2ED573;
        box-shadow: 0 0 20px rgba(46, 213, 115, 0.6);
    }

/* Управление */
.game-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
}

.control-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Сообщение о победе */
.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, var(--color-secondary), var(--color-dark));
    padding: 50px;
    border-radius: 25px;
    box-shadow: 0 0 60px rgba(157, 78, 221, 0.7);
    text-align: center;
    z-index: 1000;
    animation: popup 0.6s ease-out;
    border: 3px solid var(--color-accent);
    max-width: 500px;
    width: 90%;
}

    .game-message h2 {
        font-size: 2.5rem;
        margin-bottom: 20px;
        background: linear-gradient(45deg, #9D4EDD, #FF6B9D);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

/* Анимации */
@keyframes popup {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes drop {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.cell.player1, .cell.player2 {
    animation: drop 0.5s ease-out;
}

/* Адаптивность */
@media (max-width: 768px) {
    .board {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        padding: 15px;
    }

    .cell {
        width: 40px;
        height: 40px;
    }

    .column-btn {
        width: 45px;
        height: 35px;
        font-size: 1.3rem;
    }

    .players-info {
        flex-direction: column;
        align-items: center;
    }

    .player {
        width: 90%;
        margin-bottom: 15px;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }

    .control-btn {
        width: 90%;
    }
}
