/* RESET & VARS */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Noto+Serif+KR:wght@200;300;400;500;600&display=swap');
@font-face {
    font-family: 'GaramYeonKkot';
    src: url('fonts/나눔손글씨 가람연꽃.ttf') format('truetype');
}

:root {
    --bg-color: #f7f5f0;
    --text-main: #2c2c2c;
    --text-sub: #555555;
    --accent-gold: #a38f6d;
    --font-kr: 'Noto Serif KR', sans-serif; /* Main Font */
    --font-hand: 'Nanum Brush Script', cursive; /* Handwriting */
    --primary-color: #333;
    --mobile-width: 440px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Global Styles */
html {
    scroll-behavior: smooth;
    height: 100%;
}
body { 
    font-family: var(--font-kr);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #f7f5f0;
    color: var(--primary-color);
    line-height: 1.6;
    overflow: hidden; /* Prevent double scrollbars */
    height: 100%;
    overflow-x: hidden;
}

/* Sections Snap Align */
.hero, .section, footer {
    scroll-snap-align: start;
}

/* SCROLL INDICATOR */
.scroll-indicator { 
    position: absolute; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    z-index: 20;
    opacity: 0; /* Hidden initially */
    transition: opacity 1s ease;
}
.scroll-indicator.visible {
    opacity: 1;
}

/* Hero Icons */
.hero-names img.icon {
    height: 3.5rem; /* Match font size roughly */
    width: auto;
    vertical-align: middle;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* INTRO (ENVELOPE) */
#intro-container {
    position: fixed; inset: 0; z-index: 9999;
    /* background: rgba(0,0,0,0.6); REMOVED: Managed by inner layers */
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.8s ease;
    height: 100vh;
    height: 100dvh; /* Mobile viewport fix */
}
#pc-bg-slideshow {
    position: absolute; inset: 0;
    z-index: 0; 
    /* Container only, no image here */
    height: 100vh;
    height: 100dvh;
}
.bg-layer {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
    will-change: opacity; /* Hint for GPU */
}
.bg-layer.active {
    opacity: 1;
    z-index: 1;
}
#pc-glass-overlay {
    position: absolute; inset: 0;
    z-index: 1; /* Middle layer */
    background: rgb(0 0 0 / 40%); /* Darker overlay as requested */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    height: 100vh;
    height: 100dvh;
}
.envelope-wrapper {
    width: 320px; height: 220px;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    z-index: 10; /* Top layer */
    /* Fallback Ambient Animation */
    animation: float-3d 6s ease-in-out infinite;
}
@keyframes float-3d {
    0%, 100% { transform: rotateX(0deg) rotateY(0deg) translateY(0); }
    33% { transform: rotateX(5deg) rotateY(2deg) translateY(-5px); }
    66% { transform: rotateX(-3deg) rotateY(-2deg) translateY(0); }
}
.envelope-body {
    width: 100%; height: 100%;
    background: #e6e0d4;
    position: absolute; inset: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10;
    border-radius: 5px;
    border: none; /* Removed border line */
}
.envelope-front {
    position: absolute; inset: 0;
    z-index: 20;
    border-radius: 5px;
    overflow: hidden; /* Clips flaps exactly to body shape */
    pointer-events: none;
    border: none; /* Removed border line */
}
.envelope-flap {
    position: absolute; border-style: solid;
}
.flap-left { 
    left: 0; top: 0; bottom: 0; 
    border-width: 110px 0 110px 160px; 
    border-color: transparent transparent transparent #dad3c1;
    z-index: 21;
}
.flap-right { 
    right: 0; top: 0; bottom: 0; 
    border-width: 110px 160px 110px 0; 
    border-color: transparent #dad3c1 transparent transparent;
    z-index: 21;
}
.flap-bottom { 
    bottom: 0; left: 0; right: 0; 
    width: 100%; height: 120px;
    z-index: 22;
    border: 0px;
}
.flap-top { 
    border: none;
    top: 1px; left: 0; right: 0; 
    height: 120px; 
    background: #e6e0d4; 
    
    clip-path: polygon(0 0, 100% 0, 50% 100%); 
    transform-origin: top; 
    z-index: 23; /* Above everything initially to flip over */
    transition: transform 0.6s ease, z-index 0.1s linear 0.3s;
    border-radius: 0 0 5px 5px; /* Slight rounding for flap tip */
}

