/* Night-purple theme (default) with a soft lavender light theme. */
:root {
    --bg: #26215C;
    --surface: #3C3489;
    --text: #EEEDFE;
    --muted: #AFA9EC;
    --line: #534AB7;
    --accent: #F0997B;
    --primary-bg: #EEEDFE;
    --primary-text: #3C3489;
    --tile-border: transparent;
    --toast-bg: #EEEDFE;
    --toast-text: #26215C;
    --serif: Georgia, Cambria, "Times New Roman", Times, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #F4F2FD;
        --surface: #FFFFFF;
        --text: #26215C;
        --muted: #534AB7;
        --line: #CECBF6;
        --accent: #993C1D;
        --primary-bg: #3C3489;
        --primary-text: #FFFFFF;
        --tile-border: rgb(38 33 92 / .08);
        --toast-bg: #26215C;
        --toast-text: #FFFFFF;
        color-scheme: light;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

.sprite {
    position: absolute;
    width: 0;
    height: 0;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.25em;
}

main {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px 16px 40px;
}

.view {
    width: 100%;
    max-width: 880px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: fade .35s ease;
}

[hidden] {
    display: none !important;
}

a {
    color: inherit;
}

h1 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    line-height: 1.2;
}

.muted {
    color: var(--muted);
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 32px;
}

.greeting,
.back {
    font-size: .9rem;
    color: var(--muted);
    text-decoration: none;
}

.back:hover {
    color: var(--text);
}

.pill,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .8rem;
    text-decoration: none;
}

.pill {
    color: var(--muted);
    border: 1px solid var(--line);
}

.pill:hover {
    color: var(--text);
}

/* Verse of the day */
.votd {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--tile-border);
    border-radius: 16px;
    text-decoration: none;
    transition: transform .15s ease;
}

.votd:hover {
    transform: translateY(-2px);
}

.votd-label {
    font-size: .75rem;
    color: var(--muted);
}

.votd-text {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.votd-ref {
    font-size: .85rem;
    color: var(--accent);
}

/* Mood tiles */
.moods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 900px) {
    .moods {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

.mood {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--tile-border);
    background: var(--tint);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.mood:hover,
.mood:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgb(0 0 0 / .18);
    outline: none;
}

.face {
    width: 48px;
    height: 48px;
    flex: none;
    overflow: visible;
    transition: transform .2s ease;
}

.mood:hover .face,
.mood:focus-visible .face {
    transform: scale(1.06) rotate(-3deg);
}

@media (min-width: 640px) {
    .mood {
        flex-direction: column;
        justify-content: center;
        padding: 20px 12px;
        font-size: 1.15rem;
    }

    .face {
        width: 88px;
        height: 88px;
    }
}

.chip-face {
    width: 18px;
    height: 18px;
    margin-left: -4px;
}

.mood-anxious  { --tint: #E1F5EE; --ink: #085041; }
.mood-sad      { --tint: #E6F1FB; --ink: #0C447C; }
.mood-angry    { --tint: #FAECE7; --ink: #712B13; }
.mood-afraid   { --tint: #EEEDFE; --ink: #3C3489; }
.mood-tired    { --tint: #FAEEDA; --ink: #633806; }
.mood-lonely   { --tint: #FBEAF0; --ink: #72243E; }
.mood-grateful { --tint: #EAF3DE; --ink: #27500A; }
.mood-grieving { --tint: #F1EFE8; --ink: #444441; }

.chip {
    background: var(--tint, var(--surface));
    color: var(--ink, var(--text));
    font-weight: 600;
}

/* Verse view */
.verse-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 22px;
    background: var(--surface);
    border: 1px solid var(--tile-border);
    border-radius: 20px;
    text-align: center;
}

.quote-icon {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#verse-body.reveal {
    animation: fade .5s ease;
}

.verse-text {
    margin: 12px 0;
    font-family: var(--serif);
    font-size: clamp(1.2rem, 3vw, 1.75rem);
    line-height: 1.55;
    white-space: pre-line;
}

.verse-ref {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: clamp(.95rem, 2.2vw, 1.15rem);
}

.tag {
    margin-left: 8px;
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .05em;
    color: var(--muted);
}

.pause {
    margin: 14px 0 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: .9rem;
    color: var(--muted);
}

.verse-card.loading .verse-text,
.verse-card.error .verse-text {
    color: var(--muted);
}

.verse-card.loading .verse-ref,
.verse-card.loading .pause,
.verse-card.error .verse-ref,
.verse-card.error .pause {
    visibility: hidden;
}

.toolbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: none;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    font: 500 .78rem var(--sans);
    text-decoration: none;
    cursor: pointer;
}

.tool .icon {
    width: 22px;
    height: 22px;
    color: var(--text);
}

.tool:hover {
    background: rgb(127 119 221 / .15);
}

.tool:disabled {
    opacity: .4;
    cursor: default;
}

#btn-save[aria-pressed="true"] .icon {
    color: var(--accent);
    fill: var(--accent);
}

.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary-text);
    font: 600 .95rem var(--sans);
    text-decoration: none;
    cursor: pointer;
}

.primary:hover {
    filter: brightness(1.05);
}

.primary:disabled {
    opacity: .5;
    cursor: default;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Support line */
.support {
    text-align: center;
    font-size: .85rem;
    line-height: 1.6;
    color: var(--muted);
}

.support p {
    margin: 0;
}

.support a {
    color: var(--accent);
}

.support-call {
    font-weight: 600;
}

.support-more {
    font-size: .78rem;
    margin-top: 4px !important;
}

/* Saved */
.saved-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.saved-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--tile-border);
    border-radius: 16px;
}

.saved-item blockquote {
    flex: 1;
    margin: 0;
    font-family: var(--serif);
    line-height: 1.5;
    white-space: pre-line;
}

.saved-item cite {
    display: block;
    margin-top: 6px;
    font: 600 .85rem var(--sans);
    font-style: normal;
    color: var(--accent);
}

.saved-item .tool {
    flex: none;
    padding: 6px;
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 16px;
    text-align: center;
}

.empty p {
    margin: 0;
}

.empty .primary {
    margin-top: 14px;
}

.empty-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--toast-bg);
    color: var(--toast-text);
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 6px 20px rgb(0 0 0 / .25);
    animation: toast-in .2s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Prayer requests ---------- */
.center {
    text-align: center;
}

.lead {
    margin: -6px 0 0;
    line-height: 1.5;
}

.prayer-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px solid var(--accent);
    border-radius: 16px;
    text-decoration: none;
    transition: transform .15s ease;
}

.prayer-tile:hover,
.prayer-tile:focus-visible {
    transform: translateY(-2px);
}

.prayer-tile-icon {
    width: 32px;
    height: 32px;
    color: var(--accent);
}

.prayer-tile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .85rem;
}

