:root {
    --board-bg: #2d5a27;
    --wood-border: #5d4037;
    --point-light: #e0cca7;
    --point-dark: #8d6e63;
    --checker-white: #f5f5f5;
    --checker-black: #333333;
    --accent-gold: #ffd700;
    --glass-bg: rgba(255, 255, 255, 0.05);
}

#game-container {
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #1e1e1e;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    user-select: none;
}

.game-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--glass-bg);
    border-radius: 8px;
    margin-bottom: 20px;
}

.game-top h2 {
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: var(--accent-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
}

#board-container {
    flex: 1;
    display: flex;
    gap: 10px;
    align-items: stretch;
    min-height: 400px;
}

#board {
    flex: 1;
    background: var(--board-bg);
    border: 10px solid var(--wood-border);
    border-radius: 8px;
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, 1fr) 20px repeat(6, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 0;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.bear-off-zone {
    width: 40px;
    background: var(--wood-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.8rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.3s;
}

.bear-off-zone.active {
    box-shadow: 0 0 15px var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.bar-space {
    grid-column: 7;
    grid-row: 1 / span 2;
    background: var(--wood-border);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.point {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.point.top {
    justify-content: flex-start;
}

.point.bottom {
    justify-content: flex-end;
}

.triangle {
    position: absolute;
    width: 100%;
    height: 45%;
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

.point.bottom .triangle {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    bottom: 0;
}

.point:nth-child(even) .triangle {
    background: var(--point-dark);
}

.point:nth-child(odd) .triangle {
    background: var(--point-light);
}

#board .point:nth-child(n+13):nth-child(odd) .triangle {
    background: var(--point-dark);
}

#board .point:nth-child(n+13):nth-child(even) .triangle {
    background: var(--point-light);
}

.checker {
    width: 85%;
    aspect-ratio: 1;
    border-radius: 50%;
    margin: 1px 0;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    z-index: 10;
}

.checker.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
    border: 1px solid #ccc;
}

.checker.black {
    background: radial-gradient(circle at 30% 30%, #555, #111);
    border: 1px solid #000;
}

.checker.selected {
    outline: 3px solid var(--accent-gold);
    box-shadow: 0 0 15px var(--accent-gold);
}

#controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
}

.dice-container {
    display: flex;
    gap: 8px;
}

.die {
    width: 40px;
    height: 40px;
    background: white;
    color: black;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: var(--accent-gold);
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:active {
    transform: translateY(2px);
}

#reset-btn {
    background: #555;
    color: #fff;
}

#status-msg {
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
    font-size: 1rem;
    color: #fff;
}

.score-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    #board-container {
        min-height: 300px;
    }

    #board {
        border-width: 6px;
    }

    .bear-off-zone {
        width: 30px;
        font-size: 0.7rem;
    }
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.die.rolling {
    animation: shake 0.2s infinite;
}