/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(-3deg); }
    50%       { transform: translateY(-12px) rotate(3deg); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ── Base ────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #FFF8E7;
    color: #2C1810;
    min-height: 100vh;
    line-height: 1.5;
}

/* ── Site header ─────────────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, #4A2509 0%, #7B3F00 60%, #9B5523 100%);
    color: #FFF8E7;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: 0 3px 16px rgba(44,24,16,.45);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-header h1 {
    font-size: 1.25rem;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.site-header h1 a { color: inherit; text-decoration: none; }
.site-header nav { display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.site-header nav a {
    color: rgba(255,248,231,.75);
    text-decoration: none;
    font-weight: 500;
    font-size: .85rem;
    padding: .35rem .7rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.site-header nav a:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
}
.site-header nav a.active {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.nav-discord {
    background: rgba(88,101,242,.7) !important;
    color: #fff !important;
}
.nav-discord:hover { background: #5865F2 !important; }

/* ── Layout ──────────────────────────────────────────────── */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
.container-sm { max-width: 620px; margin: 0 auto; padding: 2rem 1rem; }
.page-title {
    font-size: 1.6rem;
    color: #5C3317;
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: #fffdf7;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 0 #e8d5b0, 0 4px 20px rgba(92,51,23,.1);
    border: 1px solid #eedfc0;
    margin-bottom: 1.25rem;
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 0 #e8d5b0, 0 8px 28px rgba(92,51,23,.16); }

/* ── Cookie cards ────────────────────────────────────────── */
.cookie-card {
    border-left: none;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    animation: fadeInUp .35s ease both;
}
.cookie-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #C8860A, #8B4513);
    border-radius: 5px 0 0 5px;
}
.cookie-icon {
    font-size: 2.6rem;
    flex-shrink: 0;
    line-height: 1;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF3DC, #FFE4B5);
    border-radius: 14px;
    border: 2px solid #E8C870;
    transition: transform .2s;
}
.cookie-card:hover .cookie-icon { transform: rotate(-5deg) scale(1.08); }
.cookie-body { flex: 1; min-width: 0; padding-left: .25rem; }
.cookie-flavour {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #C8860A;
    margin-bottom: .2rem;
}
.cookie-message {
    font-size: 1rem;
    font-style: italic;
    color: #2C1810;
    margin-bottom: .45rem;
    line-height: 1.55;
}
.cookie-meta { font-size: .78rem; color: #9B7040; }
.cookie-meta a { color: #8B4513; text-decoration: none; font-weight: 500; }
.cookie-meta a:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-size: .875rem;
    transition: filter .15s, transform .1s, box-shadow .15s;
    line-height: 1.3;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); filter: brightness(.97); box-shadow: none; }
