:root {
    --bg: #f4f0e8;
    --ink: #1b2230;
    --muted: #6d6f78;
    --line: #ded7c8;
    --panel: #fffaf1;
    --paper: #fffdf8;
    --accent: #277568;
    --accent-strong: #164d45;
    --action-like: #11a66a;
    --action-pass: #e2343f;
    --action-favorite: #ff8a1f;
    --action-share: #f8fafc;
    --baby-girl: #d86f9b;
    --baby-boy: #4784d8;
    --shadow: 0 24px 70px rgba(43, 34, 22, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.78), transparent 28%),
        linear-gradient(135deg, #f5efe4 0%, #eff4ee 52%, #efe9df 100%);
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

.page-shell,
.discover-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.discover-header {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.35fr);
    gap: 28px;
    align-items: end;
    margin-bottom: 34px;
}

h1 {
    margin: 0 0 12px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(42px, 7vw, 86px);
    font-weight: 700;
    line-height: 0.94;
}

.brand-title {
    display: flex;
    justify-content: center;
    width: 100%;
    max-height: 40px;
    margin-bottom: 14px;
    line-height: 1;
}

.brand-title img {
    display: block;
    width: auto;
    max-width: min(260px, 82vw);
    height: 40px;
    object-fit: contain;
}

p {
    line-height: 1.65;
}

.discover-header p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.discover-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.quick-sorts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.quick-sorts a {
    min-height: 38px;
    padding: 9px 12px;
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(100, 83, 52, 0.15);
    border-radius: 999px;
}

.quick-sorts a.is-active {
    color: #fff;
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.filter-drawer {
    position: relative;
    width: auto;
}

.filter-drawer[open] {
    flex-basis: 100%;
    width: min(620px, 100%);
    margin-left: auto;
}

.filter-drawer summary {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    margin-left: auto;
    color: #fff;
    font-weight: 900;
    list-style: none;
    background: var(--accent);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(35, 34, 30, 0.14);
}

.filter-drawer summary::-webkit-details-marker {
    display: none;
}

.filter-drawer svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(100, 83, 52, 0.13);
    border-radius: 8px;
    box-shadow: 0 14px 42px rgba(47, 44, 38, 0.08);
    backdrop-filter: blur(14px);
    margin-top: 10px;
}

.filter-bar label {
    display: grid;
    gap: 6px;
}

.filter-bar span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.filter-bar button,
.deck-actions button {
    min-height: 44px;
    padding: 0 16px;
    color: #fff;
    font-weight: 800;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.ssr-stage {
    position: relative;
    display: grid;
    grid-template-columns: 0.82fr 1.08fr 0.82fr;
    gap: 18px;
    align-items: center;
    min-height: 430px;
}

.swipe-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 18px;
    overflow: hidden;
    min-height: 340px;
    padding: 28px;
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 241, 0.96)),
        var(--paper);
    border: 1px solid rgba(112, 91, 57, 0.18);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.swipe-card::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0;
    transition: opacity 160ms ease;
}

.app-card.is-like-intent::after {
    opacity: 1;
    background: linear-gradient(90deg, transparent 42%, rgba(39, 117, 104, 0.18));
}

.app-card.is-pass-intent::after {
    opacity: 1;
    background: linear-gradient(270deg, transparent 42%, rgba(192, 57, 57, 0.18));
}

.swipe-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 72px;
    line-height: 0.95;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
}

.card-meta {
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.card-meaning {
    display: -webkit-box;
    overflow: hidden;
    color: #4d4d52;
    font-size: 17px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.gender-badge {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 1;
    min-width: 34px;
    height: 28px;
    color: var(--accent-strong);
}

.gender-badge.is-female {
    color: var(--baby-girl);
}

.gender-badge.is-male {
    color: var(--baby-boy);
}

.gender-badge svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: none;
}

.gender-badge.is-unisex svg {
    width: 22px;
    height: 22px;
}

.gender-icon.is-girl {
    color: var(--baby-girl);
}

.gender-icon.is-boy {
    color: var(--baby-boy);
}

.favorite-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #9a9da5;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.favorite-badge svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linejoin: round;
}

.favorite-badge.is-favorite {
    color: var(--action-favorite);
}

.favorite-badge.is-favorite svg {
    fill: currentColor;
    stroke: currentColor;
}

.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.card-details span {
    padding: 5px 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid rgba(100, 83, 52, 0.12);
    border-radius: 999px;
}

.app-card .card-meta,
.app-card .card-meaning,
.app-card .card-details {
    display: none;
}

.app-card.is-active .card-meaning,
.app-card.is-active .card-details {
    display: flex;
}

.app-card.is-active .card-meaning {
    display: -webkit-box;
}

.swipe-intent {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 2;
    padding: 7px 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 999px;
    transform: translateX(-50%);
}

.swipe-intent-pass {
    background: var(--action-pass);
}

