/* Backgammon Board Styles - Full Width Layout with Bear-off Areas */
.board-container {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 100%;
    min-height: 500px;
    justify-content: center;
}

.board {
    background: #8B4513;
    border: 10px solid #654321;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    position: relative;
    flex: 1;
    max-width: 800px;
    aspect-ratio: 2/1.2;
}

.board-half {
    display: flex;
    flex-direction: column;
}

.points-row {
    display: flex;
    align-items: stretch;
}

.board-quarter {
    display: flex;
    gap: 2px;
}

/* Individual Points - Larger for better visibility */
.point {
    width: 50px;
    height: 250px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.point[data-color="dark"], .point[data-color="light"] {
    background: #654321;
}

.point::before {
    content: attr(data-point);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #ecf0f1;
    background: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 3px;
}

.top-half .point::before {
    top: -25px;
    bottom: auto;
}

/* Point Triangles */
.point::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
}

.top-half .point::after {
    top: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 160px solid currentColor;
}

.bottom-half .point::after {
    bottom: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 160px solid currentColor;
}

.point[data-color="dark"]::after {
    color: #8B4513;
}

.point[data-color="light"]::after {
    color: #D2B48C;
}

/* Bar (Middle Section) */
.bar {
    width: 60px;
    height: 100%;
    background: #000000; /*654321;*/
    border: 2px solid #ecf0f1;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    margin: 0 10px;
}

.bar-spacer {
    width: 60px;
    height: 100%;
    background: #000000;/*#654321;*/
    border: 2px solid #ecf0f1;
    border-radius: 0;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
}

.bar-section {
    width: 60px;
    height: 248px;
    border-radius: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border: none;
    flex-shrink: 0;
    overflow: visible;
}

/* Upper bar section (white) - align to top */
.white-bar {
    justify-content: flex-start;
}

/* Lower bar section (black) - align to bottom */
.black-bar {
    justify-content: flex-end;
}



/* Checkers - Larger for better visibility */
.checker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #2c3e50;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: auto; /* Ensure checkers can receive clicks */
}

.checker.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #ecf0f1, #bdc3c7);
    border-color: #7f8c8d;
}

.checker.black {
    background: radial-gradient(circle at 30% 30%, #34495e, #2c3e50, #1a252f);
    border-color: #ecf0f1;
}

.checker:hover {
    transform: scale(1.1);
    z-index: 20;
}

.checker.selected {
    transform: scale(1.2);
    box-shadow: 0 0 15px #e74c3c;
    border-color: #e74c3c;
    z-index: 30;
}

.checker.dragging {
    z-index: 100;
    transform: scale(1.1);
    opacity: 0.8;
}

/* Checker Stacking */
.checker-stack {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* Allow clicks to pass through to point */
    z-index: 5;
    gap: 2px; /* Small gap between checkers */
}

.top-half .checker-stack {
    justify-content: flex-start;
    padding-top: 5px;
}

.bottom-half .checker-stack {
    justify-content: flex-end;
    padding-bottom: 5px;
}

/* Ensure checkers stack properly */
.checker-stack .checker {
    margin: 0;
    flex-shrink: 0;
}

/* Bear-off Areas - Now positioned to the right of board */
.bear-off-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 25px;
    flex-shrink: 0;
    margin-left: 50px;
}

.bear-off {
    width: 140px;
    height: 240px;
    border: 3px solid;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.white-bear-off {
    background: #000000;/*rgba(236, 240, 241, 0.1);*/
    border-color: #ecf0f1;
}

.black-bear-off {
    background: #000000;/*rgba(236, 240, 241, 0.1);*/
    border-color: #ecf0f1;
}

.bear-off h4 {
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: bold;
    color: #ecf0f1;
}

.bear-off-area {
    height: 200px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 3px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.bear-off .checker {
    position: static;
    width: 28px;
    height: 28px;
    margin: 1px;
}

/* Point Highlighting */
.point.valid-destination {
    background: rgba(39, 174, 96, 0.3) !important;
    border-color: #27ae60 !important;
    box-shadow: inset 0 0 10px rgba(39, 174, 96, 0.5);
}

.point.selected-source {
    background: rgba(231, 76, 60, 0.3) !important;
    border-color: #e74c3c !important;
    box-shadow: inset 0 0 10px rgba(231, 76, 60, 0.5);
}

.point.invalid-destination {
    background: rgba(192, 57, 43, 0.3) !important;
    border-color: #c0392b !important;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive Board */
@media (max-width: 1024px) {
    .board-container {
        gap: 15px;
    }

    .bear-off {
        width: 120px;
        height: 220px;
    }

    .bear-off-area {
        height: 180px;
    }
}

@media (max-width: 1024px) {
    .board-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .bear-off-container {
        flex-direction: row;
        justify-content: center;
        gap: 30px;
    }

    .bear-off {
        width: 140px;
        height: 200px;
    }

    .bear-off-area {
        height: 160px;
    }
}

@media (max-width: 768px) {
    .point {
        width: 35px;
        height: 180px;
    }
    
    .checker {
        width: 28px;
        height: 28px;
    }
    
    .bear-off {
        width: 100px;
        height: 180px;
    }
    
    .bear-off .checker {
        width: 20px;
        height: 20px;
    }
    
    .bar {
        width: 50px;
        height: 100%;
    }

    .bar-section {
        width: 50px;
        height: 98%;
    }

    .bar-spacer {
        width: 50px;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .point {
        width: 30px;
        height: 160px;
    }
    
    .checker {
        width: 24px;
        height: 24px;
    }
    
    .bear-off {
        width: 80px;
        height: 160px;
    }
    
    .bear-off .checker {
        width: 18px;
        height: 18px;
    }
    
    .bar {
        width: 40px;
        height: 100%;
    }

    .bar-section {
        width: 40px;
        height: 98%;
    }

    .bar-spacer {
        width: 40px;
        height: 100%;
    }
    
    .board {
        padding: 15px;
    }
}

/* Animation for checker movement */
.checker.moving {
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Checker count display */
.checker-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    text-align: center;
    z-index: 20;
}

/* Pip count display */
.pip-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

/* Turn indicator on board */
.board::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 20px;
    z-index: -1;
    transition: all 0.3s ease;
}

.board.white-turn::before {
    box-shadow: 0 0 20px rgba(236, 240, 241, 0.5);
}

.board.black-turn::before {
    box-shadow: 0 0 20px rgba(44, 62, 80, 0.5);
}
