:root {
    --bg-top: #463a83;
    --bg-mid: #0e5367;
    --bg-bottom: #05283a;
    --card: rgba(255, 248, 233, 0.96);
    --card-soft: rgba(255, 247, 233, 0.9);
    --ink: #1d3427;
    --green: #8dc63f;
    --green-deep: #2d6d37;
    --teal: #54c4c4;
    --red: #ef6d60;
    --purple: #8b6dd8;
    --gold: #f4d16f;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Nunito", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top, rgba(255, 216, 152, 0.28), transparent 30%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 46%, var(--bg-bottom) 100%);
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
}

.flash-stack {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px;
}

.flash {
    margin: 0 auto 8px;
    max-width: 460px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(253, 250, 242, 0.92);
    box-shadow: var(--shadow);
}

.auth-page,
.pond-page,
.subpage {
    max-width: 460px;
    margin: 0 auto;
    padding: 14px 16px calc(120px + env(safe-area-inset-bottom));
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
}

.auth-card,
.card,
.pond-header,
.metric-ribbon {
    border-radius: 28px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.auth-card {
    width: 100%;
    padding: 28px;
}

.auth-card h1,
.pond-header h1,
.subpage-header h1,
.issue-card h2,
.list-card h2,
.collapse-card h2 {
    margin: 0;
    font-family: "Baloo 2", cursive;
    line-height: 0.95;
}

.auth-card h1 {
    font-size: 3.1rem;
}

.eyebrow,
.card-chip,
.meta,
.metric span {
    letter-spacing: 0.03em;
}

.eyebrow,
.card-chip {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-copy,
.meta {
    color: rgba(29, 52, 39, 0.78);
}

.stack-form p {
    margin: 0 0 12px;
}

.stack-form input,
.stack-form select,
.stack-form textarea {
    width: 100%;
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(45, 109, 55, 0.18);
    border-radius: 16px;
    font: inherit;
    background: rgba(255, 255, 255, 0.92);
}

.primary-button,
.secondary-button,
.ghost-button,
.anchor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border: 0;
    border-radius: 18px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    width: 100%;
    background: linear-gradient(180deg, #a3df49 0%, #6cae2f 100%);
    color: #17331f;
}

.secondary-button,
.ghost-button,
.anchor-button {
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink);
}

.pond-header,
.metric-ribbon,
.card {
    margin-bottom: 14px;
}

.pond-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
}

.pond-header-copy {
    min-width: 0;
}

.pond-header h1 {
    font-size: 2.85rem;
    word-break: break-word;
}

.pond-substatus {
    margin: 4px 0 0;
    color: rgba(29, 52, 39, 0.76);
    font-size: 0.82rem;
    font-family: "Nunito", sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

.substatus-sep {
    padding: 0 4px;
    opacity: 0.75;
}

.metric-ribbon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 10px 12px;
}

.metric {
    text-align: center;
}

.metric strong {
    display: block;
    font-size: 1.56rem;
    font-weight: 900;
}

.pond-scene {
    position: relative;
    overflow: hidden;
    min-height: 332px;
    margin-bottom: 16px;
    border-radius: 36px;
    background:
        radial-gradient(circle at 50% 10%, rgba(255, 205, 127, 0.45), transparent 28%),
        linear-gradient(180deg, rgba(74, 63, 137, 0.95), rgba(16, 79, 92, 0.82) 50%, rgba(8, 45, 57, 0.95) 100%);
    box-shadow: inset 0 -30px 90px rgba(0, 0, 0, 0.25), var(--shadow);
}

.scene-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-image-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 26, 36, 0.1), rgba(6, 26, 37, 0.15) 55%, rgba(5, 24, 34, 0.55) 100%),
        radial-gradient(circle at top, rgba(255, 221, 159, 0.22), transparent 32%);
}

.scene-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(250, 244, 224, 0.84);
    color: #1d3427;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.scene-audio-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(250, 244, 224, 0.84);
    color: #1d3427;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.pond-scene::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 84px;
    background: linear-gradient(180deg, rgba(3, 31, 43, 0), rgba(3, 31, 43, 0.74));
}

.sky-glow {
    position: absolute;
    inset: 16px auto auto 50%;
    width: 220px;
    height: 90px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(255, 214, 149, 0.18);
    filter: blur(12px);
}

.scene-stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 12% 16%, rgba(255, 242, 204, 0.9) 0 2px, transparent 3px),
        radial-gradient(circle at 26% 9%, rgba(255, 242, 204, 0.8) 0 1.5px, transparent 3px),
        radial-gradient(circle at 71% 14%, rgba(255, 242, 204, 0.78) 0 2px, transparent 3px),
        radial-gradient(circle at 88% 21%, rgba(255, 242, 204, 0.82) 0 1.5px, transparent 3px);
    opacity: 0.6;
}

