/* =============================================================================
   FOR HER ❤️ — Complete Romantic Birthday Portal CSS
   Design System for 20 Interactive Chapters & 6 Emotional Acts
   ============================================================================= */

:root {
    --midnight-purple: #170F2B;
    --deep-purple: #59366F;
    --romantic-pink: #E98DBA;
    --soft-blush: #F5D8E5;
    --champagne-gold: #E7BE79;
    --gold-glow: #F2D299;
    --pure-white: #FFFFFF;
    
    --bg-glass: rgba(34, 22, 63, 0.68);
    --bg-glass-heavy: rgba(23, 15, 43, 0.88);
    --border-pink: rgba(233, 141, 186, 0.25);
    --border-gold: rgba(231, 190, 121, 0.35);

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-script: 'Great Vibes', cursive;

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;

    --shadow-glow-pink: 0 0 25px rgba(233, 141, 186, 0.4);
    --shadow-glow-gold: 0 0 25px rgba(231, 190, 121, 0.4);
    --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--midnight-purple);
    color: var(--pure-white);
    font-family: var(--font-sans);
    overflow-x: hidden;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* =============================================================================
   CANVAS & BACKGROUND LAYERS
   ============================================================================= */
.webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

.petals-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* =============================================================================
   LOADING SCREEN
   ============================================================================= */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #2C164D 0%, #170F2B 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    max-width: 420px;
    padding: 20px;
}

.pulsing-heart {
    font-size: 3.5rem;
    display: inline-block;
    animation: heartBeat 1.4s infinite ease-in-out;
    filter: drop-shadow(0 0 20px rgba(233, 141, 186, 0.6));
}

.loader-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--soft-blush);
    margin: 16px 0 12px;
}

.loader-bar {
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    margin: 0 auto 16px;
    overflow: hidden;
    position: relative;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--romantic-pink), var(--champagne-gold));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.loader-quote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1rem;
    color: var(--champagne-gold);
    opacity: 0.85;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.22); }
    28% { transform: scale(1); }
    42% { transform: scale(1.18); }
    70% { transform: scale(1); }
}

/* =============================================================================
   HEADER & NAVIGATION
   ============================================================================= */
.portal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
    background: linear-gradient(180deg, rgba(23, 15, 43, 0.92) 0%, rgba(23, 15, 43, 0) 100%);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-logo-icon {
    font-size: 1.1rem;
}

.portal-logo-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--soft-blush);
    letter-spacing: 0.5px;
}

.birthday-pill {
    background: rgba(231, 190, 121, 0.15);
    border: 1px solid var(--border-gold);
    color: var(--champagne-gold);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 12px rgba(231, 190, 121, 0.25);
}

.chapter-nav-wrapper {
    max-width: 450px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chapter-nav-wrapper::-webkit-scrollbar {
    display: none;
}

.chapter-nav {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px;
}

.chapter-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(233, 141, 186, 0.2);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.chapter-dot.unlocked {
    background: rgba(233, 141, 186, 0.2);
    color: #FFF;
    border-color: var(--romantic-pink);
}

.chapter-dot.active {
    background: linear-gradient(135deg, var(--romantic-pink), var(--deep-purple));
    color: #FFF;
    box-shadow: var(--shadow-glow-pink);
    transform: scale(1.2);
    border-color: #FFF;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(34, 22, 63, 0.65);
    border: 1px solid var(--border-pink);
    color: var(--soft-blush);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(233, 141, 186, 0.25);
    color: #FFF;
    transform: translateY(-2px);
}

.icon-btn i, .icon-btn svg {
    width: 17px;
    height: 17px;
    display: block;
    stroke: currentColor;
}

.love-notes-badge {
    width: auto;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    gap: 6px;
}

/* =============================================================================
   CHAPTER CONTAINER & SECTIONS
   ============================================================================= */
.chapters-container {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
}

.chapter-section {
    position: absolute;
    width: 100%;
    max-width: 900px;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.97);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    pointer-events: none;
}

.chapter-section.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.wide-content { max-width: 1100px; }
.text-center { text-align: center; }

.act-badge {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--champagne-gold);
    background: rgba(231, 190, 121, 0.12);
    border: 1px solid var(--border-gold);
    padding: 6px 18px;
    border-radius: 30px;
    margin-bottom: 16px;
}

.badge-gold {
    background: rgba(231, 190, 121, 0.2);
    box-shadow: 0 0 15px rgba(231, 190, 121, 0.3);
}

