/* ============================================
   BASE STYLES & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100vh;
    overflow: hidden;
}

:root {
    /* Color Palette */
    --bg-dark-navy: #0a1628;
    --bg-navy-gradient: linear-gradient(180deg, #0a1628 0%, #1a2744 100%);
    --text-light: #ffffff;
    --text-gold: #ffd700;
    --glow-blue: #4dd0e1;
    --glow-pink: #ff4081;
    --glow-gold: #ffd700;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography - 잘난체 */
    --font-primary: 'JalnanOTF', sans-serif;
    --font-decorative: 'JalnanOTF', sans-serif;
    --font-handwriting: 'JalnanOTF', sans-serif;
    --font-button: 'Black Han Sans', sans-serif;

    /* Z-index layers */
    --z-snow: 10;
    --z-header: 15;
    --z-tree: 10;
    --z-header: 35;
    --z-cards: 30;
    --z-fab: 40;
    --z-modal: 50;
    --z-loading: 60;
}

body {
    font-family: var(--font-primary);
    font-weight: 700;
    background: var(--bg-navy-gradient);
    background-attachment: fixed;
    color: var(--text-light);
    overflow: hidden;
    height: 100vh;
    position: relative;
    width: 100vw;
}

/* ============================================
   FLOATING HEADER
   ============================================ */
#site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    z-index: var(--z-header);
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

#site-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}

#site-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(255, 215, 0, 0.6)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

.site-tagline {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-gold);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5),
        0 0 10px rgba(255, 215, 0, 0.3);
    margin: 0;
    letter-spacing: 0.5px;
    word-break: keep-all;
    /* Prevent breaking within Korean words */
}

.card-counter {
    font-family: var(--font-primary);
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255, 215, 0, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: var(--spacing-xs) 0 0 0;
    letter-spacing: 0.3px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card-counter.visible {
    opacity: 1;
}

.card-counter span {
    color: var(--glow-pink);
    font-weight: 700;
}

/* Card Intro Text */
.card-intro-text {
    font-family: var(--font-primary);
    font-size: 1.0rem;
    font-weight: 600;
    color: rgba(255, 100, 100, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: var(--spacing-xs) 0 0 0;
    letter-spacing: 0.3px;
    transition: opacity 0.3s ease;
}

.card-intro-text.shaking {
    animation: textShake 0.1s ease-in-out infinite;
}

.card-intro-text.fade-out {
    opacity: 0;
}

/* ============================================
   SNOW EFFECT
   ============================================ */
#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-snow);
    overflow: hidden;
    will-change: contents;
    contain: layout style paint;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    animation: snowfall linear infinite;
    user-select: none;
    will-change: transform;
    transform: translateZ(0);
}

/* ============================================
   CHRISTMAS TREE
   ============================================ */
#tree-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: calc(100px + var(--spacing-xl)) var(--spacing-md) var(--spacing-xl);
    z-index: var(--z-tree);
    overflow: hidden;
}

#christmas-tree {
    position: relative;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    object-fit: contain;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(77, 208, 225, 0.6));
    transition: transform 0.3s ease-out;
    z-index: 2;
}

#tree-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 700px;
    height: 100%;
    background: radial-gradient(ellipse at center,
            rgba(77, 208, 225, 0.3) 0%,
            rgba(255, 64, 129, 0.2) 30%,
            rgba(255, 215, 0, 0.15) 50%,
            transparent 70%);
    filter: blur(40px);
    animation: haloGlow 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   CARDS ON TREE
   ============================================ */
#cards-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-cards);
}

.tree-card {
    position: absolute;
    width: 60px;
    height: 90px;
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transform-origin: top center;
}

.tree-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.tree-card:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.5));
    z-index: 100;
}

/* ============================================
   FLOATING ACTION BUTTONS
   ============================================ */
.fab-container {
    position: absolute;
    bottom: var(--spacing-lg);
    width: 200px;
    height: 200px;
    z-index: var(--z-fab);
    pointer-events: none;
}

.fab-container-right {
    right: var(--spacing-lg);
}

.fab-container-left {
    left: var(--spacing-lg);
}

