* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: black;
    user-select: none;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: #1a1a1a;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: flex;
}

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

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

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    border: none;
    color: black;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.back-btn:active {
    background: #444;
}

.game-title {
    margin: 20px 0;
}

.title-ludo {
    display: block;
    font-size: 48px;
    font-weight: 900;
    color: black;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    letter-spacing: 8px;
}

.title-multiplayer {
    display: block;
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #0000ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.dice-icons {
    margin-top: 20px;
}

.dice-icon {
    font-size: 40px;
    margin: 0 10px;
    display: inline-block;
    animation: rotate 2s infinite ease-in-out;
}

.dice-icon:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tela de Seleção de Número de Jogadores */
.player-count-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 40px 0;
}

.player-count-btn {
    background: linear-gradient(135deg, #2d2d2d 0%, #3d3d3d 100%);
    border: 3px solid #444;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.player-count-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.player-count-btn:hover::before {
    left: 100%;
}

.player-count-btn:active {
    transform: scale(0.98);
    border-color: #666;
}

.player-icons {
    display: flex;
    gap: 10px;
}

.player-icon {
    font-size: 32px;
}

.count-number {
    font-size: 52px;
    font-weight: 900;
    color: #ffdd00;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.count-text {
    font-size: 24px;
    font-weight: 900;
    color: black;
}

.dice-animation {
    text-align: center;
    margin-top: 40px;
}

.dice-display {
    font-size: 80px;
    animation: bounce 1s infinite;
}

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

/* Tela de Seleção de Jogadores */
.player-setup {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-input-group {
    background: #2d2d2d;
    border-radius: 15px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 2px solid #3d3d3d;
}

.color-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.color-indicator.red { background: #ff3333; }
.color-indicator.yellow { background: #ffdd00; }
.color-indicator.green { background: #33ff33; }
.color-indicator.blue { background: #3333ff; }

.color-label {
    font-size: 20px;
    font-weight: 900;
    min-width: 80px;
    color: #000;
}

.player-name-input {
    flex: 1;
    background: white;
    border: none;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 18px;
    font-weight: bold;
    outline: none;
}

.player-name-input::placeholder {
    color: #999;
}

.divider {
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    color: #666;
    margin: 10px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 2px;
    background: #444;
}

.divider::before { left: 10%; }
.divider::after { right: 10%; }

.start-game-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #ff3333 100%);
    border: none;
    border-radius: 15px;
    padding: 18px;
    font-size: 22px;
    font-weight: 900;
    color: black;
    cursor: pointer;
    margin-top: 30px;
    box-shadow: 0 6px 20px rgba(255, 51, 51, 0.4);
    transition: all 0.3s ease;
}

.start-game-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 51, 51, 0.3);
}

.sound-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #333;
    border: 3px solid #444;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.sound-btn:active {
    transform: scale(0.95);
    background: #444;
}

/* Tela de Loading */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #333;
    border-top: 8px solid #ffdd00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 30px;
    font-size: 20px;
    color: black;
}

/* Responsividade */
@media (max-width: 480px) {
    .screen {
        padding: 15px;
    }

    .title-ludo {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .title-multiplayer {
        font-size: 20px;
    }

    .player-count-btn {
        padding: 20px;
    }

    .count-number {
        font-size: 42px;
    }

    .count-text {
        font-size: 20px;
    }

    .player-input-group {
        padding: 12px 15px;
    }

    .color-label {
        font-size: 16px;
        min-width: 70px;
    }

    .player-name-input {
        font-size: 16px;
        padding: 10px;
    }

    .start-game-btn {
        font-size: 18px;
        padding: 15px;
    }

    .sound-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
}

@media (min-width: 768px) {
    .container {
        box-shadow: 0 0 40px rgba(0,0,0,0.5);
    }
}

