:root {
    --bg-start: #f7f4ec;
    --bg-end: #edf5f0;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --text-main: #23313a;
    --text-soft: #5f6d75;
    --border: rgba(35, 49, 58, 0.08);
    --shadow: 0 20px 45px rgba(71, 94, 84, 0.12);
    --primary: #335c67;
    --primary-hover: #284952;
    --accent: #f3e7b3;
    --danger-soft: #fff1ef;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 38%),
        linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.container {
    width: min(100% - 2rem, 1120px);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: max(0.25rem, env(safe-area-inset-top));
    padding-bottom: 0.75rem;
}

.site-logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--primary);
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
}

.site-nav a {
    color: var(--text-soft);
    font-weight: 600;
    padding: 0.55rem 0;
    transition: color var(--transition);
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--primary);
}

.site-main {
    flex: 1;
    display: flex;
}

.shell {
    width: min(100% - 2rem, 960px);
    margin: 0 auto;
    flex: 1;
    display: grid;
    place-items: center;
    padding: clamp(1.25rem, 4vw, 2.5rem) 0;
}

.hero,
.result-wrap {
    width: 100%;
}

.hero {
    max-width: 760px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 0.75rem;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.intro {
    max-width: 620px;
    margin: 1rem auto 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.7;
}

.mood-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.mood-button,
.primary-button,
.secondary-button {
    border: 0;
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition);
    cursor: pointer;
}

.mood-button {
    text-align: center;
    min-height: 64px;
    font-weight: 700;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(78, 92, 82, 0.08);
    backdrop-filter: blur(8px);
}

.mood-button:hover,
.mood-button:focus-visible,
.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.mood-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
    outline: 3px solid rgba(51, 92, 103, 0.2);
    outline-offset: 2px;
}

.mood-anxious { background: linear-gradient(135deg, #f6efe6, #f9fafb); }
.mood-sad { background: linear-gradient(135deg, #e9f0fb, #f7fbff); }
.mood-angry { background: linear-gradient(135deg, #fce9e5, #fff6f3); }
.mood-lonely { background: linear-gradient(135deg, #f0ecfb, #faf8ff); }
.mood-grateful { background: linear-gradient(135deg, #eef7e8, #fbfff7); }
.mood-confused { background: linear-gradient(135deg, #fff2dc, #fffaf1); }
.mood-weak { background: linear-gradient(135deg, #eceef5, #f9fbff); }
.mood-hopeful { background: linear-gradient(135deg, #e4f7f0, #f7fffc); }

.result-wrap {
    max-width: 760px;
}

.result-heading {
    text-align: center;
    margin-bottom: 1.5rem;
}

.status-card,
.verse-card {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

.status-card {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-soft);
}

.error-card {
    background: var(--danger-soft);
}

.spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(51, 92, 103, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.verse-card {
    padding: 1.4rem;
    animation: fadeUp 360ms ease;
    text-align: center;
}

.verse-text {
    margin: 0;
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.4;
}

.verse-reference {
    margin: 1rem 0 0;
    color: var(--primary);
    font-weight: 700;
}

.verse-explanation {
    margin: 1.2rem 0 0;
    color: var(--text-soft);
    line-height: 1.8;
}

.action-box {
    margin-top: 1.35rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #fff9df, #fdf3c7);
    border: 1px solid rgba(146, 118, 26, 0.12);
}

.action-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8e6e1d;
}

.action-box p {
    margin: 0;
    line-height: 1.7;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1.4rem;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    font-weight: 700;
}

.primary-button {
    background: var(--primary);
    color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
    background: var(--primary-hover);
}

.secondary-button {
    background: #f7f8f9;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.share-feedback {
    min-height: 1.4rem;
    margin: 0.9rem 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.hidden {
    display: none;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.58);
}

.footer-inner {
    padding: 1.35rem 0 calc(1.6rem + env(safe-area-inset-bottom));
    text-align: center;
    color: #7a858c;
}

.footer-inner p {
    margin: 0.2rem 0;
    font-size: 0.95rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 680px) {
    .shell {
        width: min(100% - 3rem, 960px);
    }

    .container {
        width: min(100% - 3rem, 1120px);
    }

    .mood-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .verse-card {
        padding: 2rem;
        text-align: center;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 1.75rem, 1120px);
    }

    .header-inner {
        min-height: 64px;
        justify-content: center;
        text-align: center;
        gap: 0.5rem 1rem;
        padding-bottom: 0.65rem;
    }

    .site-logo {
        width: 100%;
    }

    .site-nav {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .site-nav a {
        font-size: 0.95rem;
        padding: 0.5rem 0.2rem;
    }

    .shell {
        width: min(100% - 1.75rem, 960px);
        padding: 1.35rem 0 1.85rem;
    }

    .hero,
    .result-wrap {
        max-width: 100%;
    }

    .intro {
        margin-top: 1rem;
        margin-left: 1.75rem;
        margin-right: 1.75rem;
        font-size: 0.97rem;
        line-height: 1.65;
    }

    .mood-grid {
        margin-top: 1.75rem;
        margin-left: 1.75rem;
        margin-right: 1.75rem;
        gap: 0.9rem;
    }

    .mood-button,
    .primary-button,
    .secondary-button {
        border-radius: 16px;
        padding: 0.95rem 0.9rem;
    }

    .result-heading {
        margin-bottom: 1.2rem;
    }

    .status-card {
        padding: 1.65rem 1.15rem;
    }

    .verse-card {
        padding: 1.35rem 1.15rem;
        border-radius: 20px;
        text-align: center;
    }

    .verse-text {
        line-height: 1.35;
    }

    .verse-reference {
        margin-top: 0.95rem;
    }

    .verse-explanation {
        margin-top: 1.1rem;
        line-height: 1.7;
    }

    .action-box {
        margin-top: 1.25rem;
        padding: 1rem;
    }

    .card-actions {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        margin-top: 1.5rem;
    }

    .primary-button,
    .secondary-button {
        width: 100%;
        min-height: 50px;
    }

    .share-feedback {
        text-align: center;
    }

    .footer-inner {
        padding-top: 1.1rem;
    }
}

@media (max-width: 380px) {
    .container {
        width: min(100% - 1.5rem, 1120px);
    }

    .shell {
        width: min(100% - 1.5rem, 960px);
    }

    h1 {
        font-size: 1.85rem;
    }

    .mood-grid {
        grid-template-columns: 1fr;
        margin-left: 1.75rem;
        margin-right: 1.75rem;
    }

    .eyebrow {
        font-size: 0.78rem;
    }

    .verse-text {
        font-size: 1.3rem;
    }
}