.fab-curved-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.fab-text {
    font-family: var(--font-button);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    fill: var(--text-gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.fab-container:hover .fab-text {
    animation: textGlow 2s ease-in-out infinite;
}

.fab-text-top {
    font-weight: 700;
}

.fab-text-bottom {
    font-weight: 400;
}

.floating-action-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: var(--text-gold);
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    pointer-events: all;
}

.floating-action-btn:hover {
    transform: translate(-50%, -50%) scale(1.1) rotate(90deg);
    background: rgba(255, 215, 0, 0.5);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

.fab-icon {
    transition: transform 0.3s ease;
}

.fab-icon-svg {
    transition: transform 0.3s ease;
    color: var(--text-gold);
}

.floating-action-btn:hover .fab-icon-svg {
    transform: rotate(180deg);
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }

    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 1), 0 0 30px rgba(255, 215, 0, 0.6);
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a2744 0%, #0a1628 100%);
    border-radius: 20px;
    padding: var(--spacing-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
}

.modal-title {
    font-family: var(--font-decorative);
    font-size: 2rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ============================================
   CARD SELECTION
   ============================================ */
.card-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.card-type-option {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
}

.card-type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-type-option:hover {
    transform: scale(1.05);
    border-color: var(--glow-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.card-type-option:hover::before {
    opacity: 1;
    animation: goldenWave 1.5s ease-in-out infinite;
}

.card-type-option img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   CARD FORM
   ============================================ */
.card-form-container {
    display: flex;
    gap: var(--spacing-xl);
    align-items: stretch;
    /* Changed from flex-start to allow stretching */
}

.selected-card-preview {
    flex: 0 0 250px;
    position: sticky;
    top: var(--spacing-md);
}

.selected-card-preview img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#card-creation-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-weight: 500;
    color: var(--text-gold);
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea {
    padding: var(--spacing-sm);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--glow-gold);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   BUTTONS
   ============================================ */
.submit-btn,
.close-btn,
.cancel-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 12px;
    font-family: var(--font-button);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn {
    background: rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    color: var(--text-gold);
    border: 2px solid rgba(255, 215, 0, 0.5);
    width: 100%;
}

.submit-btn:hover {
    background: rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

.close-btn {
    background: rgba(34, 85, 51, 0.8);
    backdrop-filter: blur(10px);
    color: #000000;
    font-weight: 700;
    border: 2px solid rgba(34, 85, 51, 0.6);
    border-radius: 12px;
    padding: var(--spacing-sm) var(--spacing-lg);
    min-width: 100px;
}

.close-btn:hover {
    background: rgba(34, 85, 51, 1);
    border-color: rgba(34, 85, 51, 0.8);
    box-shadow: 0 0 15px rgba(34, 85, 51, 0.5);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CARD VIEW MODAL
   ============================================ */
.card-view-content {
    max-width: 600px;
    padding: var(--spacing-xl);
    position: relative;
}

.card-inner {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    perspective: 1000px;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.card-front {
    background-size: cover;
    background-position: center;
}

.card-back {
    background: rgba(255, 255, 255, 0.80);
    padding: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.card-header {
    text-align: center;
    margin-bottom: 15px;
    padding-top: 0;
}

.card-logo {
    height: 70px;
    /* Doubled from 35px */
    width: auto;
    margin-bottom: 12px;
    /* Doubled from 6px */
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-tagline {
    font-family: var(--font-button);
    font-size: 1.6rem;
    /* Doubled from 0.8rem */
    color: var(--text-gold);
    margin: 0;
    font-weight: 700;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.4);
    word-break: keep-all;
    /* Prevent breaking within Korean words */
}

.card-message-content {
    text-align: center;
    color: #333;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

.card-to {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    color: #d32f2f;
    text-align: left;
}

.card-from {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    color: #d32f2f;
    text-align: right;
}

.card-message {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: var(--spacing-sm) 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: #333;
    text-align: center;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loading);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top-color: var(--glow-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVE DESIGN - HEADER
   ============================================ */
@media (max-width: 768px) {
    #site-logo {
        height: 70px;
    }

    .site-tagline {
        font-size: 1.5rem;
    }

    .card-counter {
        font-size: 1.1rem;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    #site-logo {
        height: 70px;
    }

    .site-tagline {
        font-size: 1.5rem;
    }

    #christmas-tree {
        max-width: 400px;
    }

    .tree-card {
        width: 45px;
        height: 68px;
    }

    .card-form-container {
        flex-direction: column;
        align-items: center;
    }

    #card-creation-form {
        width: 100%;
    }

    .selected-card-preview {
        flex: 0 0 auto;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
        position: relative;
    }

    .modal-content {
        padding: var(--spacing-md);
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .card-types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }


    .fab-container {
        width: 160px;
        height: 160px;
        bottom: calc(var(--spacing-md) + 80px);
        /* Raised to avoid Safari bottom bar */
    }

    .fab-container-right {
        right: var(--spacing-md);
    }

    .fab-container-left {
        left: var(--spacing-md);
    }

    .fab-text {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .floating-action-btn {
        width: 56px;
        height: 56px;
    }

    /* Pull tree container up on mobile for compact layout */
    #tree-container {
        padding-top: 60px;
        /* Reduced from calc(100px + spacing) to let tree touch/overlap header */
        padding-bottom: 180px;
        /* Extra space for raised FABs */
    }
}

@media (max-width: 480px) {
    #christmas-tree {
        max-width: 330px;
        /* Increased 10% for better mobile visibility */
    }

    .tree-card {
        width: 35px;
        height: 53px;
    }
}

/* ============================================
   CARD SLIDESHOW MODAL
   ============================================ */
.slideshow-content {
    max-width: 700px;
    padding: var(--spacing-xl);
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slideshow-card-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-lg) 0;
}


/* Slideshow Floating Header (Transparent) */
.slideshow-header {
    position: absolute;
    top: 20px;
    /* Position inside the card near the top */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    /* Full width to center properly */
    text-align: center;
    z-index: 20;
    /* Above card content */
    background: transparent;
    pointer-events: none;
    /* Allow interaction with standard buttons below */
}

.slideshow-logo {
    height: 70px;
    width: auto;
    margin-bottom: 5px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.slideshow-tagline {
    font-family: var(--font-button);
    font-size: 1.8rem;
    /* Slightly larger for impact */
    color: var(--text-gold);
    margin: 0;
    font-weight: 700;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    word-break: keep-all;
    /* Prevent breaking within Korean words */
}

.slideshow-card-container .card-inner {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding-bottom: 150%;
    perspective: 1000px;
}

/* Navigation Buttons */
/* Next Navigation Button - Floating SVG on White Layer */
.slideshow-next-btn {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    /* Match nav-arrow */
    backdrop-filter: blur(5px);
    border: 2px solid var(--text-gold);
    /* Match nav-arrow */
    border-radius: 12px;
    color: var(--text-gold);
    cursor: pointer;
    z-index: 100;
    width: 60px;
    height: 80px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center content */
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);

    /* Aesthetics: Golden Pulse */
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    animation: neonPulse 3s ease-in-out infinite;
}

.slideshow-next-btn svg {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.slideshow-next-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    animation: neonPulseFast 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.slideshow-next-btn:hover svg {
    transform: translateX(3px);
}

.slideshow-next-btn:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transition: transform 0.1s;
}

/* Progress Bar */
.slideshow-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.slideshow-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,
            var(--glow-gold) 0%,
            var(--glow-pink) 50%,
            var(--glow-blue) 100%);
    transform-origin: left;
    transition: transform 0.1s linear;
}

.slideshow-progress-bar.animating {
    animation: progressShrink 10s linear forwards;
}

/* Stop Button Container */
.slideshow-stop-container {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
}

.stop-curved-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.stop-text {
    font-family: var(--font-button);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1px;
    fill: var(--glow-pink);
    opacity: 1;
}

.stop-text-top {
    font-weight: 700;
}

.stop-text-bottom {
    font-weight: 400;
}

.slideshow-stop-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 64, 129, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 64, 129, 0.5);
    color: var(--glow-pink);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 64, 129, 0.4);
    pointer-events: all;
}