.recipient-label {
    position: absolute;
    bottom: 5%;
    width: 100%;
    text-align: center;
    font-family: 'GaramYeonKkot', cursive;
    font-size: 1.8rem;
    color: #333;
    z-index: 30;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wax-seal-img {
    position: absolute;
    top: 55%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px; /* Ensure square for perfect circle */
    object-fit: cover; /* Maintain aspect ratio inside circle */
    z-index: 10030; /* Ensure clickable above petals (20000) */
    cursor: pointer;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pulse-seal 2s infinite;
    border-radius: 50%; /* Make shadow circular */
}
.wax-seal-img:hover {
    filter: brightness(1.1);
    transform: translate(-50%, -50%) scale(1.1);
}
.wax-seal-img:active {
    transform: translate(-50%, -50%) scale(0.95);
}
@keyframes pulse-seal {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(163, 143, 109, 0.7); }
    50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 15px rgba(163, 143, 109, 0); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(163, 143, 109, 0); }
}


/* Open Animation Classes */
.envelope-wrapper.open .flap-top {
    transform: rotateX(180deg);
    z-index: 1; /* Moves behind card */
    transition: transform 0.5s ease, z-index 0.1s linear 0.25s; /* 500ms duration */
}
.envelope-wrapper.open .wax-seal-img {
    filter: brightness(1.2) drop-shadow(0 10px 20px rgba(0,0,0,0.2));
    transform: translate(-50%, -50%) scale(1.1) rotate(15deg); /* Peel off effect in place */
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s ease, opacity 0.5s ease;
}
.envelope-wrapper.open .recipient-label {
    opacity: 1; /* Keep text visible */
    transition: opacity 0.5s ease 2s; /* Fade out later if needed, but handled by container fade */
}
.envelope-wrapper.open .envelope-card {
    transform: translateY(-80px);
    opacity: 1;
    transition: transform 0.8s ease 0.4s, opacity 0.5s ease 0.4s;
    z-index: 15; /* Above back flaps, below bottom/sides effectively */
}

/* Card Inside */
.envelope-card {
    position: absolute;
    top: -50px; left: 10px; right: 10px; bottom: 10px;
    background: #fff url('image/card_texture.png') no-repeat center center/cover;
    z-index: 11;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; /* Ensure vertical stacking */
    text-align: center;
    transform: translateY(0);
    opacity: 0; /* Hidden initially inside */
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    border-radius: 5px; /* Reverted to 5px and consistent with top */
    border: none; /* Ensure no border lines */
    padding: 20px; /* Padding for text inside */
    padding-bottom: 50px; /* Shift visual center up */
}
.sticker-smile {
    position: absolute;
    top: 15px; left: 15px;
    width: 40px; height: auto;
    transform: rotate(-30deg);
    z-index: 12;
    opacity: 0.9;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}
.invite-title { 
    font-family: 'GaramYeonKkot', cursive; 
    font-size: 1.6rem; 
    line-height: 1.4; 
    color: #4a4a4a; /* Softer dark gray */
    text-shadow: 0 1px 1px rgba(255,255,255,0.8); /* Embossed text effect */
}
.invite-title.invite-accent{
    color: var(--accent-gold);
}
.invite-subtitle { 
    font-family: var(--font-kr); 
    font-size: 0.9rem; 
    letter-spacing: 2px; 
    color: #8c8c8c; 
    margin-top: 15px; 
    text-transform: uppercase;
}


/* MAIN CONTENT LAYOUT */
#main-content {
    max-width: var(--mobile-width);
    margin: 0 auto;
    background: white;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch; /* Smooth inertia scroll on iOS */
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
    opacity: 0; /* Ensures smooth transition */
    transition: opacity 1.5s ease-in-out;
}

/* Hero */
/* Hero */
.hero {
    height: 100dvh;
    position: relative;
    overflow: hidden;
}

