/* ==========================================================================
   SWORD ART ONLINE (SAO) SPECIAL EDITION WEDDING DESIGN SYSTEM - LIGHT THEME
   ========================================================================== */

/* 1. THEME VARIABLES & SYSTEM CONFIGS */
:root {
    /* Color Tokens (Authentic SAO light-grey UI and warm yellow/orange highlights) */
    --orange-neon: #e59a12;      /* Authentic SAO warm golden-yellow selection accent */
    --orange-neon-glow: rgba(229, 154, 18, 0.25);
    --cyan-neon: #2d73be;        /* Authentic SAO blue for buttons and checks */
    --cyan-neon-glow: rgba(45, 115, 190, 0.2);
    
    --bg-dark-90: rgba(30, 35, 43, 0.95);
    --bg-dark-75: rgba(50, 56, 66, 0.85);
    --bg-panel-light: #f3f5f8;
    --bg-glass-heavy: linear-gradient(180deg, #fbfcfd 0%, #e2e5ea 100%); /* Light grey gradient from Image 1 */
    --bg-item-card: rgba(255, 255, 255, 0.65);
    
    --text-primary: #333b47;      /* Dark charcoal grey text from Image 1/2/3 */
    --text-secondary: #4e5766;    /* Medium slate grey for descriptions */
    --text-muted: #808b9c;        /* Light slate for labels and dates */
    
    /* Typography */
    --font-header: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-cyber: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* System Animations Defaults */
    --transition-sao: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

/* 2. BASE RESET & MOBILE-FIRST LOCKING SETUP */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #0d1015;
    font-family: var(--font-body);
    color: var(--text-primary);
    overflow: hidden; /* Lock scroll to prevent native browser bounce */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Elegant Desktop Background Layout (Only visible on wide viewports) */
.desktop-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: radial-gradient(circle at center, #1b2230 0%, #080a0e 100%);
    background-image: 
        linear-gradient(rgba(229, 154, 18, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(229, 154, 18, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 8%;
    pointer-events: none; /* Let all click inputs bypass to the app */
}

.desktop-content {
    max-width: 450px;
    opacity: 0.65;
    display: none; /* Will be revealed via media query on large screens */
}

.desktop-title {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--orange-neon);
    text-shadow: 0 0 15px var(--orange-neon-glow);
    margin-bottom: 5px;
}

.desktop-subtitle {
    font-family: var(--font-cyber);
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.desktop-decor {
    margin: 20px 0;
    display: flex;
    align-items: center;
}

.decor-circle {
    width: 12px;
    height: 12px;
    border: 2px solid var(--orange-neon);
    border-radius: 50%;
    margin-right: 15px;
    box-shadow: 0 0 8px var(--orange-neon-glow);
}

.decor-line {
    height: 2px;
    width: 250px;
    background: linear-gradient(90deg, var(--orange-neon) 0%, transparent 100%);
}

.desktop-status {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* ==================== 3. MOBILE SMARTPHONE LOCK CONTAINER ==================== */
#app-container {
    position: relative;
    width: 100%;
    max-width: 480px; /* Locked mobile width */
    height: 100vh;
    background-color: #0b0f17;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

/* High-tech glow border for mobile viewport in desktop view */
@media (min-width: 768px) {
    #app-container {
        height: 95vh;
        border-radius: 20px;
        border: 2px solid rgba(229, 154, 18, 0.25);
        box-shadow: 
            0 0 35px rgba(229, 154, 18, 0.12),
            0 20px 50px rgba(0, 0, 0, 0.9);
    }
    .desktop-content {
        display: block;
    }
}

/* Ambient cyber Grid overlay inside the phone container */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 25px 25px;
    pointer-events: none;
    z-index: 2;
}

/* ==================== 4. SAO UI UTILITIES & BUTTONS ==================== */

/* Slanted Orange Button (SAO Primary Button style) */
.sao-btn-orange {
    position: relative;
    background: linear-gradient(135deg, #f5af19 0%, #e65c00 100%);
    border: none;
    color: #ffffff;
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 14px 28px;
    cursor: pointer;
    overflow: hidden;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
    box-shadow: 0 8px 20px rgba(229, 154, 18, 0.3);
    transition: var(--transition-sao);
    display: flex;
    justify-content: center;
    align-items: center;
}

.sao-btn-orange:hover, .sao-btn-orange:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px rgba(229, 154, 18, 0.4);
    filter: brightness(1.1);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: 0.5s;
}

.sao-btn-orange:hover .btn-glow {
    left: 100%;
}

/* Slanted Cyan/Blue Button */
.sao-btn-cyan {
    position: relative;
    background: linear-gradient(135deg, #3a82d6 0%, #1f5ca6 100%);
    border: none;
    color: #ffffff;
    font-family: var(--font-header);
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    box-shadow: 0 6px 15px rgba(45, 115, 190, 0.25);
    transition: var(--transition-sao);
}

.sao-btn-cyan:active {
    transform: scale(0.96);
    filter: brightness(1.1);
}

.sao-btn-cyan.mini {
    font-size: 0.75rem;
    padding: 6px 12px;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.sao-btn-orange.mini {
    font-size: 0.75rem;
    padding: 6px 12px;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

.sao-btn-orange.full-width, .sao-btn-cyan.full-width {
    width: 100%;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0 100%);
}

/* SAO Outline Button style */
.sao-btn-outline {
    background: transparent;
    border: 2px solid var(--orange-neon);
    color: var(--orange-neon);
    font-family: var(--font-header);
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 10px 20px;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: var(--transition-sao);
}

.sao-btn-outline:hover, .sao-btn-outline:active {
    background: var(--orange-neon);
    color: #ffffff;
    box-shadow: 0 0 15px var(--orange-neon-glow);
}

.sao-btn-outline.mini {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-width: 1px;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}

/* Sleek Translucent Separators */
.sao-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.08) 20%, rgba(0, 0, 0, 0.08) 80%, transparent);
    margin: 15px 0;
}

/* High Contrast Neon/Theme Texts */
.cyan-neon {
    color: #2d73be !important;
    font-weight: bold;
}

.orange-neon {
    color: var(--orange-neon) !important;
    font-weight: bold;
}

/* ==================== 5. ROBUST AUDIO ENGINE STYLING ==================== */
#audio-control {
    /* Fixed bottom-right: stays visible on ALL phone sizes, never clipped */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    background: rgba(30, 35, 43, 0.92);
    border: 1.5px solid var(--orange-neon);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: none; /* Hidden on cover & video — shown via JS on main screen entry */
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(229, 154, 18, 0.35);
    backdrop-filter: blur(8px);
    transition: var(--transition-sao);
    padding: 0;
    opacity: 0;
    animation: none;
}

/* Fade-in class applied by JS on main screen entry */
#audio-control.visible {
    display: flex;
    animation: audioFadeIn 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes audioFadeIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

#audio-control:active {
    transform: scale(0.95);
}

/* Spin animation when playing */
.music-icon-spinner {
    font-size: 1.15rem;
    color: var(--orange-neon);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: spin 3s linear infinite;
    animation-play-state: paused;
}

#audio-control:not(.paused) .music-icon-spinner {
    animation-play-state: running;
}

