/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #4B0082 0%, #6A0DAD 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

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

/* Cabeçalho */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    padding: 30px;
    border-radius: 20px;
    background: rgba(106, 13, 173, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.logo i {
    font-size: 3.5rem;
    color: #FFD700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    color: #E6E6FA;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border: 2px solid #E6E6FA;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #F0F0FF;
}

.card-header h2 {
    color: #6A0DAD;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
}

.game-info {
    background-color: #F0F0FF;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6A0DAD;
    font-weight: 600;
    border: 2px solid #6A0DAD;
}

/* Controles */
.control-group {
    margin-bottom: 30px;
}

.control-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #444;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6A0DAD;
}

.input-with-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 250px;
}

.input-with-buttons input {
    flex-grow: 1;
    padding: 15px;
    border: 3px solid #E6E6FA;
    border-radius: 12px;
    font-size: 1.3rem;
    text-align: center;
    font-weight: 700;
    color: #6A0DAD;
    transition: border-color 0.3s;
}

.input-with-buttons input:focus {
    outline: none;
    border-color: #6A0DAD;
    box-shadow: 0 0 0 3px rgba(106, 13, 173, 0.2);
}

.btn-small {
    padding: 15px 22px;
    background-color: #6A0DAD;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: 600;
    min-width: 60px;
}

.btn-small:hover {
    background-color: #4B0082;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 13, 173, 0.4);
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background-color: #F8F8FF;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    flex: 1;
    min-width: 200px;
}

.radio-option:hover {
    background-color: #F0F0FF;
    transform: translateY(-3px);
}

.radio-option input[type="radio"] {
    margin-right: 15px;
    accent-color: #6A0DAD;
    width: 22px;
    height: 22px;
}

.radio-option span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #555;
}

.radio-option input[type="radio"]:checked + span {
    color: #6A0DAD;
}

.radio-option:has(input[type="radio"]:checked) {
    background-color: #F0F0FF;
    border-color: #6A0DAD;
    box-shadow: 0 5px 15px rgba(106, 13, 173, 0.2);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 15px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #F8F8FF;
    border-radius: 12px;
    transition: background-color 0.3s;
}

.filter-item:hover {
    background-color: #F0F0FF;
}

.filter-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    accent-color: #6A0DAD;
}

.filter-item label {
    font-weight: 600;
    color: #555;
    font-size: 1.1rem;
    margin: 0;
    cursor: pointer;
}

