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

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-in;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
    font-weight: 700;
}

.password-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.password-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.cancel-btn {
    background: #f0f0f0;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.error-message {
    color: #f5576c;
    font-size: 14px;
    margin-top: 15px;
    font-weight: 600;
}

/* ===== Email modal (iCloud share) ===== */
.email-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.email-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.email-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
}
.email-modal-text {
    font-size: 15px;
    color: #555;
    line-height: 1.45;
    margin: 0 0 16px;
}
.email-modal-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 12px;
    box-sizing: border-box;
}
.email-modal-input:focus {
    outline: none;
    border-color: #667eea;
}
.email-modal-error {
    color: #c45c5c;
    font-size: 14px;
    margin: 0 0 12px;
}
.email-modal-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}
.email-modal-skip {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
}

/* ===== INTRO (video) ===== */
.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 2;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.intro-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.intro-video-wrap {
    position: absolute;
    inset: 0;
}
.intro-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.intro-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.35) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)) 24px;
    text-align: center;
}
.intro-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(48px, 14vw, 72px);
    font-weight: 600;
    color: #faf8f5;
    text-shadow: 0 2px 16px rgba(0,0,0,0.3);
    opacity: 0;
    animation: introFadeIn 1s ease 3s forwards;
    margin-bottom: 12px;
}
.intro-tagline {
    font-size: clamp(16px, 4vw, 24px);
    font-weight: 500;
    color: rgba(250, 248, 245, 0.95);
    text-shadow: 0 1px 8px rgba(0,0,0,0.25);
    opacity: 0;
    animation: introFadeIn 1s ease 3.4s forwards;
    margin-bottom: 32px;
    max-width: 320px;
}
.intro-cta {
    opacity: 0;
    animation: introFadeIn 0.8s ease 3.8s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.intro-arrow {
    width: 32px;
    height: 32px;
    border-right: 3px solid #faf8f5;
    border-bottom: 3px solid #faf8f5;
    transform: rotate(45deg);
    cursor: pointer;
    animation: introBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.intro-swipe-hint {
    font-size: 14px;
    font-weight: 500;
    color: rgba(250, 248, 245, 0.9);
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
@keyframes introFadeIn { to { opacity: 1; } }
@keyframes introBounce {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(6px); }
}

/* ===== BIO (Peter card, swipeable) ===== */
.bio-section {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: linear-gradient(145deg, #f5e6d8 0%, #e8d5d0 35%, #f0e2dc 70%, #e8d4c8 100%);
    padding: max(12px, env(safe-area-inset-top)) env(safe-area-inset-right) max(20px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.bio-section.visible {
    opacity: 1;
    visibility: visible;
}
.swipe-deck {
    width: 100%;
    max-width: 400px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 12px 16px;
}
.bio-card {
    width: 100%;
    max-height: 100%;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(45, 74, 62, 0.12);
    overflow: hidden;
    border: 1px solid rgba(45, 74, 62, 0.08);
    position: relative;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease-out;
}
.bio-card.dragging { transition: none; }
.bio-card.swiped-left { animation: bioFlyLeft 0.4s ease-in forwards; }
.bio-card.swiped-right { animation: bioFlyRight 0.4s ease-in forwards; }
@keyframes bioFlyLeft {
    to { transform: translateX(-120%) rotate(-18deg); opacity: 0; }
}
@keyframes bioFlyRight {
    to { transform: translateX(120%) rotate(18deg); opacity: 0; }
}
.bio-card-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    background: #e8ddd5;
}
.bio-card-body {
    padding: 20px 20px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.bio-card h1 {
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #2d4a3e;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}
.bio-card .bio-text {
    font-size: 15px;
    line-height: 1.55;
    color: #3d5c4e;
    white-space: pre-line;
}
.swipe-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    max-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 2;
}
.swipe-overlay.left {
    left: 12px;
    border: 3px solid #c45c5c;
    border-radius: 12px;
    color: #c45c5c;
    font-size: 22px;
    font-weight: 700;
    transform: rotate(-18deg);
}
.swipe-overlay.right {
    right: 12px;
    left: auto;
    border: 3px solid #3d6b52;
    border-radius: 12px;
    color: #3d6b52;
    font-size: 22px;
    font-weight: 700;
    transform: rotate(12deg);
}
.bio-card.show-nope .swipe-overlay.left { opacity: 1; }
.bio-card.show-like .swipe-overlay.right { opacity: 1; }
.bio-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.bio-actions button {
    font-family: 'DM Sans', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding: 14px 20px;
    min-height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
    -webkit-tap-highlight-color: transparent;
}
.bio-actions .btn-left {
    background: transparent;
    color: #c45c5c;
    border-color: #c45c5c;
}
.bio-actions .btn-right {
    background: #3d6b52;
    color: #fff;
    border-color: #3d6b52;
    box-shadow: 0 4px 20px rgba(45, 74, 62, 0.08);
}

/* ===== MATCH SCREEN ===== */
#matchScreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
}

.match-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #2d1b4e 0%, #4a2c6a 35%, #3d2463 70%, #1f0d38 100%);
}

.float-heart {
    position: absolute;
    width: 20px;
    height: 20px;
    opacity: 0.15;
    pointer-events: none;
}
.float-heart::before {
    content: '♥';
    font-size: 20px;
    color: #ffb7c5;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.float-heart-1 { top: 12%; left: 10%; animation: floatHeart 8s ease-in-out infinite; }
.float-heart-2 { top: 60%; right: 8%; animation: floatHeart 10s ease-in-out infinite 1s; }
.float-heart-3 { bottom: 20%; left: 15%; animation: floatHeart 9s ease-in-out infinite 0.5s; }
@keyframes floatHeart {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.12; }
    25% { transform: translate(8px, -12px) scale(1.1); opacity: 0.18; }
    50% { transform: translate(-5px, -8px) scale(0.95); opacity: 0.1; }
    75% { transform: translate(6px, -15px) scale(1.05); opacity: 0.16; }
}

.float-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}
.float-sparkle-1 { top: 25%; right: 12%; animation: floatSparkle 6s ease-in-out infinite; }
.float-sparkle-2 { top: 70%; left: 20%; animation: floatSparkle 7s ease-in-out infinite 0.8s; }
.float-sparkle-3 { bottom: 30%; right: 18%; animation: floatSparkle 5.5s ease-in-out infinite 0.3s; }
@keyframes floatSparkle {
    0%, 100% { transform: translate(0, 0); opacity: 0.3; }
    50% { transform: translate(-4px, -10px); opacity: 0.7; }
}

.match-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 16px 24px;
    gap: 0;
}

.match-profiles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.match-overlay .profile {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.match-overlay .profile img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #d4af37;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.match-overlay .profile p {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.profile-peter {
    animation: slideInLeft 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}
.profile-karin {
    animation: slideInRight 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-80px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}

.heart-trail {
    width: 32px;
    height: 32px;
    margin: 0 4px;
    opacity: 0;
    animation: heartTrailIn 0.6s ease-out 1.5s forwards;
}
.heart-trail::before {
    content: '♥';
    font-size: 28px;
    color: #ff9eb5;
    display: block;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 0 8px rgba(255, 158, 181, 0.6));
}
@keyframes heartTrailIn {
    from { opacity: 0; transform: scale(0.3); }
    to { opacity: 1; transform: scale(1); }
}