.stop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    margin-bottom: 3px;
    /* Visual correction to center the square */
}

.slideshow-stop-btn:hover {
    background: rgba(255, 64, 129, 0.5);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 64, 129, 0.6);
}

/* Stop button rotation animation */
.slideshow-stop-container.stop-rotating {
    animation: stopContainerRotate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slideshow-stop-btn.stop-button-rotating {
    animation: stopButtonRotate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Share Buttons */
.card-view-actions {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    width: auto;
}

.card-view-actions .close-btn,
.card-view-actions .share-btn {
    position: relative;
    min-width: 110px;
    padding: var(--spacing-sm) var(--spacing-lg);
}

.share-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(255, 215, 0, 0.7);
    backdrop-filter: blur(10px);
    color: #000000;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    font-family: var(--font-button);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 110px;
}

.share-btn:hover {
    background: rgba(255, 215, 0, 0.9);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Slideshow Share Button */
.slideshow-share-btn {
    position: absolute;
    bottom: calc(var(--spacing-md) + 30px);
    /* Align with stop button center (container 120px height / 2 = 60px, minus button radius 30px) */
    right: calc(50% - 110px);
    /* Adjust based on stop button positioning */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #000000;
    /* Changed to black */
    font-family: var(--font-button);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    z-index: 100;
}

.slideshow-share-btn:hover {
    background: rgba(255, 215, 0, 0.4);
    transform: scale(1.1);
}

.slideshow-share-btn:active {
    transform: scale(0.95);
    background: rgba(255, 215, 0, 0.6);
}



/* Slideshow Pause/Play Button */
.slideshow-pause-btn {
    position: absolute;
    bottom: calc(var(--spacing-md) + 30px);
    /* Same vertical alignment as share button */
    left: calc(50% - 110px);
    /* Symmetric to share button (left side) */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(77, 108, 225, 0.2);
    /* Dark blue theme */
    backdrop-filter: blur(10px);
    border: 2px solid rgba(77, 108, 225, 0.4);
    color: #000000;
    /* Black text */
    font-family: var(--font-button);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(77, 108, 225, 0.3);
    z-index: 100;
}

.slideshow-pause-btn:hover {
    background: rgba(77, 108, 225, 0.4);
    transform: scale(1.1);
}

.slideshow-pause-btn:active {
    transform: scale(0.95);
    background: rgba(77, 108, 225, 0.6);
}

/* Pause icon (II) */
.pause-icon {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play icon (triangle) - shown when paused */
.slideshow-pause-btn.paused .pause-icon {
    font-size: 0;
    letter-spacing: 0;
}

.slideshow-pause-btn.paused .pause-icon::before {
    content: '▶';
    font-size: 1.3rem;
    display: inline-block;
    margin-left: 3px;
    /* Visual centering adjustment for triangle */
}

/* Share Options Menu (Simple Overlay) */
.share-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 30, 48, 0.95);
    backdrop-filter: blur(20px);
    padding: var(--spacing-xl);
    border-radius: 24px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    z-index: 2000;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.share-menu.active {
    opacity: 1;
    visibility: visible;
}

.share-option-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    font-family: var(--font-button);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

/* Receiver Selector Styling */
.receiver-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.receiver-input-container input {
    width: 100%;
    padding-left: 40px;
    /* Space for the toggle button on left */
    padding-right: 15px;
}

.receiver-dropdown-toggle {
    position: absolute;
    left: 10px;
    /* Moved to left */
    background: transparent;
    border: none;
    color: var(--text-gold);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 5px;
    animation: dropdownPulse 2s ease-in-out infinite;
}

@keyframes dropdownPulse {

    0%,
    100% {
        transform: scale(1);
        color: var(--text-gold);
    }

    50% {
        transform: scale(1.2);
        color: #ff1493;
    }
}

.receiver-dropdown-toggle.active {
    transform: rotate(180deg);
    animation: none;
}

.receiver-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--primary-gold);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
    z-index: 1000;
    margin-top: 5px;
    display: none;
    /* Max height for approx 4 items (each ~50-60px) */
    max-height: 240px;
    overflow-y: auto;
    /* Enable scrollbar */
    backdrop-filter: blur(10px);
}

