/*#region Reset and Base*/
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #fdf6ee;
    --surface: #fff8f0;
    --surface-alt: #f5ede0;
    --primary: #c17f5a;
    --primary-dark: #a0623d;
    --accent: #e8a87c;
    --text: #4a3728;
    --muted: #9c7b6b;
    --border: #e8d5c0;
    --card-shadow: 0 4px 20px rgba(193,127,90,0.13);
    --radius: 16px;
    --radius-sm: 10px;
    --font-body: 'Georgia', 'Times New Roman', serif;
    --font-ui: 'Segoe UI', system-ui, sans-serif;
    --transition: 0.2s ease;
}

/* ── Spring ─────────────────────────────────────── */
body.spring {
    --bg: #f5f9f0;
    --surface: #eef5e8;
    --surface-alt: #e0edd6;
    --primary: #7a9e7e;
    --primary-dark: #5a7e5e;
    --accent: #c9a96e;
    --text: #2d3d2e;
    --muted: #6b8c6e;
    --border: #c8ddc8;
    --card-shadow: 0 4px 20px rgba(122,158,126,0.13);
}

/* ── Summer ─────────────────────────────────────── */
body.summer {
    --bg: #f0f7e8;
    --surface: #e8f5d8;
    --surface-alt: #d8edC0;
    --primary: #5a8a3c;
    --primary-dark: #3a6a1c;
    --accent: #d4b800;
    --text: #1e3010;
    --muted: #5a7a40;
    --border: #b8d898;
    --card-shadow: 0 4px 20px rgba(90,138,60,0.13);
}

/* ── Autumn ─────────────────────────────────────── */
body.autumn {
    --bg: #1a1008;
    --surface: #241508;
    --surface-alt: #2e1e0e;
    --primary: #d2691e;
    --primary-dark: #b24e0e;
    --accent: #9b6bb5;
    --text: #f0e0d0;
    --muted: #b89070;
    --border: #3e2810;
    --card-shadow: 0 4px 20px rgba(210,105,30,0.2);
}

/* ── Winter ─────────────────────────────────────── */
body.winter {
    --bg: #0f0d14;
    --surface: #1a1726;
    --surface-alt: #221e30;
    --primary: #b39ddb;
    --primary-dark: #9378c0;
    --accent: #7c6b9e;
    --text: #e8e0f8;
    --muted: #9080b8;
    --border: #2e2840;
    --card-shadow: 0 4px 20px rgba(179,157,219,0.15);
}

html, body {
    height: 100%;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100%;
}
/*#endregion*/

/*#region Scrollbar*/
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}
/*#endregion*/

/*#region Layout Shell*/
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background-color: var(--bg);
}
/*#endregion*/

/*#region Top Bar*/
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(193,127,90,0.08);
    z-index: 100;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    flex-shrink: 0;
}

.app-title {
    font-size: 1.2rem;
    color: var(--primary);
    font-family: var(--font-body);
    white-space: nowrap;
}

.home-btn {
    font-size: 1.4rem;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

    .home-btn:hover {
        background: var(--surface-alt);
    }

.season-indicator {
    font-size: 1.2rem;
    margin-left: auto;
    margin-right: 0.75rem;
}
/*#endregion*/

/*#region Main Content*/
.main-content {
    margin-top: 64px;
    padding: 2.5rem;
    flex: 1;
    min-height: calc(100vh - 64px);
    background-color: var(--bg);
}
/*#endregion*/

/*#region Page Header*/
.page-header {
    margin-bottom: 2rem;
}

    .page-header h1 {
        font-size: 2rem;
        color: var(--primary);
        font-family: var(--font-body);
    }

    .page-header p {
        color: var(--muted);
        font-size: 0.95rem;
        margin-top: 0.25rem;
        font-family: var(--font-ui);
    }
/*#endregion*/

/*#region Cards*/
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}
/*#endregion*/

/*#region Buttons*/
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

    .btn:active {
        transform: scale(0.97);
    }

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

    .btn-primary:hover {
        background: var(--primary-dark);
    }

.btn-ghost {
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

    .btn-ghost:hover {
        background: var(--border);
    }
/*#endregion*/

/*#region Responsive*/
@media (max-width: 900px) {
    .main-content {
        padding: 1.5rem;
    }
}
/*#endregion*/

/*#region Blazor Error UI*/
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
/*#endregion*/

/*#region Blazor Error Boundary*/
.blazor-error-boundary {
    background-color: #b32121;
    color: white;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}
/*#endregion*/

/*#region Loading Spinner*/
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--border);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--primary);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--primary);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text::after {
        content: var(--blazor-load-percentage-text, "Loading");
    }