.scene-reeds {
    position: absolute;
    bottom: 0;
    width: 90px;
    height: 220px;
    background:
        linear-gradient(90deg, transparent 0 16px, #224a28 16px 21px, transparent 21px 34px, #2d6d37 34px 39px, transparent 39px 54px, #315e2d 54px 58px, transparent 58px),
        linear-gradient(140deg, transparent 0 58px, #7f5d27 58px 72px, transparent 72px),
        linear-gradient(40deg, transparent 0 102px, #7f5d27 102px 116px, transparent 116px);
    opacity: 0.88;
}

.scene-reeds-left {
    left: 0;
    transform: scaleX(1);
}

.scene-reeds-right {
    right: 0;
    transform: scaleX(-1);
}

.water-ring {
    position: absolute;
    left: 50%;
    bottom: 26px;
    width: 260px;
    height: 140px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 42%, rgba(160, 232, 120, 0.92), rgba(35, 113, 69, 0.95) 70%);
    box-shadow: inset 0 10px 24px rgba(255, 255, 255, 0.2);
}

.lily {
    position: absolute;
    z-index: 1;
    width: 112px;
    height: 48px;
    border-radius: 999px 999px 35px 35px;
    background: radial-gradient(circle at 40% 35%, #a8ec63, #4f8f36 68%);
    box-shadow: inset 0 6px 16px rgba(255, 255, 255, 0.18);
}

.lily::after {
    content: "";
    position: absolute;
    inset: 8px 18px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.lily-left {
    left: 22px;
    bottom: 44px;
    transform: rotate(-10deg);
}

.lily-right {
    right: 18px;
    bottom: 64px;
    transform: rotate(8deg);
}

.lily-front {
    left: 50%;
    bottom: 8px;
    width: 144px;
    height: 56px;
    transform: translateX(-50%);
}

.frog {
    position: absolute;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #15361e;
    font-weight: 900;
    background: radial-gradient(circle at 30% 25%, #d9f780, #5d9f37 70%);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.24);
    z-index: 2;
}

.frog-speaker {
    left: 50%;
    bottom: 80px;
    width: 92px;
    height: 92px;
    transform: translateX(-50%);
}

.frog-left,
.frog-right,
.frog-front {
    width: 72px;
    height: 72px;
    bottom: 98px;
}

.frog-left {
    left: 54px;
}

.frog-right {
    right: 54px;
}

.frog-front {
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
}

.frog-crowd {
    position: absolute;
    inset: 38px 32px 48px;
    z-index: 0;
    pointer-events: none;
}

.crowd-frog {
    position: absolute;
    width: 34px;
    height: 26px;
    border-radius: 60% 60% 55% 55%;
    background: radial-gradient(circle at 35% 30%, rgba(223, 248, 139, 0.96), rgba(77, 134, 55, 0.95) 70%);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
    opacity: 0.8;
    animation: frog-bob 4.8s ease-in-out infinite;
}

.crowd-frog::before,
.crowd-frog::after {
    content: "";
    position: absolute;
    top: -6px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: inherit;
}

.crowd-frog::before {
    left: 4px;
}

.crowd-frog::after {
    right: 4px;
}

.crowd-frog-1 { left: 8%; bottom: 42%; animation-delay: 0.1s; }
.crowd-frog-2 { left: 22%; bottom: 56%; animation-delay: 0.6s; }
.crowd-frog-3 { left: 36%; bottom: 38%; animation-delay: 1.1s; }
.crowd-frog-4 { left: 50%; bottom: 62%; animation-delay: 1.6s; }
.crowd-frog-5 { left: 64%; bottom: 40%; animation-delay: 2.1s; }
.crowd-frog-6 { left: 78%; bottom: 54%; animation-delay: 2.6s; }
.crowd-frog-7 { left: 16%; bottom: 24%; animation-delay: 3.1s; }
.crowd-frog-8 { left: 46%; bottom: 22%; animation-delay: 3.6s; }
.crowd-frog-9 { left: 72%; bottom: 20%; animation-delay: 4.1s; }

@keyframes frog-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.mood-distressed .frog,
.mood-distressed .crowd-frog {
    transform: scale(0.96);
}

.mood-distressed .crowd-frog,
.mood-wary .crowd-frog {
    opacity: 0.66;
}

.mood-joyful .frog,
.mood-joyful .crowd-frog {
    filter: saturate(1.08) brightness(1.04);
}

.health-sickly .frog,
.health-sickly .crowd-frog {
    filter: saturate(0.76) brightness(0.92);
}

.health-weary .frog,
.health-weary .crowd-frog {
    filter: saturate(0.88);
}

.health-thriving .frog,
.health-thriving .crowd-frog {
    filter: saturate(1.08) brightness(1.06);
}

.population-sparse .frog-crowd {
    inset-inline: 56px;
}

.population-bustling .frog-crowd .crowd-frog {
    width: 38px;
    height: 29px;
}

.scene-banner {
    position: absolute;
    top: 58px;
    right: 18px;
    display: grid;
    gap: 8px;
}

.scene-banner span {
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(8, 42, 54, 0.58);
    color: #eef8d4;
    font-weight: 700;
}

.scene-sign {
    position: absolute;
    z-index: 2;
    width: 86px;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(255, 243, 219, 0.96);
    color: #5a4120;
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1.1;
    text-align: center;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.sign-left {
    left: 20px;
    bottom: 136px;
    transform: rotate(-8deg);
}

.sign-right {
    right: 14px;
    bottom: 118px;
    transform: rotate(8deg);
}

.condition-heated .pond-scene,
.condition-heated {
    filter: saturate(1.05);
}

.condition-fragile .water-ring,
.condition-crisis .water-ring {
    background: radial-gradient(circle at 50% 42%, rgba(130, 185, 97, 0.9), rgba(43, 88, 55, 0.95) 70%);
}

.condition-fragile .frog,
.condition-crisis .frog {
    filter: saturate(0.82);
}

.phase-morning .sky-glow {
    background: rgba(255, 231, 171, 0.3);
}

.phase-midday .sky-glow {
    background: rgba(255, 242, 186, 0.36);
}

.phase-evening .sky-glow {
    background: rgba(255, 197, 138, 0.28);
}

.phase-night .scene-stars {
    opacity: 0.82;
}

.card {
    padding: 20px;
}

.card-chip {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(136, 198, 62, 0.18);
    color: #426221;
}

.danger {
    background: rgba(239, 109, 96, 0.18);
    color: #9d3027;
}

.live-card {
    border: 1px solid rgba(84, 196, 196, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(240, 251, 248, 0.96));
}

.live-card .card-chip {
    background: rgba(84, 196, 196, 0.2);
    color: #255666;
}

.issue-card p,
.consequence-card p,
.report-card p,
.list-card p,
.live-card p {
    margin-bottom: 0;
    font-size: 1.18rem;
    line-height: 1.5;
}

.choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 84px;
}

.choice-form {
    margin: 0;
}

.choice-button {
    width: 100%;
    min-height: 136px;
    padding: 18px;
    border: 0;
    border-radius: 28px;
    color: #fffef2;
    text-align: left;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.choice-1 { background: linear-gradient(180deg, #9bd34b, #67972a); }
.choice-2 { background: linear-gradient(180deg, #72d4da, #358ca4); }
.choice-3 { background: linear-gradient(180deg, #f48074, #c74f4b); }
.choice-4 { background: linear-gradient(180deg, #ad84ef, #7353bd); }
.choice-5 { background: linear-gradient(180deg, #f3bf65, #be7f27); }
.choice-6 { background: linear-gradient(180deg, #69cf9a, #2f8f70); }

.choice-label {
    display: block;
    margin-bottom: 10px;
    font-family: "Baloo 2", cursive;
    font-size: 1.6rem;
    line-height: 1;
}

.choice-summary {
    display: block;
    font-size: 0.95rem;
    line-height: 1.35;
}

.delta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    font-weight: 800;
    color: #345535;
}

.subpage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.subpage-header h1 {
    font-size: 2.4rem;
    color: #fff3db;
}

.subpage-header .eyebrow {
    color: rgba(255, 243, 219, 0.8);
}

.seed-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.8;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: min(428px, calc(100% - 24px));
    transform: translateX(-50%);
    padding: 10px;
    border-radius: 26px;
    background: rgba(6, 34, 46, 0.88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.bottom-nav a {
    padding: 14px 8px;
    border-radius: 18px;
    color: rgba(245, 248, 238, 0.82);
    font-weight: 800;
    font-size: 0.88rem;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    word-break: normal;
    overflow-wrap: anywhere;
}

.bottom-nav a.active {
    background: linear-gradient(180deg, rgba(154, 220, 89, 0.3), rgba(92, 153, 50, 0.5));
    color: #fefbe8;
}

@media (min-width: 421px) {
    .choice-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .pond-page,
    .subpage {
        padding: 12px 12px calc(116px + env(safe-area-inset-bottom));
    }

    .pond-header {
        align-items: flex-start;
        padding: 12px 14px;
    }

    .pond-header h1 {
        font-size: 2.22rem;
    }

    .pond-substatus {
        font-size: 0.7rem;
    }

    .pond-substatus {
        font-size: 0.72rem;
    }

    .metric-ribbon {
        gap: 2px;
        padding: 8px 8px;
    }

    .metric strong {
        font-size: 1.24rem;
    }

    .metric span {
        font-size: 0.64rem;
    }

    .pond-scene {
        min-height: 250px;
    }

    .scene-badge {
        font-size: 0.7rem;
        top: 12px;
        left: 12px;
    }

    .scene-audio-toggle {
        top: 12px;
        right: 12px;
        font-size: 0.68rem;
        padding: 7px 10px;
    }

    .scene-sign {
        width: 72px;
        font-size: 0.74rem;
    }

    .sign-left {
        left: 12px;
        bottom: 132px;
    }

    .sign-right {
        right: 10px;
        bottom: 116px;
    }

    .scene-banner {
        top: 50px;
        right: 12px;
    }

    .scene-banner span {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    .crowd-frog {
        width: 28px;
        height: 22px;
    }

    .bottom-nav {
        gap: 6px;
        padding: 8px;
    }

    .bottom-nav a {
        padding: 12px 6px;
        font-size: 0.68rem;
        letter-spacing: -0.01em;
        white-space: nowrap;
    }
}