.receiver-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.receiver-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.receiver-item:hover {
    background: rgba(255, 215, 0, 0.1);
}

.item-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Left align */
    gap: 4px;
}

.item-name {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.item-count {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}

.badge-gold {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary-gold);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.badge-silver {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.dropdown-back-btn {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold);
    cursor: pointer;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
}

.back-arrow {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Target Item Styling */
.target-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.target-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.target-name {
    font-weight: bold;
    color: var(--text-light);
    font-size: 1rem;
}

.target-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.target-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    /* Faint text */
    margin-left: auto;
}

.target-desc {
    font-size: 0.8rem;
    color: var(--text-gold);
    margin-top: 4px;
    opacity: 0.8;
}

/* Scrollbar Customization */
.receiver-dropdown::-webkit-scrollbar {
    width: 6px;
}

.receiver-dropdown::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.receiver-dropdown::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

.share-option-btn.sns-download {
    background: linear-gradient(90deg, #FEE500 0%, #833AB4 50%, #F56040 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: center;
}

.share-option-btn.sns-download:hover {
    transform: translateX(0) scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.sns-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.share-option-btn.link {
    background: rgba(0, 122, 255, 0.2);
    color: #007AFF;
    border-color: #007AFF;
}

/* Responsive adjustments for slideshow */
@media (max-width: 768px) {
    .slideshow-share-btn {
        right: calc(50% - 90px);
        /* Maintain centered layout, adjusted for smaller button */
        bottom: calc(var(--spacing-md) + 25px);
        /* Align with stop button center (smaller button radius 25px) */
        width: 50px;
        height: 50px;
    }

    .slideshow-pause-btn {
        left: calc(50% - 90px);
        /* Symmetric to share button */
        bottom: calc(var(--spacing-md) + 25px);
        /* Same vertical alignment */
        width: 50px;
        height: 50px;
    }

    .slideshow-stop-container {
        width: 100px;
        height: 100px;
    }

    .slideshow-stop-btn {
        width: 45px;
        height: 45px;
    }

    .stop-curved-text {
        width: 100px;
        height: 100px;
    }

    .stop-text {
        font-size: 8px;
    }
}

/* ============================================
   MINI MUSIC PLAYER
   ============================================ */
.mini-music-player {
    position: fixed;
    top: 80px;
    right: 40px;
    width: 120px;
    opacity: 0;
    transform: translateY(-20px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 150;
    pointer-events: none;
}

.mini-music-player.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.player-track-title {
    font-family: var(--font-button);
    font-size: 0.75rem;
    color: var(--text-gold);
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.player-album-container {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

.player-album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-visualizer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    padding: 0 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    gap: 4px;
}

.visualizer-bar {
    width: 4px;
    background: linear-gradient(to top, var(--glow-gold), var(--glow-pink));
    border-radius: 2px 2px 0 0;
    animation: visualizerPulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* Pause visualizer when music is paused */
.mini-music-player.paused .visualizer-bar {
    animation-play-state: paused;
}

.visualizer-bar:nth-child(1) {
    animation-delay: 0s;
}

.visualizer-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.visualizer-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.visualizer-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.visualizer-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes visualizerPulse {

    0%,
    100% {
        height: 10px;
        opacity: 0.7;
    }

    50% {
        height: 35px;
        opacity: 1;
    }
}

/* Mobile adjustments for music player */
@media (max-width: 768px) {
    .mini-music-player {
        top: 70px;
        right: 20px;
        width: 80px;
    }

    .player-album-container {
        width: 80px;
        height: 80px;
    }

    .player-track-title {
        font-size: 0.65rem;
        margin-bottom: 6px;
    }

    .player-visualizer {
        height: 30px;
        padding: 0 6px;
        gap: 3px;
    }

    .visualizer-bar {
        width: 3px;
    }

    @keyframes visualizerPulse {

        0%,
        100% {
            height: 8px;
        }

        50% {
            height: 25px;
        }
    }

    .player-controls {
        gap: 6px;
    }

    .player-control-btn {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.player-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: var(--text-gold);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: neonPulse 3s ease-in-out infinite;
    pointer-events: all;
}

.player-control-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.1);
    animation: neonPulseFast 1s ease-in-out infinite;
}

.player-control-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
}

.play-pause-icon,
.next-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.3s ease;
}

/* Play/Pause icon toggle */
.player-control-btn.paused .play-pause-icon::before {
    content: '▶';
    font-size: 0.9rem;
}

.player-control-btn.playing .play-pause-icon::before {
    content: 'II';
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.9rem;
}

.player-control-btn .play-pause-icon {
    font-size: 0;
}

/* Next button animation on click */
.player-control-btn.next-pressed .next-icon {
    animation: nextBounce 0.4s ease-out;
}

@keyframes nextBounce {
    0% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(5px) scale(1.2);
    }

    100% {
        transform: translateX(0);
    }
}

/* ============================================
   SHARE MENU CARD COUNTER
   ============================================ */
.share-card-counter-container {
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 215, 0, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.25);
}

.share-card-counter {
    font-size: 0.85rem;
    color: var(--text-gold);
    font-family: var(--font-button);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    display: inline-block;
    letter-spacing: 0.3px;
}

.counter-numbers {
    font-weight: 600;
    color: var(--text-gold);
    transition: color 0.3s ease;
}

.counter-numbers.limit-reached {
    color: #f44336;
    font-weight: 700;
    animation: pulse 2s ease-in-out infinite;
}

/* ==========================================================================
   3-Page Swipe Layout Styles
   ========================================================================== */

/* Main Swiper Container */
#main-swiper {
    position: relative;
    width: 300vw;
    /* 3 pages side by side */
    height: 100vh;
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateX(-100vw);
    /* Start at Center Page (2nd page) */
    will-change: transform;
}