.btn-primary   { background: linear-gradient(135deg, #8B4513, #7B3F00); color: #fff; }
.btn-secondary { background: linear-gradient(135deg, #D4A76A, #C8860A); color: #fff; }
.btn-discord   { background: #5865F2; color: #fff; }
.btn-discord:hover { background: #4752C4; }
.btn-danger    { background: linear-gradient(135deg, #c0392b, #922b21); color: #fff; }
.btn-ghost     { background: transparent; color: #8B4513; border: 2px solid #D4A76A; }
.btn-ghost:hover { background: #FFF3DC; }
.btn-sm        { padding: .3rem .75rem; font-size: .78rem; border-radius: 8px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
    color: #5C3317;
    font-size: .875rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .65rem .9rem;
    border: 2px solid #E8D5B0;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    background: #FFFDF5;
    color: #2C1810;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #C8860A;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(200,134,10,.15);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .77rem; color: #9B7040; margin-top: .3rem; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    animation: slideIn .25s ease;
}
.alert::before { font-size: 1.1rem; flex-shrink: 0; }
.alert-success { background: #d4f0e0; color: #0d4a28; border: 1px solid #a8dfc0; }
.alert-success::before { content: '✅'; }
.alert-error   { background: #fde8e8; color: #721c24; border: 1px solid #f5c6cb; }
.alert-error::before { content: '⚠️'; }
.alert-info    { background: #e0f0ff; color: #0c4a7a; border: 1px solid #b8d8f5; }
.alert-info::before { content: 'ℹ️'; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { border-radius: 12px; overflow: hidden; box-shadow: 0 2px 0 #e8d5b0, 0 4px 20px rgba(92,51,23,.1); border: 1px solid #eedfc0; margin-bottom: 1.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; background: #fffdf7; }
.table th {
    background: linear-gradient(135deg, #5C3317, #7B3F00);
    color: #fff;
    padding: .7rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.table td { padding: .65rem 1rem; border-bottom: 1px solid #f0e6d2; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: #FFF8EC; }

/* ── Stats ───────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-box {
    background: #fffdf7;
    border-radius: 14px;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 2px 0 #e8d5b0, 0 4px 16px rgba(92,51,23,.1);
    border: 1px solid #eedfc0;
    transition: transform .2s;
}
.stat-box:hover { transform: translateY(-3px); }
.stat-num   { font-size: 2.5rem; font-weight: 800; color: #8B4513; line-height: 1.1; }
.stat-label { font-size: .72rem; color: #9B7040; text-transform: uppercase; letter-spacing: .07em; margin-top: .2rem; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.hero-bg-cookies {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-bg-cookies span {
    position: absolute;
    font-size: 2rem;
    opacity: .12;
    animation: float 4s ease-in-out infinite;
}
.hero-bg-cookies span:nth-child(1) { left: 5%;  top: 20%; animation-delay: 0s;   font-size: 2.5rem; }
.hero-bg-cookies span:nth-child(2) { left: 15%; top: 60%; animation-delay: .8s;  font-size: 1.5rem; }
.hero-bg-cookies span:nth-child(3) { left: 80%; top: 15%; animation-delay: 1.6s; font-size: 3rem; }
.hero-bg-cookies span:nth-child(4) { left: 88%; top: 65%; animation-delay: 0.4s; font-size: 1.8rem; }
.hero-bg-cookies span:nth-child(5) { left: 50%; top: 75%; animation-delay: 1.2s; font-size: 2.2rem; }
.hero-jar { font-size: 5rem; margin-bottom: .75rem; display: inline-block; animation: float 3s ease-in-out infinite; }
.hero h2 { font-size: 2.2rem; color: #5C3317; margin-bottom: .5rem; font-weight: 800; }
.hero p  { color: #9B7040; margin-bottom: 2rem; font-size: 1.05rem; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ── Share box ───────────────────────────────────────────── */
.share-box {
    background: linear-gradient(135deg, #FFF8E7, #FFF3DC);
    border: 1px solid #D4A76A;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.share-box input {
    flex: 1;
    min-width: 200px;
    border: 1px solid #D4A76A;
    border-radius: 8px;
    padding: .45rem .75rem;
    background: #fff;
    font-size: .83rem;
    font-family: monospace;
    color: #5C3317;
}

/* ── Badge ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.badge-brown { background: #F5E6CC; color: #7B3F00; }
.badge-gold  { background: #FEF3C7; color: #92400E; }
.badge-blue  { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }

/* ── Single cookie view ──────────────────────────────────── */
.cookie-big {
    text-align: center;
    padding: 2.5rem 2rem;
    position: relative;
    overflow: hidden;
}
.cookie-big::after {
    content: '🍪';
    position: absolute;
    font-size: 8rem;
    opacity: .04;
    bottom: -1rem;
    right: -1rem;
    pointer-events: none;
}
.cookie-big .icon { font-size: 5rem; margin-bottom: .75rem; display: inline-block; animation: pop .6s ease; }
.cookie-big .flavour-label {
    display: inline-block;
    background: linear-gradient(135deg, #8B4513, #C8860A);
    color: #fff;
    padding: .3rem 1.1rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1.25rem;
}
.cookie-big .big-message {
    font-size: 1.4rem;
    font-style: italic;
    color: #2C1810;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.cookie-big .big-meta { color: #9B7040; font-size: .9rem; }
.cookie-big .recipient-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #5C3317;
    margin-bottom: .4rem;
}

/* ── Login box ───────────────────────────────────────────── */
.login-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 3rem 1rem; }
.login-box { width: 100%; max-width: 420px; }
.login-box .card { padding: 2rem; }
.login-box h2 { font-size: 1.4rem; color: #5C3317; margin-bottom: 1.5rem; text-align: center; font-weight: 700; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid #E8D5B0; margin: 1.5rem 0; }
.divider-label {
    text-align: center;
    position: relative;
    color: #9B7040;
    font-size: .8rem;
    margin: 1.25rem 0;
}
.divider-label::before,
.divider-label::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 2rem);
    height: 1px;
    background: #E8D5B0;
}
.divider-label::before { left: 0; }
.divider-label::after  { right: 0; }

/* ── Profile ─────────────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 4px solid #D4A76A;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-avatar-placeholder {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: 4px solid #D4A76A;
    background: linear-gradient(135deg, #D4A76A, #8B4513);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.profile-name { font-size: 1.6rem; font-weight: 800; color: #5C3317; }
.profile-sub  { color: #9B7040; font-size: .9rem; margin-top: .2rem; }

/* ── Discord ID display ──────────────────────────────────── */
.discord-linked {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: linear-gradient(135deg, #eef0ff, #e8eaff);
    border: 1px solid #c5caff;
    border-radius: 10px;
    margin-bottom: 1rem;
}
.discord-linked .discord-icon { font-size: 1.4rem; }
.discord-linked .discord-info { flex: 1; }
.discord-linked .discord-name { font-weight: 600; color: #3730a3; font-size: .9rem; }
.discord-linked .discord-id   { font-size: .75rem; color: #6366f1; font-family: monospace; }

/* ── Action row ──────────────────────────────────────────── */
.action-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9B7040;
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: .75rem; }
.empty-state h3 { color: #7B3F00; margin-bottom: .5rem; font-size: 1.1rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .6rem;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    color: #7B3F00;
    background: #fffdf7;
    border: 1px solid #E8D5B0;
    transition: background .15s, color .15s;
}
.pagination a:hover { background: #FFF3DC; border-color: #D4A76A; }
.pagination .current { background: #8B4513; color: #fff; border-color: #8B4513; font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-header { height: auto; padding: .7rem 1rem; }
    .cookie-card { flex-direction: column; gap: .75rem; }
    .cookie-card::before { width: 100%; height: 4px; top: 0; left: 0; right: 0; bottom: auto; border-radius: 16px 16px 0 0; }
    .hero h2 { font-size: 1.6rem; }
    .cookie-big .big-message { font-size: 1.1rem; }
    .profile-header { flex-direction: column; text-align: center; }
}

/* ── Utility ─────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.text-muted { color: #9B7040; font-size: .85rem; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
code { background: #f0e6d2; padding: .1rem .4rem; border-radius: 4px; font-size: .83rem; color: #7B3F00; }
.w-full { width: 100%; }
