* {
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #0a1519 0%, #050a0e 100%);
    font-family: 'Segoe UI', system-ui, 'Roboto', sans-serif;
    margin: 0;
    padding: 12px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game {
    max-width: 750px;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 1rem;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.5);
}

h1 {
    text-align: center;
    font-size: 1.7rem;
    margin: 0 0 0.2rem;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #e0e0e0, #ffc857);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sub {
    text-align: center;
    color: #8aaeb9;
    font-size: 0.7rem;
    margin-bottom: 1rem;
}

/* === Адаптивные ячейки — 6 штук помещаются === */
.cells {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 1.2rem;
}

.cell {
    background: #1e2a2f;
    border-radius: 1.3rem;
    padding: 0.7rem 0.3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.05s linear;
    box-shadow: 0 5px 0 #0e1418;
    border: 1px solid #2f4a55;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 150px;
}

.cell.free {
    background: #1d3a36;
    border-color: #3cb38c;
}

.cell.occupied {
    background: #2a253d;
    border-left: 3px solid #f39c12;
    border-right: 3px solid #f39c12;
}

.cell.protected {
    box-shadow: 0 0 0 2px #f1c40f, 0 5px 0 #0e1418;
}

.cell:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 #0e1418;
}

.cell-id {
    font-size: 0.9rem;
    font-weight: bold;
    background: #00000066;
    padding: 0 12px;
    border-radius: 40px;
    margin-bottom: 6px;
}

.owner-name {
    font-weight: bold;
    font-size: 0.85rem;
    background: #00000055;
    border-radius: 30px;
    display: inline-block;
    padding: 2px 12px;
    margin: 4px 0;
}

.stake {
    font-size: 1rem;
    font-weight: bold;
    color: #ffbc6e;
    margin: 4px 0;
}

.free-text {
    color: #6abf9a;
    font-weight: bold;
    font-size: 0.8rem;
    margin: 8px 0;
}

.protect-badge {
    font-size: 0.65rem;
    background: #f39c12;
    color: #1e2a2f;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 30px;
    margin-top: 4px;
    font-weight: bold;
}

.cell-actions {
    margin-top: 5px;
}

.protect-btn {
    background: #2c4b5c;
    border: none;
    font-size: 0.65rem;
    padding: 3px 12px;
    border-radius: 40px;
    cursor: pointer;
    color: white;
    font-weight: bold;
}

/* Панель игроков */
.player-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.2rem;
}

.player {
    background: #1b2b30;
    border: none;
    padding: 6px 14px;
    border-radius: 2.5rem;
    font-weight: bold;
    color: #eef4ff;
    cursor: pointer;
    transition: 0.07s linear;
    min-width: 85px;
    font-size: 0.85rem;
}

.player.active {
    background: #f39c12;
    color: #1e2a2f;
    box-shadow: 0 0 6px #ffb347;
}

.balance {
    display: block;
    font-size: 0.7rem;
    background: #00000077;
    border-radius: 30px;
    margin-top: 4px;
}

/* Инфо панель */
.info-panel {
    background: #071217cc;
    border-radius: 2rem;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1rem;
}

.jackpot-box {
    background: #2c2a1f;
    padding: 4px 16px;
    border-radius: 2rem;
    font-weight: bold;
    font-size: 0.85rem;
}

.timer {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background: #00000077;
    padding: 3px 12px;
    border-radius: 2rem;
}

.reset-btn {
    background: #4a2f2f;
    border: none;
    padding: 5px 16px;
    border-radius: 2rem;
    color: #ffb7b7;
    cursor: pointer;
    font-weight: bold;
}

/* Лог-область — светлый шрифт */
.log {
    background: #030e12dd;
    border-radius: 1.3rem;
    padding: 8px 14px;
    max-height: 140px;
    overflow-y: auto;
    font-size: 0.75rem;
    font-family: monospace;
    margin-top: 0.8rem;
    color: #cbd5e1;
}

.log-entry {
    border-bottom: 1px solid #2f5555;
    padding: 4px 0;
    color: #e2e8f0;
}

footer {
    font-size: 0.6rem;
    text-align: center;
    color: #7a9aa6;
    margin-top: 12px;
}

/* Адаптив: на узких экранах 6 ячеек всё равно видны */
@media (max-width: 550px) {
    .cells {
        gap: 8px;
    }
    .cell {
        min-height: 130px;
        padding: 0.5rem 0.2rem;
    }
    .stake {
        font-size: 0.85rem;
    }
    .owner-name {
        font-size: 0.75rem;
    }
    .player {
        padding: 4px 8px;
        min-width: 70px;
        font-size: 0.75rem;
    }
    .info-panel {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 450px) {
    .cells {
        gap: 6px;
    }
    .cell {
        min-height: 120px;
    }
    .free-text {
        font-size: 0.7rem;
    }
}