/*#endregion*/

/*#region Login Page*/
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 1.5rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.login-title {
    font-size: 1.8rem;
    color: var(--primary);
    font-family: var(--font-body);
}

.login-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    font-family: var(--font-ui);
    margin-top: 0.25rem;
    margin-bottom: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-input {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color var(--transition);
}

    .login-input:focus {
        border-color: var(--primary);
    }

.login-error {
    color: #b85c5c;
    font-size: 0.85rem;
    font-family: var(--font-ui);
}

.login-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
    font-size: 1rem;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.4s ease;
}
/*#endregion*/

/*#region Home Page*/
.home-page {
    max-width: 900px;
    margin: 0 auto;
}
/*#endregion*/

/*#region Home Page Header*/
.current-datetime {
    font-size: 0.95rem;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-top: 0.5rem;
}

.rotating-message {
    font-size: 1.05rem;
    color: var(--primary);
    font-family: var(--font-body);
    font-style: italic;
    margin-top: 0.4rem;
    min-height: 1.6rem;
    transition: opacity 0.3s ease;
}

.day-fun-fact {
    font-size: 0.9rem;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-top: 0.25rem;
}

    .day-fun-fact strong {
        color: var(--primary);
    }
/*#endregion*/

/*#region Section Title*/
.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-family: var(--font-ui);
    margin: 2.5rem 0 1rem;
}
/*#endregion*/

/*#region On This Day*/
.on-this-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.on-this-day-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.otd-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.otd-emoji {
    font-size: 1.5rem;
}

.otd-year {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: var(--font-ui);
}

.otd-title {
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text);
    font-weight: bold;
}

.otd-description {
    font-size: 0.88rem;
    color: var(--muted);
    font-family: var(--font-ui);
    line-height: 1.6;
}
/*#endregion*/

/*#region Bubbles*/
.bubbles-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: var(--radius);
    background: radial-gradient(ellipse at 30% 50%, var(--surface) 0%, var(--bg) 50%, var(--surface-alt) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.bubble {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--surface), var(--primary));
    border: 2px solid var(--border);
    box-shadow: 0 4px 20px rgba(193,127,90,0.2);
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
    will-change: transform;
}

    .bubble:hover {
        box-shadow: 0 0 0 6px rgba(193,127,90,0.2), 0 0 0 12px rgba(193,127,90,0.1);
        animation: pulse 1s infinite;
        z-index: 10;
    }

.bubble-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.bubble-label {
    font-size: 0.85rem;
    font-family: var(--font-ui);
    color: #fff;
    margin-top: 0.4rem;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 6px rgba(193,127,90,0.2), 0 0 0 12px rgba(193,127,90,0.1);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(193,127,90,0.15), 0 0 0 20px rgba(193,127,90,0.05);
    }

    100% {
        box-shadow: 0 0 0 6px rgba(193,127,90,0.2), 0 0 0 12px rgba(193,127,90,0.1);
    }
}

@media (max-width: 600px) {
    .bubbles-container {
        height: 400px;
    }

    .bubble {
        width: 110px;
        height: 110px;
    }

    .bubble-icon {
        font-size: 1.8rem;
    }

    .bubble-label {
        font-size: 0.72rem;
    }
}
/*#endregion*/

/*#region Stats Page*/
.stats-page {
    max-width: 960px;
    margin: 0 auto;
}

.stats-grid-new {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Base Card */
.stat-card-new {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition);
}

    .stat-card-new:hover {
        transform: translateY(-3px);
    }

