@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
    --color-bg: #f8f4ee;
    --color-bg-alt: #fdfaf6;
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f7f1ea;
    --color-ink: #2b2a27;
    --color-muted: #6c645a;
    --color-text-primary: #2b2a27;
    --color-text-secondary: #6c645a;
    --color-accent: #f06449;
    --color-accent-dark: #d14d34;
    --color-card: #ffffff;
    --color-border: #eadfd2;
    --color-pill: #f1e7dc;
    --color-input-bg: #ffffff;
    --color-input-text: #2b2a27;
    --color-header-managed-bg: #f2e8dd;
    --color-reserve: #c79a3a;
    --color-card-top: linear-gradient(120deg, rgba(143, 195, 220, 0.35), rgba(125, 161, 208, 0.2));
    --color-card-top-border: rgba(113, 163, 198, 0.35);
    --shadow-card-top: 0 12px 24px rgba(92, 128, 162, 0.2);
    --shadow-soft: 0 20px 45px rgba(50, 41, 35, 0.08);
    --shadow-card: 0 18px 40px rgba(35, 28, 22, 0.08);
}

* {
    box-sizing: border-box;
}

body.page {
    margin: 0;
    min-height: 100vh;
    color: var(--color-ink);
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    background: linear-gradient(150deg, #f9f4ee 0%, #fefcf9 45%, #f5efe6 100%);
    position: relative;
    overflow-x: hidden;
}

body.page[data-theme='dark'] {
    --color-bg: #0f1622;
    --color-bg-alt: #131c2a;
    --color-bg-primary: #161f2e;
    --color-bg-secondary: #101826;
    --color-ink: #f3efe8;
    --color-muted: #b7af9f;
    --color-text-primary: #f3efe8;
    --color-text-secondary: #b7af9f;
    --color-accent: #f0a36a;
    --color-accent-dark: #d8854e;
    --color-card: #161f2e;
    --color-border: #2a3344;
    --color-pill: #1f2a3b;
    --color-input-bg: #0f1724;
    --color-input-text: #f3efe8;
    --color-header-managed-bg: #1b2638;
    --color-reserve: #e0b94a;
    --color-ghost-border: rgba(224, 185, 74, 0.45);
    --color-card-top: linear-gradient(120deg, rgba(39, 58, 86, 0.95), rgba(18, 28, 43, 0.95));
    --color-card-top-border: rgba(255, 255, 255, 0.12);
    --shadow-card-top: 0 14px 26px rgba(7, 11, 18, 0.55);
    --shadow-soft: 0 18px 38px rgba(8, 12, 18, 0.45);
    --shadow-card: 0 20px 50px rgba(6, 9, 14, 0.55);
    color-scheme: dark;
    background: linear-gradient(150deg, #0b111b 0%, #111a29 50%, #0c1320 100%);
}

body.page::before,
body.page::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    opacity: 0.35;
    z-index: -1;
    filter: blur(0px);
}

img,
video {
    max-width: 100%;
    height: auto;
}

body.page::before {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at 30% 30%, rgba(240, 100, 73, 0.25), transparent 70%);
    top: -220px;
    left: -180px;
}

body.page::after {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at 60% 40%, rgba(113, 163, 198, 0.25), transparent 70%);
    bottom: -200px;
    right: -140px;
}

.floating-tools {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 30;
}

.tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    color: var(--color-ink);
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.tool-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 0.6rem);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-card);
    color: var(--color-ink);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    transition: opacity 0.15s ease;
}

.tool-btn:hover::after {
    opacity: 1;
}

body.page[data-theme='dark'] .tool-btn {
    background: rgba(15, 22, 34, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
}

.stars-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 55;
}

.stars-overlay .star {
    position: absolute;
    color: #f5e7b2;
    font-size: 0.75rem;
    opacity: 0.6;
    text-shadow: 0 0 10px rgba(245, 231, 178, 0.7);
    animation: twinkle 3.6s ease-in-out infinite;
}