.chapter-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: var(--pure-white);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.greeting-title { font-size: 3.4rem; }

.highlight-pink {
    color: var(--romantic-pink);
    text-shadow: 0 0 25px rgba(233, 141, 186, 0.6);
}

.chapter-lead {
    font-size: 1.15rem;
    color: var(--soft-blush);
    max-width: 640px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.font-serif { font-family: var(--font-serif); }
.font-script { font-family: var(--font-script); }
.text-muted { color: rgba(255, 255, 255, 0.6); }
.text-gold { color: var(--champagne-gold) !important; }

.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 36px; }
.max-w-md { max-width: 500px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    font-family: var(--font-sans);
}

.btn-magic {
    background: linear-gradient(135deg, var(--romantic-pink) 0%, #D86A9E 50%, var(--deep-purple) 100%);
    color: #FFFFFF;
    box-shadow: 0 8px 25px rgba(233, 141, 186, 0.35);
}

.btn-magic:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(233, 141, 186, 0.55);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: rotate(30deg);
    animation: shimmer 4s infinite linear;
}

@keyframes shimmer {
    0% { transform: translate(-100%, -100%) rotate(30deg); }
    100% { transform: translate(100%, 100%) rotate(30deg); }
}

.btn-secondary {
    background: rgba(89, 54, 111, 0.6);
    border: 1px solid var(--border-pink);
    color: var(--soft-blush);
}

.btn-secondary:hover {
    background: rgba(89, 54, 111, 0.9);
    color: #FFF;
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--champagne-gold);
    color: var(--champagne-gold);
}

.btn-outline-gold:hover {
    background: rgba(231, 190, 121, 0.15);
    box-shadow: var(--shadow-glow-gold);
}

.btn-sm { padding: 8px 18px; font-size: 0.88rem; }
.btn-lg { padding: 16px 36px; font-size: 1.15rem; }

/* =============================================================================
   GLASS PANELS
   ============================================================================= */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-pink);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 30px;
}

/* =============================================================================
   ACT 1 & 2 SPECIFICS (Invitation, Verification, Door)
   ============================================================================= */
.envelope-teaser-card {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}

.teaser-whisper {
    font-size: clamp(0.98rem, 3.8vw, 1.25rem);
    font-style: italic;
    color: var(--champagne-gold);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.invitation-text-box {
    background: rgba(23, 15, 43, 0.6);
    padding: clamp(16px, 4vw, 24px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(233, 141, 186, 0.2);
    font-size: clamp(0.95rem, 3.6vw, 1.15rem);
    line-height: 1.65;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}

.greeting {
    font-size: clamp(1.15rem, 4.4vw, 1.55rem);
    color: var(--romantic-pink);
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    margin-bottom: 8px;
    max-width: 100%;
    box-sizing: border-box;
}

.sub-whisper {
    font-size: clamp(0.86rem, 3.2vw, 0.98rem);
    color: var(--soft-blush);
    margin-top: 10px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: break-word;
}

.verification-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.verification-res {
    font-size: 1.2rem;
    color: var(--soft-blush);
    max-width: 520px;
    margin: 20px auto 0;
    line-height: 1.5;
}

/* =============================================================================
   PUZZLE CARDS (Chapters 4, 8, 17)
   ============================================================================= */
.puzzle-card {
    max-width: 540px;
    margin: 20px auto;
    padding: 36px 30px;
}

.puzzle-icon { font-size: 2.5rem; margin-bottom: 12px; }
.puzzle-question {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    color: var(--soft-blush);
    margin-bottom: 8px;
    line-height: 1.4;
}

.input-glow-wrapper {
    display: flex;
    background: rgba(23, 15, 43, 0.85);
    border: 1.5px solid var(--border-pink);
    border-radius: 35px;
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.input-glow-wrapper:focus-within {
    border-color: var(--romantic-pink);
    box-shadow: 0 0 20px rgba(233, 141, 186, 0.4);
}

.puzzle-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: #FFF;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.puzzle-input::placeholder { color: rgba(255, 255, 255, 0.4); font-style: italic; }

.puzzle-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--romantic-pink), var(--deep-purple));
    color: #FFF;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28), background 0.3s;
    touch-action: manipulation;
    white-space: nowrap;
}

.puzzle-submit-btn.caught-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #FFF !important;
    font-weight: 700 !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.8) !important;
    transform: translate(0, 0) scale(1.02) !important;
}