/* Top Border Accent */
.stat-card-top-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.met-card .stat-card-top-border {
    background: linear-gradient(90deg, #f0c060, #e8a87c);
}

.wedding-card .stat-card-top-border {
    background: linear-gradient(90deg, #d4a0c0, #c17f5a);
}

.together-card .stat-card-top-border {
    background: linear-gradient(90deg, #c17f5a, #e8a87c);
}

.anniversary-card .stat-card-top-border {
    background: linear-gradient(90deg, #a0c080, #60a060);
}

.home-card .stat-card-top-border {
    background: linear-gradient(90deg, #80b0d0, #5090b0);
}

.lieins-card .stat-card-top-border {
    background: linear-gradient(90deg, #b090d0, #9070b0);
}

.kelly-card .stat-card-top-border {
    background: linear-gradient(90deg, #f080a0, #d06080);
}

.matty-card .stat-card-top-border {
    background: linear-gradient(90deg, #80a0f0, #5070d0);
}

.percent-card .stat-card-top-border {
    background: linear-gradient(90deg, #f0c060, #c17f5a);
}

/* Featured Cards */
.featured-card {
    grid-column: span 2;
    align-items: stretch;
    text-align: left;
}

.stat-card-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.stat-card-left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-card-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
}

/* Typography */
.stat-icon-new {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-icon-large {
    font-size: 3rem;
}

.stat-label-new {
    font-size: 0.78rem;
    color: var(--muted);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-date-new {
    font-size: 0.82rem;
    color: var(--muted);
    font-family: var(--font-ui);
}

.stat-number {
    font-size: 3.2rem;
    font-family: var(--font-body);
    color: var(--primary);
    line-height: 1;
    font-weight: bold;
}

.stat-unit-new {
    font-size: 0.9rem;
    color: var(--muted);
    font-family: var(--font-ui);
}

.stat-breakdown {
    font-size: 0.82rem;
    color: var(--muted);
    font-family: var(--font-ui);
}

/* Live Ticker */
.stat-live-ticker {
    display: flex;
    gap: 0.5rem;
}

.ticker-item {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--muted);
    text-align: center;
}

    .ticker-item span {
        display: block;
        font-size: 1.1rem;
        color: var(--primary);
        font-weight: bold;
    }

.stat-live-ticker-small {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--primary);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    margin-top: 0.25rem;
}

/* Progress Bar */
.stat-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-alt);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.stat-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 99px;
    transition: width 1s ease;
}

/* Next Anniversary */
.stat-next-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-next-days {
    font-size: 1.4rem;
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 650px) {
    .stats-grid-new {
        grid-template-columns: 1fr;
    }

    .featured-card {
        grid-column: span 1;
    }

    .stat-card-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-card-left {
        align-items: center;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}
/*#endregion*/

/*#region Timeline Page*/
.timeline-page {
    max-width: 900px;
    margin: 0 auto;
}

.timeline-loading {
    text-align: center;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-top: 3rem;
}

.timeline {
    position: relative;
    padding: 2rem 0;
}

    .timeline::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--border);
        transform: translateX(-50%);
    }

.timeline-item {
    display: flex;
    justify-content: flex-end;
    padding-right: calc(50% + 2rem);
    position: relative;
    margin-bottom: 2.5rem;
}

    .timeline-item.right {
        justify-content: flex-start;
        padding-right: 0;
        padding-left: calc(50% + 2rem);
    }

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 1.5rem;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 3px solid var(--bg);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-card {
    max-width: 380px;
    width: 100%;
}

.timeline-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.timeline-emoji {
    font-size: 1.5rem;
}

.timeline-category {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background: var(--surface-alt);
    color: var(--muted);
}

    .timeline-category.milestone {
        background: #fdeedd;
        color: var(--primary);
    }

    .timeline-category.memories {
        background: #eef5e8;
        color: #6a9a50;
    }

.timeline-date {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-bottom: 0.4rem;
}

.timeline-title {
    font-size: 1.1rem;
    color: var(--text);
    font-family: var(--font-body);
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.9rem;
    color: var(--muted);
    font-family: var(--font-ui);
    line-height: 1.6;
}

.timeline-media {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    display: block;
}

.timeline-image-clickable {
    cursor: pointer;
    transition: transform var(--transition);
}

    .timeline-image-clickable:hover {
        transform: scale(1.02);
    }

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background var(--transition);
}

    .lightbox-close:hover {
        background: rgba(255, 255, 255, 0.3);
    }

@media (max-width: 600px) {
    .lightbox {
        padding: 1rem;
    }

    .lightbox-img {
        max-width: 100%;
        max-height: 85%;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 650px) {
    .timeline::before {
        left: 1rem;
    }

    .timeline-item,
    .timeline-item.right {
        padding-left: 3rem;
        padding-right: 0;
        justify-content: flex-start;
    }

    .timeline-dot {
        left: 1rem;
    }

    .timeline-card {
        max-width: 100%;
    }
}
/*#endregion*/

/*#region Memory Map Page*/
.memory-map-page {
    max-width: 960px;
    margin: 0 auto;
}

.map-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.map-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--card-shadow);
    min-width: 100px;
}

.map-stat-number {
    font-size: 2rem;
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: bold;
    line-height: 1;
}

.map-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.25rem;
}

.map-wrapper {
    padding: 0;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

#memory-map {
    height: 500px;
    width: 100%;
    border-radius: var(--radius);
}

.map-locations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.map-location-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-family: var(--font-ui);
    color: var(--text);
}

@media (max-width: 600px) {
    #memory-map {
        height: 350px;
    }
}
/*#endregion*/