.stars-overlay .s1 { left: 8%; top: 24px; animation-delay: 0.2s; }
.stars-overlay .s2 { left: 18%; top: 12px; animation-delay: 1.1s; }
.stars-overlay .s3 { left: 28%; top: 36px; animation-delay: 0.6s; }
.stars-overlay .s4 { left: 40%; top: 18px; animation-delay: 1.8s; }
.stars-overlay .s5 { left: 52%; top: 28px; animation-delay: 0.4s; }
.stars-overlay .s6 { left: 64%; top: 8px; animation-delay: 1.3s; }
.stars-overlay .s7 { left: 84%; top: 10px; animation-delay: 0.9s; }
.stars-overlay .s8 { left: 86%; top: 2px; animation-delay: 1.6s; }
.stars-overlay .s9 { left: 90%; top: 12px; animation-delay: 0.7s; }
.stars-overlay .s10 { left: 12%; top: 58px; animation-delay: 1.5s; }
.stars-overlay .s11 { left: 46%; top: 64px; animation-delay: 0.3s; }
.stars-overlay .s12 { left: 82%; top: 32px; animation-delay: 1.0s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.9); }
    50% { opacity: 0.9; transform: scale(1.15); }
}

body.page[data-theme='dark'].stars-enabled .stars-overlay {
    opacity: 1;
}

.sun-orb {
    position: fixed;
    top: 1.4rem;
    left: 1.4rem;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff2b2, #f4b740 70%, #f09a2c);
    box-shadow: 0 0 24px rgba(244, 183, 64, 0.6), 0 0 40px rgba(244, 183, 64, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 60;
}

.sun-orb::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(244, 183, 64, 0.65) 0deg,
        rgba(244, 183, 64, 0.65) 10deg,
        rgba(244, 183, 64, 0.15) 18deg,
        rgba(244, 183, 64, 0.15) 32deg
    );
    filter: blur(0.4px);
    animation: sunspin 9s linear infinite;
}

.sun-orb::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff8d8, #f7c65f);
    opacity: 0.9;
}

@keyframes sunspin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

body.sun-enabled .sun-orb {
    opacity: 1;
    animation: sunpulse 2.6s ease-in-out infinite, sunfloat 4.5s ease-in-out infinite;
}

@keyframes sunpulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes sunfloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

body.page[data-theme='dark']::before {
    background: radial-gradient(circle at 30% 30%, rgba(240, 163, 106, 0.3), transparent 70%);
    opacity: 0.28;
}

body.page[data-theme='dark']::after {
    background: radial-gradient(circle at 60% 40%, rgba(82, 120, 158, 0.35), transparent 70%);
    opacity: 0.28;
}

.site-nav {
    position: sticky;
    top: 0;
    backdrop-filter: blur(14px);
    background: rgba(253, 250, 246, 0.86);
    border-bottom: 1px solid var(--color-border);
    z-index: 20;
}

body.page[data-theme='dark'] .site-nav {
    background: rgba(15, 22, 34, 0.82);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-ink);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    font-size: 0.95rem;
}

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

.nav-link {
    color: var(--color-ink);
    text-decoration: none;
    font-weight: 600;
}

.lang-form {
    margin-left: 0.5rem;
}

.lang-select {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: var(--color-card);
    color: var(--color-ink);
    font-weight: 600;
    font-size: 0.85rem;
}

.theme-toggle {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    background: var(--color-card);
    color: var(--color-ink);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

body.page[data-theme='dark'] .theme-toggle {
    box-shadow: none;
}

.theme-toggle-track {
    width: 44px;
    height: 22px;
    border-radius: 999px;
    background: var(--color-pill);
    border: 1px solid var(--color-border);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--color-accent);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.theme-toggle-text {
    letter-spacing: 0.01em;
}

body.page[data-theme='dark'] .theme-toggle-track {
    background: #0f1724;
    border-color: #3a4254;
}

body.page[data-theme='dark'] .theme-toggle-thumb {
    transform: translateX(22px);
    background: #f0a36a;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.flash-wrap {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
}

.flash-bar {
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-soft);
}