/* Generic Page Style */
.page {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow-y: auto;
    /* Enable vertical scrolling for content pages */
    overflow-x: hidden;
    flex-shrink: 0;
}

/* Center Page (Main Tree) */
/* Keep existing tree styles working within this container */
.page-center {
    overflow-y: hidden;
    overflow-x: hidden;
    /* Tree page shouldn't scroll */
}

/* Left & Right Pages Content Wrapper */
.page-content {
    padding: 80px 20px 40px;
    /* Top padding for header space */
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-light);
    font-family: var(--font-primary);
}

/* Page Headers */
.stats-header,
#store-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    padding-bottom: 20px;
}

.stats-header h2,
#store-header h2 {
    font-family: var(--font-button);
    color: var(--text-gold);
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-icon {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

#store-header p {
    font-size: 1.1rem;
    color: #ccc;
    line-height: 1.6;
}

.contact-email {
    margin-top: 0;
    font-family: var(--font-primary);
    font-size: 0.95rem !important;
    color: #fff !important;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

#location-ranking-list {
    margin-bottom: 2rem;
}

/* ==========================================================================
   Leaflet Map & Stats Styles
   ========================================================================== */

#map-container {
    width: 100%;
    height: 350px;
    border-radius: 15px;
    border: 2px solid var(--text-gold);
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
    /* Lower than modals */
}