.flying-btn {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    z-index: 25;
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, background 0.3s ease !important;
    will-change: transform;
    touch-action: manipulation;
}

.input-shake {
    animation: inputShake 0.45s ease-in-out !important;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.hints-accordion {
    border: 1px solid rgba(231, 190, 121, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(231, 190, 121, 0.08);
    overflow: hidden;
}

.hint-header {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--champagne-gold);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.hint-body {
    padding: 12px 16px;
    border-top: 1px dashed rgba(231, 190, 121, 0.3);
    font-size: 0.95rem;
    color: #FFF;
}

.hint-item { margin-bottom: 6px; line-height: 1.4; }

/* Vault Keys */
.vault-keys-display {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.vault-key-slot {
    font-size: 0.8rem;
    background: rgba(231, 190, 121, 0.15);
    border: 1px solid var(--border-gold);
    color: var(--champagne-gold);
    padding: 4px 10px;
    border-radius: 12px;
}

/* =============================================================================
   QUIZZES (Chapters 6 & 16)
   ============================================================================= */
/* =============================================================================
   ROMANTIC PLAYFUL QUIZ (Chapters 6 & 16 — One Question at a Time)
   ============================================================================= */
.quiz-container {
    max-width: 600px;
    width: 100%;
    margin: 16px auto;
    box-sizing: border-box;
}

.quiz-step-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.quiz-progress-bar-wrap {
    width: 100%;
    box-sizing: border-box;
}

.quiz-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.quiz-step-badge {
    color: var(--champagne-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.quiz-pct-badge {
    color: var(--romantic-pink);
    font-weight: 700;
}

.quiz-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(233, 141, 186, 0.2);
    box-sizing: border-box;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #E98DBA 0%, #E7BE79 100%);
    border-radius: 6px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(233, 141, 186, 0.6);
}

.quiz-step-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-pink);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-card);
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    animation: quizCardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.quiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.quiz-q-pill {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--champagne-gold);
    font-weight: 700;
    background: rgba(231, 190, 121, 0.15);
    border: 1px solid rgba(231, 190, 121, 0.3);
    padding: 4px 10px;
    border-radius: 12px;
}

.quiz-q-fun {
    font-size: 0.8rem;
    color: var(--soft-blush);
    font-style: italic;
}

.quiz-q-text {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 4.2vw, 1.55rem);
    color: var(--pure-white);
    line-height: 1.35;
    margin: 10px 0 16px;
    word-break: break-word;
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.quiz-step-opt-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    background: rgba(34, 22, 63, 0.75);
    border: 1.5px solid rgba(233, 141, 186, 0.25);
    border-radius: 14px;
    color: var(--pure-white);
    font-size: clamp(0.92rem, 3.4vw, 1.02rem);
    cursor: pointer;
    text-align: left;
    transition: all 0.22s ease;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.quiz-step-opt-btn:hover {
    border-color: var(--romantic-pink);
    background: rgba(233, 141, 186, 0.2);
    transform: translateX(3px);
}

.quiz-step-opt-btn.selected {
    border-color: #E98DBA !important;
    background: linear-gradient(135deg, rgba(233, 141, 186, 0.38) 0%, rgba(89, 54, 111, 0.7) 100%) !important;
    box-shadow: 0 0 16px rgba(233, 141, 186, 0.5) !important;
    color: #FFF !important;
    font-weight: 600;
}

.opt-bullet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(231, 190, 121, 0.2);
    border: 1px solid var(--border-gold);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--champagne-gold);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.quiz-step-opt-btn.selected .opt-bullet {
    background: var(--romantic-pink);
    border-color: #FFF;
    color: #FFF;
}

.opt-label {
    flex: 1;
    word-break: break-word;
    line-height: 1.35;
}

.opt-check {
    font-size: 1.15rem;
    flex-shrink: 0;
    animation: gentlePulse 1.2s infinite;
}

.quiz-step-feedback {
    background: rgba(231, 190, 121, 0.16);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 14px 16px;
    color: #FFFFFF;
    font-size: clamp(0.95rem, 3.6vw, 1.1rem);
    line-height: 1.45;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 14px;
}