#audio-control.paused {
    border-color: var(--text-muted);
    box-shadow: none;
}

#audio-control.paused .music-icon-spinner {
    color: var(--text-muted);
    animation-play-state: paused;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==================== 6. COVER SECTION STYLING ==================== */
#cover-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    background: linear-gradient(180deg, rgba(13, 21, 33, 0.3) 0%, rgba(5, 7, 10, 0.88) 100%), 
                url('assets/aincrad_bg.png') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Let cover-content manage distribution */
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

#cover-screen.active {
    opacity: 1;
    visibility: visible;
}

/* .cover-content: strict height-locked flex column */
.cover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    padding: 20px 24px 12vh 24px; /* Large bottom padding lifts guest card & button up */
    width: 100%;
    box-sizing: border-box;
}

/* Header detail — never grows, sits at top */
.system-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
    flex-shrink: 0;
}

.system-time {
    color: var(--orange-neon);
    font-weight: bold;
    text-shadow: 0 0 5px var(--orange-neon-glow);
}

/* Center Names — takes remaining middle space proportionally */
.wedding-title-container {
    text-align: center;
    flex: 1;           /* Grow to fill available space */
    min-height: 0;     /* Allow shrinking */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 0;
}

.announcement {
    font-family: var(--font-cyber);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.announcement::before, .announcement::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30px;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}
.announcement::before { right: 100%; margin-right: 15px; }
.announcement::after { left: 100%; margin-left: 15px; }

.bride-groom-names {
    font-family: var(--font-header);
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.and-symbol {
    font-size: 1.6rem;
    color: var(--orange-neon);
    text-shadow: 0 0 10px var(--orange-neon-glow);
    display: inline-block;
    margin: 6px 0;
    animation: heartbeat 2.5s infinite ease-in-out;
}

/* Guest Hologram Box — compact, never grows */
.guest-card-container {
    background: var(--bg-dark-75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--orange-neon);
    padding: 12px 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: 100%;
    flex-shrink: 0;
}

.guest-card-header {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: var(--orange-neon);
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.guest-label {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.guest-name {
    font-family: var(--font-cyber);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 2px 0 5px 0;
    letter-spacing: 1px;
}

.guest-status {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    color: #00ff66;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

.guest-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #00ff66;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 6px #00ff66;
    animation: flash 1s infinite alternate;
}

/* LINK START button — always visible, never shrinks */
#btn-login {
    width: 85%;
    max-width: 320px;
    flex-shrink: 0; /* Never compressed by overflow */
}

/* ==================== 7. VIDEO LOGIN STYLING ==================== */
#video-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: #000000;
    display: none; /* Controlled via JS */
    justify-content: center;
    align-items: center;
}

#login-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#btn-skip-video {
    position: absolute;
    bottom: 40px;
    right: 20px;
    z-index: 210;
    background-color: rgba(11, 15, 23, 0.75);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* ==================== 8. MAIN SCREEN HUD & BANNER ==================== */
#main-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: linear-gradient(180deg, #11151c 0%, #07090d 100%);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.005) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.005) 1px, transparent 1px);
    background-size: 20px 20px;
    display: none; /* Controlled via JS */
    flex-direction: column;
    padding: 8px 20px 85px 20px; /* Reduced top padding */
    overflow: hidden;
}

