/* VARIABLES & THEMES */
:root {
    --ludo-bg: #fff;
    --green: #009d5e;  /* Professional Green */
    --yellow: #f9be00; /* Professional Yellow */
    --blue: #0076bf;   /* Professional Blue */
    --red: #e01e26;    /* Professional Red */
    --border: #333;
}

.ludo-wrapper {
    font-family: 'Segoe UI', sans-serif;
    max-width: 500px; /* Thoda chhota taaki fit rahe */
    margin: 0 auto;
    background: #e2e8f0;
    min-height: 600px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3);
}

/* SCREENS */
.ludo-screen { padding: 20px; text-align: center; height: 100%; display:flex; flex-direction:column; align-items:center; }

/* GAME BOARD - CSS ONLY (No Image) */
.ludo-container {
    width: 100%;
    aspect-ratio: 1/1;
    background: white;
    border: 2px solid #000;
    position: relative;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    
    /* YAHAN HAI MAGIC: CSS Gradients se Board banega */
    background-image: 
        /* --- COLORED BASES --- */
        linear-gradient(to right, var(--green) 40%, transparent 40% 60%, var(--yellow) 60%),
        linear-gradient(to bottom, var(--green) 40%, transparent 40% 60%, var(--red) 60%),
        /* --- HOME TRIANGLES --- */
        linear-gradient(45deg, transparent 49.5%, var(--border) 49.5% 50.5%, transparent 50.5%),
        linear-gradient(-45deg, transparent 49.5%, var(--border) 49.5% 50.5%, transparent 50.5%);
        
    background-size: 100% 100%;
}

/* Overlay Grid Lines (Path bananeke liye) */
.ludo-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Grid Lines Pattern */
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 6.66% 6.66%; /* 15 boxes = 100/15 */
    pointer-events: none;
    opacity: 0.3;
}

/* Colored Corners (Bases) Overlay Fix */
.ludo-board-grid {
    width: 100%; height: 100%; position: relative;
}

/* Colored Home Paths (Stripes) */
/* Hum pseudo elements use karenge taaki HTML ganda na ho */
.ludo-board-grid::before {
    content: ''; position: absolute; top: 40%; left: 6.66%; width: 33.33%; height: 6.66%;
    background: var(--green); opacity: 0.3; /* Green Path */
    box-shadow: 
        160% 100% 0 var(--yellow), /* Yellow Path (rotated logic approx) */
        0 300% 0 var(--red), /* Red Path */
        160% -200% 0 var(--blue); /* Blue Path logic needs rotation, simplified here */
}

/* --- BASES (White Areas inside Colors) --- */
.ludo-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background:
        /* Green Base White Box */
        radial-gradient(circle, white 50%, transparent 51%) 10% 10% / 20% 20% no-repeat,
        /* Yellow Base White Box */
        radial-gradient(circle, white 50%, transparent 51%) 70% 10% / 20% 20% no-repeat,
        /* Red Base White Box */
        radial-gradient(circle, white 50%, transparent 51%) 10% 70% / 20% 20% no-repeat,
        /* Blue Base White Box */
        radial-gradient(circle, white 50%, transparent 51%) 70% 70% / 20% 20% no-repeat;
    z-index: 1;
}


/* TOKENS */
.ludo-token {
    width: 6%; height: 6%;
    position: absolute;
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

.token-inner {
    width: 80%; height: 80%;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 3px 5px rgba(0,0,0,0.4);
}

.token-green .token-inner { background: var(--green); box-shadow: 0 0 10px var(--green); }
.token-yellow .token-inner { background: var(--yellow); box-shadow: 0 0 10px var(--yellow); }
.token-blue .token-inner { background: var(--blue); box-shadow: 0 0 10px var(--blue); }
.token-red .token-inner { background: var(--red); box-shadow: 0 0 10px var(--red); }

.ludo-token.highlight {
    animation: bounce 0.8s infinite;
    z-index: 100;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.3); filter: brightness(1.3); }
}

/* DICE & UI */
.game-controls {
    margin-top: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 15px; background: white; border-radius: 10px; width: 100%;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}
.dice-box {
    width: 70px; height: 70px; background: white; border: 2px solid #333;
    border-radius: 15px; display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; cursor: pointer; user-select: none;
    box-shadow: 0 6px 0 #94a3b8; transition: transform 0.1s;
}
.dice-box:active { transform: translateY(6px); box-shadow: none; }
.dice-box.rolling { animation: shake 0.4s infinite; }

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

#active-turn-badge {
    background: #333; color: white; padding: 8px 25px; border-radius: 30px; 
    font-weight: bold; font-size: 1.2rem;
    margin-bottom: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border: 2px solid white;
}

/* Setup Screen Styles */
.input-group input { padding: 15px; border-radius: 10px; border: none; margin-bottom: 20px; text-align: center; font-weight: bold; font-size: 1.1rem; }
.theme-options { display: flex; gap: 15px; margin-bottom: 30px; }
.t-btn { width: 50px; height: 50px; border-radius: 50%; border: 3px solid white; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2); transition: transform 0.2s; }
.t-btn:hover { transform: scale(1.1); }
.t-classic { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.t-modern { background: linear-gradient(135deg, #56ab2f, #a8e063); }
.t-dark { background: linear-gradient(135deg, #232526, #414345); }

.btn-primary { background: linear-gradient(to right, #2563eb, #1d4ed8); color: white; border: none; padding: 15px; border-radius: 50px; font-weight: bold; width: 100%; cursor: pointer; margin-bottom: 10px; box-shadow: 0 5px 20px rgba(37, 99, 235, 0.4); }
.btn-secondary { background: transparent; border: 2px solid #2563eb; color: #2563eb; padding: 12px; border-radius: 50px; font-weight: bold; width: 100%; cursor: pointer; }