* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 0.8s ease;
}

.game-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* Game Board Styles */
.game-board {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 3px;
    aspect-ratio: 1;
    max-width: 800px;
    animation: fadeIn 1s ease;
}

.cell {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: bold;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cell:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cell-number {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 0.75rem;
    color: #666;
    font-weight: bold;
}

.cell.snake {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.cell.ladder {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

.cell.start {
    background: linear-gradient(135deg, #ffd93d 0%, #f6c23e 100%);
    font-size: 1.2rem;
}

.cell.finish {
    background: linear-gradient(135deg, #4dabf7 0%, #228be6 100%);
    color: white;
    font-size: 1.2rem;
}

.snake-ladder-icon {
    font-size: 1.5rem;
    margin-top: 5px;
}

.player-token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    position: absolute;
    bottom: 8px;
    animation: bounce 0.5s ease;
    z-index: 10;
}

.player-token.player1 {
    background: #ff6b6b;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.5);
}

.player-token.player2 {
    background: #4dabf7;
    box-shadow: 0 2px 4px rgba(77, 171, 247, 0.5);
}

.player-token.player1 {
    left: 8px;
}

.player-token.player2 {
    right: 8px;
}

/* Game Controls */
.game-controls {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInRight 1s ease;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.player-card {
    padding: 15px;
    border-radius: 10px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.player1-card {
    background: linear-gradient(135deg, #ffe5e5 0%, #ffcccc 100%);
    border-color: #ff6b6b;
}

.player2-card {
    background: linear-gradient(135deg, #e5f4ff 0%, #cce7ff 100%);
    border-color: #4dabf7;
}

.player-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.player-stats p {
    margin: 5px 0;
    font-size: 1rem;
}

.current-turn {
    color: #51cf66;
    font-weight: bold;
    animation: pulse 1s infinite;
}

.color-picker-group {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

.color-picker-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker-group input[type="color"]:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

/* Game Start Modal */
.game-start-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.game-start-modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s ease;
}

.modal-content h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.color-selection-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.player-color-setup {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #ddd;
    transition: all 0.3s ease;
}

.player-color-setup:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.color-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    margin: 0 auto 15px;
    border: 3px solid #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.player-color-setup h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.player-color-setup label {
    display: block;
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.player-color-setup input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.player-color-setup input[type="color"]:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.start-game-button {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.start-game-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.start-game-button:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dice Section */
.dice-section {
    text-align: center;
    margin: 25px 0;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border: 3px solid #333;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.dice-face {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.dice.rolling {
    animation: roll 0.5s ease;
}

.roll-button {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.roll-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.roll-button:active {
    transform: translateY(0);
}

.roll-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Game Info */
.game-info {
    margin-top: 25px;
}

.game-info h3 {
    margin-bottom: 10px;
    color: #333;
}

.game-log {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.game-log p {
    margin: 5px 0;
    padding: 5px;
    border-left: 3px solid #667eea;
    padding-left: 10px;
}

.reset-button {
    width: 100%;
    margin-top: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Legend */
.game-legend {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.game-legend h3 {
    margin-bottom: 15px;
    color: #333;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 2px solid #333;
}

.snake-color {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.ladder-color {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes roll {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-wrapper {
        grid-template-columns: 1fr;
    }

    .game-controls {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .game-board {
        gap: 2px;
        padding: 10px;
    }

    .cell {
        font-size: 0.7rem;
    }

    .cell-number {
        font-size: 0.6rem;
    }

    .snake-ladder-icon {
        font-size: 1rem;
    }

    .player-token {
        width: 15px;
        height: 15px;
    }
}