/* Sleek SAO Party Status HUD (Authentic Stacked Party HUD) */
.player-hud {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-dark-75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    margin-top: 4px; /* Reduced from 15px */
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
    border-radius: 4px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.party-member {
    display: flex;
    align-items: center;
    width: 100%;
}

.player-avatar-ring {
    width: 30px;
    height: 30px;
    border: 2px solid var(--orange-neon);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-size: 0.9rem;
    box-shadow: 0 0 6px var(--orange-neon-glow);
    background-color: rgba(0,0,0,0.3);
    overflow: hidden; /* clip the avatar image to the circle */
}

.party-member:nth-child(1) .player-avatar-ring {
    border-color: var(--cyan-neon);
    box-shadow: 0 0 6px var(--cyan-neon-glow);
}

/* Avatar PNG image inside the HUD ring */
.hud-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* show face/head, not feet */
    display: block;
    border-radius: 50%;
}

.hud-details {
    flex-grow: 1;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.hud-name {
    font-family: var(--font-cyber);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: #ffffff;
}

.hud-lvl {
    font-family: var(--font-mono);
    color: var(--orange-neon);
    font-size: 0.65rem;
    font-weight: bold;
}

.party-member:nth-child(1) .hud-lvl {
    color: var(--cyan-neon);
}

.hp-bar-container {
    position: relative;
    height: 11px;
    background-color: #232a35;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hp-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #52c234 0%, #eed815 100%);
    box-shadow: 0 0 6px rgba(82, 194, 52, 0.4);
    transition: width 1s cubic-bezier(0.1, 0.8, 0.1, 1);
}

.hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: #ffffff;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
}

/* Dashboard Banner */
.dashboard-banner {
    background: linear-gradient(90deg, rgba(229, 154, 18, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--orange-neon);
    padding: 10px 15px;
    margin-bottom: 15px;
}

.glitch-title {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--orange-neon);
    text-shadow: 0 0 10px var(--orange-neon-glow);
}

.banner-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 1px;
}

.hud-decor-lines {
    margin-top: 5px;
    display: flex;
}

.hud-decor-lines span {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
}
.hud-decor-lines span:nth-child(1) { width: 50px; margin-right: 5px;}
.hud-decor-lines span:nth-child(2) { width: 10px; background-color: var(--orange-neon);}

/* ==================== 9. INFO CARD PANELS SYSTEM - AUTHENTIC LIGHT GREY ==================== */
#content-display-area {
    position: relative;
    flex-grow: 1;
    height: 0; /* Lock flex height */
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.info-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.96) translateY(10px);
    transition: opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1), 
                transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), 
                visibility 0.4s;
    z-index: 1;
    display: none; /* Changed from flex to display:none for locked page alignment */
    flex-direction: column;
    overflow: hidden;
}

/* Active panel state */
.info-panel.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    z-index: 5;
    display: flex;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.panel-header h3 {
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.panel-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--orange-neon);
    background-color: rgba(229, 154, 18, 0.15);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(229, 154, 18, 0.3);
}

/* Light Grey Panel Body (Matching Image 1 dialogue boxes) */
.panel-body {
    background: var(--bg-glass-heavy);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 15px 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    flex-grow: 1;
    height: 0; /* Scale lock */
    min-height: 0;
    overflow-y: auto; /* Confine scrolling internally */
    color: var(--text-primary);
}

.panel-body.scrollable {
    overflow-y: auto;
}

.panel-intro-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* 9A. PANEL MEMPELAI (CHARACTER PROFILE SHEET) - Full-art card layout */

/* ── Profile Page Keyframes ────────────────────────────────────────────── */

/* Card entrance: slides up from slightly below */
@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(28px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Character image gentle float (breathing feel) */
@keyframes charFloat {
    0%, 100% { transform: translateY(0px)  scale(1);    }
    50%       { transform: translateY(-8px) scale(1.02); }
}

/* Groom border glow pulse (cyan) */
@keyframes glowCyan {
    0%, 100% { box-shadow: 0 0 16px rgba(45,115,190,0.45), 0 8px 24px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 36px rgba(45,115,190,0.9),  0 0 55px rgba(45,115,190,0.3), 0 8px 24px rgba(0,0,0,0.4); }
}

/* Bride border glow pulse (orange) */
@keyframes glowOrange {
    0%, 100% { box-shadow: 0 0 16px rgba(229,154,18,0.45), 0 8px 24px rgba(0,0,0,0.4); }
    50%       { box-shadow: 0 0 36px rgba(229,154,18,0.9),  0 0 55px rgba(229,154,18,0.3), 0 8px 24px rgba(0,0,0,0.4); }
}

/* Scan line sweep from top to bottom */
@keyframes scanSweep {
    0%   { top: -3px;  opacity: 0; }
    5%   { opacity: 0.65; }
    90%  { top: 100%;  opacity: 0.3; }
    100% { top: 100%;  opacity: 0; }
}

/* Badge flicker — subtle holographic glitch */
@keyframes badgeFlicker {
    0%, 88%, 100% { opacity: 1; }
    90%            { opacity: 0.5; }
    93%            { opacity: 1; }
    96%            { opacity: 0.65; }
}

/* Stat number neon glow pulse */
@keyframes statNeonGlow {
    0%, 100% { text-shadow: none; }
    50%       { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor; }
}

/* ── Profile Page Animation Rules ──────────────────────────────────────── */

/* Card entrance: groom first (0.05s), bride follows (0.25s) */
#panel-mempelai.active .character-card.groom {
    animation:
        cardSlideUp 0.7s cubic-bezier(0.19,1,0.22,1) 0.05s both,
        glowCyan    3.5s ease-in-out 0.75s infinite;
}
#panel-mempelai.active .character-card.bride {
    animation:
        cardSlideUp 0.7s cubic-bezier(0.19,1,0.22,1) 0.25s both,
        glowOrange  3.5s ease-in-out 1.0s  infinite;
}

