body {
    margin: 0;
    padding: 0;
    background-color: #000000;
    display: flex;
    justify-content: center;
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
}

.main-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.bg-img {
    width: 100%;
    display: block;
}

/* --- THE FLEX GRID --- */
.calendar-grid {
    position: absolute;
    /* YOUR PREFERRED POSITIONING */
    top: 42.5%;      
    left: 21%;     
    right: 21%;    
    
    display: flex;
    flex-wrap: wrap;
    /* THIS CENTERS THE LAST ROW WITHOUT CHANGING THE REST */
    justify-content: center; 
    gap: 5px;      
    direction: rtl; 
}

/* --- THE SQUARE SIZES --- */
.day-sq {
    /* (100% / 5) minus the gap makes exactly 5 fit per row */
    width: calc(20% - 5px); 
    background: #fef4d1;
    border-radius: 5px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    aspect-ratio: 1 / 1; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    
    transition: all 0.15s ease-in-out;
    -webkit-tap-highlight-color: transparent; 
    cursor: pointer;
}

/* Hover/Tap Effects */
.day-sq:hover {
    transform: translateY(-2px) scale(1.03);
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.day-sq:active {
    transform: scale(0.95);
    background: #e6ddbc;
}

/* --- TEXT SIZES (RESTORED TO YOUR PREFERRED VALUES) --- */
.num {
    color: #3b4a50;
    font-size: 1.5rem; 
    font-weight: 700;
    line-height: 1;
}

.line {
    width: 50%;
    height: 1px;
    background-color: #3b4a50;
    margin: 2px 0;
}

.date {
    color: #3b4a50;
    font-size: 0.6rem; 
    font-weight: 500;
    line-height: 1;
}

/* --- MOBILE RESPONSIVENESS (RESTORED VALUES) --- */
@media (max-width: 450px) {
    .num { font-size: 1.1rem; }
    .date { font-size: 0.5rem; }
    .calendar-grid { gap: 4px; }
}