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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #0f4c3a 0%, #1a5f4a 50%, #0f4c3a 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Snowflakes animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 60%, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 200px 200px, 150px 150px, 180px 180px, 160px 160px;
    background-position: 0 0, 50px 50px, 100px 100px, 150px 150px;
    animation: snow 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes snow {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: #fff;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.3); }
    to { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 215, 0, 0.6); }
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 120px;
    gap: 20px;
    margin-bottom: 40px;
    grid-auto-flow: dense;
}

.card {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1538 100%);
    border: 4px solid #ffd700;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Card sizes - 4 different sizes */
.card.size-small {
    grid-column: span 1;
    grid-row: span 1;
}

.card.size-medium {
    grid-column: span 1;
    grid-row: span 2;
}

.card.size-large {
    grid-column: span 2;
    grid-row: span 2;
}

.card.size-extra-large {
    grid-column: span 2;
    grid-row: span 3;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
}

.card:hover::before {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.card:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
}

.card.opened {
    background: linear-gradient(135deg, #2d5016 0%, #1a5f4a 100%);
    border-color: #ffd700;
    cursor: default;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.card.opened::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(45, 80, 22, 0.7) 0%, rgba(26, 95, 74, 0.7) 100%);
    z-index: 0;
    border-radius: 11px;
}

.card.opened:hover {
    transform: scale(1.02);
}

.card-number {
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 2;
    position: relative;
}

.card.size-small .card-number {
    font-size: 1.8em;
}

.card.size-medium .card-number {
    font-size: 2.2em;
}

.card.size-large .card-number {
    font-size: 2.8em;
}

.card.size-extra-large .card-number {
    font-size: 3.5em;
}

.card.opened .card-number {
    color: #ffd700;
    opacity: 0.7;
}

.card-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.card.size-small .card-icon {
    font-size: 1.2em;
}

.card.size-medium .card-icon {
    font-size: 1.5em;
}

.card.size-large .card-icon {
    font-size: 2em;
}

.card.size-extra-large .card-icon {
    font-size: 2.5em;
}

.card.opened .card-icon {
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
    overflow-y: auto;
    overflow-x: hidden;
}

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

.modal-content {
    background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
    margin: 2% auto;
    padding: 0;
    border: 5px solid #ffd700;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 96vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideDown 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.close {
    color: #c41e3a;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s;
}

.close:hover {
    transform: scale(1.2);
    color: #8b1538;
}

.modal-body {
    padding: 40px;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(96vh - 100px);
}

.modal-body h2 {
    color: #c41e3a;
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 3px solid #ffd700;
    padding-bottom: 15px;
}

.modal-body .card-type {
    display: inline-block;
    background: #ffd700;
    color: #0f4c3a;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 20px;
}

.modal-body .card-content {
    color: #333;
    font-size: 1.2em;
    line-height: 1.8;
    margin-top: 20px;
}

.modal-body .card-date {
    color: #666;
    font-size: 0.9em;
    margin-top: 20px;
    font-style: italic;
}

.modal-body .card-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 3px solid #ffd700;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        grid-auto-rows: 80px;
        gap: 15px;
    }
    
    .card.size-small .card-number {
        font-size: 1.2em;
    }
    
    .card.size-medium .card-number {
        font-size: 1.5em;
    }
    
    .card.size-large .card-number {
        font-size: 1.8em;
    }
    
    .card.size-extra-large .card-number {
        font-size: 2.2em;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 30px 20px;
        max-height: calc(90vh - 80px);
    }
    
    .modal-body h2 {
        font-size: 1.5em;
    }
}