/* Character float — staggered so they breathe at different times */
#panel-mempelai.active .character-card.groom .char-bg-img {
    animation: charFloat 6.5s ease-in-out 0s infinite;
}
#panel-mempelai.active .character-card.bride .char-bg-img {
    animation: charFloat 6.5s ease-in-out 2s infinite;
}

/* Scan line on each card (uses ::before; ::after is the gradient) */
.character-card::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%);
    z-index: 4;
    pointer-events: none;
    animation: scanSweep 6s linear infinite;
}
.character-card.bride::before {
    animation-delay: 3s; /* bride scan starts halfway so they don't sync */
}

/* GROOM/BRIDE badge holographic flicker */
#panel-mempelai.active .char-role {
    animation: badgeFlicker 7s ease-in-out infinite;
}

/* Stat numbers neon glow pulse */
#panel-mempelai.active .char-stats .cyan-neon {
    animation: statNeonGlow 2.5s ease-in-out 1s infinite;
}
#panel-mempelai.active .char-stats .orange-neon {
    animation: statNeonGlow 2.5s ease-in-out 1.8s infinite;
}

.profile-panel-body {
    padding: 10px !important;
    overflow: hidden !important;
}

.profile-grid {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    height: 100%;
}

/* Character card — tall card, character art as background */
.character-card {
    position: relative;
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 260px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    cursor: default;
}

/* Groom card: cyan border glow */
.character-card.groom {
    border: 2px solid var(--cyan-neon);
    box-shadow: 0 0 18px rgba(45, 115, 190, 0.5), 0 8px 24px rgba(0,0,0,0.4);
}

/* Bride card: orange border glow */
.character-card.bride {
    border: 2px solid var(--orange-neon);
    box-shadow: 0 0 18px rgba(229, 154, 18, 0.5), 0 8px 24px rgba(0,0,0,0.4);
}

/* Character PNG — fills entire card; inset: -10px gives float room without clipping */
.char-bg-img {
    position: absolute;
    inset: -10px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 1;
    /* transition only for hover; float animation overrides when panel active */
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Both characters centered in their cards */
.character-card.groom .char-bg-img {
    background-position: center center;
}

.character-card.bride .char-bg-img {
    background-position: center center;
}

/* Hover zoom — only when panel-mempelai is NOT animated (fallback safety) */
.character-card:hover .char-bg-img {
    transform: scale(1.06);
}

/* Gradient overlay — dark at bottom so text is readable */
.character-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 25%,
        rgba(5, 8, 14, 0.55) 60%,
        rgba(5, 8, 14, 0.92) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Info overlay — absolutely pinned at bottom with fixed height for alignment */
.char-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    padding: 8px 8px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 170px; /* Fixed height — keeps GROOM/BRIDE badge at the same Y on both cards */
    justify-content: flex-start;
}

.char-role {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 2px;
    text-align: center;
    width: fit-content;
    margin: 0 auto 3px auto;
    font-weight: bold;
}

.character-card.groom .char-role {
    color: #ffffff;
    background-color: var(--cyan-neon);
    box-shadow: 0 0 8px rgba(45, 115, 190, 0.6);
}
.character-card.bride .char-role {
    color: #ffffff;
    background-color: var(--orange-neon);
    box-shadow: 0 0 8px rgba(229, 154, 18, 0.6);
}

.char-real-name {
    font-family: var(--font-cyber);
    font-size: 0.78rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    word-break: break-word;
    line-height: 1.2;
}

.char-username {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.65);
    text-align: center;
    margin-bottom: 2px;
}

.sao-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2) 30%, rgba(255,255,255,0.2) 70%, transparent);
    margin: 4px 0;
}

.char-stats {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    margin-bottom: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    color: rgba(255,255,255,0.75);
}

.char-parents {
    font-size: 0.5rem;
    color: rgba(255,255,255,0.55);
    font-style: italic;
    line-height: 1.3;
    text-align: center;
    /* Clamp to 2 lines so long text doesn't shift alignment */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 9B. PANEL ACARA (QUEST LOG & COUNTDOWN) */
.quest-countdown-box {
    background-color: rgba(229, 154, 18, 0.06);
    border: 1px solid rgba(229, 154, 18, 0.2);
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 18px;
}

.countdown-title {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--orange-neon);
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-weight: bold;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.timer-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
}

