@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary-dark: #0f172a;
    --gold-accent: #ffd700;
    --gold-glow: #fff0a5;
    --gold-dark: #b8860b;
    
    /* Overlay colors over Mother Mary background */
    --prayer-box-bg: rgba(15, 23, 42, 0.92);
    
    /* Text Colors */
    --text-light: #ffffff;
    --text-muted: #e2e8f0;

    /* Bead Palette */
    --bead-gold-start: #ffe066;
    --bead-gold-end: #c59b27;
    --bead-blue-start: #38bdf8;
    --bead-blue-end: #0284c7;
    --bead-base: rgba(255, 255, 255, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: #090d16;
    color: var(--text-light);
    margin: 0;
    padding: 12px 6px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Outer Container - Fixed Bounds for Mobile & Laptop */
.container {
    max-width: 440px;
    width: 100%;
    height: 680px;
    max-height: calc(100dvh - 20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    
    background: 
        linear-gradient(rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.85)),
        url('Mother marry.jpg') center/cover no-repeat;
        
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 
                0 0 0 1px rgba(255, 215, 0, 0.3) inset;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Header */
.header-group {
    flex-shrink: 0;
    margin-bottom: 2px;
}

h1 { 
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", 'Cinzel', serif;
    color: #ffffff; 
    font-size: clamp(1.15rem, 4vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 2px 0; 
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.5);
}

.subtitle { 
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", 'Cinzel', serif;
    color: var(--gold-glow); 
    font-size: clamp(0.7rem, 2.6vw, 0.8rem);
    font-weight: 600; 
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Rosary SVG Diagram */
.rosary-svg-container {
    width: 100%;
    max-width: 220px;
    flex-shrink: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2px auto;
}

.rosary-svg {
    width: 100%;
    max-height: 240px;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.7));
}

.svg-bead {
    fill: var(--bead-base);
    stroke: #ffffff;
    stroke-width: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.svg-bead.completed {
    fill: url(#blueGradient);
    stroke: #38bdf8;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.svg-bead.active {
    fill: url(#goldGradient);
    stroke: #ffffff;
    stroke-width: 2px;
    filter: drop-shadow(0 0 14px rgba(255, 224, 102, 1));
}

.step-tracker {
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", 'Cinzel', serif;
    font-size: clamp(0.68rem, 2.2vw, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--gold-glow); 
    margin: 2px 0;
    text-transform: uppercase;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
}

.outer-intention-badge {
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", sans-serif;
    display: inline-block;
    font-size: clamp(0.65rem, 2.2vw, 0.75rem);
    font-weight: 600;
    color: var(--gold-glow);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 215, 0, 0.4);
    padding: 3px 10px;
    border-radius: 16px;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* Fixed Compact Prayer Card */
.prayer-card {
    position: relative;
    width: 100%;
    height: 125px;
    flex-shrink: 0;
    background: var(--prayer-box-bg);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 14px;
    padding: 10px 14px;
    margin: 4px 0 6px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Scrollbar for Prayer Card */
.prayer-card::-webkit-scrollbar {
    width: 5px;
}

.prayer-card::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

.prayer-card::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 10px;
}

.prayer-card::-webkit-scrollbar-thumb:hover {
    background: var(--gold-accent);
}

.prayer-card-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: auto 0;
}

.prayer-title { 
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", 'Cinzel', serif;
    color: var(--gold-glow); 
    font-size: clamp(0.75rem, 2.4vw, 0.85rem); 
    font-weight: 600; 
    margin-bottom: 4px; 
    letter-spacing: 0.8px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.8);
    text-align: center;
    text-transform: uppercase;
}

.prayer-text { 
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", sans-serif;
    line-height: 1.45; 
    color: #ffffff; 
    font-size: clamp(0.72rem, 2.3vw, 0.8rem); 
    font-weight: 500;   
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
    text-align: center;
}

/* Grid Action Buttons */
.nav-buttons { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 6px; 
    width: 100%;
    flex-shrink: 0;
}

.btn {
    font-family: FangSong, "仿宋", STFangsong, "华文仿宋", sans-serif;
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-light);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px 10px;
    border-radius: 14px;
    font-size: clamp(0.7rem, 2.2vw, 0.78rem);
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: all 0.25s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    color: var(--gold-glow);
    border-color: var(--gold-dark);
}

.btn-secondary {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn.disabled { 
    background: rgba(15, 23, 42, 0.3);
    color: rgba(255, 255, 255, 0.25);
    border-color: transparent;
    box-shadow: none;
    cursor: not-allowed; 
}

/* Laptop Display Optimization */
@media (min-width: 768px) {
    .container {
        max-width: 460px;
        height: 700px;
        padding: 18px 20px;
    }

    .prayer-card {
        height: 135px;
    }

    .btn:hover:not(.disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
        border-color: var(--gold-accent);
    }
}