body.page[data-theme='dark'] .flash-bar[data-cat="success"] {
    border-color: rgba(125, 204, 151, 0.45);
    background: rgba(24, 42, 32, 0.9);
}

body.page[data-theme='dark'] .flash-bar[data-cat="danger"] {
    border-color: rgba(232, 128, 128, 0.45);
    background: rgba(48, 24, 24, 0.92);
}

body.page[data-theme='dark'] .flash-bar[data-cat="info"] {
    border-color: rgba(120, 160, 214, 0.45);
    background: rgba(25, 34, 52, 0.9);
}

.flash-bar[data-cat="success"] {
    border-color: #b7dfc1;
    background: #f0fbf2;
}

.flash-bar[data-cat="danger"] {
    border-color: #f1b7b7;
    background: #fff1f1;
}

.flash-bar[data-cat="info"] {
    border-color: #c6d6f2;
    background: #f1f5ff;
}

.hero {
    background: var(--color-card);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border);
}

.hero-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.hero-kicker {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-muted);
    margin-bottom: 0.4rem;
}

.hero-title {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 0.5rem;
}

.hero-sub {
    margin: 0;
    color: var(--color-muted);
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 12px 30px rgba(240, 100, 73, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-ink);
    border-color: var(--color-ghost-border, rgba(240, 100, 73, 0.35));
}

.section {
    margin-top: 2.5rem;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 1.6rem;
    margin: 0;
}

.section-meta {
    color: var(--color-muted);
    font-size: 0.95rem;
}

.birthday-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.birthday-card {
    background: var(--color-card);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 210px;
    transform: translateY(0) scale(var(--card-scale, 1));
    transform-origin: center top;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.page[data-theme='dark'] .birthday-card {
    border-color: rgba(255, 255, 255, 0.12);
    background: linear-gradient(160deg, rgba(22, 31, 46, 0.98), rgba(15, 22, 34, 0.95));
    box-shadow: 0 22px 60px rgba(5, 8, 12, 0.65), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.birthday-card:hover {
    transform: translateY(-6px) scale(var(--card-scale, 1));
    box-shadow: 0 24px 55px rgba(35, 28, 22, 0.2);
}

body.page[data-theme='dark'] .birthday-card:hover {
    box-shadow: 0 28px 70px rgba(4, 7, 12, 0.75), 0 10px 28px rgba(0, 0, 0, 0.45);
}

.birthday-card.birthday-today {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(214, 164, 58, 0.75);
    outline: 2px solid rgba(245, 214, 133, 0.45);
    outline-offset: 1px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 243, 196, 0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 86% 20%, rgba(255, 224, 141, 0.28) 0 2px, transparent 3px),
        linear-gradient(145deg, rgba(255, 237, 188, 0.22), rgba(244, 202, 118, 0.12) 45%, rgba(240, 180, 76, 0.08));
    box-shadow: 0 28px 66px rgba(177, 129, 31, 0.34), 0 12px 28px rgba(96, 69, 18, 0.22);
    animation:
        fadeUp 0.6s ease forwards,
        birthdayGlowPulse 2.8s ease-in-out infinite 0.6s,
        birthdayCardShine 7s linear infinite 0.6s;
}

.birthday-card.birthday-today > * {
    position: relative;
    z-index: 2;
}

.birthday-card.birthday-today::before {
    content: "";
    position: absolute;
    width: min(96%, 520px);
    aspect-ratio: 1 / 1;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 52%, rgba(255, 244, 201, 0.09) 0 28%, rgba(255, 220, 133, 0.055) 40%, rgba(255, 198, 98, 0.03) 56%, transparent 74%);
    opacity: 0.09;
    pointer-events: none;
    z-index: 1;
    animation: birthdaySunPulse 4.8s ease-in-out infinite;
}

