/* ==========================================================================
   BAMBICIM — SITE THEME (clean)
   - Chat UI lives in: chatbot.css
   ========================================================================== */

/* ==========================================================================
   1) THEME TOKENS (default = pink) + VARIANTS
   ========================================================================== */
:root,
body[data-theme="pink"] {
    --bg: #120812;
    --text: #ffeef9;
    --muted: #f1cde3;
    --card: #1c0c1d;
    --line: #3d1a40;
    --accent: #ff6ad5;
    --accent2: #ffb7f5;
    --radius: 16px;
    --radius-sm: 12px;
    --container: 1100px;
}

body[data-theme="dark"] {
    --bg: #0b0b10;
    --text: #f6f0fa;
    --muted: #cdbfdb;
    --card: #14131a;
    --line: #2b2635;
    --accent: #a86cff;
    --accent2: #6ad8ff;
}

body[data-theme="hot"] {
    --bg: #0f0612;
    --text: #fff4ff;
    --muted: #f8b9e6;
    --card: #19071d;
    --line: #36103d;
    --accent: #ff2bb6;
    --accent2: #ff7ad9;
}

body[data-theme="white"] {
    --bg: #fff8fe;
    --text: #321a33;
    --muted: #644d66;
    --card: #ffffff;
    --line: #f1dff1;
    --accent: #ff4fb8;
    --accent2: #ffc8e9;
}

/* ==========================================================================
   2) RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    transition: background-color .4s ease, color .4s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout helpers */
.b-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px;
}

.b-text {
    color: var(--text);
}

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

.b-mt-xl {
    margin-top: 40px;
}

/* Pills & buttons */
.cta, .ghost, .pill, .choice-btn {
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
}

.cta, .pill {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #120812;
}

.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
}

.b-nav .pill.ghost,
.b-nav form button.ghost {
    /* nav pills: make ghost look solid */
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border: none;
    color: var(--bg);
    font-weight: 800;
}

.b-nav .pill.small, .b-nav .ghost.small {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .95rem;
}

/* ==========================================================================
   3) TOP NAV
   ========================================================================== */
.b-nav {
    display: grid;
    grid-template-columns:1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 22px 24px 0;
    position: relative;
    z-index: 10;
}

.brand {
    letter-spacing: .16em;
    font-weight: 800;
    justify-self: start;
}

.b-nav nav.main-nav {
    justify-self: center;
    display: flex;
    gap: 18px;
    align-items: center;
}

.b-nav nav.main-nav a {
    color: var(--muted);
}

.b-nav .auth {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.b-nav form {
    margin: 0;
}

.b-nav form button {
    all: unset;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Theme dots */
.theme-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 16px;
}

.theme-toggle .swatch {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent2));
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
}