/* Define Custom Font */
@font-face {
    font-family: 'NanumGlobal';
    src: url('fonts/나눔손글씨 세계적인 한글.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

.hero-bg {
    position: absolute; inset: 0;
    background-image: url('image/JDC_7374.jpg');
    background-size: cover;
    background-position: center;
    z-index: 0;
}
.hero-overlay {
    position: absolute; inset: 0;
    /* Reduced opacity for Galaxy as requested */
    background: rgba(0,0,0,0.15); 
    z-index: 1;
}
.hero-date {
    position: absolute;
    top: 60px; left: 30px;
    z-index: 10;
    color: white;
    font-size: 1.8rem; /* Reduced 20% from 2.25rem */
    font-family: 'NanumGlobal', cursive;
    letter-spacing: 1px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap; /* Prevent wrap */
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    opacity: 0;
    animation: fadeInDown 1s ease forwards 0.5s;
}
.hero-names {
    position: absolute;
    bottom: 110px; right: 30px;
    z-index: 10;
    color: white;
    text-align: left;
    font-size: 2.4rem; /* Reduced 20% from 3rem */
    font-family: 'NanumGlobal', cursive;
    line-height: 1.3;
    white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}
.hero-names p { margin: 0; }

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.date { font-family: var(--font-kr); letter-spacing: 4px; font-size: 1.1rem; margin-bottom: 20px; }
.names { font-family: var(--font-kr); font-weight: 400; font-size: 3rem; line-height: 1.1; margin-bottom: 20px; }
.venue { font-size: 0.72rem; letter-spacing: 2px; opacity: 0.8; } /* Reduced 20% from 0.9rem */

@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* Sections */
/* Sections */
.section { 
    padding: 4rem 1.5rem; 
    text-align: center; 
    min-height: 100dvh; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Subtle separation */
    position: relative; /* Context for pseudo-elements */
    isolation: isolate; /* Create new stacking context */
}

/* Invitation Section Background */
.invitation-text::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('image/paper.jpg') repeat;
    background-size: cover; /* or contain depending on texture */
    opacity: 0.5;
    z-index: -1;
}

.invitation-text h2 { font-family: var(--font-kr); color: var(--accent-gold); font-size: 1.4rem; margin-bottom: 2rem; font-weight: 500; }
.main-text { font-size: 0.95rem; color: #444; margin-bottom: 1.5rem; word-break: keep-all; }
.divider { width: 40px; height: 1px; background: #ddd; margin: 0 auto 1.5rem; }
.parents-info .row { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1rem; 
    color: #555; 
    margin-bottom: 8px; /* Slightly tighter */
}
/* Parent Relation Alignment */
.parents { text-align: center; width: 140px; } /* Fixed width, centered text */
.name { text-align: center; width: 100px; font-weight: 500; font-size: 1.1rem; color: #222; }

/* Parent Relation Alignment */
.relation {
    display: inline-block;
    width: 50px; /* Fixed center width */
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin: 0; /* Let flex gap handle or fixed width */
}
.parents-info strong { color: #222; font-weight: 500; font-size: 1.1rem; } /* Legacy support or remove if unused */

/* Native Calendar Link (Glassmorphism) */
.location-info {
    margin-top: 40px;
    padding: 24px; /* Increased padding */
    background: rgba(255, 255, 255, 0.6); /* Less transparent to pop */
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(163, 143, 109, 0.3); /* Gold border hint */
    border-radius: 12px;
    font-size: 0.8rem; /* Further reduced from 0.95rem */
    line-height: 1.6;
    color: #444;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(163, 143, 109, 0.15); /* Stronger shadow */
    position: relative;
    overflow: hidden;
}
.location-info:active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(0.98);
}
.cal-hint {
    margin-top: 15px;
    font-size: 0.95rem;
    color: #fff; /* White text on button */
    
    background: var(--accent-gold); /* Gold button */
    padding: 10px 20px;
    border-radius: 30px;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(163, 143, 109, 0.3);
    animation: bounceHint 2s infinite;
}
@keyframes bounceHint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Hybrid Gallery */
.section.gallery {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    justify-content: flex-start;
    padding: 1.2rem 0.8rem 1.6rem;
    overflow: hidden;
}
.gallery { background: #fafafa; overflow: hidden; overflow-x: hidden;}
.gallery h2 {
    font-family: var(--font-kr);
    font-size: 2rem;
    color: var(--accent-gold);
    margin: 0 0 0.8rem 0;
    flex: 0 0 auto;
}
/* Gallery Swiper */
/* Scattered Polaroid Floor */
.gallery-grid {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}

.polaroid-item {
    position: absolute;
    width: clamp(68px, 20vw, 108px);
    min-width: auto;
    max-width: none;
    margin: 0;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    will-change: transform;
    animation: dropIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Horizontal Polaroid */
.polaroid-item.is-landscape {
    width: clamp(102px, 29vw, 154px);
}

.polaroid-inner {
    background: white;
    padding: 6px 6px 20px 6px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); /* Stronger shadow */
    border-radius: 2px;
    transition: box-shadow 0.3s;
    height: 100%; /* Fill item */
    display: flex; flex-direction: column;
}

.polaroid-item img {
    border-radius: 3px;
    width: 100%;
    height: auto;
    display: block;
    background: #f0f0f0;
    aspect-ratio: auto;
    pointer-events: none; /* Let parent handle clicks for mobile logic */
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Hover & Mobile Focus Interaction: Lift up and Straighten */
.polaroid-item:hover,
.polaroid-item.mobile-hover {
    transform: translate(-50%, -50%) scale(1.18) rotate(0deg) !important; /* Keep absolute anchor */
    z-index: 999 !important; /* Top of pile */
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.polaroid-item:hover .polaroid-inner,
.polaroid-item.mobile-hover .polaroid-inner {
    box-shadow: 0 20px 40px rgba(0,0,0,0.4); /* Apply to inner */
}

/* Global Image Protection */
img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes dropIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Location & Account Sections */
.location { background: #fff; padding-bottom: 3rem; }
.location h2 { color: var(--accent-gold); font-family: var(--font-kr); margin-bottom: 1rem; font-size: 2rem; }
.location-name { font-size: 1.15rem; font-weight: 600; color: #222; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.location-addr { font-size: 0.95rem; color: #777; margin-bottom: 2rem; }

#map-area {
    width: 100%; height: 320px;
    background: #f8f8f8; border-radius: 4px;
    margin-bottom: 1px;
    overflow: hidden;
}

.map-buttons-row {
    display: flex; width: 100%; margin-bottom: 2.5rem;
}
.map-buttons-row .btn-map {
    flex: 1; padding: 14px; text-align: center;
    text-decoration: none; font-size: 0.9rem; font-weight: 600;
    transition: opacity 0.2s;
}
.map-buttons-row .btn-map.naver { background: #03c75a; color: #fff; }
.map-buttons-row .btn-map.kakao { background: #fae100; color: #371d1e; }
.map-buttons-row .btn-map:hover { opacity: 0.85; }

/* Transport Info */
.transport-info { padding: 0 5%; }
.subway-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.subway-badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 700; color: #fff;
}
.subway-badge.line-1 {
    width: 20px; height: 20px; background: #264e9a; border-radius: 50%;
}
.subway-badge.line-suin {
    padding: 0 8px; height: 20px; background: #fabc30; border-radius: 10px;
}
.transport-text { font-size: 0.95rem; color: #444; letter-spacing: -0.01em; }

/* Account Section */
.account { background: #fdfcf8; padding-top: 4rem; padding-bottom: 5rem; }
.account h2 { color: var(--accent-gold); font-family: var(--font-kr); margin-bottom: 1rem; font-size: 2rem; }
.account-list { display: flex; flex-direction: column; gap: 2.5rem; text-align: left; padding: 0 8%; }
.account-group { border-bottom: 1px solid #eee; padding-bottom: 2rem; }
.account-group:last-child { border-bottom: none; }
.group-label { font-size: 0.85rem; color: #999; margin-bottom: 1rem; }
.account-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #333; margin-bottom: 1rem; }

/* Parent Relation Alignment */
.relation {
    display: inline-block;
    width: 36px; /* Fixed width to align '아들' (2 chars) and '딸' (1 char) */
    text-align: center;
    margin: 0 4px;
}
.account-text {
    cursor: pointer;
    color: #333 !important; /* Force color */
    text-decoration: none;
    flex: 1; /* Allow it to take space */
}
/* Force removed link styling for iPhone injected links */
.account-text a {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none; /* Let the span handle click */
}
.copy-btn { padding: 6px 12px; font-size: 0.75rem; border: 1px solid #ddd; background: #fff; border-radius: 4px; color: #777; cursor: pointer; }

.kakaopay-btn {
    width: 100%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fee500;
    color: #3c1e1e;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.kakaopay-btn img { height: 16px; }

/* Refusal Note */
.refusal-note {
    margin-top: 1rem; padding: 2rem 1rem;
    border-top: 1px solid #f2f2f2;
    text-align: center;
}
.refusal-note p { font-size: 0.85rem; color: #888; line-height: 1.8; margin: 0; font-family: var(--font-kr); font-weight: 300; }


footer { padding: 3rem 0; background: #f9f9f9; color: #bbb; font-size: 0.8rem; text-align: center; }

/* =========================================
   MOBILE LAYOUT
   ========================================= */
#mobile-layout {
    max-width: var(--mobile-width);
    margin: 0 auto;
    background: #fff; /* Main card bg */
    min-height: 100vh;
    min-height: 100dvh; /* Mobile viewport fix */
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    overflow: hidden; /* Contain petals */
}

/* FALLING PETALS */
.petal {
    position: absolute;
    top: -20px;
    width: 14px; height: 18px;
    background: linear-gradient(120deg, #ffc0cb 0%, #ffebef 100%);
    border-radius: 10% 80% 30% 80%;
    opacity: 0.8;
    z-index: 20000; /* Above intro (z9999) & lightbox */
    pointer-events: none;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.05);
    /* Animation handled in JS */
}
@keyframes fall {
    0% {
        top: -10%;
        transform: translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.8; }
    100% {
        top: 110%;
        transform: translateX(var(--tx)) rotate(var(--r));
        opacity: 0;
    }
}

/* =========================================
   LIGHTBOX (Advanced)
   ========================================= */
#lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 30000; /* Highest priority */
    display: none; /* Flex when active */
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
#lightbox.active {
    display: flex; opacity: 1;
}

/* Backdrop */
.lb-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1;
}

/* Content Wrapper */
.lb-content {
    position: relative; z-index: 2;
    width: 90%; max-width: 800px;
    height: 80vh;
    display: flex; align-items: center; justify-content: center;
}

/* Image Wrapper & Animation */
.lb-img-wrapper {
    position: relative;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

#lb-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 8px solid white; /* Polaroid Frame in Lightbox too */
    border-bottom: 25px solid white;
    
    /* Animation State */
    opacity: 0; 
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}
#lightbox.active #lb-img {
    opacity: 1; transform: scale(1);
    border-radius: 5px;
}

/* Navigation Buttons */
.lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none; color: rgba(255, 255, 255, 0.9);
    font-size: 2rem; padding: 15px;
    cursor: pointer; z-index: 10;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.lb-nav:hover { background: rgba(0, 0, 0, 0.5); transform: translateY(-50%) scale(1.1); }
.lb-nav:active { transform: translateY(-50%) scale(0.95); }
.lb-nav.prev { left: -60px; }
.lb-nav.next { right: -60px; }

/* Mobile Adjustment for Nav */
@media (max-width: 768px) {
    .lb-nav { font-size: 1.5rem; padding: 10px; }
    .lb-nav.prev { left: -10px; }
    .lb-nav.next { right: -10px; }
    #lb-img { border-width: 25px; border-bottom-width: 60px; } /* Thinner frame on mobile */
}

/* Close Button */
.close-lb {
    position: absolute; top: 20px; right: 20px;
    color: white; font-size: 2.5rem;
    cursor: pointer; z-index: 20;
    transition: transform 0.3s;
}
.close-lb:hover { transform: rotate(90deg); }

/* Slide Animations */
.slide-out-left { animation: slideOutLeft 0.5s forwards; }
.slide-in-right { animation: slideInRight 0.5s forwards; }
.slide-out-right { animation: slideOutRight 0.5s forwards; }
.slide-in-left { animation: slideInLeft 0.5s forwards; }

@keyframes slideOutLeft {
    to { opacity: 0; transform: translateX(-50px) rotate(-5deg) scale(0.9); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px) rotate(5deg) scale(0.9); }
    to { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}
@keyframes slideOutRight {
    to { opacity: 0; transform: translateX(50px) rotate(5deg) scale(0.9); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px) rotate(-5deg) scale(0.9); }
    to { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

/* SCROLL INDICATOR */
/* Old Scroll Indicator Removed - Handled in previous block */
.mouse { width: 24px; height: 36px; border: 2px solid white; border-radius: 12px; position: relative; }
.mouse::after { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 2px; height: 6px; background: white; animation: scroll 1.5s infinite; }
@keyframes scroll { 0% { top: 6px; opacity: 1; } 100% { top: 20px; opacity: 0; } }

/* =========================================
   MUSIC PLAYER (TURNTABLE STYLE)
   ========================================= */
#music-controller {
    position: fixed; bottom: 30px; right: 20px; /* Moved to bottom */
    z-index: 20050; /* Above everything */
    display: flex; align-items: center; gap: 12px;
    background: rgba(255, 255, 255, 0.85); /* Slightly more opaque */
    backdrop-filter: blur(8px);
    padding: 8px 20px 8px 8px; /* Larger right padding */
    border-radius: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.5);
    
    /* Slide-in Effect */
    transform: translateX(150%); /* Start off-screen right */
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease; 
}
#music-controller.visible {
    transform: translateX(0);
    opacity: 1;
}
#music-controller.minimized {
    transform: translateX(calc(100% - 40px)); /* Peek out just the disc edge */
    border-radius: 50px;
    padding-right: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 1; /* Keep visible */
}

/* Disc Wrapper & Overlay */
.disc-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}
#music-disc {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: spin 3s linear infinite;
    animation-play-state: paused; /* Default paused */
}
.music-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4); /* Dark dim */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}
/* Icon Toggle Logic */
.music-overlay ion-icon { display: none; }
.music-overlay .icon-play { display: block; padding-left: 2px; } /* Correction for visual center */
.music-overlay .icon-pause { display: none; }

/* When Playing */
#music-disc.playing {
    animation-play-state: running;
}
/* When Playing, show Pause icon */
.disc-wrapper.playing .music-overlay .icon-play { display: none; }
.disc-wrapper.playing .music-overlay .icon-pause { display: block; }
/* When Playing, overlay is fainter unless hovered? User said "faint pause button" */
.disc-wrapper.playing .music-overlay {
    background: rgba(0, 0, 0, 0.3);
}

#music-info-box {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--font-kr);
    line-height: 1.2;
}
.music-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #111;
}
.music-artist {
    font-size: 0.75rem;
    color: #666;
}

/* =========================================
   7-1. SHARE SECTION
   ========================================= */
.share-section {
    padding: 3rem 1.5rem;
    text-align: center;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}
.share-section h3 {
    font-family: var(--font-kr);
    color: var(--accent-gold);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.share-section p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.share-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}
.share-input-group input {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.share-input-group input:focus {
    border-color: var(--accent-gold);
}
.btn-kakao-share {
    background-color: #FAE100;
    color: #371D1E;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.btn-kakao-share:active {
    background-color: #E6CF00;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =========================================
   7-1. SHARE SECTION
   ========================================= */
.share-section {
    padding: 3rem 1.5rem;
    text-align: center;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}
.share-section h3 {
    font-family: var(--font-kr);
    color: var(--accent-gold);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}
.share-section p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.share-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}
.share-input-group input {
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.share-input-group input:focus {
    border-color: var(--accent-gold);
}
.btn-kakao-share {
    background-color: #FAE100;
    color: #371D1E;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.btn-kakao-share:active {
    background-color: #E6CF00;
}

/* =========================================
   8. CALENDAR MODAL (MOBILE ONLY)
   ========================================= */
.cal-modal {
    display: none; /* Hidden by default */
    position: fixed; 
    inset: 0; 
    z-index: 10001;
    align-items: center; 
    justify-content: center;
    padding: 20px;
}
.cal-modal.visible { display: flex !important; }

.cal-modal-backdrop {
    position: absolute; 
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cal-modal-content {
    position: relative; 
    z-index: 10002;
    width: 100%; 
    max-width: 320px;
    background: #fff; 
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: calModalOpen 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

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

.cal-modal-title {
    font-size: 1.35rem; 
    color: var(--accent-gold);
    line-height: 1.4; 
    margin-bottom: 1rem;
    font-family: var(--font-kr);
}

.cal-modal-date {
    font-size: 1.1rem; 
    color: #333; 
    font-weight: 700;
    margin-bottom: 0.25rem; 
    letter-spacing: 0.5px;
    font-family: var(--font-en);
}

.cal-modal-venue {
    font-size: 0.95rem; 
    color: #777; 
    margin-bottom: 2rem;
}

.cal-modal-buttons {
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}

.btn-cal-save {
    width: 100%;
    padding: 16px; 
    background: var(--accent-gold); 
    color: #fff;
    border: none; 
    border-radius: 12px; 
    font-size: 1rem; 
    font-weight: 600;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    cursor: pointer; 
    box-shadow: 0 4px 12px rgba(163, 143, 109, 0.3);
    transition: transform 0.2s active 0.1s;
}
.btn-cal-save:active { transform: scale(0.98); }

.btn-cal-close {
    width: 100%;
    padding: 12px; 
    background: transparent; 
    color: #999;
    border: none; 
    font-size: 0.9rem; 
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cal-modal-footer {
    margin-top: 1.5rem; 
    font-size: 0.75rem; 
    color: #ccc;
    font-weight: 300;
}
