@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --bg-1: #eaf5ff;
    --bg-2: #f5f8ff;
    --bg-3: #fff6ea;
    --card: #ffffff;
    --text: #1e2e4f;
    --muted: #5b6b87;
    --navy: #123e78;
    --gold: #f5b93d;
    --red: #e25252;
    --line: #d9e2f0;
    --shadow: 0 10px 24px rgba(18, 62, 120, 0.08);
    --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Nunito', 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 5%, #ffffff 0%, transparent 35%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2) 42%, var(--bg-3));
    min-height: 100vh;
}

.page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 12px;
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(18, 62, 120, 0.1);
}

h1, h2, h3 { margin: 0; }

h1 {
    font-size: clamp(2.1rem, 4.8vw, 3.1rem);
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    margin-bottom: 10px;
}

.kicker {
    margin: 0 0 8px;
    color: var(--navy);
    font-weight: 800;
}

.lead, .meta { color: var(--muted); }

.hero-card {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 20px;
    align-items: center;
}

.hero-copy .lead {
    margin: 10px 0 0;
    max-width: 60ch;
    line-height: 1.45;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.hero-jotd {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
    box-shadow: none;
}

.hero-jotd h2 {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.hero-mascot {
    justify-self: center;
    text-align: center;
}

.logo {
    width: min(255px, 100%);
    border-radius: 14px;
    border: 2px solid #e6eef9;
}

.speech-bubble {
    margin: 10px auto 0;
    max-width: 280px;
    padding: 7px 11px;
    background: #fff9ea;
    border: 1px solid #f4ddb2;
    border-radius: 999px;
    font-weight: 700;
    color: #6f4d11;
    font-size: .93rem;
}

.btn {
    border: none;
    border-radius: 11px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-secondary { background: var(--gold); color: #2d2d2d; }
.btn-ghost { background: #eef4ff; color: var(--navy); }
.btn:hover { transform: translateY(-1px); }

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.step-card {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fcfdff;
    padding: 8px 10px;
}

.step-card h3 { font-size: .98rem; }

.feature-card .jotd {
    white-space: pre-line;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    line-height: 1.35;
    margin: 8px 0 10px;
}

.hero-jotd .jotd {
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    margin: 8px 0;
}

.chip {
    display: inline-block;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--navy);
    border: 1px solid #d8e6fb;
    padding: 3px 9px;
    font-size: .82rem;
    font-weight: 700;
}

.approved {
    font-weight: 700;
    color: #1e6c2f;
    font-size: .92rem;
}

.jotd-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.reaction-wrap {
    margin: 10px 0 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.reaction-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.reaction-btn {
    border: 1px solid #d4e2fa;
    background: #f6f9ff;
    color: #28406f;
    border-radius: 999px;
    padding: 5px 10px;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.reaction-emoji {
    font-size: .95rem;
    line-height: 1;
}

.reaction-btn:hover {
    transform: translateY(-1px);
    background: #eef5ff;
}

.reaction-btn.is-active {
    background: #e3efff;
    border-color: #9fc2ff;
    color: #15386f;
}

.reaction-count {
    display: inline-flex;
    min-width: 22px;
    justify-content: center;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid #c8dbfb;
    background: #fff;
}

.reaction-total {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
}

.spinner-wrap {
    display: flex;
    align-items: center;
    min-height: 28px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #e7eefc;
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

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

#browseSection { padding-bottom: 12px; }

.filters {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #c8d5ea;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    color: inherit;
    background: #fff;
}

textarea {
    min-height: 108px;
    resize: vertical;
}

.joke-feed {
    display: grid;
    gap: 6px;
}

.history-window {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-window::-webkit-scrollbar {
    width: 10px;
}

.history-window::-webkit-scrollbar-thumb {
    background: #c9d8f0;
    border-radius: 999px;
}

.joke-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 9px;
    background: #fff;
}

.joke-item .joke-text {
    white-space: pre-line;
    margin: 0;
    line-height: 1.28;
    font-size: .95rem;
}

.joke-meta-row {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    min-height: 18px;
}

.joke-meta-row .chip { opacity: .85; }

.joke-check {
    color: #1e6c2f;
    font-size: .85rem;
    font-weight: 700;
}

.tag {
    display: inline-block;
    font-size: .76rem;
    border: 1px solid #f1d69c;
    color: #7f5a10;
    background: #fff7e5;
    border-radius: 999px;
    padding: 2px 7px;
}

.submit-card .meta { margin-top: -3px; }
.submit-steps {
    margin: 10px 0 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfdff;
}
.submit-wrap { margin-top: 12px; }

#submitForm {
    display: grid;
    gap: 8px;
}

.check {
    display: flex;
    gap: 8px;
    align-items: center;
}

.check input { width: auto; }
.hidden { display: none !important; }

.site-footer {
    text-align: center;
    padding: 8px 2px 2px;
}

.footer-label {
    margin: 0 0 6px;
    font-size: .88rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dotted #bccce8;
    font-size: .9rem;
}

.footer-links a:hover {
    color: var(--navy);
    border-bottom-color: var(--navy);
}

@media (max-width: 860px) {
    .hero-card { grid-template-columns: 1fr; }
    .hero-mascot { justify-self: start; }
    .steps { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .filters { grid-template-columns: 1fr; }
}