.timer-segment span {
    font-family: var(--font-header);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.timer-segment label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.quest-item {
    display: flex;
    gap: 15px;
    background-color: var(--bg-item-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* Quest item that contains its own countdown below */
.quest-item-with-countdown {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: var(--bg-item-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 15px 0 15px;
    border-radius: 4px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}

/* Top row: icon + info (same as old .quest-item layout) */
.quest-item-top {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
}

/* Countdown box inside quest item: no outer margin, flush with card bottom */
.quest-item-with-countdown .quest-countdown-box {
    margin: 0 -15px;  /* Bleed edge-to-edge within the card */
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 8px 15px;
    background-color: rgba(229, 154, 18, 0.08);
    border-top: 1px solid rgba(229, 154, 18, 0.25);
}

.quest-item-with-countdown .countdown-title {
    font-size: 0.58rem;
    margin-bottom: 5px;
}

.quest-item-with-countdown .timer-segment span {
    font-size: 1.1rem;
}

.quest-item-with-countdown .timer-segment {
    min-width: 38px;
}

.quest-icon {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
}

.quest-info {
    flex-grow: 1;
}

.quest-subtitle {
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.quest-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.maps-section {
    margin-top: 20px;
}

.section-title-sm {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.map-preview {
    height: 80px;
    background-color: rgba(0,0,0,0.02);
    border: 1px dashed rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    background-image: radial-gradient(rgba(229, 154, 18, 0.05) 1px, transparent 1px);
    background-size: 10px 10px;
}

/* 9C. PANEL STORY (ADVENTURE LOG) */
.story-timeline {
    position: relative;
    padding-left: 20px;
}

.story-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 4px;
    width: 2px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.06);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    top: 0;
    left: -27px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid var(--cyan-neon);
    box-shadow: 0 0 6px var(--cyan-neon-glow);
    font-family: var(--font-mono);
    font-size: 0.45rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--cyan-neon);
    font-weight: bold;
}

.timeline-item:nth-child(even) .timeline-badge {
    border-color: var(--orange-neon);
    box-shadow: 0 0 6px var(--orange-neon-glow);
    color: var(--orange-neon);
}

.timeline-panel {
    background-color: var(--bg-item-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 12px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.timeline-panel h4 {
    font-family: var(--font-cyber);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.timeline-panel p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 9D. PANEL GALLERY (IMAGE STORAGE) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gallery-item-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.gallery-item {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(229, 154, 18, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: var(--font-header);
    font-size: 0.75rem;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 1px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* 9E. PANEL GIFT (COR EXCHANGE) */
.bank-card {
    background-color: var(--bg-item-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.bank-icon {
    font-size: 1.8rem;
}

.bank-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bank-name {
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: bold;
}

.bank-acc-no {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 2px 0;
}

.bank-holder {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.shipping-address-box {
    margin-top: 18px;
    background-color: rgba(229, 154, 18, 0.03);
    border: 1px solid rgba(229, 154, 18, 0.1);
    padding: 15px;
    border-radius: 4px;
}

.address-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* 9F. PANEL RSVP & FORM RULES */
#rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.form-group input[type="text"], .form-group select, .form-group textarea {
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    outline: none;
    transition: var(--transition-sao);
}

.form-group input[type="text"]:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--orange-neon);
    background-color: #ffffff;
    box-shadow: 0 0 8px var(--orange-neon-glow);
}

/* Custom glowing radios for RSVP */
.attendance-radio-group {
    display: flex;
    gap: 12px;
}

.radio-label {
    flex: 1;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    display: none;
}

.custom-radio {
    display: block;
    text-align: center;
    padding: 10px;
    font-family: var(--font-header);
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-color: rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
    transition: var(--transition-sao);
}

.radio-label input[type="radio"]:checked + .custom-radio.glow-cyan {
    background-color: rgba(45, 115, 190, 0.08);
    border-color: var(--cyan-neon);
    color: var(--cyan-neon);
    box-shadow: 0 0 10px var(--cyan-neon-glow);
}

.radio-label input[type="radio"]:checked + .custom-radio.glow-red {
    background-color: rgba(188, 41, 93, 0.08);
    border-color: #bc295d;
    color: #bc295d;
    box-shadow: 0 0 10px rgba(188, 41, 93, 0.15);
}

/* Guest count input panel */
#guest-count-group {
    display: none;
}

/* Wishlist logs */
.wishes-log-area {
    margin-top: 25px;
}

.wishes-list-container {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

.wish-card {
    background-color: var(--bg-item-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 10px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.wish-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    margin-bottom: 4px;
}

.wish-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Custom Scrollbar for sleek UI look */
.panel-body::-webkit-scrollbar, 
.wishes-list-container::-webkit-scrollbar, 
.menu-inner-scroller::-webkit-scrollbar {
    width: 4px;
}

.panel-body::-webkit-scrollbar-track, 
.wishes-list-container::-webkit-scrollbar-track, 
.menu-inner-scroller::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb, 
.wishes-list-container::-webkit-scrollbar-thumb, 
.menu-inner-scroller::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
}

/* ==================== 10. SYSTEM FOOTER STYLING ==================== */
.sao-footer {
    margin-top: 40px;
    text-align: center;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    padding-top: 15px;
}

.hashtag {
    font-family: var(--font-mono);
    color: var(--orange-neon);
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.credit {
    font-family: var(--font-header);
    color: var(--text-muted);
    font-size: 0.55rem;
    letter-spacing: 2px;
}

/* Footer swipe hint text (replaces scroll-helper-text, clickable) */
.swipe-footer-hint {
    font-family: var(--font-header);
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--orange-neon);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--orange-neon-glow);
    margin-bottom: 5px;
    cursor: pointer;
    animation: pulse-glow 2s ease-in-out infinite;
    user-select: none;
}

.swipe-footer-hint:hover {
    opacity: 0.85;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; text-shadow: 0 0 14px var(--orange-neon-glow); }
}

/* ==================== 11. SWIPE DOWN MENU INTRO HINTS ==================== */
/* Invisible click/swipe trigger zone — text has been moved to footer */
#swipe-down-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc(100% - 65px); /* Leave room for the BGM button on the right */
    height: 80px;
    z-index: 50;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#swipe-down-hint.active {
    opacity: 1;
    pointer-events: auto;
}

.hint-text {
    font-family: var(--font-header);
    font-size: 0.65rem;
    color: var(--orange-neon);
    letter-spacing: 2px;
    font-weight: 800;
    text-shadow: 0 0 8px var(--orange-neon-glow);
}

.swipe-arrow {
    font-size: 0.9rem;
    color: var(--orange-neon);
    margin-top: 5px;
    animation: bounce-arrow 1.2s infinite ease-in-out;
}

/* ==================== 12. FLOATING SAO CIRCULAR MENU STYLING (Image 2 style) ==================== */
#swoosh-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    background-color: rgba(11, 15, 23, 0.85);
    backdrop-filter: blur(8px);
    display: none; /* Controlled via active class */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

#swoosh-menu.active {
    display: flex;
    opacity: 1;
}

/* Round structural ring containing items list */
.menu-outer-ring {
    position: relative;
    width: 250px;
    max-height: 480px;
    display: flex;
    justify-content: center;
}

.menu-inner-scroller {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 10px;
    overflow-y: auto;
    max-height: 400px;
    width: 100%;
    align-items: flex-start;
    padding-left: 65px; /* Offset left to center the combined Button + Label combo beautifully on mobile */
}

/* Sleek SAO Menu Button Item (Image 2 Selection Theme) */
.menu-item {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: rgba(240, 243, 246, 0.85); /* Semi-transparent light grey from Image 2/3 */
    border: 2px solid #5a626f;
    color: #4a525f;
    font-size: 1.4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    transition: var(--transition-sao);
    flex-shrink: 0;
}

/* Label bubble that slides out to the right (Slanted left pointer from Image 2) */
.menu-item-lbl {
    position: absolute;
    left: 68px;
    background: #e1e4e8; /* Light grey backdrop */
    border: 1px solid #9ea5b0;
    font-family: var(--font-header);
    font-size: 0.65rem;
    font-weight: 800;
    color: #333b47;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border-radius: 4px;
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition-sao);
    pointer-events: auto; /* Allow direct clicking on the label text */
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    white-space: nowrap;
}

/* Left pointing arrow on the menu option block, matching Image 2 */
.menu-item-lbl::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #e1e4e8 transparent transparent;
}

/* Active State (Solid gold/orange matching Segment 3 Logout from Image 2) */
.menu-item:hover, .menu-item.active {
    background-color: var(--orange-neon);
    border-color: #5a626f;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(229, 154, 18, 0.5);
    transform: scale(1.1);
}

/* Make ALL labels permanently visible when the swoosh menu is active */
#swoosh-menu.active .menu-item-lbl {
    opacity: 1;
    transform: translateX(0);
}

/* Specific golden active highlight for the active menu item label */
.menu-item.active .menu-item-lbl, .menu-item:hover .menu-item-lbl {
    background-color: var(--orange-neon);
    color: #ffffff;
    border-color: var(--orange-neon);
    box-shadow: 0 0 8px var(--orange-neon-glow);
}

.menu-item.active .menu-item-lbl::before, .menu-item:hover .menu-item-lbl::before {
    border-color: transparent var(--orange-neon) transparent transparent;
}

/* Stagger animations for cascading reveal */
#swoosh-menu.active .menu-item {
    animation: slide-in-circle 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

#swoosh-menu.active .menu-item:nth-child(1) { animation-delay: 0.05s; }
#swoosh-menu.active .menu-item:nth-child(2) { animation-delay: 0.1s; }
#swoosh-menu.active .menu-item:nth-child(3) { animation-delay: 0.15s; }
#swoosh-menu.active .menu-item:nth-child(4) { animation-delay: 0.2s; }
#swoosh-menu.active .menu-item:nth-child(5) { animation-delay: 0.25s; }
#swoosh-menu.active .menu-item:nth-child(6) { animation-delay: 0.3s; }

/* Slanted close menu button */
#btn-close-menu {
    margin-top: 30px;
    border-color: var(--orange-neon);
    color: var(--orange-neon);
}

