:root {
    --primary: #5BA4C9;
    --primary-dark: #4A90B8;
    --primary-light: #7EC4E0;
    --bg-gradient-start: #a8d8ea;
    --bg-gradient-end: #e8f4f8;
    --bg-white: #ffffff;
    --text-dark: #2C3E50;
    --text-light: #ffffff;
    --text-muted: #6B7B8C;
    --bubble-bg: #7BA4B8;
    --bubble-text: #ffffff;
    --btn-pink: #E891A8;
    --btn-blue: #7EC4E0;
    --btn-green: #90D4A0;
    --btn-yellow: #F0D878;
    --btn-grey: #B8C4CC;
    --header-bg: #5BA4C9;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --radius-full: 50%;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: 2rem;
}

.loading-logo {
    width: 200px;
    height: 200px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 4px solid white;
}

.loading-content h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.loading-bar {
    width: 200px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 3px;
    margin: 1rem auto;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: var(--primary);
    border-radius: 3px;
    animation: loadProgress 2s ease forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-content p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* App Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.header-btn:active {
    background: rgba(255,255,255,0.2);
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* Screens */
#app {
    padding-top: 56px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

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

.screen-content {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.screen-title {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.screen-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
}

/* Screen Header (for inner pages) */
.screen-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.screen-header h2 {
    font-size: 1.25rem;
    color: var(--text-dark);
    flex: 1;
    text-align: center;
    margin-right: 3rem;
}

.back-btn {
    background: rgba(255,255,255,0.5);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
}

/* Character Carousel */
.character-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.6);
    border: none;
    font-size: 1.2rem;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.carousel-arrow:active {
    transform: scale(0.95);
}

/* Character Select Grid */
.character-select-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    padding: 0 0.5rem;
}

.character-grid-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.character-grid-item:active {
    transform: scale(0.95);
}

.character-grid-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.character-grid-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

@media (min-width: 400px) {
    .character-select-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
    
    .character-grid-item img {
        height: 100px;
    }
}

@media (min-width: 600px) {
    .character-select-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.character-showcase {
    position: relative;
    width: 200px;
    height: 200px;
}

.character-showcase.small {
    width: 150px;
    height: 150px;
    margin-bottom: 1rem;
}

.character-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    background: white;
}

.character-sparkle {
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 2rem;
    animation: sparkle 2s ease infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 0.8; }
}

.character-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.character-info h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.character-info p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Speech Bubble */
.speech-bubble {
    background: var(--bubble-bg);
    color: var(--bubble-text);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    position: relative;
    margin: 0 1rem 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--bubble-bg);
}

.speech-bubble p {
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: center;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Menu Buttons */
.menu-buttons {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 1rem;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    text-align: left;
}

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

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    flex: 1;
}

.btn-pink { background: var(--btn-pink); }
.btn-blue { background: var(--btn-blue); color: var(--text-dark); }
.btn-green { background: var(--btn-green); color: var(--text-dark); }
.btn-yellow { background: var(--btn-yellow); color: var(--text-dark); }
.btn-grey { background: var(--btn-grey); color: var(--text-dark); }

/* Story Grid */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
    padding: 0 0.5rem;
}

.story-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.story-card:active {
    transform: scale(0.98);
}

.story-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.story-card-info {
    padding: 0.75rem;
}

.story-card-info h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.story-card-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.testament-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.testament-badge.old {
    background: #d4a574;
    color: #5c3d1e;
}

.testament-badge.new {
    background: #74b9d4;
    color: #1e3a5c;
}

/* Story Player */
/* Story Narrator Bar */
.story-narrator-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--primary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: 50;
}

.narrator-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.narrator-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: transform 0.3s;
}

.narrator-avatar.speaking {
    animation: storyLadyTalk 1s ease infinite;
    border-color: var(--success);
}

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

.narrator-text {
    display: flex;
    flex-direction: column;
}

.narrator-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.narrator-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.narrator-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.narrator-play-btn:active {
    transform: scale(0.95);
}

.narrator-play-btn.playing {
    background: var(--error);
}

/* Story Player adjustments */
.story-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 100px; /* Space for narrator bar */
}

.story-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.story-header img {
    width: 100%;
    max-width: 400px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.story-header h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.verse-ref {
    color: var(--text-muted);
    font-style: italic;
}

.scene-content {
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.scene-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.scene-question {
    background: var(--bg-gradient-start);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.scene-question p {
    margin-bottom: 0.75rem;
}

.show-answer-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
}

.answer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.3);
    display: none;
}

