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

@font-face {
    font-family: 'Filson Soft';
    src: url('filson-soft.otf') format('opentype');
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Filson Soft', Arial, sans-serif;
    background: white;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.app-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    background: white;
}

/* Main Screen */
.main-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    overflow: hidden;
}

/* Background Image */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url('5c506c7f37d31def4e71994bd5899db1d40be3f2.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Center Logo */
.center-logo {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.logo-image {
    max-width: 50%;
    height: auto;
}

/* Content Section */
.content-section {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: #F0E5D6;
    box-shadow: 4px 4px 100px 25px rgba(0, 0, 0, 0.25);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3vh 0 max(3vh, env(safe-area-inset-bottom));
    overflow: hidden;
}

/* Text Content */
.text-content {
    text-align: center;
    margin-bottom: 0;
    max-width: min(92%, 1200px);
    overflow: hidden;
    margin-top: 1vw;
}

.text-content h1 {
    font-family: 'Filson Soft', Arial, sans-serif;
    font-size: clamp(12px, 3.2vw, 36px);
    font-weight: 400;
    line-height: 1.2;
    color: #00649f;
    padding: 0 40px;
}

.text-content p {
    font-family: 'Filson Soft', Arial, sans-serif;
    font-weight: 400;
    color: #00649f;
    margin: 2vw;
    white-space: nowrap;
}

/* Button Container */
.button-container {
    display: flex;
    gap: clamp(16px, 6vw, 80px);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1vw;
    position: relative;
    z-index: 11;
}

/* Video Buttons */
.video-btn {
    background: #00649f;
    border: none;
    border-radius: 755px;
    padding: clamp(12px, 2.2vh, 20px) clamp(24px, 4.2vh, 40px);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-btn:hover {
    background: #005085;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 100, 159, 0.4);
}

.video-btn:active {
    transform: translateY(0);
}

.btn-text {
    font-family: 'Filson Soft', Arial, sans-serif;
    font-size: clamp(16px, 2.6vw, 24px);
    font-weight: 400;
    color: #f0e5d6;
    white-space: nowrap;
}

/* Specific Button Styles */
.meditation-btn {
    min-width: clamp(180px, 30vw, 266px);
}

.affirmations-btn {
    min-width: clamp(160px, 24vw, 188px);
}

/* Footer Section */
.footer-section {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: #00649f;
    z-index: 3;
    overflow: hidden;
}

.footer-decoration {
    position: absolute;
    right: max(-2vw, -20px);
    bottom: max(-4vw, -40px);
    width: min(22vw, 220px);
    height: min(18vw, 180px);
    background-image: url('c64073e3f42cdceb800fbd46a89a292b4eb026ab.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Status Indicator */
.status {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.loading-status, .ready-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Filson Soft', Arial, sans-serif;
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: opacity 0.5s ease-out;
}

.ready-status.fade-out {
    opacity: 0;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 100, 159, 0.3);
    border-top: 2px solid #00649f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.checkmark {
    font-size: 16px;
    color: #00649f;
}

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

/* Video Player */
.video-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow: hidden;
}

#videoElement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 1200px);
    height: min(80dvh, 800px);
    border-radius: 10px;
    background: black;
    object-fit: contain;
}

.back-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    background: #00649f;
    border: none;
    border-radius: 755px;
    padding: 10px 20px;
    color: #f0e5d6;
    font-family: 'Filson Soft', Arial, sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background: #005085;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 100, 159, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .center-logo {
        top: 18%;
    }
    
    .logo-image {
        max-width: 300px;
    }
    
    .content-section {
        height: 46%;
        padding: 16px 0 max(16px, env(safe-area-inset-bottom));
    }
    
    #videoElement {
        width: 96vw;
        height: 75dvh;
        max-width: none;
        max-height: none;
    }
    
    .text-content h1 {
        font-size: inherit;
        line-height: inherit;
        padding: 0 30px;
    }
    
    .text-content p {
        font-size: inherit;
        line-height: inherit;
        white-space: nowrap;
    }
    
    .button-container {
        flex-direction: column;
        gap: 16px;
        margin-top: 5vh;
    }
    
    .video-btn {
        min-width: 200px;
        padding: 12px 24px;
    }
    
    .btn-text {
        font-size: 18px;
    }
    
    .footer-decoration {
        width: 150px;
        height: 120px;
        bottom: 0;
    }
    
    .status {
        top: 10px;
        right: 10px;
    }
    
    .loading-status, .ready-status {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        max-width: 250px;
    }
    
    .text-content h1 {
        font-size: inherit;
        line-height: inherit;
    }
    
    .text-content p {
        font-size: inherit;
        line-height: inherit;
        white-space: nowrap;
    }
    
    .video-btn {
        min-width: 180px;
        padding: 10px 22px;
    }
    
    .btn-text {
        font-size: 18px;
    }
    
    .footer-section {
        height: 90px;
    }
    
    .footer-decoration {
        width: 120px;
        height: 90px;
        bottom: 0;
    }
}

/* Landscape adjustments: give more room to buttons and shrink logo area */
@media (orientation: landscape) and (max-height: 480px) {
    .center-logo {
        top: 14%;
        transform: translate(-50%, -50%);
    }
    .logo-image {
        max-width: 200px;
    }
    .content-section {
        height: 60%;
        padding-top: 10px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    .button-container {
        gap: 12px;
        margin-bottom: max(8px, env(safe-area-inset-bottom));
    }
    .video-btn {
        min-height: 40px;
        padding: 10px 18px;
    }
    .btn-text {
        font-size: clamp(14px, 2.4vw, 18px);
    }
    .footer-section {
        display: none;
    }
}

/* Height-constrained devices: shrink bottom panel and typography to avoid overflow */
@media (max-height: 640px) {
    .content-section {
        height: 50%;
        padding: 12px 0 10px;
    }
    .text-content h1 {
        padding: 0 24px;
    }
    .button-container {
        gap: 12px;
    }
    .video-btn {
        min-height: 44px;
    }
    .footer-section {
        display: none;
    }
}