.theme-toggle .swatch.hot {
    background: radial-gradient(circle at 30% 30%, #ff2bb6, #ff7ad9);
}

.theme-toggle .swatch.white {
    background: radial-gradient(circle at 30% 30%, #ff4fb8, #ffc8e9);
    border-color: #e8d3e8;
}

.theme-toggle .swatch:hover {
    transform: translateY(-1px) scale(1.06);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* ==========================================================================
   4) HERO
   ========================================================================== */
.b-hero {
    display: grid;
    grid-template-columns:1.2fr .8fr;
    gap: 32px;
    align-items: center;
    padding: 64px 24px 24px;
}

.hero-copy h1 {
    font-size: 44px;
    line-height: 1.05;
    margin: .1em 0 .3em;
}

.hero-copy p {
    color: var(--muted);
    max-width: 56ch;
}

.grad {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cta-row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    align-items: center;
}

.badges {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
}

.badges span {
    border: 1px solid var(--line);
    padding: 6px 10px;
    border-radius: 999px;
}

/* Art */
.hero-art {
    position: relative;
    height: 320px;
    background: radial-gradient(1200px 400px at 10% -20%, rgba(124, 77, 255, .12), transparent),
    radial-gradient(1200px 400px at 90% 120%, rgba(0, 212, 255, .12), transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background: linear-gradient(var(--line) 1px, transparent 1px) 0 0/24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0/24px 24px;
    opacity: .25;
}

.orb {
    position: absolute;
    filter: blur(32px);
    opacity: .65;
    animation: float 10s ease-in-out infinite;
}

.hero-art .orb-1 {
    width: 220px;
    height: 220px;
    left: -30px;
    top: 40px;
    background: color-mix(in srgb, var(--accent) 35%, transparent);
}

.hero-art .orb-2 {
    width: 260px;
    height: 260px;
    right: -40px;
    bottom: -30px;
    background: color-mix(in srgb, var(--accent2) 35%, transparent);
}

@keyframes float {
    50% {
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   5) FEATURE CARDS
   ========================================================================== */
.b-cards {
    display: grid;
    grid-template-columns:repeat(3, 1fr);
    gap: 18px;
    margin-top: 26px;
}

.b-cards article {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}

.b-cards h3 {
    margin: .2em 0 .2em;
}

.b-cards p {
    color: var(--muted);
}

/* ==========================================================================
   6) SELECTED WORK GRID
   ========================================================================== */
.work-grid {
    display: grid;
    grid-template-columns:1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .work-grid {
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .work-grid {
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }
}

.work-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    transition: transform .2s ease;
}

.work-card:hover {
    transform: translateY(-2px);
}

.work-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.work-card .card-body {
    padding: 14px 16px 16px;
}

.work-title {
    font-weight: 800;
    margin: 0 0 4px;
}

.work-desc {
    margin: 0;
    color: var(--muted);
}

.work-meta {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    opacity: .75;
    font-size: .9rem;
    margin-top: .5rem;
}

/* Title clamp + meta polish */
.work-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 6px;
    line-height: 1.2;
}

.work-meta {
    font-size: .875rem;
    opacity: .85;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.repo-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    opacity: .6;
}

/* ==========================================================================
   7) CONTACT
   ========================================================================== */
.b-contact {
    margin-top: 12px;
}

.contact {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.contact .row {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 12px;
}

.contact input, .contact textarea {
    width: 100%;
    background: #0f0f16;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
}

.contact button {
    margin-top: 12px;
}

.flash {
    margin-top: 10px;
    background: #0f3024;
    border: 1px solid #1d5a47;
    color: #9ff0d1;
    padding: 10px;
    border-radius: 10px;
}

.alt {
    margin-top: 8px;
}

/* ==========================================================================
   8) GAME BLOCK (Bambi Game)
   ========================================================================== */
.b-game {
    margin-top: 28px;
}

.game-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, .25);
}

.scene h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.scene p {
    margin: 0 0 14px;
    color: var(--muted);
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.choice-btn {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    color: #120812;
    border: none;
    font-weight: 800;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform .12s, filter .12s;
}

.choice-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* Inventory bar */
.inventory-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 18px;
}

.inventory-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.inventory-label {
    opacity: .8;
}

.inventory-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    line-height: 1.2;
}

.reset-btn {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    transition: background .12s, transform .12s;
}

.reset-btn:hover {
    background: var(--line);
    color: var(--text);
    transform: translateY(-1px);
}

/* ==========================================================================
   9) AUTH
   ========================================================================== */
.auth-card {
    max-width: 440px;
    margin: 56px auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
}

.auth-card h2 {
    margin: 0 0 12px;
}

.auth-card form > div {
    margin-bottom: 12px;
}

.auth-card input {
    width: 100%;
    background: #0f0f16;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
}

.auth-card .cta {
    width: 100%;
}

.auth-card .muted {
    display: inline-block;
    margin-top: 10px;
}

.form-error {
    color: #dc2626;
    margin: 4px 0;
}

/* ==========================================================================
   10) FOOTER
   ========================================================================== */
.b-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--line);
    margin-top: 24px;
    padding-top: 18px;
}

/* Footer grid (extended) */
.f-grid {
    display: grid;
    grid-template-columns:1.2fr repeat(3, 1fr);
    gap: 18px;
    padding: 24px 24px 36px;
    border-top: 1px solid var(--line);
}

.f-col, .f-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.f-col h4 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--muted);
}

.f-col a {
    color: var(--text);
    opacity: .9;
}

.f-col a:hover {
    opacity: 1;
    text-decoration: underline;
}

.logo {
    font-weight: 800;
    letter-spacing: .12em;
}