.match-overlay .match-title {
    font-size: clamp(32px, 8vw, 52px);
    font-weight: 800;
    color: #d4af37;
    letter-spacing: 0.02em;
    margin: 0 0 6px;
    opacity: 0;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    animation: matchTitleIn 0.5s ease-out 2.1s forwards, matchHeartbeat 1.2s ease-in-out 2.8s infinite;
}
@keyframes matchTitleIn {
    from { opacity: 0; transform: scale(0.5); }
    70% { opacity: 1; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes matchHeartbeat {
    0%, 100% { transform: scale(1); }
    14%, 28% { transform: scale(1.1); }
    42%, 56%, 70%, 84% { transform: scale(1); }
}

.match-heart-emoji {
    font-size: 44px;
    margin: 0 0 20px;
    line-height: 1;
    opacity: 0;
    animation: heartEmojiIn 0.4s ease-out 2.4s forwards, heartPulse 1s ease-in-out 2.9s infinite;
}
@keyframes heartEmojiIn {
    to { opacity: 1; }
}
@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.match-cta {
    background: linear-gradient(135deg, #e87a6b 0%, #d96a5b 100%);
    color: #fff;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 24px rgba(232, 122, 107, 0.45), 0 0 30px rgba(232, 122, 107, 0.25);
    opacity: 0;
    animation: ctaIn 0.5s ease-out 2.6s forwards;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.match-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(232, 122, 107, 0.5), 0 0 40px rgba(232, 122, 107, 0.35);
}
.match-cta:active {
    transform: translateY(0);
}
@keyframes ctaIn {
    to { opacity: 1; }
}

.cta-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border: none;
    padding: 18px 50px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
}

/* Stars background animation */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ===== CALENDAR SCREEN (simplified: Plan Dates → calshow) ===== */
#calendarContainer {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(160deg, #2d1b4e 0%, #4a2c6a 40%, #5b3a7a 70%, #3d2463 100%);
    padding: 0;
    animation: fadeIn 0.4s ease-in;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.calendar-simple {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: max(env(safe-area-inset-top), 16px) max(env(safe-area-inset-right), 20px) max(env(safe-area-inset-bottom), 20px) max(env(safe-area-inset-left), 20px);
}

.calendar-simple-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.calendar-simple-header .back-button {
    margin-bottom: 0;
}

.calendar-simple-header h2 {
    font-size: clamp(20px, 5vw, 26px);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-align: center;
}

.calendar-simple-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.plan-dates-btn {
    width: 100%;
    max-width: 320px;
    padding: 24px 40px;
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.45), 0 0 40px rgba(118, 75, 162, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.plan-dates-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5), 0 0 50px rgba(118, 75, 162, 0.35);
}

.plan-dates-btn:active {
    transform: translateY(-1px);
}

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

.calendar-header {
    max-width: 1200px;
    margin: 0 auto 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.calendar-header h2 {
    font-size: 36px;
    color: #333;
    margin: 15px 0;
    font-weight: 800;
}

.back-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    margin-bottom: 15px;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.edit-button,
.export-button,
.logout-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
}

.edit-button:hover,
.export-button:hover,
.logout-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.export-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.export-button:hover {
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
}

.logout-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.calendar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#calendar {
    font-size: 16px;
}

