:root {
    --red: #e11d2e;
    --red-ink: #b3101d;
    --red-soft: #fdecee;
    --ink: #1d1517;
    --muted: #6d6165;
    --bg: #f6f6f8;
    --surface: #ffffff;
    --line: #ebe5e7;
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Handjet", system-ui, sans-serif;
    font-size: 1.15rem;
    color: var(--ink);
    background: var(--bg);
    text-align: center;
}

.app {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 16px 40px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .7s ease, transform .7s ease;
}
.app.revealed { opacity: 1; transform: none; }

.top { margin-bottom: 18px; }
.heading { margin: 0; font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; color: var(--red); line-height: 1.05; }
.heading img { vertical-align: middle; }
.sub { margin: 6px 0 0; color: var(--muted); font-size: 1.2rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 1px 2px rgba(29, 21, 23, .04), 0 8px 24px rgba(29, 21, 23, .04);
}

/* form */
.form { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 1.1rem; color: var(--muted); }
.input {
    font: inherit; font-size: 1.2rem;
    padding: 12px 14px; min-width: 190px;
    border: 1.5px solid var(--line); border-radius: 12px;
    color: var(--ink); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--red); }
.input:focus-visible { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

button {
    font: inherit; font-size: 1.35rem; font-weight: 600;
    padding: 12px 30px; cursor: pointer;
    color: #fff; background: var(--red);
    border: 1.5px solid var(--red); border-radius: 12px;
    transition: background .15s, color .15s, transform .1s;
}
button:hover { background: #fff; color: var(--red); }
button:active { transform: scale(.97); }
button:focus-visible { outline: 3px solid var(--red-soft); outline-offset: 2px; }
.font-issue { font-family: "Handjet", sans-serif; }
.msg { flex-basis: 100%; margin: 0; color: var(--red-ink); font-size: 1.15rem; }

/* hero: live age */
.hero {
    margin-top: 16px; padding: 22px 18px;
    background: var(--red); color: #fff;
    border-radius: 24px;
    box-shadow: 0 14px 34px rgba(225, 29, 46, .28);
}
.hero h2 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 600; }
.hero h2 small { font-size: 1rem; font-weight: 400; opacity: .8; margin-left: 8px; }
.hero-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.hero-grid div { background: rgba(255,255,255,.14); border-radius: 14px; padding: 10px 4px; }
.hero-grid b { display: block; font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-grid span { font-size: 1.05rem; opacity: .9; }

.sec { margin: 22px 0 10px; font-size: 1.55rem; font-weight: 600; color: var(--ink); text-align: left; }
.card .sec { margin-top: 0; }

/* totals */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; }
.stat b { display: block; font-size: clamp(1.5rem, 4.6vw, 2.3rem); font-weight: 700; color: var(--red-ink); line-height: 1.1; word-break: break-all; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 1.05rem; }

/* next birthday */
.next-date { margin: 0; font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 600; }
.next-date b { color: var(--red); }
.next-age { margin: 2px 0 14px; color: var(--muted); font-size: 1.2rem; }
.next-age b { color: var(--red-ink); font-size: 1.4rem; }
.count { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.count div { background: var(--red-soft); border-radius: 14px; padding: 10px 2px; }
.count b { display: block; font-size: clamp(1.7rem, 6vw, 2.8rem); color: var(--red-ink); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.count span { font-size: 1rem; color: var(--muted); }

.banner { margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: #fff4d6; color: #7a5200; font-size: 1.3rem; font-weight: 600; }

/* upcoming list */
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
    padding: 10px 4px; text-align: left; border-top: 1px solid var(--line);
}
.upcoming li:first-child { border-top: 0; }
.upcoming .d { font-size: 1.3rem; font-weight: 600; }
.upcoming .w { color: var(--muted); grid-column: 1; }
.upcoming .a { grid-column: 2; grid-row: 1 / span 2; background: var(--red-soft); color: var(--red-ink); border-radius: 999px; padding: 4px 14px; font-size: 1.2rem; font-weight: 700; }

/* developer info */
.dev { margin-top: 28px; padding: 18px; border: 1.5px solid var(--red); border-radius: var(--radius); background: var(--surface); }
.dev-title { margin: 0 0 8px; font-size: 1.6rem; font-weight: 700; color: var(--red); }
.dev ul { list-style: none; margin: 0; padding: 0; line-height: 1.7; }
.dev a { color: var(--red-ink); text-decoration: none; word-break: break-all; }
.dev a:hover { text-decoration: underline; }
.credit { margin: 10px 0 0; color: var(--muted); font-size: 1rem; }

@media (max-width: 560px) {
    .hero-grid { grid-template-columns: repeat(3, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .count { grid-template-columns: repeat(3, 1fr); }
    .field, .input, button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .app { transition: none; transform: none; }
}