.animate-pop {
    animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.quiz-step-action-wrap {
    margin-top: 14px;
    width: 100%;
}

.quiz-next-step-btn {
    width: 100% !important;
    min-height: 48px !important;
    font-size: clamp(0.95rem, 3.5vw, 1.05rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
}

.quiz-prev-link-wrap {
    margin-top: 10px;
    text-align: center;
}

.quiz-prev-btn {
    background: none;
    border: none;
    color: var(--soft-blush);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.75;
    padding: 6px 12px;
    transition: opacity 0.2s;
}

.quiz-prev-btn:hover {
    opacity: 1;
    color: #FFF;
}

/* =============================================================================
   MEMORIES & BLURRED MYSTERY (Chapters 7 & 8)
   ============================================================================= */
.polaroid-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    perspective: 1000px;
    margin: 20px 0;
}

.polaroid-card {
    background: #FFFFFF;
    color: #170F2B;
    padding: 14px 14px 20px;
    border-radius: 6px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 20px rgba(233,141,186,0.3);
    max-width: 320px;
    width: 100%;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.polaroid-card:hover { transform: translateY(-8px) scale(1.02); }

.polaroid-img-wrap {
    width: 100%;
    height: 250px;
    background: #000;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
}

.polaroid-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.polaroid-card:hover .polaroid-img-wrap img { transform: scale(1.05); }

.polaroid-caption {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    margin-top: 12px;
    font-weight: 600;
    text-align: center;
    color: #2D1B4E;
}

.polaroid-date {
    font-size: 0.8rem;
    color: #7B6888;
    text-align: center;
    margin-top: 4px;
}

.memory-like-btn {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(23, 15, 43, 0.7);
    color: var(--romantic-pink);
    border: none;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Blurred Mystery Photo */
.mystery-photo-box {
    max-width: 440px;
    margin: 20px auto;
}

.mystery-img-wrap {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.blurred-memory-img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: blur(18px);
    transition: filter 1s ease;
}

.blurred-memory-img.unblurred {
    filter: blur(0px);
}

.blur-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 15, 43, 0.4);
    color: #FFF;
    font-size: 0.95rem;
    font-weight: 600;
}

/* =============================================================================
   FLIRTING BREAK & BOUNCING HEART (Chapter 10)
   ============================================================================= */
.flirt-card {
    max-width: 520px;
    margin: 24px auto;
    text-align: center;
}

.speech-bubble {
    background: rgba(233, 141, 186, 0.18);
    border: 1.5px solid var(--romantic-pink);
    border-radius: 24px;
    padding: 24px 20px;
    font-family: var(--font-serif);
    font-size: 1.45rem;
    line-height: 1.6;
    color: #FFFFFF;
    box-shadow: 0 0 20px rgba(233, 141, 186, 0.3);
}

.flirt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* =============================================================================
   SECRET GARDEN & ROSES (Chapter 11)
   ============================================================================= */
.garden-flowers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.rose-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-pink);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.rose-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow-pink);
}

.rose-icon { font-size: 2.8rem; margin-bottom: 8px; }
.rose-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.rose-whisper { font-size: 0.9rem; color: var(--soft-blush); font-style: italic; }

/* =============================================================================
   FUTURE DREAMS & PROMISES (Chapters 12 & 13)
   ============================================================================= */
.future-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.future-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-pink);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    text-align: left;
}

.future-card:hover { transform: translateY(-6px); border-color: var(--romantic-pink); }

.future-card-img { width: 100%; height: 160px; object-fit: cover; }
.future-card-body { padding: 18px; }
.future-card-category { font-size: 0.75rem; text-transform: uppercase; color: var(--champagne-gold); }
.future-card-title { font-family: var(--font-serif); font-size: 1.35rem; margin: 4px 0 8px; }
.future-card-text { font-size: 0.9rem; color: rgba(255,255,255,0.75); line-height: 1.5; }
.future-card-note { font-size: 0.8rem; color: var(--romantic-pink); font-style: italic; margin-top: 10px; }

.promises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.promise-card {
    background: rgba(231, 190, 121, 0.12);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 24px 18px;
    text-align: center;
}

.promise-card-num { font-size: 0.8rem; color: var(--champagne-gold); text-transform: uppercase; }
.promise-card-title { font-family: var(--font-serif); font-size: 1.3rem; margin: 8px 0; }
.promise-card-text { font-size: 0.92rem; color: var(--soft-blush); line-height: 1.5; }

/* =============================================================================
   BIRTHDAY CAKE & CELEBRATION (Chapter 15)
   ============================================================================= */