.prayer-tile-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.prayer-tile-chevron {
    margin-left: auto;
    color: var(--muted);
}

.secondary {
    align-self: center;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: none;
    color: var(--text);
    font: 500 .9rem var(--sans);
    cursor: pointer;
}

.secondary:hover {
    background: rgb(127 119 221 / .15);
}

.prayer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prayer-card {
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--tile-border);
    border-radius: 16px;
    animation: fade .3s ease;
}

.prayer-meta {
    margin: 0;
    font-size: .8rem;
    color: var(--muted);
}

.prayer-body {
    margin: 8px 0 12px;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.55;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.pray-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--text);
    font: 500 .82rem var(--sans);
    cursor: pointer;
}

.pray-btn:hover {
    background: rgb(127 119 221 / .15);
}

.pray-btn.on {
    background: var(--primary-bg);
    border-color: var(--primary-bg);
    color: var(--primary-text);
    cursor: default;
}

/* Form */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.field-label {
    font-size: .9rem;
    font-weight: 600;
    padding: 0;
}

.field input[type="text"],
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: 1rem/1.5 var(--sans);
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
    opacity: .8;
}

.field input:focus,
.field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.field-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .8rem;
}

.field-error {
    color: var(--accent);
    font-size: .85rem;
}

.choices {
    gap: 8px;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: rgb(240 153 123 / .08);
}

.choice input {
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.choice .icon {
    margin-top: 1px;
    color: var(--muted);
}

.choice > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: .9rem;
}

.choice strong {
    font-weight: 600;
}

.choice .muted {
    font-size: .8rem;
}

.turnstile {
    min-height: 65px;
}

.fine-print {
    margin: 0;
    font-size: .8rem;
    line-height: 1.5;
}

/* Thank-you */
.thanks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 8px;
    text-align: center;
}

.thanks p {
    margin: 0;
    max-width: 520px;
    line-height: 1.6;
}

.thanks-icon {
    width: 56px;
    height: 56px;
    padding: 12px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary-text);
    stroke-width: 2.5;
}

.support-slot:empty {
    display: none;
}

.support-slot .support {
    padding: 14px 18px;
    border: 1px solid var(--accent);
    border-radius: 14px;
}