.swipe-intent-like {
    background: var(--action-like);
}

.ssr-card-left,
.ssr-card-right {
    min-height: 280px;
    opacity: 0.55;
    transform: scale(0.92);
}

.ssr-card-active {
    min-height: 390px;
}

.vue-stage {
    display: grid;
    justify-items: center;
    gap: 20px;
}

.is-vue-ready .ssr-stage {
    display: none;
}

.deck {
    position: relative;
    width: min(340px, calc(100vw - 72px));
    height: 390px;
    touch-action: pan-y;
}

.app-card {
    position: absolute;
    inset: auto 0 0;
    min-height: 300px;
    max-height: 320px;
    align-content: center;
    text-align: center;
    transform-origin: 50% 100%;
    user-select: none;
    will-change: transform;
    transition: transform 180ms ease, opacity 180ms ease;
}

.app-card.is-detail-open {
    gap: 12px;
    max-height: 360px;
    align-content: center;
}

.deck.is-dragging .app-card {
    transition: none;
}

.app-card.is-active {
    cursor: grab;
    z-index: 10;
}

.app-card.is-active:active {
    cursor: grabbing;
}

.app-card.is-detail-open .card-meaning {
    font-size: 15px;
    line-height: 1.45;
    -webkit-line-clamp: 4;
}

.feedback {
    position: absolute;
    top: -10px;
    left: 50%;
    z-index: 20;
    padding: 9px 12px;
    color: #fff;
    font-weight: 900;
    background: var(--accent-strong);
    border-radius: 8px;
    transform: translate(-50%, -100%);
}

.feedback-warning {
    background: #8b5f22;
}

.deck-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: min(390px, calc(100vw - 32px));
}

.deck-actions button {
    display: grid;
    place-items: center;
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 14px 32px rgba(35, 34, 30, 0.14);
}

.deck-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.deck-actions svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.deck-actions .action-pass {
    background: var(--action-pass);
}

.deck-actions .action-share,
.deck-actions .action-undo {
    color: var(--ink);
    background: var(--action-share);
    border: 1px solid rgba(27, 34, 48, 0.16);
}

.deck-actions .action-favorite {
    background: var(--action-favorite);
}

.deck-actions .action-like {
    background: var(--action-like);
}

.empty-state {
    padding: 32px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.empty-state.compact {
    position: absolute;
    inset: 70px 0 auto;
    text-align: center;
}

.list-panel {
    width: min(520px, 100%);
    padding: 16px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.list-panel-header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.list-panel h2 {
    margin: 0;
    font-size: 18px;
}

.list-panel p {
    margin: 4px 0 0;
    color: var(--muted);
}

.list-panel button {
    min-height: 40px;
    padding: 0 14px;
    color: #fff;
    font-weight: 800;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.share-link {
    display: block;
    margin-top: 12px;
    overflow-wrap: anywhere;
    color: var(--accent-strong);
    font-weight: 800;
}

.shared-list-hero {
    margin-bottom: 28px;
}

.shared-list-hero > span {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-strong);
    font-weight: 900;
    text-transform: uppercase;
}

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

.shared-list-item {
    display: grid;
    gap: 12px;
    min-height: 220px;
    padding: 20px;
    text-decoration: none;
    background: rgba(255, 253, 248, 0.84);
    border: 1px solid rgba(112, 91, 57, 0.18);
    border-radius: 8px;
    box-shadow: 0 14px 42px rgba(47, 44, 38, 0.08);
}

.shared-list-item strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 42px;
    line-height: 1;
}

.name-detail {
    max-width: 720px;
    padding: 28px;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
}

.name-detail dl {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 24px;
}

.name-detail dt,
.name-detail dd {
    margin: 0;
}

.name-detail dt {
    color: var(--muted);
    font-size: 14px;
}

.name-detail dd {
    margin-top: 4px;
    font-weight: 800;
}

@media (max-width: 860px) {
    .discover-header,
    .ssr-stage {
        grid-template-columns: 1fr;
    }

    .filter-drawer {
        justify-self: stretch;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .brand-title {
        justify-content: flex-start;
    }

    .ssr-card-left,
    .ssr-card-right {
        display: none;
    }

    .deck {
        height: 380px;
    }
}

@media (max-width: 520px) {
    .page-shell,
    .discover-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 24px;
    }

    .swipe-card {
        min-height: 390px;
        padding: 22px;
    }

    .app-card {
        min-height: 290px;
    }

    .deck-actions {
        gap: 8px;
    }

    .deck-actions button {
        width: min(48px, calc((100vw - 64px) / 5));
        min-width: min(48px, calc((100vw - 64px) / 5));
        height: min(48px, calc((100vw - 64px) / 5));
        min-height: min(48px, calc((100vw - 64px) / 5));
    }

    .deck-actions svg {
        width: 24px;
        height: 24px;
    }
}
