:root {
    --bg: #0a0a0b;
    --bg-elev: #161618;
    --card: #17171a;
    --border: #26262b;
    --text: #f2f2f4;
    --muted: #9d9da6;
    --accent: #ff2d55;
    --accent-2: #ff5e7e;
    --online: #35d07f;
    --idle: #f0b43c;
    --offline: #6b7080;
    --radius: 12px;
    --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.logo span {
    color: var(--accent);
}

.header-search {
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
}

.header-search form {
    display: flex;
    align-items: center;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 8px 8px 16px;
    gap: 10px;
    transition: border-color 0.15s ease;
}

.header-search form:focus-within {
    border-color: var(--accent);
}

.header-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
}

.header-search input::placeholder {
    color: var(--muted);
}

.header-search button {
    background: var(--accent);
    border: none;
    color: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
}

.header-search button:hover {
    background: var(--accent-2);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.header-actions .select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.header-actions select {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 7px 10px;
    font-family: var(--font);
    font-size: 0.9rem;
}

.btn-create {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 18px;
    border-radius: 999px;
}

.btn-create:hover {
    background: var(--accent-2);
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 72px 24px 40px;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto 28px;
}

.hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .btn {
    display: inline-block;
    padding: 13px 30px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
}

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

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

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

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-2);
}

/* ---------- Tag filters ---------- */
.tag-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.tag-filters a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.85rem;
    color: var(--muted);
    transition: all 0.15s ease;
}

.tag-filters a:hover {
    color: var(--text);
    border-color: var(--muted);
}

.tag-filters a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.count {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 18px;
}

/* ---------- Character grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    padding-bottom: 56px;
}

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

.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--bg-elev);
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

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

.card-img .shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent 45%);
}

.status-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    color: #fff;
    backdrop-filter: blur(4px);
}

.status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--offline);
}

.status-pill.online::before { background: var(--online); }
.status-pill.idle::before { background: var(--idle); }

.card-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.card:hover .card-hover {
    opacity: 1;
}

.chat-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 9px 26px;
    border-radius: 999px;
    cursor: pointer;
}

.chat-btn:hover {
    background: var(--accent-2);
}

.card-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info .tagline {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.card-tags span {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    color: var(--muted);
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-stats .icon {
    font-size: 0.9rem;
}

/* ---------- Empty ---------- */
.empty {
    text-align: center;
    color: var(--muted);
    padding: 80px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin-bottom: 56px;
}

.empty p {
    margin-bottom: 16px;
}

/* ---------- Profile detail ---------- */
.breadcrumb {
    padding: 24px 0 16px;
}

.breadcrumb a {
    color: var(--muted);
    font-size: 0.9rem;
}

.breadcrumb a:hover {
    color: var(--text);
}

.profile {
    max-width: 880px;
    margin: 0 auto 56px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    animation: profile-in 0.45s ease both;
}

@keyframes profile-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.profile-cover {
    height: 250px;
    background-size: cover;
    background-position: center 30%;
    background-color: var(--bg-elev);
    position: relative;
}

.profile-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 11, 0.9) 0%, rgba(10, 10, 11, 0.45) 45%, rgba(10, 10, 11, 0.25) 100%);
}

.profile-head {
    position: relative;
    padding: 0 32px 26px;
}

.profile-avatar {
    position: absolute;
    top: -86px;
    left: 32px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--bg);
    background: var(--bg-elev);
    box-shadow: 0 0 0 2px var(--accent), 0 14px 34px rgba(0, 0, 0, 0.65);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.avatar-status {
    position: absolute;
    right: 4px;
    bottom: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--offline);
    border: 5px solid var(--bg);
}

.avatar-status.online {
    background: var(--online);
    box-shadow: 0 0 12px rgba(53, 208, 127, 0.8);
}

.avatar-status.idle {
    background: var(--idle);
    box-shadow: 0 0 12px rgba(240, 180, 60, 0.7);
}

.profile-title {
    padding-top: 96px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.profile-title h1 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.status-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.online {
    background: rgba(53, 208, 127, 0.12);
    color: var(--online);
}

.status-badge.idle {
    background: rgba(240, 180, 60, 0.12);
    color: var(--idle);
}

.status-badge.offline {
    background: rgba(107, 112, 128, 0.18);
    color: var(--muted);
}

.profile-title .alias {
    color: var(--muted);
    font-style: italic;
    font-size: 1rem;
    margin: 4px 0 14px;
}

.profile-stats {
    display: flex;
    gap: 34px;
}

.profile-stats div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.profile-stats b {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.profile-stats span {
    color: var(--muted);
    font-size: 0.85rem;
}

.profile-body {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 0;
    border-top: 1px solid var(--border);
}

.profile-col {
    padding: 28px 32px;
}

.profile-col + .profile-col {
    border-left: 1px solid var(--border);
}

.profile-col h2 {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
}

.profile-col p {
    line-height: 1.7;
    color: #d6d6dc;
    font-size: 0.95rem;
}

.profile-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.profile-tags span {
    border: 1px solid rgba(255, 45, 85, 0.28);
    background: rgba(255, 45, 85, 0.08);
    border-radius: 999px;
    padding: 4px 13px;
    font-size: 0.78rem;
    color: #ff9db0;
    transition: background 0.15s ease, color 0.15s ease;
}

.profile-tags span:hover {
    background: rgba(255, 45, 85, 0.2);
    color: #ffc2cf;
}

.profile-bio-text {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
}

.profile-details {
    background: var(--bg-elev);
}

.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row dt {
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}

.detail-row dd {
    color: var(--text);
    text-align: right;
}

.profile-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding: 0 32px 32px;
}

.profile-actions .btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
}

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

.profile-actions .btn-primary:hover {
    background: var(--accent-2);
}

.profile-actions .btn-ghost {
    border: 1px solid var(--border);
    color: var(--text);
}

.profile-actions .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent-2);
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: auto;
    padding: 22px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .profile-body {
        grid-template-columns: 1fr;
    }

    .profile-col + .profile-col {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 720px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

    .hero {
        padding: 44px 16px 28px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .container {
        padding: 0 16px;
    }

    .profile {
        border-radius: 14px;
    }

    .profile-cover {
        height: 170px;
    }

    .profile-avatar {
        top: -64px;
        left: 20px;
        width: 108px;
        height: 108px;
    }

    .avatar-status {
        width: 20px;
        height: 20px;
        border-width: 4px;
    }

    .profile-head {
        padding: 0 20px 20px;
    }

    .profile-title {
        padding-top: 60px;
    }

    .profile-title h1 {
        font-size: 1.45rem;
    }

    .profile-stats {
        gap: 20px;
    }

    .profile-col {
        padding: 22px 20px;
    }

    .profile-actions {
        padding: 0 20px 24px;
    }
}
