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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}

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

header {
    text-align: center;
    margin-bottom: 15px;
    animation: fadeInDown 1s ease;
}

header h1 {
    font-size: 3rem;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #ffd700, #ff6b6b, #4ecdc4, #ffd700);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

/* Bola atual */
.current-number-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.ball-display {
    perspective: 1000px;
}

.ball {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #ee5a6f, #c44569);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset -10px -10px 20px rgba(0, 0, 0, 0.3),
        inset 10px 10px 20px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.ball::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 50%;
    filter: blur(10px);
}

.ball span {
    font-size: 6.5rem;
    font-weight: bold;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

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

.ball.pop {
    animation: popAnimation 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.ball.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Controles */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.call-button, .reset-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.call-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reset-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.call-button:hover, .reset-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.call-button:active, .reset-button:active {
    transform: translateY(-2px);
}

.call-button::before, .reset-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.call-button:active::before, .reset-button:active::before {
    width: 300px;
    height: 300px;
}

.call-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Contador */
.counter {
    text-align: center;
    font-size: 1.3rem;
    margin: 15px 0;
    color: #4ecdc4;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

/* Números recentes */
.recent-numbers {
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.recent-numbers h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
    font-size: 1.5rem;
}

.recent-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 70px;
}

.recent-number {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #4ecdc4, #3ba99c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset -3px -3px 10px rgba(0, 0, 0, 0.2),
        inset 3px 3px 10px rgba(255, 255, 255, 0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px) scale(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Grade de todos os números */
.all-numbers {
    margin: 50px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.all-numbers h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #ffd700;
    font-size: 2rem;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-width: 1000px;
    margin: 0 auto;
}

.number-cell {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.number-cell.called {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #ffd700;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

/* Controles de Som */
.sound-controls {
    position: fixed;
    bottom: 80px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.sound-toggle, .speech-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sound-toggle:hover, .speech-toggle:hover {
    transform: scale(1.1);
}

.sound-toggle.muted {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    opacity: 0.6;
}

.speech-toggle.active {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-control label {
    font-size: 1.3rem;
}

#volumeSlider {
    width: 120px;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#volumeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: none;
}

/* Controles de UX */
.ux-controls {
    position: fixed;
    bottom: 80px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.fullscreen-toggle, .help-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.fullscreen-toggle:hover, .help-toggle:hover {
    transform: scale(1.1);
}

/* Modal de ajuda */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.shortcut-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.shortcut-item kbd {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    margin-right: 5px;
}

.shortcut-item span {
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    text-align: right;
}

/* Confetes */
#confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* Botão de gerar cartelas */
.generate-cards-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.generate-cards-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.generate-cards-button:active {
    transform: translateY(-2px);
}

/* Botão de tela de exibição */
.display-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.display-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.display-button:active {
    transform: translateY(-2px);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.4s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
}

.modal-body p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.cards-preview {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
}

.cards-preview p {
    margin-bottom: 10px;
    color: #ffd700;
}

.cards-preview ul {
    list-style: none;
    padding-left: 0;
}

.cards-preview ul li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.9);
    position: relative;
    padding-left: 25px;
}

.cards-preview ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4ecdc4;
    font-weight: bold;
}

/* Botão automático */
.auto-button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.auto-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.auto-button.active {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Configuração do modo automático */
.auto-config {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.auto-config label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #ffd700;
}

.auto-interval-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

#autoInterval {
    flex: 1;
    max-width: 250px;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

#autoInterval::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#autoInterval::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: none;
}

#autoIntervalValue {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 60px;
    display: inline-block;
}

/* Responsivo */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .ball {
        width: 200px;
        height: 200px;
    }

    .ball span {
        font-size: 5rem;
    }

    .call-button, .reset-button, .generate-cards-button, .display-button, .auto-button {
        padding: 12px 25px;
        font-size: 1.1rem;
    }

    .controls {
        flex-wrap: wrap;
    }

    .recent-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .number-cell {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .modal-content {
        width: 95%;
    }
}