.birthday-card.birthday-today::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background:
        radial-gradient(circle at 14% 22%, rgba(255, 248, 214, 0.56) 0 1.6px, transparent 2.8px),
        radial-gradient(circle at 83% 19%, rgba(255, 226, 140, 0.46) 0 1.5px, transparent 2.7px),
        radial-gradient(circle at 24% 76%, rgba(255, 238, 177, 0.42) 0 1.7px, transparent 2.9px),
        radial-gradient(circle at 74% 72%, rgba(247, 202, 93, 0.36) 0 1.4px, transparent 2.6px),
        radial-gradient(circle at 47% 40%, rgba(255, 240, 188, 0.28) 0 1.2px, transparent 2.3px);
    opacity: 0.46;
    pointer-events: none;
    z-index: 1;
    animation: birthdaySparkleDrift 6.2s ease-in-out infinite;
}

.birthday-card.birthday-today .card-top {
    background: linear-gradient(120deg, rgba(251, 222, 135, 0.58), rgba(236, 179, 69, 0.45), rgba(253, 229, 156, 0.55));
    background-size: 220% 220%;
    border-bottom: 1px solid rgba(198, 149, 48, 0.5);
    animation: birthdayTopShine 5.5s ease-in-out infinite;
}

.birthday-card.birthday-today .name {
    font-weight: 800;
}

.birthday-today-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.22rem 0.62rem;
    margin-right: 0.35rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #6e4b10;
    background: linear-gradient(120deg, rgba(255, 236, 165, 0.95), rgba(241, 191, 86, 0.95));
    border: 1px solid rgba(190, 143, 45, 0.72);
    box-shadow: 0 6px 14px rgba(183, 136, 41, 0.3);
    animation: birthdayBadgePulse 2.2s ease-in-out infinite;
}

body.page[data-theme='dark'] .birthday-card.birthday-today {
    border: 2px solid rgba(227, 187, 95, 0.78);
    outline: 2px solid rgba(239, 210, 137, 0.35);
    background:
        radial-gradient(circle at 12% 18%, rgba(247, 221, 152, 0.22) 0 2px, transparent 3px),
        radial-gradient(circle at 86% 20%, rgba(229, 181, 84, 0.2) 0 2px, transparent 3px),
        linear-gradient(155deg, rgba(79, 58, 23, 0.35), rgba(44, 33, 17, 0.3) 45%, rgba(34, 26, 14, 0.26));
    box-shadow: 0 30px 75px rgba(6, 10, 17, 0.84), 0 14px 34px rgba(194, 147, 48, 0.31);
}

body.page[data-theme='dark'] .birthday-card.birthday-today::before {
    background:
        radial-gradient(circle at 50% 52%, rgba(246, 224, 156, 0.08) 0 28%, rgba(226, 177, 83, 0.05) 40%, rgba(194, 136, 51, 0.028) 56%, transparent 74%);
    opacity: 0.08;
}

body.page[data-theme='dark'] .birthday-card.birthday-today::after {
    background:
        radial-gradient(circle at 14% 22%, rgba(247, 222, 150, 0.42) 0 1.6px, transparent 2.8px),
        radial-gradient(circle at 83% 19%, rgba(229, 176, 82, 0.36) 0 1.5px, transparent 2.7px),
        radial-gradient(circle at 24% 76%, rgba(236, 197, 113, 0.32) 0 1.7px, transparent 2.9px),
        radial-gradient(circle at 74% 72%, rgba(210, 157, 64, 0.28) 0 1.4px, transparent 2.6px),
        radial-gradient(circle at 47% 40%, rgba(231, 189, 101, 0.22) 0 1.2px, transparent 2.3px);
    opacity: 0.4;
}

body.page[data-theme='dark'] .birthday-card.birthday-today .card-top {
    background: linear-gradient(120deg, rgba(192, 146, 56, 0.5), rgba(138, 98, 33, 0.44), rgba(209, 167, 84, 0.48));
    background-size: 220% 220%;
    border-bottom: 1px solid rgba(231, 190, 101, 0.5);
    animation: birthdayTopShine 5.5s ease-in-out infinite;
}

body.page[data-theme='dark'] .birthday-today-badge {
    color: #ffe4a7;
    background: linear-gradient(120deg, rgba(174, 127, 43, 0.95), rgba(121, 85, 27, 0.95));
    border-color: rgba(233, 193, 106, 0.62);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35), 0 0 16px rgba(220, 170, 72, 0.24);
}