/* ==================== 13. SAO DIALOGUE MODALS - AUTHENTIC ALERTS (Image 1 style) ==================== */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 7, 10, 0.85);
    z-index: 1000;
    display: none; /* Controlled via JS */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

/* Clean rectangular SAO dialogue container - LIGHT GREY (Image 1 replica) */
.modal-sao-frame {
    background: var(--bg-glass-heavy);
    border: 2px solid #5a626f;
    border-radius: 8px; /* Clean rectangle, no trapezoid */
    width: 100%;
    max-width: 380px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background-color: #ffffff; /* White title bar from Image 1 */
    border-bottom: 2px solid #dcdfe4;
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

/* Circular X close button — consistent with SAO circle button language */
.btn-close-modal {
    position: absolute;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #bc295d;
    border: 2px solid #bc295d;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-sao);
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(188, 41, 93, 0.35);
}

.btn-close-modal:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(188, 41, 93, 0.5);
}

.modal-body-content {
    padding: 25px 20px;
    color: var(--text-primary);
}

.modal-body-content img {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    border-radius: 4px;
}

/* Ticket detail layout */
.flex-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.success-title {
    font-family: var(--font-header);
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.quest-desc-sm {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
}

.qr-code-wrapper {
    background-color: #ffffff;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.qr-code-wrapper img {
    width: 140px;
    height: 140px;
}

.ticket-details {
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 25px;
}

.ticket-details p {
    margin-bottom: 6px;
}

.ticket-details p:last-child {
    margin-bottom: 0;
}

.ticket-details strong {
    color: var(--text-primary);
}

/* 13B. AUTHENTIC DIALOGUE BUTTONS (Image 1 replica) */
.sao-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-top: 5px;
}

