/* Paithani Palace Wedding — adapted from the Gauri & Shubhankar invitation. Fonts: Gotu and Amita (Google Fonts). */
:root {
    --primary-color: #800000;
    --secondary-color: #41040c;
    --bg-color: #fdfbf7;
    --text-dark: #333333;
    --text-light: #ffffff;
    --font-heading: 'Gotu', sans-serif;
    --font-accent: 'Gotu', sans-serif;
    --font-body: 'Gotu', sans-serif;
}
body {
    font-family: var(--font-body);
    background-color: #1a1a1a;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    line-height: normal;
}
body.doors-locked { overflow: hidden; }
.app-wrapper {
    width: 100%;
    max-width: 500px;
    min-width: 0; /* never wider than the screen, whatever the names' length */
    background-color: var(--bg-color);
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2 !important;
}
.text-maroon { color: var(--primary-color) !important; }
.couplenames {
    font-family: 'Amita', 'Gotu', cursive;
    font-size: 2.8rem !important;
    font-weight: 700;
    white-space: nowrap; /* names are scaled to fit one line by the template script */
}
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    text-align: center;
    overflow: hidden;
    top: 0;
    left: 0;
    width: 100%;
    padding: 50px 20px;
    background-color: #f4dad4;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top center;
}
.hero-section.hero1 { background-image: url(images/section1/back.webp); }
.hero-section.hero3 { background-image: url(images/section3/back.webp); background-color: #d8979b; }
.hero-section.hero6 { background-image: url(images/section6/back.webp); }
.hero-section .topimg { position: absolute; top: 0; width: 100%; }
.hero-section .names { font-family: var(--font-accent); }
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: -55px;
    padding: 48px 10px;
    max-width: 90%;
    transition: none;
}
.hero-content.show { opacity: 1; }
.hero3 .hero-content { margin-top: -15px; }
.hero-content h1 {
    font-family: var(--font-accent);
    font-size: 2.5rem;
    margin: 0;
    margin-bottom: 1rem;
    color: #800000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
}
.hero-content h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 2rem;
}
.hero-content h3 span { font-weight: bolder; }
.hero-content .datetime {
    display: flex;
    align-items: center;
    color: #800000;
    text-transform: uppercase;
    justify-content: center;
}
.hero-content .datetime .day {
    width: 120px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    font-weight: bold;
    font-size: 1rem;
}
.hero-content .datetime .day-num {
    font-size: 2rem;
    line-height: 0.5;
    color: #800000;
    padding: 0 4px;
    font-weight: bold;
}
.side-images, .bottom-scroll-container { position: relative; z-index: 2; }
.side-images {
    position: absolute;
    top: -3%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    z-index: 1;
    width: 120px;
}
.side-images img { height: auto; }
.side-images.side-left { left: 3%; }
.side-images.side-right { right: 3%; }
.hero6 .bottom-scroll-container { position: absolute; width: 95%; z-index: 7; pointer-events: none; }
.side-images.side-left .img2 { position: relative; rotate: 20deg; left: -50%; }
.side-images.side-left .img3 { position: relative; rotate: 58deg; left: -50%; top: -5%; }
.side-images.side-left .img4 { position: relative; rotate: 20deg; left: -50%; top: -9%; }
.side-images.side-left .img5 { position: relative; rotate: 58deg; left: -50%; top: -17%; }
.side-images.side-right .img2 { position: relative; rotate: -20deg; left: 50%; }
.side-images.side-right .img3 { position: relative; rotate: -58deg; left: 50%; top: -5%; }
.side-images.side-right .img4 { position: relative; rotate: -20deg; left: 50%; top: -9%; }
.side-images.side-right .img5 { position: relative; rotate: -58deg; left: 50%; top: -17%; }
.bottom-scroll-container {
    position: absolute;
    bottom: -34px;
    width: 95%;
    text-align: center;
    z-index: 7;
    pointer-events: none;
}
/* Outranks ".entry-text img" like the original #id selector did. */
.bottom-scroll-container .scroll-scale-img {
    max-width: 210px;
    will-change: transform;
    transform-origin: center center;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.2));
}
.hero3 .bottom-scroll-container .scroll-scale-img { max-width: 260px; }
.rotating-bg {
    position: absolute;
    top: 44%;
    left: 50%;
    width: 350px;
    height: 350px;
    transform: translate(-50%, -50%);
    background: url('images/section1/bg.svg') no-repeat center center;
    background-size: contain;
    opacity: 0.4;
    z-index: 0;
    animation: rotateBg 40s linear infinite;
}
@keyframes rotateBg {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
.address-section {
    background-image: url('images/entry/map.webp');
    background-position: center;
    background-size: cover !important;
}
.address-section .hero-content { margin-top: 59px; padding: 47px 0px; }
.address-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 200;
    line-height: 1;
    margin-top: 15px;
    color: #5a3e36;
}
.map-container {
    margin-top: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.map-container iframe { width: 100%; height: 105px; border: none; border-radius: 10px; }
.thankyou-section {
    background-image: url('images/entry/thankyou.webp');
    background-position: center;
    background-size: cover !important;
}
.thankyou-section .hero-content { margin-top: -51px; padding: 55px 9px; max-width: 95%; }
.thank-text {
    font-family: var(--font-heading);
    color: #800000;
    font-size: 1.6rem;
    font-weight: 600;
}
.divider-line { width: 60px; height: 2px; background: #d8a7a7; margin: 20px auto; }
.names { font-size: 1.5rem; letter-spacing: 1px; }
#door-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('images/entry/bg.webp');
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
    overflow: hidden;
    cursor: pointer;
    transition: visibility 0s 1.5s;
    flex-direction: column;
}
.start-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('images/entry/bg.webp');
    background-size: cover !important;
    background-position: center !important;
    overflow: hidden;
}
.door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #600000, #800000);
    transition: transform 1.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.door-left {
    left: 0;
    transform-origin: left;
    background-image: url('images/entry/door-left.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-blend-mode: multiply;
}
.door-right {
    right: 0;
    transform-origin: right;
    background-image: url('images/entry/door-right.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-blend-mode: multiply;
}
.door-badge {
    width: 150px;
    padding: 0;
    height: 150px;
    position: relative;
    z-index: 10000;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-align: center;
    animation: pulseBadge 2s infinite;
}
.date-text {
    font-family: var(--font-heading);
    font-weight: bolder;
    font-size: 2rem;
    color: #edc968 !important;
    background-image: linear-gradient(to bottom, #902220 0%, #800000 20%, #dc3545 60%, #feb68c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.arrows {
    width: 76px;
    height: 100px;
    position: absolute;
    left: 50%;
    margin-left: -30px;
    bottom: 27%;
    scale: 0.7;
}
.arrows path { stroke: #800000; fill: transparent; stroke-width: 2px; animation: arrow 2s infinite; }
@keyframes arrow { 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } }
.arrows path.a1 { animation-delay: -1s; }
.arrows path.a2 { animation-delay: -0.5s; }
.arrows path.a3 { animation-delay: 0s; }
@keyframes pulseBadge {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.4); }
    50% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.8); }
}
#door-overlay.open .door-left { transform: translateX(-100%); }
#door-overlay.open .door-right { transform: translateX(100%); }
#door-overlay.open .door-badge { opacity: 0; transform: scale(0.5); pointer-events: none; }
#entry-text {
    display: flex;
    visibility: hidden;
    flex-direction: column;
    align-content: center;
    text-align: center;
    align-items: center;
}
#entry-text.open { visibility: visible; }
#audio-controls {
    position: fixed;
    bottom: 30px;
    left: calc(50% + 170px);
    z-index: 9990;
    background: var(--secondary-color);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: transform 0.3s ease, background 0.3s ease;
}
#audio-controls:hover { transform: scale(1.1); background: var(--primary-color); }
@media (max-width: 500px) {
    #audio-controls { left: auto; right: 30px; }
}
.scroll-transition-container { overflow: hidden; position: relative; }
.sticky-view { top: 0; }
.btn-directions {
    display: block;
    width: fit-content;
    margin: 25px auto 0;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.btn-directions:hover { color: white; opacity: 0.9; transform: scale(1.02); }
.entry-text h3 { font-size: 0.9rem; }
.entry-text { margin-bottom: 200px; }
.entry-text img { max-width: 330px; }
h1, h2, h3, h4, h5, h6 { line-height: 1.6; }

/* Marathi text refinements */
.invocation { font-size: 0.8rem; font-weight: 500; opacity: 0.85; display: inline-block; margin-bottom: 8px; }
.tithi-text {
    font-family: var(--font-body);
    color: #800000;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 12px;
}
.sub-h1 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 600; }