#ranking-container,
#archive-container {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#ranking-container h3,
#archive-container h3 {
    color: var(--text-gold);
    font-family: var(--font-button);
    margin-top: 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Ranking List */
#receiver-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Map Subtitle */
.map-subtitle {
    text-align: left;
    color: #fff;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
}

.ranking-container-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Ranking List Container */
#ranking-list,
#location-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 250px;
    /* Approximately 5 items (50px each) */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) rgba(255, 255, 255, 0.1);
}

/* Custom Scrollbar */
#ranking-list::-webkit-scrollbar,
#location-ranking-list::-webkit-scrollbar {
    width: 6px;
}

#ranking-list::-webkit-scrollbar-track,
#location-ranking-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#ranking-list::-webkit-scrollbar-thumb,
#location-ranking-list::-webkit-scrollbar-thumb {
    background: var(--text-gold);
    border-radius: 3px;
    opacity: 0.7;
}

#ranking-list::-webkit-scrollbar-thumb:hover,
#location-ranking-list::-webkit-scrollbar-thumb:hover {
    background: #fff;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-item:last-child {
    border-bottom: none;
}

.rank-badge {
    background: var(--text-gold);
    color: #333;
    font-family: var(--font-button);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

.rank-name {
    font-weight: bold;
    flex-grow: 1;
}

.rank-count {
    color: var(--text-gold);
    font-family: var(--font-button);
}

/* Archive Section */
#archive-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#archive-container h3 {
    font-family: var(--font-button);
    color: var(--text-gold);
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* Level 1 Tabs */
.archive-tabs-level-1 {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.archive-tab-btn {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.archive-tab-btn.active {
    background: var(--text-gold);
    color: #000;
    border-color: var(--text-gold);
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Level 2 Tabs */
.archive-tabs-level-2 {
    display: flex;
    flex-direction: column;
    /* Stack items vertically first */
    flex-wrap: wrap;
    /* Wrap to next column when height is filled */
    height: 140px;
    /* Height ensuring approx 3 rows fit */
    gap: 8px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
    align-content: flex-start;
    /* Align columns to the start */
    overflow-x: auto;
    /* Scroll horizontally */
    overflow-y: hidden;
    /* Hide vertical scroll */
}

.archive-sub-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ddd;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: max-content;
    /* Ensure button takes needed width */
    max-width: 150px;
    /* Prevent overly long buttons */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.archive-sub-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.archive-sub-btn.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.4);
}

.archive-placeholder {
    color: #888;
    font-size: 0.9rem;
    width: 100%;
    text-align: center;
}

/* Manual Input */
.archive-manual-input {
    margin-bottom: 15px;
}

#archive-search-input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
}

#archive-search-input:focus {
    border-color: var(--text-gold);
    outline: none;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* Search Button */
.btn-gold-search {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 10px;
    color: #000;
    font-family: var(--font-button);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s ease;
}

.btn-gold-search:active {
    transform: scale(0.98);
}

/* Archive List Table */
.archive-table-header {
    display: flex;
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 5px;
    border-radius: 5px 5px 0 0;
    font-weight: bold;
    color: var(--text-gold);
    font-size: 0.9rem;
}

.archive-table-body {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Columns */
.col-to {
    width: 25%;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-from {
    width: 20%;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.col-msg {
    width: 55%;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-row {
    display: flex;
    padding: 12px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #ddd;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.archive-row:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.archive-row:last-child {
    border-bottom: none;
}

.archive-empty {
    padding: 20px;
    text-align: center;
    color: #888;
}

/* Store Navigation Controls */
.store-nav-controls {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.store-nav-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--text-gold);
    color: var(--text-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(5px);
    font-family: var(--font-button);
    font-size: 1.2rem;
    font-weight: bold;

    /* Golden Pulse */
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    animation: neonPulse 3s ease-in-out infinite;
}

.store-nav-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #fff;
    transform: scale(1.1);
    animation: neonPulseFast 1.5s ease-in-out infinite;
}

.store-nav-btn:active {
    transform: scale(0.95);
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transition: transform 0.1s;
}

.store-nav-btn svg {
    width: 20px;
    height: 20px;
}

.donation-info {
    margin-top: 10px;
    margin-bottom: 20px;
    /* Added spacing from iframe */
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.donation-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
    word-break: keep-all;
    line-height: 1.4;
}

/* Store Iframe */
#store-frame-container {
    width: 100%;
    height: 70vh;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    position: relative;
}

#store-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Navigation Arrows */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    /* Slightly more transparent for glow to pop */
    color: var(--text-gold);
    border: 2px solid var(--text-gold);
    width: 50px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    font-family: var(--font-button);
    font-size: 1.5rem;
    backdrop-filter: blur(5px);
    border-radius: 10px;

    /* Aesthetics: Golden Pulse */
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    animation: neonPulse 3s ease-in-out infinite;
}

.nav-arrow:hover {
    background: rgba(255, 215, 0, 0.1);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    animation: neonPulseFast 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
    background: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transition: transform 0.1s;
}

.nav-arrow-left {
    left: 20px;
}

.nav-arrow-right {
    right: 20px;
}

/* Hide arrows on appropriate pages (handled by JS via class) */
.nav-arrow.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.nav-arrow.fade-out {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

/* Nav Labels Styles */
.nav-arrow {
    overflow: visible !important;
    /* Allow label to show outside */
    flex-direction: column;
}

.arrow-symbol {
    line-height: 1;
    margin-bottom: 2px;
}

.nav-label-container {
    position: absolute;
    bottom: -22px;
    /* Position below */
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-word {
    position: absolute;
    font-family: var(--font-button);
    font-size: 0.65rem;
    font-weight: 800;
    color: #000;
    /* Black font */
    text-shadow: 0 0 4px #FFD700, 0 0 8px #FFD700, 0 0 12px #FFD700;
    /* Intense Gold Glow */
    opacity: 0;
    white-space: nowrap;
    letter-spacing: 0.5px;
    animation: wordFade 6s infinite;
}

.word-1 {
    animation-delay: 0s;
}

.word-2 {
    animation-delay: 3s;
    /* Half of 6s to alternate */
}

@keyframes wordFade {
    0% {
        opacity: 0;
        transform: translateY(2px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0;
        transform: translateY(-2px);
    }

    100% {
        opacity: 0;
        transform: translateY(-2px);
    }
}

@media (max-width: 768px) {
    /* #main-swiper rules for mobile if needed */

    .nav-arrow {
        width: 40px;
        height: 60px;
        font-size: 1.2rem;
        background: rgba(0, 0, 0, 0.3);
    }

    /* Hide cluttered labels on mobile */
    .nav-label-container {
        display: none;
    }

    .page-content {
        padding: 60px 15px 30px;
    }
}

/* PC View Adjustments */
@media (min-width: 769px) {
    #store-header p br {
        display: none;
        /* Single line on PC */
    }
}

/* Help Button Styles */
.help-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    /* Semi-transparent dark background */
    backdrop-filter: blur(5px);
    border: 2px solid var(--text-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-gold);
    /* Gold color for the '?' */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.help-button:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.help-button span {
    font-family: var(--font-button);
    display: inline-block;
    animation: helpShake 2s ease-in-out infinite;
}

@keyframes helpShake {

    0%,
    85%,
    100% {
        transform: rotate(0deg);
    }

    88% {
        transform: rotate(-15deg);
    }

    91% {
        transform: rotate(15deg);
    }

    94% {
        transform: rotate(-10deg);
    }

    97% {
        transform: rotate(10deg);
    }
}

/* Interactive Tutorial Styles */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tutorial-overlay.tutorial-fade-out {
    opacity: 0;
}

.tutorial-spotlight {
    position: absolute;
    background: transparent;
    border: 4px solid #ff1493;
    border-radius: 50%;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 20, 147, 0.6),
        inset 0 0 20px rgba(255, 20, 147, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10001;
    animation: magentaCircle 2s ease-in-out infinite;
    transform: scale(1);
}

@keyframes magentaCircle {

    0%,
    100% {
        box-shadow:
            0 0 0 9999px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(255, 20, 147, 0.6),
            inset 0 0 20px rgba(255, 20, 147, 0.3);
    }

    50% {
        box-shadow:
            0 0 0 9999px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(255, 20, 147, 0.9),
            inset 0 0 40px rgba(255, 20, 147, 0.5);
    }
}

.tutorial-tooltip {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 14, 39, 0.85);
    border: 2px solid #ff1493;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    z-index: 10002;
    box-shadow:
        0 0 20px rgba(255, 20, 147, 0.6),
        0 0 40px rgba(255, 20, 147, 0.4),
        inset 0 0 20px rgba(255, 20, 147, 0.2);
    animation: tooltipAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), magentaGlow 2s ease-in-out infinite;
}

@keyframes magentaGlow {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(255, 20, 147, 0.6),
            0 0 40px rgba(255, 20, 147, 0.4),
            inset 0 0 20px rgba(255, 20, 147, 0.2);
    }

    50% {
        box-shadow:
            0 0 30px rgba(255, 20, 147, 0.8),
            0 0 60px rgba(255, 20, 147, 0.6),
            inset 0 0 30px rgba(255, 20, 147, 0.3);
    }
}

@keyframes tooltipAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tutorial-content {
    text-align: center;
}

.tutorial-content h3 {
    color: var(--text-gold);
    font-family: var(--font-button);
    font-size: 1.6rem;
    margin: 0 0 15px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tutorial-content p {
    color: #fff;
    font-family: var(--font-primary);
    line-height: 1.8;
    margin: 0 0 30px 0;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    white-space: pre-line;
}

.tutorial-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.tutorial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-gold);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    animation: buttonPulse 2s ease-in-out infinite;
    height: 48px;
    min-width: 100px;
}

@keyframes buttonPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

.tutorial-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

/* Mobile adjustments for tutorial */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 280px;
        padding: 20px;
    }

    .tutorial-content h3 {
        font-size: 1.2rem;
    }

    .tutorial-content p {
        font-size: 0.9rem;
    }

    .tutorial-btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}