:root {
    --gold: #d4af37;
    --gold-light: #f3e5ab;
    --ink: #f8fafc;
    --muted: #cbd5e1;
    --deep: #0f172a;
    --deep-soft: #172033;
    --green: #166534;
    --surface: rgba(15, 23, 42, 0.92);
    --border: rgba(212, 175, 55, 0.42);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(113, 178, 128, 0.20), transparent 35%),
        linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    background-attachment: fixed;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
}

.page-wrap {
    width: calc(100% - 32px);
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.site-header {
    padding: 56px 0 30px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-size: 0.76rem;
    font-weight: 700;
}

.site-header h1,
.result-panel h1,
.admin-panel h1 {
    margin: 0;
    color: var(--gold);
}

.intro {
    max-width: 720px;
    margin: 14px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 32px;
}

.category-filter a {
    padding: 9px 15px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    background: rgba(15, 23, 42, 0.45);
}

.category-filter a:hover,
.category-filter a.active {
    color: #111827;
    background: var(--gold-light);
    border-color: var(--gold-light);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.card-shell {
    min-width: 0;
}

.flip-card {
    min-height: 560px;
    perspective: 1200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    min-height: 560px;
    transition: transform 0.7s;
    transform-style: preserve-3d;
}

.card-shell.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 30px;
    border: 2px solid var(--gold);
    border-radius: 20px;
    background: var(--surface);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.28),
        inset 0 0 22px rgba(212, 175, 55, 0.08);
    backface-visibility: hidden;
}

.card-front {
    text-align: center;
}

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

.category-badge {
    align-self: center;
    display: inline-flex;
    padding: 6px 10px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--gold-light);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.card-face h2,
.received-card h1 {
    margin: 0 0 18px;
    color: var(--gold);
}

.front-message {
    color: #e2e8f0;
    line-height: 1.7;
}

.front-message p {
    margin: 10px 0;
}

.footer-text {
    margin-top: auto;
    padding-top: 16px;
    color: #94a3b8;
    border-top: 1px solid rgba(255,255,255,0.10);
}

audio {
    width: 100%;
    margin: 16px 0;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 17px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    border: 0;
    margin-top: 18px;
    background: var(--gold);
    color: #111827;
}

.primary-button:hover {
    background: var(--gold-light);
}

.secondary-button {
    border: 1px solid var(--gold);
    color: var(--gold-light);
    background: rgba(15,23,42,0.55);
}

.secondary-button:hover {
    background: rgba(212,175,55,0.14);
}

.close-back {
    position: absolute;
    top: 12px;
    right: 14px;
    border: 0;
    color: var(--gold-light);
    background: transparent;
    font-size: 2rem;
    cursor: pointer;
}

.back-help {
    margin-top: -6px;
    color: var(--muted);
    line-height: 1.5;
}

form:not(.card-search) {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--gold-light);
    font-size: 0.9rem;
    font-weight: 650;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 9px;
    padding: 11px 12px;
    color: var(--ink);
    background: rgba(2, 6, 23, 0.62);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.14);
}

textarea {
    resize: vertical;
}

.site-footer {
    padding: 38px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.empty-state,
.notice {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15,23,42,0.70);
    color: var(--muted);
}

.single-page {
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.result-panel,
.admin-panel,
.received-card {
    width: min(720px, 100%);
    padding: 32px;
    border: 2px solid var(--gold);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0,0,0,0.30);
}

.result-panel,
.admin-panel,
.received-card {

    width: 100%;
    max-width: 720px;

    padding: 32px;
    border: 2px solid var(--gold);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0,0,0,0.30);

}

.copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.copy-row .primary-button {
    margin: 0;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.text-link {
    color: var(--gold-light);
}

.received-card-wrap {
    width: 100%;
    max-width: 760px;
    text-align: center;
}

.received-card {
    margin-bottom: 20px;
}

.recipient-line {
    color: var(--gold-light);
    font-size: 1.05rem;
}

.personal-note {
    margin-top: 26px;
    padding: 22px;
    border-radius: 14px;
    background: rgba(22, 101, 52, 0.22);
    border: 1px solid rgba(134, 239, 172, 0.22);
    text-align: left;
}

.personal-note h2 {
    margin-top: 0;
    color: #bbf7d0;
}

.personal-note p {
    color: #ecfdf5;
    line-height: 1.7;
}

.sender-line {
    margin-bottom: 0;
    text-align: right;
    font-weight: 700;
}

@media (max-width: 980px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .flip-card,
    .flip-card-inner {
        min-height: 590px;
    }

    .card-face {
        padding: 25px 20px;
    }

    .copy-row {
        grid-template-columns: 1fr;
    }

    .share-actions {
        display: grid;
    }
}

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

    .flip-card,
    .flip-card-inner {
        min-height: 590px;
    }

    .card-face {
        padding: 25px 20px;
    }

    .copy-row {
        grid-template-columns: 1fr;
    }

    .share-actions {
        display: grid;
    }
}
/* ==========================================================
   Search & Filter Bar
   ========================================================== */

.card-search {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 220px 180px auto;
    gap: 15px;
    align-items: flex-end;
    margin: 25px 0;
}

.search-field,
.audience-field {
    display: flex;
    flex-direction: column;
}

.card-search label {
    margin-bottom: 6px;
    color: #f3e5ab;
    font-weight: 700;
}

.card-search input,
.card-search select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.65);
    color: #f8fafc;
    outline: none;
}

.card-search input:focus,
.card-search select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.card-search button {
    width: auto;
    min-width: 160px;
    height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #d4af37;
    color: #111827;
    font-weight: 700;
    cursor: pointer;
}

.card-search button:hover {
    background: #f3e5ab;
}

.clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #d4af37;
    border-radius: 10px;
    color: #f3e5ab;
    text-decoration: none;
}

.clear-search:hover {
    background: rgba(212, 175, 55, 0.15);
}

@media (max-width: 900px) {
    .card-search {
        grid-template-columns: 1fr 1fr;
    }

    .card-search button,
    .clear-search {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .card-search {
        grid-template-columns: 1fr;
    }
}






