/* Concentric Blue YES Button */
.sao-btn-circle-yes {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid #2d73be;
    background-color: #ffffff;
    position: relative;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(45, 115, 190, 0.2);
    transition: transform 0.15s ease;
}

.sao-btn-circle-yes::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #2d73be;
    display: block;
}

.sao-btn-circle-yes::after {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #2d73be;
    position: absolute;
}

/* Concentric Red/Pink NO Button */
.sao-btn-circle-no {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid #bc295d;
    background-color: #ffffff;
    position: relative;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(188, 41, 93, 0.2);
    transition: transform 0.15s ease;
}

.sao-btn-circle-no::before {
    content: '✕';
    font-family: Arial, sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #bc295d;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sao-btn-circle-yes:hover, .sao-btn-circle-no:hover {
    transform: scale(1.1);
}

.sao-btn-circle-yes:active, .sao-btn-circle-no:active {
    transform: scale(0.95);
}

/* ==================== 14. ANIMATIONS & HARDWARE ACCELERATION ==================== */

@keyframes slide-in-circle {
    0% {
        opacity: 0;
        transform: scale(0.6) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@keyframes bounce-wave {
    0% { height: 20%; }
    100% { height: 100%; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); text-shadow: 0 0 18px var(--orange-neon); }
}

@keyframes flash {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Lightweight utility animations */
.animate-fade-in {
    will-change: opacity, transform;
    animation: fadeIn 0.8s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.animate-slide-in {
    will-change: opacity, transform;
    animation: slideIn 0.5s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.animate-scale-up {
    will-change: opacity, transform;
    animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15) both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}


/* ==========================================================================
   RESPONSIVE BREAKPOINTS — Mobile First (All Phone Sizes)
   ========================================================================== */

/* ── TINY PHONES: width < 360px (Galaxy A03, iPhone 5/SE 1st gen, etc.) ── */
@media screen and (max-width: 359px) {
    #app-container {
        max-width: 100vw;
    }
    #main-screen {
        padding: 12px 12px 80px 12px;
    }
    .player-hud {
        padding: 6px 10px;
        margin-top: 8px;
        margin-bottom: 8px;
        gap: 5px;
    }
    .player-avatar-ring {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        margin-right: 7px;
    }
    .hud-name { font-size: 0.65rem; }
    .hud-lvl  { font-size: 0.55rem; }
    .hp-bar-container { height: 9px; }
    .hp-text  { font-size: 0.42rem; }

    .panel-header h3 { font-size: 0.75rem; letter-spacing: 1px; }
    .panel-tag        { font-size: 0.55rem; }
    .panel-body       { padding: 10px 12px; }

    /* Profile side-by-side — keep but tighter */
    .profile-grid     { gap: 6px; }
    .character-card   { padding: 8px 6px; }
    .avatar-img-placeholder { width: 32px; height: 32px; font-size: 1.2rem; }
    .char-real-name   { font-size: 0.7rem; }
    .char-username    { font-size: 0.58rem; }
    .char-stats       { font-size: 0.52rem; }
    .char-parents     { font-size: 0.5rem; }

    .sao-btn-orange   { font-size: 0.85rem; padding: 12px 20px; }
    .sao-footer       { padding-top: 6px; margin-top: 10px; }
    .scroll-helper-text { font-size: 0.5rem; letter-spacing: 1px; }
    .credit           { font-size: 0.45rem; }

    /* Menu */
    .menu-inner-scroller { padding-left: 45px; gap: 10px; }
    .menu-item        { width: 46px; height: 46px; font-size: 1.2rem; }
    .menu-item-lbl    { left: 58px; font-size: 0.58rem; padding: 4px 8px; }
    #btn-close-menu   { font-size: 0.6rem; padding: 6px 16px; margin-top: 18px; }

    /* Cover screen */
    .bride-groom-names { font-size: 2.4rem; }
    .announcement      { font-size: 0.65rem; letter-spacing: 3px; }
    .guest-card-container { padding: 0 10px; }

    /* BGM button */
    #audio-control { width: 38px; height: 38px; bottom: 14px; right: 14px; }
    .music-icon-spinner { font-size: 1rem; }

    /* Swipe hint */
    .hint-text { font-size: 0.55rem; letter-spacing: 1.5px; }
}

/* ── SMALL PHONES: 360px – 374px (Galaxy A32, Redmi, etc.) ── */
@media screen and (min-width: 360px) and (max-width: 374px) {
    #main-screen { padding: 14px 14px 82px 14px; }
    .player-hud  { padding: 7px 10px; gap: 6px; }
    .player-avatar-ring { width: 28px; height: 28px; font-size: 0.8rem; }
    .hud-name    { font-size: 0.7rem; }
    .hp-bar-container { height: 10px; }

    .panel-header h3 { font-size: 0.8rem; }
    .panel-body      { padding: 12px 14px; }
    .profile-grid    { gap: 7px; }
    .character-card  { padding: 8px 7px; }
    .char-real-name  { font-size: 0.75rem; }
    .char-stats      { font-size: 0.55rem; }

    .menu-inner-scroller { padding-left: 52px; }
    .menu-item-lbl       { font-size: 0.6rem; }
}

/* ── STANDARD PHONES: 375px – 413px (iPhone 12/13/14, Pixel 6, Samsung S21) ── */
@media screen and (min-width: 375px) and (max-width: 413px) {
    #main-screen { padding: 16px 16px 84px 16px; }
    .player-hud  { padding: 8px 12px; gap: 7px; }
    .panel-body  { padding: 14px 16px; }
    .profile-grid { gap: 8px; }
    .character-card { padding: 9px 7px; }
    .char-real-name { font-size: 0.78rem; }

    .menu-inner-scroller { padding-left: 58px; }
}

/* ── LARGE PHONES: 414px – 480px (iPhone 14 Plus, iPhone 6 Plus, Galaxy Note) ── */
@media screen and (min-width: 414px) and (max-width: 480px) {
    #main-screen  { padding: 18px 18px 85px 18px; }
    .panel-body   { padding: 15px 18px; }
    .character-card { padding: 10px 8px; }
    .char-real-name { font-size: 0.82rem; }
    .char-stats   { font-size: 0.63rem; }
    .char-parents { font-size: 0.6rem; }
    .menu-inner-scroller { padding-left: 62px; }
}

/* ── EXTRA SAFE: ensure app fills full width on all mobiles ── */
@media screen and (max-width: 480px) {
    #app-container {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    /* Ensure BGM button is never hidden behind browser chrome */
    #audio-control {
        bottom: max(20px, env(safe-area-inset-bottom));
        right: max(20px, env(safe-area-inset-right));
    }

    /* Footer stays compact */
    .sao-footer { margin-top: 6px; padding-top: 6px; }

    /* Cover: tighter padding on mobile, everything stays inside */
    .cover-content {
        padding: 16px 20px 10vh 20px; /* 10vh bottom lifts button & card up */
    }

    /* Scale down names so they don't crowd out the button */
    .bride-groom-names { font-size: 1.9rem; }
    .and-symbol        { font-size: 1.4rem; margin: 4px 0; }
    .announcement      { font-size: 0.85rem; letter-spacing: 3px; margin-bottom: 10px; }

    /* Guest card tight */
    .guest-card-container { margin-bottom: 12px; padding: 10px 14px; }
    .guest-name            { font-size: 1rem; }

    /* Button full-width on mobile */
    #btn-login { width: 90%; }

    /* Countdown boxes */
    .countdown-timer { gap: 8px; }
    .timer-segment span { font-size: 1.6rem; }
    .timer-segment label { font-size: 0.5rem; }

    /* Bank cards fit width */
    .bank-card { padding: 12px; }
    .bank-acc-no { font-size: 0.95rem; }

    /* Modals */
    .modal-sao-frame { margin: 10px; }
}