/* FullCalendar Customization */
.fc {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.fc .fc-button-primary {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    font-weight: 600;
    transition: all 0.3s;
}

.fc .fc-button-primary:hover {
    background-color: #764ba2;
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.fc .fc-button-primary.fc-button-active {
    background-color: #764ba2;
    border-color: #764ba2;
}

.fc .fc-daygrid-day {
    background-color: #fafafa;
    border-color: #e0e0e0;
}

.fc .fc-daygrid-day:hover {
    background-color: #f0f0f0;
}

.fc .fc-event {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 4px 8px;
}

.fc .fc-event:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.fc .fc-event-title {
    font-weight: 600;
    color: white;
}

.fc .fc-col-header-cell {
    background-color: #f5f5f5;
    color: #333;
    font-weight: 700;
    border-color: #e0e0e0;
    padding: 15px 0;
}

.fc .fc-daygrid-day-number {
    padding: 10px;
    color: #666;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .match-overlay .match-title {
        font-size: clamp(28px, 7vw, 42px);
    }

    .match-profiles {
        gap: 8px;
    }

    .match-overlay .profile img {
        width: 140px;
        height: 140px;
    }

    .heart-trail::before {
        font-size: 22px;
    }

    .match-cta {
        padding: 14px 32px;
        font-size: 17px;
    }

    .cta-button {
        padding: 15px 40px;
        font-size: 18px;
    }

    .calendar-header {
        padding: 20px;
    }

    .calendar-header h2 {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
    }

    .edit-button,
    .export-button {
        width: 100%;
    }
}
}

#exportBtn {
    background: #2196f3;
}

#exportBtn:hover {
    background: #1976d2;
}

@media (max-width: 768px) {
    .profiles {
        flex-direction: column;
    }
    .profile img {
        width: 80px;
        height: 80px;
    }
    #calendar {
        font-size: 14px;
    }
}