@keyframes birthdayGlowPulse {
    0%, 100% {
        box-shadow: 0 28px 66px rgba(177, 129, 31, 0.34), 0 12px 28px rgba(96, 69, 18, 0.22);
    }
    50% {
        box-shadow: 0 34px 80px rgba(193, 143, 38, 0.42), 0 16px 36px rgba(108, 77, 20, 0.3);
    }
}

@keyframes birthdayTopShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes birthdayCardShine {
    0% { background-position: 0% 0%, 100% 0%, 0% 50%; }
    50% { background-position: 100% 0%, 0% 0%, 100% 50%; }
    100% { background-position: 0% 0%, 100% 0%, 0% 50%; }
}

@keyframes birthdayBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes birthdaySparkleDrift {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.62; }
    50% { transform: translateY(-1.5%) translateX(1.2%); opacity: 0.9; }
}

@keyframes birthdaySunSpin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes birthdaySunPulse {
    0%, 100% { opacity: 0.06; }
    50% { opacity: 0.12; }
}


.birthday-card.size-xl {
    grid-column: span 2;
    min-height: 260px;
}

.birthday-card.size-lg {
    min-height: 240px;
}

.birthday-card.size-md {
    min-height: 220px;
}

.birthday-card.size-sm {
    opacity: 0.92;
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    background: var(--color-card-top);
    margin: -1.5rem -1.5rem 0;
    padding: 1.1rem 1.5rem 1rem;
    border-radius: 22px 22px 18px 18px;
    border-bottom: 1px solid var(--color-card-top-border);
    box-shadow: var(--shadow-card-top);
}

.card-top-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.card-top-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
    min-width: 0;
}

.card-top h3 {
    margin: 0 0 0.2rem;
    font-size: 1.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.age-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(240, 100, 73, 0.18), rgba(240, 163, 106, 0.22));
    color: var(--color-ink);
    font-size: 1.02rem;
    font-weight: 700;
    border: 1px solid rgba(240, 100, 73, 0.25);
    box-shadow: 0 10px 20px rgba(240, 100, 73, 0.12);
}

.name {
    font-weight: 600;
}

.name-next {
    font-weight: 800;
}

.name-emoji {
    font-size: 1.1rem;
    line-height: 1;
}

