/* =========================================================
   COMMON REALISTIC FRAME & BACKGROUND SYSTEM (Mrg-001 Base)
   ========================================================= */

/* HIDE ALL SCROLLBARS GLOBALLY */
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* 1. OUTER CONTAINER */
.realistic-frame-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Mobile browser height fix */
    background: #eae7e2 url('../images/background_image.webp') center/cover no-repeat;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.realistic-frame-container::after {
  display: none !important;
}

/* 2. THE HARDWARE FRAME (Desktop View) */
.realistic-frame {
    box-sizing: content-box !important;
    width: 360px;
    height: 780px; 
    max-height: 90vh;
    border: 12px solid #111; 
    border-radius: 40px;
    background: #111; 
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    position: relative;
    margin: 0;
}

/* Physical Hardware Buttons */
.btn-mute { position: absolute; top: 100px; left: -16px; width: 4px; height: 25px; background: #333; border-radius: 4px 0 0 4px; }
.btn-vol-up { position: absolute; top: 140px; left: -16px; width: 4px; height: 50px; background: #333; border-radius: 4px 0 0 4px; }
.btn-vol-down { position: absolute; top: 200px; left: -16px; width: 4px; height: 50px; background: #333; border-radius: 4px 0 0 4px; }
.btn-power { position: absolute; top: 160px; right: -16px; width: 4px; height: 70px; background: #333; border-radius: 0 4px 4px 0; }

/* 3. THE SCREEN CONTENT */
.screen-content {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 28px; 
    overflow: hidden; 
    z-index: 1;
}

/* Dynamic Island - Removed */
.dynamic-island {
    display: none !important;
}

/* 4. FLOATING BACK TO HOME BUTTON (REMOVED) */
.btn-frame-back-home {
    display: none !important;
}

/* MOBILE VIEW: REMOVE FRAME & GO FULLSCREEN */
@media (max-width: 768px) {
    .realistic-frame-container { background: none; }
    .realistic-frame-container::after { display: none; }
    .realistic-frame {
        box-sizing: border-box !important;
        width: 100vw;
        height: 100vh;
        height: 100dvh; /* Mobile browser height fix */
        max-height: 100dvh;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
    .screen-content { border-radius: 0; }
    .btn-mute, .btn-vol-up, .btn-vol-down, .btn-power, .dynamic-island { display: none; }
}

/* =========================================================
   EMPTY-FIELD COLLAPSE UTILITY
   Hides containers or elements when their editor field is empty
   ========================================================= */
.g--empty-field,
[data-g-empty-hide].g--empty-field {
    display: none !important;
}

/* =========================================================
   UNIVERSAL THEME PRELOADER
   Automatically active across all invitation themes.
   Matches light/dark palettes and theme accent colors.
   ========================================================= */
.g-universal-loader {
    position: absolute;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--loader-bg, rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: inherit;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
                visibility 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.g-universal-loader.g-loader-dismissed {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.025);
    pointer-events: none !important;
}

/* Dark Theme variant */
.g-universal-loader.g-loader-dark {
    background: var(--loader-dark-bg, #0b111c);
    color: #f7eedb;
}

.g-loader-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 28px;
    max-width: 280px;
    user-select: none;
    -webkit-user-select: none;
    animation: gLoaderCardEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.g-loader-emblem {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.g-loader-rings {
    position: absolute;
    inset: 0;
}

.g-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.g-loader-ring-1 {
    border-top-color: var(--primary, #c9a27c);
    border-right-color: var(--accent, #d4af37);
    animation: gLoaderSpin 1.4s cubic-bezier(0.68, -0.2, 0.27, 1.2) infinite;
}

.g-loader-ring-2 {
    inset: 5px;
    border-bottom-color: var(--accent, #d4af37);
    border-left-color: var(--primary, #c9a27c);
    animation: gLoaderSpinReverse 1.7s linear infinite;
    opacity: 0.75;
}

.g-loader-center {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent, var(--primary, #d4af37));
}

.g-loader-monogram-text {
    font-family: 'Great Vibes', 'Cormorant Garamond', 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--accent, var(--primary, #c9a27c));
    text-shadow: 0 1px 4px rgba(201, 162, 124, 0.3);
    white-space: nowrap;
    animation: gLoaderPulse 1.8s ease-in-out infinite alternate;
}

.g-loader-sparkle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    filter: drop-shadow(0 2px 6px rgba(212, 175, 55, 0.35));
    animation: gLoaderPulse 1.8s ease-in-out infinite alternate;
}

.g-loader-title {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-soft, var(--primary, #665c54));
    margin-bottom: 14px;
    opacity: 0.9;
    font-family: inherit;
}

.g-universal-loader.g-loader-dark .g-loader-title {
    color: var(--gold-light, #f3dfab);
    opacity: 0.95;
}

.g-loader-line-wrap {
    width: 104px;
    height: 2px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.g-universal-loader.g-loader-dark .g-loader-line-wrap {
    background: rgba(255, 255, 255, 0.12);
}

.g-loader-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary, #c9a27c), var(--accent, #d4af37), transparent);
    animation: gLoaderLineSweep 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes gLoaderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes gLoaderSpinReverse {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes gLoaderPulse {
    0% { transform: scale(0.92); opacity: 0.75; }
    100% { transform: scale(1.08); opacity: 1; }
}

@keyframes gLoaderLineSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes gLoaderCardEntrance {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}



