:root {
    --jade: #00A86B;
    --blue: #2196F3;
    --black: #121212;
    --white: #FFFFFF;
    --bg-gradient: linear-gradient(180deg, #004d40 0%, #002f6c 100%);
}

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

body {
    margin: 0; padding: 0;
    font-family: 'Helvetica Neue', Roboto, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--white);
    font-size: 16pt;
    height: 100vh;
    /* Removed overflow: hidden from body to allow internal section scrolling */
    text-align: center;
}

/* --- Screen Management --- */
section {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    position: absolute;
    top: 0; left: 0;
    /* FIX: Allow sections to scroll internally if content is too tall */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

section.active-screen { display: flex; }

/* --- Typography --- */
h1 { font-size: 24pt; margin: 10px 0; font-weight: 300; }
.tagline { font-style: italic; opacity: 0.9; }
.callout-text { 
    font-size: 30pt;
    font-weight: bold; 
    margin: 15px 0;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    min-height: 1.2em;
}
.big-number { font-size: 80pt; }

/* --- Images --- */
.logo { width: 100px; height: 100px; border-radius: 12px; }
.logo-small { width: 40px; height: 40px; vertical-align: middle; margin-right: 10px; border-radius: 5px; }

/* --- Layout Components --- */
.header, .footer { flex: 0 0 auto; }
.meditation-area { 
    flex: 1 0 auto; /* Allow to grow but also shrink if needed */
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    padding: 20px 0;
}

/* 1:1 Aspect Ratio Image Container */
.image-container {
    width: 60vw;
    max-width: 300px;
    max-height: 300px;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
}
#direction-image { width: 100%; height: 100%; object-fit: contain; }

/* --- Controls --- */
.controls-area { width: 100%; padding-bottom: 20px; flex: 0 0 auto; }

.btn-large {
    background: var(--white);
    color: var(--black);
    border: none;
    border-radius: 50px;
    padding: 15px 0;
    width: 100%;
    font-size: 18pt;
    font-weight: bold;
    margin: 10px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.btn-danger { background: #ff5252; color: white; }
.btn-secondary {
    background: rgba(255,255,255,0.2);
    border: 1px solid var(--white);
    color: var(--white);
    padding: 10px;
    border-radius: 10px;
    font-size: 14pt;
    margin: 5px;
    flex: 1;
}

.secondary-controls { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.count-buttons { display: flex; gap: 10px; }

/* --- Video Specifics (FIXED) --- */
#video-screen {
    padding: 0; /* Remove padding for full width video area */
    justify-content: center; /* Center content vertically */
}

.video-wrapper {
    flex: 1; /* Take available space */
    display: flex; 
    align-items: center; 
    justify-content: center; /* Ensure horizontal centering */
    width: 100%; 
    background: transparent; /* Remove black bg to show gradient */
    padding-top: 20px;
}

video {
    /* Constraint height so buttons are likely visible without scrolling */
    max-height: 85vh; 
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-radius: 8px;
}

.video-ui {
    padding: 20px; /* Add padding back for buttons */
    width: 100%;
    flex-shrink: 0; /* Ensure buttons don't get crushed */
}

/* --- Stats & Privacy --- */
.stats-bar { font-size: 14pt; background: rgba(0,0,0,0.3); padding: 8px; border-radius: 20px; display: inline-block; }
.privacy { font-size: 10pt; opacity: 0.7; padding: 20px; }
.goal-text { font-size: 18pt; color: var(--jade); font-weight: bold; }

/* --- Landscape Adjustment --- */
@media (orientation: landscape) and (max-height: 600px) {
    .image-container { width: 25vh; max-height: 25vh; }
    .callout-text { font-size: 20pt; margin: 5px 0; }
    .controls-area { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .btn-large { width: 45%; margin: 5px; padding: 10px 0; font-size: 16pt;}
    .secondary-controls { width: 100%; flex-direction: row; }
    video { max-height: 70vh; }
}