/* LexParchisi - Old Wooden Table Theme */

#lex-parchisi-screen {
    background: #1a1a1a;
    color: #fff;
    overflow-y: auto;
    padding-bottom: 50px;
}

.parchisi-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.parchisi-board-wrapper {
    background: #5d4037;
    /* Dark wood base */
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(0, 0, 0, 0.5);
    border: 8px solid #3e2723;
}

.parchisi-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    width: 95vw;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    background: #d4a373;
    /* Richer wood color */
    border: 4px solid #3e2723;
    position: relative;
    margin: 0 auto;
}

/* Cell styles */
.parchisi-cell {
    border: 1px solid rgba(62, 39, 35, 0.3);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
}

/* Home Bases */
.home-base {
    grid-column: span 6;
    grid-row: span 6;
    border: 4px solid #3e2723;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.base-red {
    background: rgba(211, 47, 47, 0.4);
    grid-area: 1 / 1 / 7 / 7;
    border: 2px solid #b71c1c;
}

.base-yellow {
    background: rgba(251, 192, 45, 0.4);
    grid-area: 1 / 10 / 7 / 16;
    border: 2px solid #f9a825;
}

.base-empty-left {
    grid-area: 10 / 1 / 16 / 7;
    background: rgba(0, 0, 0, 0.05);
}

.base-empty-right {
    grid-area: 10 / 10 / 16 / 16;
    background: rgba(0, 0, 0, 0.05);
}

/* Safe Squares */
.safe-square {
    background: #bcaaa4;
}

.safe-square::after {
    content: '★';
    opacity: 0.3;
}

/* Path colors */
.path-red {
    background: #ffcdd2;
}

.path-yellow {
    background: #fff9c4;
}

.path-neutral {
    background: #e0e0e0;
}

/* Center piece */
.parchisi-center {
    grid-area: 7 / 7 / 10 / 10;
    background: #3e2723;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #5d4037;
}

/* Pieces */
.parchisi-piece {
    width: 65%;
    height: 65%;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
    pointer-events: auto;
    /* Ensure pieces can be clicked */
}

.parchisi-piece:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px #ffca28;
}

.piece-playable {
    animation: bounce 0.6s infinite alternate;
    box-shadow: 0 0 15px #ffca28;
    border-color: #ffca28;
}

@keyframes bounce {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.15);
    }
}

.piece-red {
    background: radial-gradient(circle at 35% 35%, #ff5252, #d32f2f, #8e0000);
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.5);
}

.piece-yellow {
    background: radial-gradient(circle at 35% 35%, #ffee58, #fbc02d, #f57f17);
    box-shadow: 0 4px 8px rgba(251, 192, 45, 0.5);
}

/* We'll use Red for User and Blue for AI for now as per "2 people" request */

/* Sidebar & Dice */
.parchisi-sidebar {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 10px;
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    width: 45%;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-info.active-turn {
    border-color: #ffca28;
    background: rgba(255, 202, 40, 0.1);
}

.player-avatar {
    font-size: 2rem;
}

.player-name {
    font-weight: bold;
}

.dice-container {
    perspective: 1000px;
}

.die {
    font-size: 3rem;
    cursor: pointer;
    transition: transform 0.5s;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.die.rolling {
    animation: roll 0.5s infinite linear;
}

@keyframes roll {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.overlay-content {
    text-align: center;
    background: #2b1d1d;
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #d4a373;
}

.hidden {
    display: none !important;
}