.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-turn-badge {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.ludo-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.ludo-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    width: 450px;
    height: 450px;
    background: #fff;
    border: 3px solid #333;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.cell {
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2; /* Always above the yard corner overlays */
}

/* Base colors */
.bg-red { background-color: #ef4444; }
.bg-green { background-color: #10b981; }
.bg-yellow { background-color: #facc15; }
.bg-blue { background-color: #3b82f6; }
.bg-white { background-color: #ffffff; }
.bg-safe { background-color: #cbd5e1; } /* Safe star spots */
.center-home { background-color: #333; border: none; }

/* The large base yards (6x6 squares at corners) */
.yard {
    position: absolute;
    width: 40%; /* 6/15 */
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Below path cells so tokens moving through corners are visible */
}

.yard-red { top: 0; left: 0; background-color: #ef4444; border-right: 3px solid #333; border-bottom: 3px solid #333;}
.yard-green { top: 0; right: 0; background-color: #10b981; border-left: 3px solid #333; border-bottom: 3px solid #333;}
.yard-blue { bottom: 0; left: 0; background-color: #3b82f6; border-right: 3px solid #333; border-top: 3px solid #333;}
.yard-yellow { bottom: 0; right: 0; background-color: #facc15; border-left: 3px solid #333; border-top: 3px solid #333;}

.yard-inner {
    width: 65%;
    height: 65%;
    background: #fff;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    padding: 15px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.yard-spot {
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    width: 100%;
    height: 100%;
}

/* Tokens */
.token {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 4px 5px rgba(0,0,0,0.5), inset 0 2px 2px rgba(255,255,255,0.4);
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.token:active { transform: scale(0.9); }
.token.movable {
    animation: pulseMovable 1s infinite alternate;
}

@keyframes pulseMovable {
    0% { transform: scale(1); box-shadow: 0 4px 10px rgba(255,255,255,0.8); }
    100% { transform: scale(1.15); box-shadow: 0 4px 20px rgba(255,255,255,1); }
}

.token-red { background: radial-gradient(circle at 30% 30%, #f87171, #b91c1c); border: 2px solid #7f1d1d; }
.token-green { background: radial-gradient(circle at 30% 30%, #34d399, #047857); border: 2px solid #022c22; }
.token-yellow { background: radial-gradient(circle at 30% 30%, #fde047, #a16207); border: 2px solid #4a0404; color: black; text-shadow: none; }
.token-blue { background: radial-gradient(circle at 30% 30%, #60a5fa, #1d4ed8); border: 2px solid #1e3a8a; }

/* In-cell stack alignment */
.cell .token {
    width: 60%;
    height: 60%;
}
.cell .token:nth-child(2) { margin-left: 5px; margin-top: -5px; }
.cell .token:nth-child(3) { margin-left: 10px; margin-top: 5px; }

/* Center Home */
.center-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}
.triangle-top { border-width: 0 45px 45px 45px; border-color: transparent transparent #10b981 transparent; top: 0; left: 45px;}
.triangle-right { border-width: 45px 0 45px 45px; border-color: transparent transparent transparent #facc15; top: 45px; right: 0;}
.triangle-bottom { border-width: 45px 45px 0 45px; border-color: #3b82f6 transparent transparent transparent; bottom: 0; left: 45px;}
.triangle-left { border-width: 45px 45px 45px 0; border-color: transparent #ef4444 transparent transparent; top: 45px; left: 0;}

/* Dice Area */
.dice-panel {
    background: rgba(0,0,0,0.5);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.dice {
    font-size: 5rem;
    color: white;
    background: transparent;
    line-height: 1;
    transition: transform 0.2s;
}
.dice.rolling {
    animation: rollAnim 0.4s infinite linear;
}

@keyframes rollAnim {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

@media (max-width: 700px) {
    .ludo-wrapper { flex-direction: column; gap: 1rem; }
    .ludo-board { width: 320px; height: 320px; }
    .triangle-top { border-width: 0 32px 32px 32px; left: 32px; }
    .triangle-right { border-width: 32px 0 32px 32px; top: 32px;}
    .triangle-bottom { border-width: 32px 32px 0 32px; left: 32px;}
    .triangle-left { border-width: 32px 32px 32px 0; top: 32px;}
}