/* ── TINY phones: extra scale-down for very small screens ── */
@media screen and (max-width: 480px) and (max-height: 700px) {
    .cover-content     { padding: 12px 18px 8vh 18px; } /* Still keep generous bottom */
    .bride-groom-names { font-size: 1.65rem; line-height: 1.1; }
    .and-symbol        { font-size: 1.2rem; margin: 2px 0; }
    .announcement      { font-size: 0.78rem; margin-bottom: 8px; }
    .guest-card-container { margin-bottom: 10px; padding: 8px 12px; }
    .guest-card-header { font-size: 0.55rem; margin-bottom: 4px; }
    .guest-name        { font-size: 0.9rem; margin: 1px 0 4px 0; }
    .guest-status      { font-size: 0.52rem; }
    .system-header     { font-size: 0.62rem; padding-bottom: 6px; }
    #btn-login         { font-size: 0.85rem; padding: 12px 20px; }
}

/* ── SHORT-HEIGHT PHONES: landscape or compact devices < 680px tall ── */
@media screen and (max-height: 680px) {
    #main-screen { padding-top: 10px; padding-bottom: 75px; }
    .player-hud  { margin-top: 5px; margin-bottom: 6px; padding: 5px 10px; }
    .player-avatar-ring { width: 26px; height: 26px; font-size: 0.78rem; }
    .hp-bar-container { height: 9px; }
    .panel-header { margin-bottom: 8px; padding-bottom: 6px; }
    .panel-header h3 { font-size: 0.8rem; }
    .panel-body   { padding: 10px 14px; }
    .character-card { padding: 8px 6px; }
    .avatar-img-placeholder { width: 34px; height: 34px; font-size: 1.3rem; }
    .char-real-name { font-size: 0.72rem; }
    .char-stats   { font-size: 0.55rem; gap: 1px; }
    .char-parents { font-size: 0.52rem; }
    .sao-footer   { margin-top: 4px; }
}

/* ── VERY SHORT PHONES: < 600px height (Galaxy Fold, landscape mode) ── */
@media screen and (max-height: 600px) {
    .player-hud  { display: flex; flex-direction: row; gap: 12px; padding: 5px 10px; }
    .party-member { flex: 1; }
    .hp-text     { display: none; } /* Save vertical space: HP text hidden on tiny screens */
    .hp-bar-container { height: 7px; }
    .menu-inner-scroller { max-height: 280px; gap: 10px; }
    .menu-outer-ring { max-height: 320px; }
}