/* Scratch card */
.scratch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 8;
}
.scratch-card {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    min-width: min(250px, 100%);
    max-width: 100%;
    margin: 0 auto;
}
.scratch-card .date-text {
    margin: 0;
    padding: 10px 22px !important;
    white-space: nowrap;
    font-size: clamp(1.5rem, 7.5vw, 2rem);
    text-align: center;
}
#scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
#scratch-canvas.cleared { opacity: 0; transform: scale(1.15); pointer-events: none; }
.scratch-card.revealed {
    overflow: visible;
    animation: datePop 1s ease-out 0.2s both, dateGlow 2.4s ease-in-out 1.2s infinite;
}
@keyframes datePop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 70% { transform: scale(0.97); } 100% { transform: scale(1); } }
@keyframes dateGlow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.95)); }
}
.scratch-hint {
    font-family: var(--font-heading);
    color: #800000;
    font-size: 0.8rem;
    margin: 8px 0 0;
    animation: hintBob 1.6s ease-in-out infinite;
    transition: opacity 0.4s ease;
}
.scratch-hint.hide { opacity: 0; height: 0; margin: 0; overflow: hidden; }
@keyframes hintBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Celebration */
#celebrate-canvas {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100vw, 500px);
    height: 100vh;
    pointer-events: none;
    z-index: 9500;
    display: none;
}
#celebrate-canvas.active { display: block; }

