* {
    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;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    padding: 10px;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

header {
    text-align: center;
    position: relative;
    margin-bottom: 20px;
}

h1 {
    color: #667eea;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.sound-control {
    position: absolute;
    top: 0;
    right: 0;
}

.sound-btn {
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.sound-btn:hover {
    transform: scale(1.1);
}

.sound-btn.muted {
    opacity: 0.3;
}

/* Game Setup */
.game-setup {
    padding: 40px 20px;
}

.setup-card {
    text-align: center;
    margin-bottom: 30px;
}

.setup-card h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

.mode-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 30px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 250px;
}

.mode-btn .mode-desc {
    font-size: 0.9rem;
    font-weight: normal;
    opacity: 0.7;
}

.mode-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.mode-btn.selected {
    background: #667eea;
    color: white;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.game-type-selector {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.game-type-btn {
    padding: 30px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
}

.game-type-btn .mode-desc {
    font-size: 0.9rem;
    font-weight: normal;
    opacity: 0.7;
}

.game-type-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.game-type-btn.selected {
    background: #667eea;
    color: white;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.player-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.player-btn, .ai-btn {
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    border: 3px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.player-btn:hover, .ai-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

/* Game Container */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.players-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 10px;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.player-card.active {
    border-color: #ffd700;
    background: #fff9e6;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.player-token {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.player-position {
    color: #666;
    font-size: 0.9rem;
}

.current-turn {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

/* Board */
.board-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #ddd;
    padding: 2px;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    aspect-ratio: 1;
}

.cell {
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    color: #333;
    transition: all 0.3s;
}

.cell:nth-child(even) {
    background: #f0f0f0;
}

.cell-number {
    font-size: 0.8rem;
    color: #999;
    position: absolute;
    top: 2px;
    left: 4px;
}

.cell-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.token.moving {
    animation: smoothBounce 0.5s ease-in-out;
}

@keyframes smoothBounce {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.2) translateY(-8px); }
    50% { transform: scale(1.15) translateY(-5px); }
    70% { transform: scale(1.1) translateY(-3px); }
    100% { transform: scale(1) translateY(0); }
}

/* Ladder */
.cell.has-ladder {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
}

.ladder {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #22c55e;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.3);
}

.ladder::before {
    content: '🪜↑';
}

/* Snake */
.cell.has-snake {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
}

.snake {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #ef4444;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
}

.snake::before {
    content: '🐍↓';
}

/* Power-Up Cell */
.cell.has-powerup {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    animation: powerupGlow 2s infinite;
}

@keyframes powerupGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.8); }
}

.powerup-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    z-index: 2;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0px); }
    50% { transform: translate(-50%, -50%) translateY(-5px); }
}

@keyframes collectPowerup {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Power-Ups Panel */
.powerups-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 3px solid #f59e0b;
}

.powerups-panel h3 {
    color: #f59e0b;
    margin-bottom: 15px;
    text-align: center;
}

.powerups-inventory {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.powerup-slot {
    background: white;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    min-width: 180px;
    text-align: center;
    transition: all 0.3s;
}

.powerup-slot.active {
    border-color: #f59e0b;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.powerup-slot.active:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
}

.powerup-slot .powerup-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.powerup-slot .powerup-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.powerup-slot .powerup-desc {
    font-size: 0.8rem;
    color: #666;
}

.powerup-slot .powerup-player {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: bold;
    margin-top: 8px;
}

.powerup-slot.empty {
    opacity: 0.3;
    border-style: dashed;
}

.powerup-activate-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.powerup-activate-btn:hover {
    background: #d97706;
    transform: scale(1.05);
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.dice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

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

@keyframes roll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
    100% { transform: rotate(360deg); }
}

.roll-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.roll-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.roll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.new-game-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

.new-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.6);
}

/* Message Box */
.message-box {
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
}

.message-box.show {
    animation: slideIn 0.5s;
}

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

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

.winner-modal.show {
    display: flex;
}

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

.winner-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.winner-content h2 {
    color: #667eea;
    font-size: 3rem;
    margin-bottom: 20px;
}

.winner-content p {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 30px;
}

.play-again-btn {
    padding: 15px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

/* Player Select Modal */
.player-select-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.player-select-modal.show {
    display: flex;
}

.player-select-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    max-width: 500px;
    width: 90%;
}

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

.player-select-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.player-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.player-select-btn {
    padding: 20px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.player-select-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.player-select-btn .player-token-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.player-select-btn .player-info {
    text-align: center;
}

.player-select-btn .player-info-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.player-select-btn .player-info-position {
    font-size: 0.9rem;
    color: #666;
}

.cancel-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .mode-btn {
        padding: 20px 30px;
        font-size: 1.2rem;
        min-width: 200px;
    }

    .setup-card h2 {
        font-size: 1.5rem;
    }

    .player-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
    }

    .board {
        gap: 1px;
        padding: 1px;
    }

    .cell {
        font-size: 0.7rem;
    }

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

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

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

    .ladder, .snake {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .dice {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .roll-btn {
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .message-box {
        font-size: 1.1rem;
    }

    .winner-content {
        padding: 30px;
    }

    .winner-content h2 {
        font-size: 2rem;
    }

    .winner-content p {
        font-size: 1.2rem;
    }

    .player-select-content {
        padding: 25px;
    }

    .player-select-content h2 {
        font-size: 1.5rem;
    }

    .player-select-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .sound-btn {
        font-size: 1.5rem;
    }

    .player-card {
        padding: 8px 12px;
        gap: 8px;
    }

    .player-name {
        font-size: 1rem;
    }

    .current-turn {
        font-size: 1.1rem;
    }

    .cell-number {
        font-size: 0.5rem;
        top: 1px;
        left: 2px;
    }

    .token {
        width: 12px;
        height: 12px;
        border-width: 1px;
    }

    .ladder, .snake {
        font-size: 1.2rem;
    }
}
