/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: linear-gradient(to bottom, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Calendar Card */
.calendar-card {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.3);
}

.calendar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-card:hover::before {
    opacity: 1;
}

.calendar-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.calendar-card.unlocked {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.5);
    color: white;
    box-shadow: 0 4px 24px -4px rgba(59, 130, 246, 0.4);
}

.calendar-card.unlocked:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 32px -4px rgba(59, 130, 246, 0.5);
}

.calendar-card.locked {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.2);
    cursor: not-allowed;
}

.calendar-card.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.03);
}

.calendar-card.opened {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.5);
    color: white;
    box-shadow: 0 4px 24px -4px rgba(16, 185, 129, 0.4);
}

.calendar-card.opened::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: white;
    margin: 8% auto;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

.close {
    color: #94a3b8;
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #475569;
}

#modal-title {
    color: #0f172a;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
}

/* Riddle Box */
.riddle-box {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
}

.riddle-box h3 {
    color: #3b82f6;
    margin-bottom: 16px;
    font-size: 1.2rem;
    font-weight: 600;
}

#riddle-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #475569;
}

/* Answer Section */
.answer-section {
    text-align: center;
}

#answer-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    font-family: inherit;
}

#answer-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#submit-answer {
    background: #3b82f6;
    color: white;
    padding: 14px 32px;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-family: inherit;
}

#submit-answer:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#submit-answer:active {
    transform: translateY(0);
}

.error-message {
    color: #ef4444;
    margin-top: 12px;
    font-weight: 500;
    min-height: 20px;
    font-size: 0.95rem;
}

/* Gift Box */
.gift-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 28px;
    border-radius: 16px;
    border: 2px solid #10b981;
    text-align: center;
}

.gift-box h3 {
    color: #059669;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 700;
}

#gift-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #475569;
}

#gift-content img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 16px;
}

#gift-content a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: white;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: 2px solid #e2e8f0;
}

#gift-content a:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

/* Warning Modal */
.warning-content {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    text-align: center;
}

.warning-content h2 {
    color: #dc2626;
    margin-bottom: 16px;
    font-weight: 700;
}

#warning-text {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
}

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

    .subtitle {
        font-size: 1rem;
    }

    .calendar-grid {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 12px;
    }

    .calendar-card {
        font-size: 2rem;
    }

    .modal-content {
        margin: 10% auto;
        padding: 28px;
        width: 95%;
    }

    #modal-title {
        font-size: 1.6rem;
    }

    .riddle-box {
        padding: 20px;
    }

    .riddle-box h3 {
        font-size: 1.1rem;
    }

    #riddle-text {
        font-size: 1rem;
    }

    #answer-input {
        padding: 14px 16px;
    }

    #submit-answer {
        padding: 12px 28px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    header {
        margin-bottom: 30px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .calendar-grid {
        gap: 10px;
    }

    .calendar-card {
        font-size: 1.6rem;
        border-radius: 16px;
    }

    .modal-content {
        padding: 24px;
        border-radius: 20px;
    }

    #modal-title {
        font-size: 1.4rem;
        margin-bottom: 24px;
    }

    .close {
        font-size: 24px;
        right: 16px;
        top: 16px;
    }
}