.answer.show {
    display: block;
}

.scene-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.scene-navigation button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
}

.story-progress {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    width: 100%;
    padding: 0 0.5rem;
}

.games-grid a.game-card,
.games-grid a.game-card:hover,
.games-grid a.game-card:active,
.games-grid a.game-card:visited {
    text-decoration: none !important;
    color: inherit;
}

.games-grid a.game-card h3,
.games-grid a.game-card p {
    text-decoration: none !important;
    border-bottom: none !important;
}

.game-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.game-card:active {
    transform: scale(0.95);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.game-card h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.game-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Memory Match Game */
#game-memory .game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255,255,255,0.3);
}

#game-memory .game-header h3 {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
}

#memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    flex: 1;
}

.memory-card {
    aspect-ratio: 1;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.3s, background 0.3s;
    border: none;
    width: 100%;
    height: 100%;
}

.memory-card.flipped {
    background: var(--primary-light);
    transform: rotateY(180deg);
}

.memory-card.matched {
    background: var(--btn-green);
    opacity: 0.7;
}

/* Memory Verses */
.verse-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    padding: 0 0.5rem;
}

.verse-week {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.verse-week-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 0.25rem;
}

.verse-item {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.verse-item:active {
    transform: scale(0.98);
}

.verse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.verse-item h4 {
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.verse-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 1rem;
}

.verse-badge.old {
    background: #d4a574;
    color: #5c3d1e;
}

.verse-badge.new {
    background: #74b9d4;
    color: #1e3a5c;
}

.verse-item p {
    color: var(--text-dark);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Talk to Me Screen */
.talk-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
}

.talk-character-area {
    text-align: center;
    margin-bottom: 1rem;
}

.talk-character-img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow);
}

.talk-character-img.bounce {
    animation: bounce 2s ease infinite;
}

.talk-character-img.talking {
    animation: talking 0.5s ease infinite;
}

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

.talk-character-name {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.voice-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 0.5rem;
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    background: linear-gradient(135deg, #27ae60, #229954);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(39, 174, 96, 0.7); }
}

.voice-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.voice-label {
    font-size: 0.65rem;
    color: white;
    font-weight: 600;
    margin-top: 0.1rem;
}

.voice-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Chat Screen (updated) */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
}

.chat-bubble {
    background: white;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    max-width: 80%;
}

.character-message .chat-bubble {
    background: var(--bubble-bg);
    color: white;
}

.chat-bubble p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
}

#chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: white;
    box-shadow: var(--shadow);
}

.btn-send {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

/* Parent Dashboard */
.pin-entry {
    text-align: center;
    padding: 2rem 1rem;
}

.pin-label {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

#pin-input {
    width: 200px;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    background: white;
}

.dashboard-content {
    padding: 1rem;
}

.dashboard-section {
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.dashboard-section h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

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

/* Footer */
.app-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: rgba(255,255,255,0.3);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 380px) {
    .character-showcase {
        width: 160px;
        height: 160px;
    }
    
    .screen-title {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 600px) {
    .screen-content {
        padding: 2rem;
    }
    
    .story-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 2s ease infinite;
}

/* Paywall */
#paywall {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.paywall-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    max-width: 350px;
    width: 100%;
}

.paywall-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.plans {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.plan-btn {
    background: var(--bg-gradient-start);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    text-align: center;
}

.plan-btn.selected {
    background: var(--primary);
    color: white;
}

.plan-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
}

.plan-price {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ===== STORY PLAYER v2 ===== */
.story-player-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    padding-bottom: 100px;
}

.story-lady-hero {
    text-align: center;
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.story-lady-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
    transition: transform 0.3s;
}

.story-lady-img.speaking {
    animation: storyLadyTalk 1s ease infinite;
    border-color: var(--success);
}

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

.story-text-container {
    width: 100%;
    max-width: 500px;
    background: rgba(255,255,255,0.8);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.story-text-container h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.story-text-container p {
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-dark);
}

.story-question {
    background: var(--bg-gradient-start);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin: 1rem 0;
}

.story-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid var(--primary);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: 50;
}

.ctrl-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.ctrl-btn:active {
    transform: scale(0.95);
}

.stop-btn {
    background: #e74c3c;
    color: white;
}