/* Countdown */
.countdown {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease, max-height 0.8s ease;
}
.countdown.show { opacity: 1; max-height: 90px; transform: translateY(0); }
.cd-box {
    width: 56px;
    padding: 6px 0 4px;
    border-radius: 10px;
    background: linear-gradient(160deg, #8b0a1a, #5c0010);
    border: 1px solid #edc968;
    box-shadow: 0 4px 10px rgba(128, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cd-num { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; line-height: 1.1; color: #edc968; }
.cd-num.tick { animation: cdTick 0.4s ease-out; }
@keyframes cdTick { 0% { transform: translateY(-6px); opacity: 0.3; } 100% { transform: translateY(0); opacity: 1; } }
.cd-label { font-family: var(--font-body); font-size: 0.65rem; color: #fbe9c6; }
.cd-done { font-family: var(--font-heading); color: #800000; font-weight: 600; margin: 0; }
#entry-text.counting .arrows { bottom: calc(27% - 26px); }

/* Swastik between the couple names */
.couplenames .swastik {
    display: inline-block;
    width: 2.1rem;
    height: 2.1rem;
    margin: 0 10px !important;
    vertical-align: middle;
    position: relative;
    top: -0.1rem;
    line-height: 0;
    color: #800000;
    font-size: 1.5rem;
}
.couplenames .swastik svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.6));
}
.shloka { display: inline-block; font-size: 0.8rem; font-weight: 700; line-height: 1.5; margin-bottom: 6px; }

/* "श्री" emblem above the shloka */
.ganesh-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 38% 32%, #fff3c4, #edc968 45%, #b07d1f 100%);
    box-shadow: 0 0 0 2px #800000, 0 0 0 4px #edc968, 0 4px 10px rgba(92, 0, 16, 0.35);
    margin-bottom: 6px;
}
.ganesh-icon span { font-family: 'Amita', 'Gotu', serif; font-weight: 700; font-size: 1.45rem; line-height: 1; color: #800000; padding-top: 4px; }

/* Wedding section: keep the side flowers clear of the date */
.hero1 .side-images { width: 105px; }
.hero1 .side-images.side-left { left: -4%; }
.hero1 .side-images.side-right { right: -4%; }
@media (max-width: 400px) {
    .hero-content .datetime .day { width: auto; min-width: 88px; padding: 0 6px; font-size: 0.9rem; }
    .hero1 .datetime .day, .hero3 .datetime .day { white-space: nowrap; }
    .hero-content .datetime .date { flex-shrink: 0; padding: 0 6px; }
}

/* Venue names & address */
.address-text .venue-name { display: inline-block; font-size: 1.45rem; margin-bottom: 4px; }

/* Namaskar */
.namaskar { margin-top: 18px; text-align: center; }
.namaskar-hands {
    display: inline-block;
    font-size: 3.2rem;
    line-height: 1;
    filter: drop-shadow(0 3px 6px rgba(128, 0, 0, 0.25));
    animation: namaskarBow 2.4s ease-in-out infinite;
}
.namaskar-text { font-family: var(--font-heading); color: #800000; font-size: 1.2rem; font-weight: 700; margin: 6px 0 0; }
@keyframes namaskarBow { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }

/* Door medallion with the couple's own initials */
.door-badge .badge-art { position: relative; display: block; height: 200px; }
.door-badge .badge-art img { height: 200px; width: auto; display: block; }
.monogram {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 61%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 42% 36%, #e6d3a8 0%, #cfb27a 48%, #ad8a51 78%, #8a6630 100%);
    box-shadow: inset 0 0 0 1.5px #f3dc9a, inset 0 0 0 3px #8b6424, inset 0 0 7px 3px rgba(80, 50, 15, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.monogram::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; border: 1px dashed rgba(122, 86, 30, 0.55); }
.monogram-text {
    position: relative;
    font-family: 'Cinzel', 'Yatra One', 'Noto Sans Devanagari', serif;
    font-weight: 700;
    font-size: 52px;
    letter-spacing: -1px;
    line-height: 1;
    white-space: nowrap;
    background: linear-gradient(180deg, #fff4c8 0%, #f0c868 30%, #b98424 55%, #7a4c0e 78%, #d9a944 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 0.7px #4a2a04;
    filter: drop-shadow(0 1.5px 0 #3d2204) drop-shadow(1px 3px 2px rgba(30, 15, 0, 0.6));
}

/* "You are invited" ribbon on the door screen */
.invited-badge {
    position: absolute;
    left: 50%;
    bottom: 7%;
    width: 86%;
    max-width: 380px;
    z-index: 10000;
    transform: translateX(-50%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    text-align: center;
}
.invited-badge .invited-text {
    display: inline-block;
    padding: 10px 24px 8px;
    border-radius: 40px;
    background: linear-gradient(180deg, #8b0a1a, #5c0010);
    border: 2px solid #edc968;
    box-shadow: inset 0 0 0 3px #5c0010, inset 0 0 0 4px rgba(237, 201, 104, 0.6), 0 6px 14px rgba(0, 0, 0, 0.55);
    color: #f7dc8c;
    font-family: 'Amita', 'Gotu', cursive;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    animation: invitedFloat 2.6s ease-in-out infinite;
}
@keyframes invitedFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
#door-overlay.open .invited-badge { opacity: 0; transform: translateX(-50%) scale(0.5); }

/* Editable multi-line text keeps the customer's line breaks. */
.shloka-text, .opening-text, .wedding-message-text, .reception-message-text, .thankyou-message-text,
.humble-names-text, .wedding-venue-address-text, .reception-venue-address-text,
.bride-grandparents-text, .bride-parents-text, .groom-grandparents-text, .groom-parents-text { white-space: pre-line; }
.family-lines { font-size: 1.2rem; line-height: 1.6; }
.family-lines .bride-grandparents-text, .family-lines .groom-grandparents-text { display: block; margin-bottom: 1.2em; }
.family-lines span { display: block; }
.venue-name-line, .address-line { display: block; }

/* Downloads (PNG/PDF/MP4) show each section as a still frame. */
.export-mode .app-wrapper { height: 640px !important; max-width: none !important; box-shadow: none !important; }
.export-mode #scratch-canvas, .export-mode .scratch-hint, .export-mode .countdown, .export-mode #celebrate-canvas,
.export-mode .arrows, .export-mode .btn-directions { display: none !important; }
.export-mode .scratch-card { overflow: visible !important; }

/* Narrow phones: keep the opening lines over the sky, clear of the curtains and leaves. */
#entry-text > .thank-text { max-width: 94%; }
@media (max-width: 380px) {
    #entry-text > .thank-text { font-size: 0.92rem !important; }
}
@media (max-height: 720px) {
    .start-section .bottom-scroll-container .scroll-scale-img { max-width: 160px; }
    .start-section .arrows { display: none; }
}
