[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
:root {
    --gold: #f2c96b; --gold2: #ffe3a3; --ink: #f6eedc; --muted: #c9bda3;
    --panel: rgba(18, 14, 30, 0.86); --line: rgba(242, 201, 107, 0.35); --sky: #8fd3ff;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0a18; color: var(--ink); }
body { font-family: 'Lora', Georgia, serif; font-size: 17px; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.screen { position: fixed; inset: 0; z-index: 20; display: flex; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }   /* the only scroller: the browser's own scrollbar at the window edge */
.screen.dim { background: rgba(5, 3, 12, 0.55); }
.card { width: min(560px, 100%); margin: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px;
    box-shadow: 0 0 50px rgba(242, 201, 107, 0.15), 0 20px 60px rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.card.wide { width: min(900px, 100%); }
.card.hero { text-align: center; }
h1, h2, h3 { font-family: 'Cinzel', Georgia, serif; margin: 0; }
h1 { font-size: clamp(2.2em, 8vw, 3.6em); color: var(--gold2); text-shadow: 0 0 24px rgba(255, 210, 120, 0.6); }
h2 { font-size: 1.6em; color: var(--gold2); margin-bottom: 8px; }
h3 { font-size: 0.95em; color: var(--gold); letter-spacing: 0.08em; margin: 16px 0 8px; }
.eyebrow { font-family: 'Cinzel', serif; font-size: 0.78em; letter-spacing: 0.22em; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; }
.lede { font-size: 1.1em; line-height: 1.5; color: var(--muted); }
.small { font-size: 0.85em; color: var(--muted); }
.menu { display: flex; flex-direction: column; gap: 10px; margin: 18px auto 8px; max-width: 320px; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { display: inline-block; text-align: center; text-decoration: none; padding: 11px 20px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink); font-family: 'Cinzel', serif; font-weight: 600; letter-spacing: 0.04em; }
.btn:hover { border-color: var(--gold); background: rgba(242, 201, 107, 0.14); }
.btn.primary { background: linear-gradient(180deg, #e8b54e, #b47f1e); color: #241604; border-color: #ffd98a; }
.btn.primary:hover { background: linear-gradient(180deg, #f3c460, #c48c25); }
.btn.ghost { background: transparent; }
.small-btn { padding: 7px 14px; font-size: 0.85em; }
.story-text { line-height: 1.6; font-size: 1.05em; }
.key-verse { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: rgba(242, 201, 107, 0.08); font-style: italic; line-height: 1.5; }
.key-verse cite { display: block; margin-top: 6px; font-style: normal; font-family: 'Cinzel', serif; font-size: 0.8em; color: var(--gold); }

/* book map */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.book { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: var(--ink); font-family: 'Cinzel', serif; font-size: 0.78em; text-align: center; }
.book .bi { font-size: 1.8em; line-height: 1; }
.book.open { border-color: var(--gold); background: linear-gradient(160deg, rgba(242, 201, 107, 0.2), rgba(255, 255, 255, 0.04)); box-shadow: 0 0 16px rgba(242, 201, 107, 0.3); }
.book.open:hover { transform: translateY(-2px); }
.book.locked { opacity: 0.45; cursor: default; }
.book .soon { font-family: 'Lora', serif; font-size: 0.85em; color: var(--muted); }
.book .done-badge { position: absolute; top: 4px; right: 6px; color: #7be38a; }

/* stories in a book */
.stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.story { display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.story:hover { border-color: var(--gold); background: rgba(242, 201, 107, 0.12); }
.story .si { font-size: 2em; width: 48px; text-align: center; }
.story b { display: block; font-family: 'Cinzel', serif; color: var(--gold2); }
.story small { color: var(--muted); }
.story.done { border-color: rgba(123, 227, 138, 0.6); }
.story.done b::after { content: '  ✓'; color: #7be38a; }

/* memory verses */
.story.memory { width: 100%; margin-top: 12px; border-color: #f2c96b; background: linear-gradient(160deg, rgba(242, 201, 107, 0.22), rgba(255, 255, 255, 0.04)); }
.mem-theme { line-height: 1.5; margin: 8px 0; }
.mem-jesus { margin: 10px 0 14px; padding: 12px 16px; border-left: 3px solid #ffe08a; background: rgba(255, 220, 130, 0.12); border-radius: 0 10px 10px 0; line-height: 1.5; }
.mem-jesus-head { font-family: 'Cinzel', serif; color: var(--gold2); font-size: 0.85em; letter-spacing: 0.08em; margin-bottom: 4px; }
.mem-verse { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; margin: 8px 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.mem-verse.learned { border-color: rgba(123, 227, 138, 0.6); }
.mem-verse q { display: block; font-style: italic; line-height: 1.45; }
.mem-verse cite { display: block; margin-top: 4px; font-style: normal; font-family: 'Cinzel', serif; font-size: 0.8em; color: var(--gold); }
.mem-verse .mem-btns { display: flex; gap: 6px; flex-shrink: 0; }
.prac-text { font-size: 1.25em; line-height: 1.7; margin: 14px 0; min-height: 3em; }
.prac-text .blank { display: inline-block; min-width: 3.5em; border-bottom: 2px solid var(--gold); color: transparent; }
.prac-text .filled { color: #b8f5c2; font-weight: 600; }
.prac-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 2.5em; }
.chip { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--gold); background: rgba(242, 201, 107, 0.12); color: var(--ink); font-family: 'Lora', serif; font-size: 1em; }
.chip:hover { background: rgba(242, 201, 107, 0.25); }
.chip.wrong { animation: shake 0.35s; border-color: #ff8a7a; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.prac-done { text-align: center; font-size: 1.3em; color: var(--gold2); }

/* HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(820px, calc(100% - 240px)); text-align: center; padding: 10px 16px; border-radius: 12px; background: rgba(10, 6, 20, 0.62); border: 1px solid rgba(242, 201, 107, 0.3); }
.step-caption { font-size: 1em; line-height: 1.4; }
.step-verse { margin-top: 4px; font-style: italic; color: var(--gold2); font-size: 0.95em; }
.step-verse.divine { color: #fff3c4; text-shadow: 0 0 10px rgba(255, 214, 120, 0.95), 0 0 22px rgba(255, 200, 90, 0.55); }
.key-verse.divine { border-left-color: #ffe08a; background: rgba(255, 220, 130, 0.16); box-shadow: 0 0 24px rgba(255, 210, 110, 0.25); }
.step-verse cite { font-style: normal; font-family: 'Cinzel', serif; font-size: 0.75em; color: var(--gold); margin-left: 6px; }
.top-right { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.progress-dots { font-size: 0.8em; letter-spacing: 3px; color: var(--gold); }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 6, 20, 0.6); color: var(--ink); font-size: 1.1em; }
.hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(10, 6, 20, 0.7); border: 1px solid var(--gold); color: var(--gold2); font-family: 'Cinzel', serif; font-size: 0.9em; letter-spacing: 0.03em; text-align: center; max-width: calc(100% - 32px); animation: hintPulse 2.4s ease-in-out infinite; }
.hint.done { border-color: #7be38a; color: #b8f5c2; }
@keyframes hintPulse { 50% { box-shadow: 0 0 18px rgba(242, 201, 107, 0.45); } }

.credit { position: fixed; bottom: 4px; left: 8px; z-index: 5; font-size: 0.7em; color: rgba(246, 238, 220, 0.4); pointer-events: none; }

@media (max-width: 640px) {
    .banner { width: calc(100% - 112px); left: 8px; transform: none; padding: 8px 10px; }
    .hint { font-size: 0.74em; border-radius: 14px; bottom: 10px; padding: 8px 12px; max-width: calc(100% - 24px); }
    .step-caption { font-size: 0.85em; } .step-verse { font-size: 0.8em; }
    .top-right { top: 8px; right: 6px; } .progress-dots { display: none; }
    .card { padding: 18px; }
    .mem-verse { flex-direction: column; align-items: stretch; }
    .mem-verse .mem-btns { justify-content: flex-end; }
}

/* Verse of the Day rainbow link */
.rainbow-card { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; padding: 12px 16px; border-radius: 14px; text-decoration: none; color: #fff6d8; position: relative; background: linear-gradient(#2a1e3a, #2a1e3a) padding-box, linear-gradient(90deg, #ff5a5a, #ffb04a, #ffe14a, #5ad05a, #4aa8ff, #9a6aff) border-box; border: 3px solid transparent; transition: transform 0.15s; }
.rainbow-card:hover, .rainbow-card:focus-visible { transform: translateY(-2px); }
.rainbow-card .rb-icon { font-size: 2rem; line-height: 1; }
.rainbow-card .rb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rainbow-card .rb-text small { opacity: 0.8; font-size: 0.85rem; }
.rainbow-card .rb-new { background: #ffd24a; color: #3a2410; font-weight: 700; font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; animation: rbpulse 1.4s ease-in-out infinite; white-space: nowrap; }
.rainbow-card.slim { margin: 0; padding: 8px 14px; }
@keyframes rbpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .rainbow-card .rb-new { animation: none; } }

/* The celebration: the canvas shows the picture, the card sits low so the picture stays visible */
.screen.celeb { background: none; align-items: flex-end; }
.screen.celeb .card.celeb-card { margin: auto auto 3vh; background: rgba(14, 10, 26, 0.82); text-align: center; padding: 18px 24px 20px; }
.celeb-card h2 { margin: 2px 0 8px; }
.cel-verse { margin: 6px 0 8px; padding: 10px 14px; border-left: 3px solid #ffe08a; background: rgba(255, 220, 130, 0.1); border-radius: 0 10px 10px 0; text-align: left; line-height: 1.5; }
.cel-verse q { font-style: italic; display: block; }
.cel-verse cite { display: block; margin-top: 4px; font-size: 0.8em; color: #ffe08a; font-style: normal; letter-spacing: 0.04em; }
.cel-verse[hidden] { display: none; }
.cel-note { margin: 6px 0 12px; line-height: 1.5; opacity: 0.92; }