/* ==========================================================================
   11) RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
    .b-hero {
        grid-template-columns:1fr;
    }

    .b-cards {
        grid-template-columns:1fr;
    }

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

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

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

/* Mobile header reflow */
@media (max-width: 640px) {
    .b-container {
        padding: 16px;
    }

    .b-nav {
        grid-template-columns:auto 1fr;
        row-gap: 10px;
        padding: 16px 16px 0;
    }

    .b-nav .brand {
        grid-column: 1/2;
        justify-self: start;
    }

    .b-nav .auth {
        grid-column: 2/3;
        justify-self: end;
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: nowrap;
    }

    .b-nav nav.main-nav {
        grid-column: 1/-1;
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .b-nav .nav-user {
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .b-nav .pill, .b-nav form button, .b-nav .btn {
        padding: 6px 10px;
        border-radius: 10px;
        font-size: .9rem;
        font-weight: 800;
    }

    .theme-toggle {
        display: none;
    }

    .b-hero {
        padding: 36px 16px 12px;
        gap: 18px;
    }

    .hero-copy h1 {
        font-size: clamp(28px, 7vw, 40px);
        line-height: 1.08;
    }

    .hero-copy p {
        font-size: .95rem;
    }

    .hero-art {
        height: 220px;
    }

    .b-cards {
        grid-template-columns:1fr;
    }

    .work-grid {
        grid-template-columns:1fr;
    }

    .b-nav .nav-user .hi {
        display: none;
    }
}

/* ==========================================================================
   12) PROFILE / INVENTORY
   ========================================================================== */
.pill {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    padding: .4rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    margin: .25rem .25rem 0 0;
}

.pill .emoji {
    width: 1.2rem;
    text-align: center;
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.inv-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.inv-card {
    display: grid;
    grid-template-columns:42px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 14px;
}

.inv-emoji {
    font-size: 28px;
    line-height: 1;
}

.inv-main small.muted {
    opacity: .6;
    margin-left: 6px;
}

.inv-qty {
    font-weight: 600;
    opacity: .85;
}

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

/* Accessibility helpers */
.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

/* ==========================================================================
   13) ACHIEVEMENTS
   ========================================================================== */
.achv-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0 0;
}

.achv-bar.is-empty {
    opacity: .8;
    font-size: .95rem;
}

.achv-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06) inset;
}

.achv-badge .emo {
    font-size: 1rem;
    line-height: 1;
}

.achv-badge .nm {
    font-size: .9rem;
    opacity: .9;
}

/* Toast */
.achv-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 24px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: .95rem;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    max-width: 92vw;
    z-index: 9999;
}

.achv-toast.show {
    opacity: 1;
}

.achv-toast-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.achv-toast-row .emo {
    font-size: 1.1rem;
}

/* ==========================================================================
   14) SCENE PIXEL (game image)
   ========================================================================== */
.scene-pixel {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1/1;
    image-rendering: pixelated;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    display: block;
    margin: 6px 0 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15) inset;
}

@media (max-width: 640px) {
    .scene-pixel {
        max-width: 100%;
    }
}

.b-game .game-card.scene {
    max-width: 980px;
    margin-inline: auto;
}

.scene-pixel {
    margin: 0 auto 12px;
}

/* ==========================================================================
   15) FLOATING LAUNCHER
   ========================================================================== */
.bambi-launcher {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10005;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
    background: linear-gradient(90deg, #ff6abf, #ff96d5);
    color: #280017;
    box-shadow: 0 10px 28px rgba(255, 105, 180, .35);
}

.bambi-launcher:hover {
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .bambi-launcher {
        right: 12px;
        bottom: 12px;
    }
}

.blog-index .empty {
    padding: 2rem 0;
    text-align: center;
    opacity: .8;
}

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

.post-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* search */
.search-form .input {
    padding: .65rem .9rem;
    border-radius: .8rem;
}

.search-form .btn {
    margin-left: .5rem;
    padding: .6rem 1rem;
    border-radius: .8rem;
}

.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-item {
    padding: .9rem 1rem;
    border: 1px solid rgba(255, 182, 225, .15);
    border-radius: 1rem;
    margin-bottom: .75rem;
}

.search-item .title {
    font-weight: 700;
}

mark {
    background: #ffb6e1;
    color: #1a0b18;
    padding: 0 .15em;
    border-radius: .25rem;
}