.cake-interaction-box {
    max-width: 500px;
    margin: 20px auto;
    font-size: 1.25rem;
    color: var(--soft-blush);
}

/* =============================================================================
   PARCHMENT LETTER & VOICE (Chapter 19)
   ============================================================================= */
.finale-content { max-width: 780px; }

.parchment-letter {
    background: radial-gradient(circle at center, #FFFDF7 0%, #F5E8D3 100%);
    color: #241635;
    padding: 50px 44px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(231, 190, 121, 0.4);
    text-align: left;
    border: 1px solid #E2D0B5;
}

.letter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(89, 54, 111, 0.15);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.letter-date { font-size: 0.95rem; color: #6C5478; font-style: italic; }
.letter-salutation { font-family: var(--font-serif); font-size: 2.1rem; color: #401B58; margin-bottom: 20px; }
.letter-body { font-size: 1.35rem; line-height: 1.85; color: #2B163B; white-space: pre-line; min-height: 180px; }
.letter-closing { margin-top: 36px; border-top: 1px solid rgba(89, 54, 111, 0.15); padding-top: 24px; }
.letter-signature { font-size: 2.2rem; color: #B52A60; text-align: right; }

.voice-message-player {
    background: rgba(23, 15, 43, 0.08);
    border: 1px solid rgba(89, 54, 111, 0.2);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.voice-title { font-weight: 600; font-size: 0.95rem; color: #401B58; }

/* =============================================================================
   HUG CELEBRATION (Chapter 20)
   ============================================================================= */
.hug-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.replay-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* =============================================================================
   EASTER EGGS & FLOATING HEARTS
   ============================================================================= */
.easter-heart-btn {
    position: absolute;
    bottom: 12px; right: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.45;
    transition: all 0.3s;
    animation: gentlePulse 2.5s infinite ease-in-out;
}

.easter-heart-btn:hover { opacity: 1; transform: scale(1.3); }

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.click-heart {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 1.6rem;
    animation: floatHeart 1.2s ease-out forwards;
}

@keyframes floatHeart {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
    50% { opacity: 0.9; transform: translate(-50%, -100px) scale(1.3); }
    100% { opacity: 0; transform: translate(-50%, -160px) scale(0.9); }
}

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

.modal.active { display: flex; }
.modal-dialog { width: 100%; max-width: 520px; animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.modal-memory-dialog { max-width: 800px; }
.modal-content { padding: 32px 28px; position: relative; }
.modal-close {
    position: absolute;
    top: 16px; right: 20px;
    background: none; border: none;
    color: var(--soft-blush);
    font-size: 2rem; cursor: pointer;
}

.cute-popup-icon { font-size: 3.5rem; margin-bottom: 12px; }
.cute-popup-title { font-family: var(--font-serif); font-size: 1.8rem; color: var(--romantic-pink); margin-bottom: 8px; }
.cute-popup-message { font-size: 1.1rem; color: var(--soft-blush); margin-bottom: 16px; line-height: 1.4; }
.cute-hint-box { background: rgba(231, 190, 121, 0.15); border: 1px solid var(--border-gold); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px; }
.hint-tag { font-size: 0.8rem; font-weight: 700; color: var(--champagne-gold); text-transform: uppercase; margin-bottom: 4px; }

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* =============================================================================
   AUTO-REVEAL & RUNAWAY TEASING BUTTON
   ============================================================================= */
.auto-reveal-box {
    margin-top: 18px;
    animation: fadeIn 0.4s ease-out;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.reveal-content {
    background: rgba(34, 22, 63, 0.85);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.reveal-teaser {
    color: var(--romantic-pink);
    font-size: 1.05rem;
    font-weight: 600;
}

.reveal-explanation {
    color: var(--soft-blush);
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 8px 0;
}

.runaway-container {
    position: relative;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    margin-top: 12px;
}

.runaway-btn {
    position: relative;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28), background 0.3s;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(233, 141, 186, 0.4);
}

.runaway-btn.caught-btn {
    background: linear-gradient(135deg, #E7BE79 0%, #E98DBA 100%) !important;
    color: #170F2B !important;
    font-weight: 700 !important;
    animation: pulseGlow 1.2s infinite alternate !important;
    transform: none !important;
    box-shadow: 0 0 25px rgba(231, 190, 121, 0.8) !important;
}

.runaway-taunt {
    font-size: 0.9rem;
    color: var(--champagne-gold);
    min-height: 24px;
    margin-top: 6px;
    animation: fadeIn 0.3s ease;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 15px rgba(231, 190, 121, 0.5); }
    to { box-shadow: 0 0 30px rgba(233, 141, 186, 0.9); }
}

.mobile-chapter-badge {
    display: none;
}

/* =============================================================================
   MOBILE RESPONSIVENESS & TOUCH OPTIMIZATIONS (100% Mobile Optimized)
   ============================================================================= */
html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-text-size-adjust: 100% !important;
    box-sizing: border-box !important;
}

#portalApp, .chapters-container, .chapter-section, .chapter-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Base button and card word-wrapping on any viewport */
.btn, .quiz-step-opt-btn, .puzzle-submit-btn, .runaway-btn {
    box-sizing: border-box !important;
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

@media (max-width: 768px) {
    /* Header layout strictly confined to 100vw */
    .portal-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        height: 52px !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        gap: 6px !important;
        z-index: 100 !important;
    }

    .portal-brand {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
        min-width: 26px !important;
    }

    .portal-logo-icon {
        font-size: 1rem !important;
    }

    .portal-logo-text {
        display: none !important;
    }

    /* Birthday status pill hidden on mobile to reserve full header space for action controls */
    .birthday-pill {
        display: none !important;
    }

    /* Center chapter indicator badge */
    .chapter-nav-wrapper {
        flex: 1 1 auto !important;
        max-width: 90px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
    }

    .chapter-nav {
        display: none !important;
    }

    .mobile-chapter-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 3px 8px !important;
        background: rgba(231, 190, 121, 0.15) !important;
        border: 1px solid var(--border-gold) !important;
        border-radius: 20px !important;
        font-size: 0.72rem !important;
        color: var(--champagne-gold) !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
    }

    /* Header actions pinned permanently to right edge */
    .header-actions {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        margin-left: auto !important;
    }

    .icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .icon-btn i, .icon-btn svg {
        width: 15px !important;
        height: 15px !important;
        display: block !important;
        flex-shrink: 0 !important;
        stroke: currentColor !important;
    }

    .love-notes-badge {
        width: auto !important;
        min-width: 44px !important;
        height: 32px !important;
        border-radius: 16px !important;
        padding: 0 6px !important;
        font-size: 0.72rem !important;
        gap: 3px !important;
        display: inline-flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    #musicToggleBtn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0 !important;
    }

    #fullscreenBtn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0 !important;
    }

    #restartBtn {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0 !important;
    }

    /* Container padding to offset 52px fixed header */
    .chapters-container {
        padding: 60px 10px 30px !important;
        min-height: 100dvh !important;
        min-height: calc(100vh - 52px) !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .chapter-section {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .chapter-content {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Typography Responsive Scaling */
    .chapter-title {
        font-size: clamp(1.3rem, 5vw, 1.85rem) !important;
        line-height: 1.25 !important;
        margin-bottom: 6px !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .greeting-title {
        font-size: clamp(1.45rem, 5.8vw, 2.1rem) !important;
        line-height: 1.2 !important;
        word-break: break-word !important;
    }

    .chapter-lead {
        font-size: clamp(0.86rem, 3.3vw, 1rem) !important;
        line-height: 1.45 !important;
        margin-top: 4px !important;
        margin-bottom: 16px !important;
        word-break: break-word !important;
    }

    .act-badge {
        font-size: 0.68rem !important;
        padding: 4px 12px !important;
        margin-top: 4px !important;
        margin-bottom: 12px !important;
        max-width: 90% !important;
        white-space: normal !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    .glass-panel {
        padding: 16px 12px !important;
        border-radius: var(--radius-md) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .puzzle-card {
        padding: 16px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .puzzle-question {
        font-size: clamp(0.96rem, 3.7vw, 1.15rem) !important;
        line-height: 1.35 !important;
        word-break: break-word !important;
        margin-bottom: 8px !important;
    }

    /* Vertical stack for input and button on mobile to prevent squishing */
    .input-glow-wrapper {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        border-radius: 16px !important;
        padding: 8px !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .puzzle-input {
        width: 100% !important;
        text-align: center !important;
        height: 48px !important;
        font-size: 16px !important; /* Critical to prevent iOS auto-zoom */
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }

    .puzzle-submit-btn {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        justify-content: center !important;
        border-radius: 12px !important;
        font-size: 0.95rem !important;
        white-space: normal !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Standard mobile buttons with min-height: 48px for thumb comfort */
    .btn {
        min-height: 48px !important;
        font-size: 0.92rem !important;
        padding: 10px 14px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }

    .btn-lg {
        min-height: 50px !important;
        font-size: 0.98rem !important;
        padding: 12px 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Envelope Teaser & Hero Section (Ch 1) */
    .envelope-teaser-card {
        padding: 16px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .teaser-whisper {
        font-size: clamp(0.92rem, 3.5vw, 1.1rem) !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    .invitation-text-box {
        font-size: clamp(0.88rem, 3.4vw, 1.05rem) !important;
        padding: 14px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .greeting {
        font-size: clamp(1.1rem, 4.4vw, 1.4rem) !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 6px !important;
    }

    .sub-whisper {
        font-size: clamp(0.82rem, 3vw, 0.95rem) !important;
        line-height: 1.45 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    #acceptInvitationBtn {
        max-width: 100% !important;
        width: 100% !important;
        min-height: 48px !important;
        font-size: clamp(0.92rem, 3.5vw, 1.05rem) !important;
        padding: 12px 14px !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.3 !important;
    }

    /* Verification (Ch 2) */
    .verification-buttons {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .verification-buttons .btn {
        width: 100% !important;
        min-height: 48px !important;
    }

    /* Universe Quote (Ch 5) */
    .universe-quote-card {
        padding: 18px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .quote-text {
        font-size: clamp(1rem, 3.8vw, 1.35rem) !important;
    }

    .quote-subtext {
        font-size: clamp(0.88rem, 3.4vw, 1.1rem) !important;
    }

    /* Flirting Break (Ch 10) */
    .flirt-card {
        padding: 16px 10px !important;
        width: 100% !important;
    }

    .speech-bubble {
        font-size: clamp(1rem, 3.8vw, 1.25rem) !important;
        padding: 18px 14px !important;
        line-height: 1.45 !important;
    }

    .flirt-actions {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .flirt-actions .btn {
        width: 100% !important;
        min-height: 46px !important;
    }

    /* Polaroids (Ch 7) */
    .polaroid-gallery {
        padding: 6px 0;
        min-height: 330px;
    }

    .polaroid-card {
        max-width: 275px;
        margin: 0 auto;
        padding: 10px 10px 16px;
    }

    .polaroid-img-wrap {
        height: 200px;
    }

    /* Parchment Letter (Ch 19) */
    .parchment-letter {
        padding: 20px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .letter-salutation {
        font-size: clamp(1.15rem, 4.6vw, 1.55rem) !important;
        line-height: 1.3 !important;
    }

    .letter-body {
        font-size: clamp(0.92rem, 3.5vw, 1.05rem) !important;
        line-height: 1.65 !important;
    }

    .letter-signature {
        font-size: clamp(1.25rem, 4.8vw, 1.7rem) !important;
    }

    /* Grids */
    .future-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .garden-flowers-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .promises-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Hugs (Ch 20) */
    .hug-buttons-wrapper {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .hug-buttons-wrapper .btn {
        width: 100% !important;
        min-height: 48px !important;
    }

    .replay-tray {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    /* Modals */
    .modal-dialog {
        max-width: 95vw !important;
        margin: 8px auto !important;
        box-sizing: border-box !important;
    }

    .modal-content {
        padding: 20px 12px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-sizing: border-box !important;
    }

    /* Auto-Reveal & Runaway button container */
    .auto-reveal-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .reveal-content {
        padding: 14px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .runaway-container {
        min-height: 52px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .runaway-btn {
        max-width: 100% !important;
        white-space: normal !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 360px) {
    .portal-header {
        padding: 0 4px !important;
        gap: 2px !important;
    }

    .header-actions {
        gap: 3px !important;
    }

    .icon-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
    }

    .icon-btn i, .icon-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .love-notes-badge {
        min-width: 38px !important;
        height: 30px !important;
        font-size: 0.68rem !important;
        padding: 0 4px !important;
    }

    .mobile-chapter-badge {
        font-size: 0.68rem !important;
        padding: 2px 6px !important;
    }

    .chapters-container {
        padding: 56px 6px 20px !important;
    }

    .glass-panel {
        padding: 14px 8px !important;
    }

    .btn {
        padding: 8px 10px !important;
        font-size: 0.88rem !important;
    }

    .modal-content {
        padding: 16px 8px !important;
    }
}
