:root {
    --primary-color: #6c47ff; /* Morado vibrante */
    --primary-hover: #5633db;
    --bg-color: #f8f6ff; /* Fondo general lila muy claro */
    --card-bg: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #6b6b6b;
    --border-color: #e5e5e5;
    
    /* Estados de números */
    --state-available-bg: #ffffff;
    --state-available-border: #e0e0e0;
    --state-available-text: #333333;
    
    --state-selected-bg: #6c47ff;
    --state-selected-border: #6c47ff;
    --state-selected-text: #ffffff;
    
    --state-sold-bg: #a3a3a3;
    --state-sold-border: #a3a3a3;
    --state-sold-text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(180deg, #ede8ff 0%, #ffffff 400px);
    color: var(--text-main);
    padding-bottom: 100px; /* Espacio para barra inferior */
    min-height: 100vh;
}

/* Header */
.hero {
    text-align: center;
    padding: 2rem 1rem;
}

.hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero .highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.hero p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.heart-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--card-bg);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.heart-badge .icon-heart {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Stats Card */
.stats-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg { width: 20px; height: 20px; }

.icon-meta { background: #efeaff; color: #6c47ff; }
.icon-recaudado { background: #ffeaf3; color: #ff4785; }
.icon-avance { background: #ebfcf0; color: #20b85a; }
.icon-sorteo { background: #f0eeff; color: #5a4bda; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 1rem;
    font-weight: 700;
}

/* Numbers Section */
.numbers-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.numbers-section h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.box {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}
.box-disponible { background: var(--state-available-bg); border: 1px solid var(--state-available-border); }
.box-seleccionado { background: var(--state-selected-bg); }
.box-vendido { background: var(--state-sold-bg); }

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
}

.number-btn {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1px solid var(--state-available-border);
    background: var(--state-available-bg);
    color: var(--state-available-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
}

.number-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.number-btn.selected {
    background: var(--state-selected-bg);
    border-color: var(--state-selected-border);
    color: var(--state-selected-text);
}

.number-btn.sold {
    background: var(--state-sold-bg);
    border-color: var(--state-sold-border);
    color: var(--state-sold-text);
    cursor: not-allowed;
}

/* Bottom Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 10;
}

.selection-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.selection-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s;
}

.btn-primary:disabled {
    background: #c3b5ff;
    cursor: not-allowed;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.w-100 {
    width: 100%;
    justify-content: center;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.modal-content p {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 400px) {
    .numbers-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}
