:root {
    --gold: #d4af37;
    --creamy: #fdfaf5;
    --dark-text: #4a4a4a;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--creamy);
    background-image: url('https://www.transparenttextures.com/patterns/paper.png');
    font-family: 'Cairo', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
    overflow: hidden;
    
}

/* --- المرحلة 1: حركة العريس والعروسة --- */
#animation-stage {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 1s ease;
}

.path-line {
    position: absolute;
    width: 80%;
    height: 1px;
    background: border-box;
    border-top: 1px dashed var(--gold);
    opacity: 0.4;
}

.char { 
    font-size: 70px; 
    position: absolute; 
    transition: 3s cubic-bezier(0.45, 0.05, 0.55, 0.95); 
}

.groom { left: -120px; }
.bride { right: -120px; }

.meet-groom { left: calc(50% - 45px); }
.meet-bride { right: calc(50% - 45px); }

/* --- المرحلة 2: الـ Terminal --- */
#terminal-overlay {
    background: white;
    color: var(--gold);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    max-width: 90%;
    border: 1px solid #eee;
    z-index: 500;
}

.cursor { animation: blink 0.7s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- المرحلة 3: الكارت الزجاجي المعدل للمناسبتين --- */
.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
    padding: 25px 15px;
    border-radius: 25px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 40px rgba(212, 175, 55, 0.15);
    animation: slideUp 1.2s ease-out;
    max-height: 95vh; /* لضمان عدم خروج الكارت عن الشاشة في الموبايلات القصيرة */
    overflow-y: auto;
}

.names {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    color: var(--gold);
    margin: 10px 0;
}

.sub-title { font-size: 1rem; color: #888; margin-bottom: 5px; }
.main-text { font-size: 0.9rem; color: var(--dark-text); margin-bottom: 15px; }

/* تنسيق صناديق المناسبات */
.events-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.event-box {
    background: rgba(212, 175, 55, 0.05);
    padding: 12px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.event-title {
    font-size: 1.1rem;
    color: var(--gold);
    margin: 0 0 8px 0;
}

.details-row {
    display: flex;
    justify-content: space-around;
    gap: 5px;
}

.detail-item {
    font-size: 0.8rem;
    color: var(--dark-text);
}

.detail-item span { display: block; font-size: 1.1rem; }
.detail-item p { margin: 3px 0 0 0; font-weight: bold; }

.divider {
    border: 0;
    border-top: 1px dashed var(--gold);
    width: 50%;
    margin: 5px auto;
    opacity: 0.3;
}

/* العداد */
#countdown {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
}

.time-box {
    background: var(--gold);
    color: white;
    padding: 8px 4px;
    border-radius: 10px;
    flex: 1;
    min-width: 55px;
}

.time-box.secondary {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.time-box span {
    font-size: 1.1rem;
    display: block;
    font-weight: bold;
}

.time-box p { margin: 0; font-size: 0.6rem; }

.btn-music {
    background: var(--gold);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Helpers */
.hidden { display: none !important; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Optimized */
@media (max-width: 400px) {
    .names { font-size: 1.8rem; }
    .event-title { font-size: 1rem; }
    .detail-item p { font-size: 0.75rem; }
    .time-box { min-width: 45px; }
    .char { font-size: 50px; }
    .glass-card { padding: 15px 10px; margin-bottom: 30px;}
}