/*#region Pets Page*/
.pets-page {
    max-width: 900px;
    margin: 0 auto;
}

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

.pet-card-wrapper {
    perspective: 1000px;
    height: 520px;
}

.pet-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    cursor: pointer;
}

    .pet-card.flipped {
        transform: rotateY(180deg);
    }

.pet-card-front,
.pet-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pet-card-back {
    transform: rotateY(180deg);
    padding: 1.5rem;
    justify-content: space-between;
}

.pet-card-photo {
    height: 220px;
    flex-shrink: 0;
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.pet-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform var(--transition);
}

    .pet-photo-img:hover {
        transform: scale(1.05);
    }

.pet-placeholder-emoji {
    font-size: 6rem;
}

.pet-card-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.pet-name {
    font-size: 1.4rem;
    font-family: var(--font-body);
    color: var(--primary);
}

.pet-card-info-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pet-alias {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text);
    font-family: var(--font-body);
}

.pet-status {
    font-size: 0.75rem;
    font-family: var(--font-ui);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
}

    .pet-status.alive {
        background: #eef5e8;
        color: #6a9a50;
    }

    .pet-status.deceased {
        background: #f0e8f5;
        color: #9a50a0;
    }

.pet-defining {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--muted);
}

.pet-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.25rem 0;
}

.pet-bio-front {
    font-size: 0.82rem;
    color: var(--muted);
    font-family: var(--font-ui);
    line-height: 1.6;
}

.pet-gotcha {
    font-size: 0.8rem;
    color: var(--muted);
    font-family: var(--font-ui);
}

.pet-gotcha-age {
    color: var(--primary);
}

.pet-flip-hint {
    font-size: 0.75rem;
    color: var(--muted);
    font-family: var(--font-ui);
    margin-top: 0.25rem;
}

.pet-back-name {
    font-size: 1.2rem;
    font-family: var(--font-body);
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.pet-stats {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
    justify-content: center;
}

.pet-stat-row {
    display: grid;
    grid-template-columns: 130px 1fr 24px;
    align-items: center;
    gap: 0.5rem;
}

.pet-stat-label {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--text);
}

.pet-stat-bar {
    height: 8px;
    background: var(--surface-alt);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.pet-stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 99px;
    transition: width 0.6s ease;
}

.pet-stat-value {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--primary);
    font-weight: bold;
    text-align: right;
}

.pet-top-stat {
    font-size: 0.82rem;
    font-family: var(--font-ui);
    color: var(--text);
    text-align: center;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

    .pet-top-stat strong {
        color: var(--primary);
    }
/*#endregion*/

/*#region Playlist Page*/
.playlist-page {
    max-width: 800px;
    margin: 0 auto;
}

.playlist-embed-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
}

    .playlist-embed-wrapper iframe {
        display: block;
        width: 100%;
    }
/*#endregion*/

/*#region Misc*/
code {
    color: #c02d76;
}
/*#endregion*/

/*#region Reasons Page*/
.reasons-page {
    max-width: 900px;
    margin: 0 auto;
}

/* Featured */
.reasons-featured {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.reasons-featured-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.reasons-featured-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-family: var(--font-ui);
}

.reasons-featured-count {
    font-size: 0.78rem;
    color: var(--muted);
    font-family: var(--font-mono, var(--font-ui));
}

.reasons-featured-text {
    font-size: 1.3rem;
    font-family: var(--font-body);
    color: var(--text);
    font-style: italic;
    line-height: 1.7;
    text-align: center;
    padding: 0.5rem 1rem;
}

.reasons-random-btn {
    align-self: center;
}

/* Grid */
.reasons-grid {
    columns: 3;
    gap: 1rem;
}

.reason-card {
    break-inside: avoid;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: border-color var(--transition), transform var(--transition);
}

    .reason-card:hover {
        transform: translateY(-2px);
        border-color: var(--primary);
    }

    .reason-card.reason-highlighted {
        border-color: var(--primary);
        background: linear-gradient(135deg, var(--surface) 60%, var(--surface-alt));
    }

.reason-num {
    font-size: 0.72rem;
    color: var(--muted);
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.reason-text {
    font-size: 0.88rem;
    font-family: var(--font-body);
    color: var(--text);
    font-style: italic;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .reasons-grid {
        columns: 2;
    }
}

@media (max-width: 450px) {
    .reasons-grid {
        columns: 1;
    }
}
/*#endregion*/

.init-loader {
    min-height: 100vh;
    background: var(--bg);
}