.name-rainbow {
    background: linear-gradient(90deg, #ff6f61, #ffb347, #ffe066, #7dd56f, #5dade2, #af7ac5);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 6px 14px rgba(255, 255, 255, 0.2);
}

body.page[data-theme='dark'] .age-tag {
    background: linear-gradient(120deg, rgba(240, 163, 106, 0.3), rgba(224, 185, 74, 0.28));
    color: var(--color-ink);
    border-color: rgba(224, 185, 74, 0.4);
    box-shadow: 0 12px 24px rgba(224, 185, 74, 0.18);
}

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

.card-date {
    background: var(--color-pill);
    border-radius: 16px;
    padding: 0.4rem 0.7rem;
    text-align: center;
    font-weight: 600;
}

.date-day {
    display: block;
    font-size: 1.2rem;
}

.date-month {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.card-countdown {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-countdown-top {
    justify-content: center;
    margin: 0;
    gap: 0.4rem;
}

.card-countdown-top .pill {
    background: rgba(255, 255, 255, 0.7);
    color: var(--color-ink);
    border: 1px solid rgba(113, 163, 198, 0.35);
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 0.22rem 0.6rem;
}

body.page[data-theme='dark'] .card-countdown-top .pill {
    background: rgba(9, 14, 23, 0.65);
    color: var(--color-ink);
    border-color: rgba(255, 255, 255, 0.12);
}

.pill {
    background: var(--color-pill);
    color: var(--color-ink);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.pill-soon {
    background: rgba(240, 100, 73, 0.15);
    color: var(--color-accent-dark);
}

.pill-muted {
    background: rgba(108, 100, 90, 0.12);
    color: var(--color-muted);
}

.card-wishlist ul {
    margin: 0;
    padding-left: 1rem;
    color: var(--color-ink);
}

.card-wishlist li {
    margin-bottom: 0.3rem;
}

.card-wishlist .empty {
    margin: 0;
    color: var(--color-muted);
}

.wish-list.is-collapsed li:nth-child(n+4) {
    display: none;
}

.birthday-card.is-collapsible:hover .wish-list.is-collapsed li:nth-child(n+4),
.birthday-card.is-expanded .wish-list.is-collapsed li:nth-child(n+4) {
    display: flex;
}

.wish-more {
    margin-top: 0.4rem;
    color: var(--color-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.birthday-card.is-collapsible:hover .wish-more,
.birthday-card.is-expanded .wish-more {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

body.blur-enabled .birthday-card[data-self="0"] .card-wishlist {
    filter: blur(6px);
    transition: filter 0.2s ease;
}

body.blur-enabled .birthday-card[data-self="0"]:hover .card-wishlist {
    filter: none;
}

.card-wishlist .wish-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.wish-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-bottom: 1px solid rgba(108, 100, 90, 0.15);
}

.wish-row:last-child {
    border-bottom: none;
}

body.page[data-theme='dark'] .wish-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.wish-reserve {
    margin-top: 0.15rem;
    width: 16px;
    height: 16px;
    accent-color: var(--color-reserve);
    border-radius: 4px;
    border: 1px solid var(--color-reserve);
    background-color: var(--color-bg-primary);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.wish-reserve:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.wish-spacer {
    width: 16px;
    height: 16px;
    margin-top: 0.15rem;
    display: inline-block;
}

.wish-owner-mark {
    width: 12px;
    height: 12px;
    margin-top: 0.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #ffed8a 0%, #f4c24a 40%, #b88312 100%);
    border: 1px solid rgba(169, 118, 18, 0.65);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.45), 0 6px 12px rgba(139, 97, 15, 0.22);
    opacity: 0.75;
}

body.page[data-theme='dark'] .wish-owner-mark {
    box-shadow: inset 0 0 8px rgba(255, 231, 140, 0.4), 0 6px 14px rgba(0, 0, 0, 0.45);
}

.wish-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: baseline;
}

.wish-title {
    font-weight: 600;
}

.wish-secret-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(186, 140, 45, 0.55);
    background: rgba(224, 184, 94, 0.22);
    color: #7a5a18;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-transform: lowercase;
}

body.page[data-theme='dark'] .wish-secret-pill {
    border-color: rgba(236, 201, 118, 0.52);
    background: rgba(196, 152, 60, 0.25);
    color: #f4de9e;
}

.wish-hidden .wish-text {
    opacity: 0.6;
}

.wish-hidden .wish-title {
    color: var(--color-muted);
}

.wish-reserved {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.wish-actions {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
    margin-left: auto;
}

.my-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.my-list-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    align-items: center;
}

.my-list-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.my-list-desc {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.my-list-meta {
    color: var(--color-muted);
    font-size: 0.85rem;
}

.my-list-actions {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.wish-action,
.wish-action-form button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-bg-primary);
    color: var(--color-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wish-action:hover,
.wish-action-form button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.wish-action.danger,
.wish-action-form button.danger {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.3);
}

.wish-action-form {
    margin: 0;
}

.modal.hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    width: min(560px, calc(100% - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    z-index: 1;
}

.modal-content.modal-wide {
    width: min(760px, calc(100% - 2rem));
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 1.4rem;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--color-ink);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body p {
    margin: 0 0 0.6rem;
    color: var(--color-text-secondary);
}

.modal-body strong {
    color: var(--color-ink);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.modal-footer .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    line-height: 1.1;
    min-height: 36px;
}

body.page[data-theme='dark'] .wish-action,
body.page[data-theme='dark'] .wish-action-form button {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(15, 22, 34, 0.9);
}

body.page[data-theme='dark'] .modal-content {
    background: linear-gradient(160deg, rgba(22, 31, 46, 0.98), rgba(15, 22, 34, 0.95));
}


.card-actions {
    margin-top: auto;
}

.text-link {
    color: var(--color-accent-dark);
    font-weight: 600;
    text-decoration: none;
}

.card-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    box-shadow: 0 14px 28px rgba(240, 100, 73, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(240, 100, 73, 0.35);
}

body.page[data-theme='dark'] .card-action-btn {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.month-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.month-card {
    background: var(--color-card);
    border-radius: 20px;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.month-card h3 {
    margin: 0 0 0.8rem;
    font-family: 'Fraunces', 'Georgia', serif;
}

.month-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.month-card li {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--color-border);
    font-size: 0.95rem;
}

.month-card li:last-child {
    border-bottom: none;
}

.month-name {
    font-weight: 600;
    text-align: left;
}

.year-link {
    color: inherit;
    text-decoration: none;
}

.year-link:focus,
.year-link:hover {
    text-decoration: none;
}

.month-age {
    display: flex;
    justify-content: center;
}

.month-date {
    color: var(--color-muted);
    font-size: 0.85rem;
    text-align: right;
}

.facts-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.fact-card {
    background: linear-gradient(140deg, rgba(255, 214, 186, 0.35), rgba(255, 245, 228, 0.8));
    border-radius: 18px;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(230, 187, 146, 0.45);
    box-shadow: 0 14px 28px rgba(214, 156, 96, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.page[data-theme='dark'] .fact-card {
    background: var(--color-card-top);
    border-color: rgba(255, 190, 125, 0.28);
    box-shadow: 0 18px 32px rgba(6, 10, 18, 0.35);
}

.fact-card h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.fact-value {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-ink);
}

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

.fact-sub {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.celebration-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.celebration-overlay .celebration-card {
    transform: translateY(-6vh);
}

.celebration-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 18, 0.6);
    backdrop-filter: blur(2px);
}

.celebration-card {
    position: relative;
    border-radius: 22px;
    padding: 2rem 2.6rem;
    max-width: 560px;
    width: min(90vw, 560px);
    background: radial-gradient(circle at top left, rgba(255, 232, 186, 0.95), rgba(255, 208, 124, 0.85));
    color: #2e1b08;
    border: 2px solid rgba(245, 188, 72, 0.9);
    box-shadow: 0 18px 40px rgba(255, 188, 72, 0.35), 0 0 22px rgba(255, 212, 112, 0.65);
    animation: glowPulse 3.6s ease-in-out infinite;
    overflow: hidden;
    z-index: 2;
}

body.page[data-theme='dark'] .celebration-card {
    background: radial-gradient(circle at top left, rgba(255, 214, 140, 0.95), rgba(191, 134, 36, 0.85));
    border-color: rgba(255, 214, 120, 0.75);
    box-shadow: 0 18px 40px rgba(255, 188, 72, 0.35), 0 0 24px rgba(255, 200, 120, 0.55);
    animation: glowPulseDark 3.6s ease-in-out infinite;
}

.celebration-content {
    position: relative;
    z-index: 2;
}

.celebration-kicker {
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.95rem;
    font-weight: 700;
}

.celebration-sep {
    margin: 0 0.4rem;
    opacity: 0.6;
}

.celebration-title {
    margin: 0 0 0.6rem;
    font-size: 2.2rem;
    font-weight: 800;
}

.celebration-name {
    color: #b45309;
    text-shadow: 0 6px 16px rgba(255, 188, 72, 0.6);
}

.celebration-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.celebration-decor .decor {
    position: absolute;
    font-size: 1.6rem;
    opacity: 0.9;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.2));
}

.balloon-1 {
    top: 8%;
    right: 18%;
    animation: balloonFloat 4.2s ease-in-out infinite;
}

.balloon-2 {
    top: 18%;
    right: 6%;
    animation: balloonFloat 4.8s ease-in-out infinite;
}

.cake-1 {
    top: 32%;
    right: 12%;
    font-size: 1.9rem;
    animation: cakeBob 5s ease-in-out infinite;
}

.star-1 {
    top: 6%;
    right: calc(36% - 10px);
    font-size: 1.4rem;
    animation: starTwinkle 3s ease-in-out infinite;
}

.star-2 {
    top: 28%;
    right: calc(28% - 10px);
    font-size: 1.5rem;
    animation: starTwinkle 3.4s ease-in-out infinite;
}

.celebration-message {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.celebration-confetti {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.celebration-confetti span {
    position: absolute;
    top: 0;
    left: var(--confetti-left);
    width: 10px;
    height: 16px;
    background: var(--confetti-color);
    opacity: 0.95;
    border-radius: 3px;
    animation: confettiFall var(--confetti-duration) linear infinite;
    animation-delay: var(--confetti-delay);
    transition: opacity 4.5s ease;
}

.celebration-overlay.is-hidden {
    display: none;
}

.celebration-confetti.confetti-stop span {
    animation-iteration-count: 1;
    animation-play-state: running;
    animation-fill-mode: forwards;
}

.celebration-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 1.8rem;
    color: rgba(46, 27, 8, 0.75);
    cursor: pointer;
    z-index: 3;
}

body.page[data-theme='dark'] .celebration-close {
    color: rgba(46, 27, 8, 0.9);
}

@keyframes confettiFall {
    0% {
        transform: translateY(var(--confetti-start, 70vh)) rotate(0deg);
        opacity: 0;
    }
    12% {
        opacity: 1;
    }
    40% {
        transform: translate(var(--confetti-drift, 0), -20vh) rotate(220deg);
        opacity: 0.9;
    }
    100% {
        transform: translate(var(--confetti-drift, 0), 120vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 18px 40px rgba(255, 188, 72, 0.35), 0 0 18px rgba(255, 212, 112, 0.55);
    }
    50% {
        box-shadow: 0 20px 48px rgba(255, 188, 72, 0.45), 0 0 30px rgba(255, 212, 112, 0.85);
    }
}

body.page[data-theme='dark'] .celebration-card {
    animation: glowPulseDark 3.6s ease-in-out infinite;
}

@keyframes glowPulseDark {
    0%, 100% {
        box-shadow: 0 18px 40px rgba(255, 188, 72, 0.35), 0 0 18px rgba(255, 200, 120, 0.45);
    }
    50% {
        box-shadow: 0 22px 50px rgba(255, 188, 72, 0.5), 0 0 32px rgba(255, 200, 120, 0.8);
    }
}

@keyframes balloonFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes cakeBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
}

.is-hidden {
    display: none !important;
}


.missing-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.missing-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    padding: 1rem 1.2rem;
    border: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

body.page[data-theme='dark'] .missing-card {
    background: rgba(22, 31, 46, 0.85);
}

.empty-state {
    background: var(--color-bg-alt);
    border-radius: 20px;
    border: 1px dashed var(--color-border);
    padding: 1.5rem;
    color: var(--color-muted);
}

body.page[data-theme='dark'] .empty-state {
    background: #121a28;
}

html {
    scroll-behavior: smooth;
}

.fade-in {
    opacity: 0;
    animation: fadeUp 0.6s ease forwards;
    animation-delay: var(--delay, 0s);
}

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

@media (max-width: 900px) {
    .birthday-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
    .nav-user {
        display: none;
    }
    .hero {
        padding: 1.6rem;
    }
    .my-list-row {
        flex-direction: column;
        align-items: stretch;
    }

    .my-list-actions {
        justify-content: flex-end;
    }
}

@media (min-width: 1400px) {
    .nav-inner,
    .page-main,
    .flash-wrap {
        max-width: 1400px;
    }
}

@media (max-width: 640px) {
    .birthday-grid {
        grid-template-columns: 1fr;
    }
    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .page-main {
        padding: 1.5rem 1.1rem 3rem;
    }
    .hero-actions {
        width: 100%;
    }
    .hero-actions .btn {
        flex: 1;
        text-align: center;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 520px) {
    .hero {
        padding: 1.4rem;
        border-radius: 20px;
    }
    .birthday-card {
        padding: 1.2rem;
    }
    .card-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-date {
        align-self: flex-start;
    }
    .month-card li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}