.play-btn {
    background: var(--primary);
    color: white;
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
}

.pause-btn {
    background: #f39c12;
    color: white;
}

/* ===== NEW STORY PLAYER - Audio Only ===== */
#story-player {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.story-player-overlay {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Back Button */
.story-back-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Story Lady Stage */
.story-lady-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1rem;
    padding-top: 4rem;
}

.story-lady-full {
    width: 85vw;
    max-width: 400px;
    height: 70vh;
    max-height: 500px;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 2rem;
    border: 4px solid rgba(255,255,255,0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.5s ease;
    z-index: 2;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.story-lady-full.speaking {
    animation: storyLadyBreathe 2s ease infinite;
    border-color: #ffd700;
    box-shadow: 0 20px 60px rgba(255,215,0,0.3);
}

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

.story-lady-glow {
    position: absolute;
    width: 70vw;
    max-width: 350px;
    height: 45vh;
    max-height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,215,0,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 1;
}

.story-lady-glow.active {
    opacity: 1;
    animation: glowPulse 2s ease infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.03); opacity: 0.3; }
}

/* Play Button */
.story-play-btn {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(102,126,234,0.5);
    z-index: 10;
}

.story-play-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.story-play-btn.playing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 30px rgba(245,87,108,0.5);
}

/* ===== MEMORY VERSE PLAYER ===== */
#memory-verses {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.verse-week-nav {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    backdrop-filter: blur(10px);
}

.week-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.3);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#verse-week-label {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    min-width: 80px;
    text-align: center;
}

.verse-display {
    text-align: center;
    padding: 0 1.5rem;
    padding-bottom: 100px;
    z-index: 10;
    max-width: 400px;
    margin: 0 auto;
}

.verse-reference {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.verse-text {
    color: white;
    font-size: 1rem;
    line-height: 1.5;
    font-style: italic;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.verse-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    z-index: 10;
    padding: 0.5rem 0;
}

.verse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.verse-dot.active {
    background: #ffd700;
    transform: scale(1.3);
}

/* ===== FRUIT SORTER GAME ===== */
.fruit-game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 2rem;
}

.fruit-baskets {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.basket {
    width: 140px;
    height: 140px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 4px solid white;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
}

.basket:active {
    transform: scale(0.95);
}

.basket.correct {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    animation: correctBounce 0.5s ease;
}

.basket.wrong {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: shake 0.5s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.basket-label {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
}

@media (max-width: 400px) {
    .fruit-baskets {
        gap: 1rem;
    }
    .basket {
        width: 120px;
        height: 120px;
    }
    .basket-label {
        font-size: 0.8rem;
    }
    .current-fruit {
        font-size: 4rem;
    }
}

.fruit-item-area {
    text-align: center;
}

.current-fruit {
    font-size: 6rem;
    margin-bottom: 1rem;
    animation: fruitAppear 0.3s ease;
}

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

.fruit-question {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 600;
}

/* ===== ARMOUR OF GOD BUBBLE POP ===== */
.bubble-game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 50%, #98FB98 100%);
    min-height: 300px;
}

.bubble-target-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.9);
    padding: 0.75rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bubble-target {
    font-size: 2rem;
    margin-left: 0.5rem;
}

.bubble-container {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.2) 20%, rgba(135,206,235,0.6) 60%, rgba(70,130,180,0.8) 100%);
    border: 2px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), inset 0 -5px 10px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    user-select: none;
    z-index: 5;
}

.bubble:active {
    transform: scale(0.9);
}

.bubble.popped {
    animation: popBubble 0.3s ease forwards;
}

@keyframes popBubble {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.bubble.wrong {
    animation: shakeBubble 0.3s ease;
    background: radial-gradient(circle at 30% 30%, rgba(255,200,200,0.8), rgba(255,100,100,0.6) 60%, rgba(200,50,50,0.8) 100%);
}

@keyframes shakeBubble {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.bubble.correct-pop {
    animation: correctPop 0.3s ease forwards;
    background: radial-gradient(circle at 30% 30%, rgba(200,255,200,0.8), rgba(100,255,100,0.6) 60%, rgba(50,200,50,0.8) 100%);
}

@keyframes correctPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(0); opacity: 0; }
}

/* Game Screens - Flex Layout (only when active) */
#game-memory.active,
#game-fruit.active,
#game-bubble.active {
    display: flex;
    flex-direction: column;
}