.buttons {
    display: flex;
    gap: 25px;
    margin-top: 40px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 22px;
    border: none;
    border-radius: 15px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.4s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(145deg, #6A0DAD, #4B0082);
    color: white;
    box-shadow: 0 8px 25px rgba(106, 13, 173, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #4B0082, #32006E);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(106, 13, 173, 0.5);
}

.btn-secondary {
    background: linear-gradient(145deg, #F0F0FF, #E6E6FA);
    color: #6A0DAD;
    border: 3px solid #6A0DAD;
    box-shadow: 0 8px 25px rgba(106, 13, 173, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(145deg, #E6E6FA, #D8D8F0);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(106, 13, 173, 0.3);
}

/* Resultados */
.results-section {
    background-color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    border: 2px solid #E6E6FA;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #F0F0FF;
}

.results-header h3 {
    color: #6A0DAD;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 25px;
}

#resultsCount {
    font-weight: 700;
    color: #6A0DAD;
    font-size: 1.2rem;
    background-color: #F0F0FF;
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid #6A0DAD;
}

.results-container {
    min-height: 250px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
    background-color: #F8F8FF;
    border-radius: 15px;
    border: 3px dashed #D8D8F0;
}

.empty-state i {
    margin-bottom: 25px;
    color: #D8D8F0;
    font-size: 4rem;
}

.empty-state p {
    font-size: 1.3rem;
    font-weight: 600;
    color: #6A0DAD;
    max-width: 500px;
}

.game-container {
    background: linear-gradient(145deg, #FFFFFF, #F8F8FF);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 8px solid #6A0DAD;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.game-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.game-title {
    font-weight: 700;
    color: #6A0DAD;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.4rem;
}

.game-actions {
    display: flex;
    gap: 15px;
}

.numbers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.number {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6A0DAD, #4B0082);
    color: white;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 6px 15px rgba(106, 13, 173, 0.4);
    transition: all 0.3s ease;
    border: 3px solid white;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.number::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.number:hover::before {
    transform: translateX(100%);
}

.number:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(106, 13, 173, 0.6);
}

.number.sorted {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    box-shadow: 0 6px 15px rgba(255, 165, 0, 0.4);
    color: #6A0DAD;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid #F0F0FF;
    font-size: 1rem;
    color: #666;
    font-weight: 600;
}

/* Estatísticas */
.statistics h3 {
    color: #6A0DAD;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-item {
    background: linear-gradient(145deg, #F8F8FF, #FFFFFF);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.4s ease;
    border: 3px solid #E6E6FA;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-item:hover {
    transform: translateY(-8px);
    background: linear-gradient(145deg, #FFFFFF, #F0F0FF);
    border-color: #6A0DAD;
    box-shadow: 0 15px 35px rgba(106, 13, 173, 0.15);
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #6A0DAD;
    margin-bottom: 10px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
}

.all-numbers {
    margin-top: 40px;
}

.all-numbers h4 {
    margin-bottom: 20px;
    color: #6A0DAD;
    font-size: 1.4rem;
    padding-bottom: 15px;
    border-bottom: 2px solid #F0F0FF;
}

.numbers-frequency {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.freq-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45px;
}

.freq-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6A0DAD, #4B0082);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 8px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(106, 13, 173, 0.3);
}

.freq-bar {
    width: 100%;
    background-color: #F0F0FF;
    border-radius: 8px;
    overflow: hidden;
    height: 120px;
    position: relative;
    border: 2px solid #E6E6FA;
}

.freq-fill {
    background: linear-gradient(to top, #6A0DAD, #8A2BE2);
    width: 100%;
    position: absolute;
    bottom: 0;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.freq-count {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6A0DAD;
    font-weight: 700;
    background-color: #F0F0FF;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Seção de informações */
.info-section {
    margin-bottom: 40px;
}

.info-card {
    background: linear-gradient(145deg, #FFFFFF, #F8F8FF);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border: 3px solid #6A0DAD;
}

.info-card h3 {
    color: #6A0DAD;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
    padding-bottom: 15px;
    border-bottom: 3px solid #F0F0FF;
}

.info-card ul {
    padding-left: 25px;
}

.info-card li {
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.1rem;
    color: #555;
    font-weight: 500;
    padding-left: 10px;
}

.info-card li:before {
    content: "•";
    color: #6A0DAD;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 1.3rem;
}

/* Rodapé */
footer {
    text-align: center;
    color: white;
    padding: 40px 0 30px;
    font-size: 1rem;
    background: rgba(106, 13, 173, 0.9);
    border-radius: 20px;
    margin-top: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

footer p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.footer-links {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

.footer-links a {
    color: #FFD700;
    text-decoration: none;
    margin: 0 15px;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 15px;
    border-radius: 8px;
}

.footer-links a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(75, 0, 130, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 5px solid #6A0DAD;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 2.5rem;
    cursor: pointer;
    color: #6A0DAD;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    background-color: #F0F0FF;
}

.close-modal:hover {
    color: white;
    background-color: #6A0DAD;
    transform: rotate(90deg);
}

.modal-content h2 {
    color: #6A0DAD;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2.2rem;
    padding-bottom: 20px;
    border-bottom: 3px solid #F0F0FF;
}

.history-frequency {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
    justify-content: center;
}

.history-number {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6A0DAD, #4B0082);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    position: relative;
    border: 3px solid white;
    box-shadow: 0 6px 15px rgba(106, 13, 173, 0.4);
    font-size: 1.2rem;
}

.history-number.high-frequency {
    background: linear-gradient(145deg, #FFD700, #FFA500);
    color: #6A0DAD;
    box-shadow: 0 6px 15px rgba(255, 165, 0, 0.4);
}

.history-frequency-label {
    font-size: 0.8rem;
    position: absolute;
    bottom: -20px;
    color: #6A0DAD;
    font-weight: 700;
    white-space: nowrap;
}

.note {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(145deg, #FFF8DC, #FFEBCD);
    border-radius: 15px;
    color: #8B4513;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    border: 3px solid #FFD700;
}

.note i {
    color: #FFA500;
    font-size: 1.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: linear-gradient(145deg, #6A0DAD, #4B0082);
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(106, 13, 173, 0.5);
    display: none;
    z-index: 1001;
    animation: fadeInOut 3.5s ease;
    border: 3px solid #FFD700;
    max-width: 400px;
    font-weight: 600;
    font-size: 1.1rem;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    15% { opacity: 1; transform: translateY(0) scale(1); }
    85% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(30px) scale(0.9); }
}

/* Responsividade */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .radio-option {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .logo {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo h1 {
        font-size: 2.2rem;
        text-align: center;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .game-info {
        align-self: stretch;
        text-align: center;
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .results-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .buttons {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .input-with-buttons {
        max-width: 100%;
    }
    
    .number {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-option {
        min-width: 100%;
    }
    
    .numbers-grid {
        gap: 10px;
    }
    
    .number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
}