/* ================================================================
   Murchi Social — Stylesheet
   ================================================================ */

:root {
    --bg: #14142B;
    --bg-lighter: #1A1A3E;
    --surface: #1E1E3F;
    --surface-hover: #252552;
    --border: rgba(124, 92, 252, 0.15);
    --border-light: rgba(255, 255, 255, 0.06);
    --accent: #7C5CFC;
    --accent-hover: #6A4AE8;
    --accent-glow: rgba(124, 92, 252, 0.3);
    --pink: #FF6B9D;
    --pink-hover: #E85A8A;
    --pink-glow: rgba(255, 107, 157, 0.3);
    --green: #4ADE80;
    --green-dim: rgba(74, 222, 128, 0.15);
    --red: #F87171;
    --yellow: #FBBF24;
    --text: #E8E4F0;
    --text-dim: #8B85A0;
    --text-muted: #5C5675;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 50% 40% at 20% 10%, rgba(124, 92, 252, 0.06), transparent 70%),
        radial-gradient(ellipse 40% 35% at 80% 80%, rgba(255, 107, 157, 0.04), transparent 70%),
        radial-gradient(ellipse 50% 30% at 50% 50%, rgba(124, 92, 252, 0.03), transparent 70%);
}

body > * {
    position: relative;
    z-index: 1;
}

/* ── UTILITIES ── */

.hidden {
    display: none !important;
}

/* ── NAVIGATION ── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(20, 20, 43, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 8px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.nav-logo-icon {
    font-size: 22px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    margin-right: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
    white-space: nowrap;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(124, 92, 252, 0.1);
}

.nav-badge {
    background: var(--pink);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-avatar-btn {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    transition: all var(--transition);
}

.nav-avatar-btn:hover {
    border-color: var(--accent);
}

.nav-icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-xs);
    transition: all var(--transition);
}

.nav-icon-btn:hover {
    color: var(--red);
    background: rgba(248, 113, 113, 0.1);
}

.nav-icon-btn svg {
    width: 20px;
    height: 20px;
}

/* ── PAGES ── */

.page {
    min-height: 100vh;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 72px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ── CARDS ── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* ── BUTTONS ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 12px 24px;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #9B6FFF);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover), #8A5EEE);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(124, 92, 252, 0.12);
    color: var(--accent);
    border: 1px solid rgba(124, 92, 252, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(124, 92, 252, 0.2);
    border-color: rgba(124, 92, 252, 0.3);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.2);
}

.btn-success {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.btn-success:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-xs);
}

.btn-xs {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: var(--radius-xs);
}

.btn-full {
    width: 100%;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── FORMS ── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── AUTH PAGE ── */

.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-hero {
    text-align: center;
    margin-bottom: 32px;
}

.auth-cat-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-cat-animated {
    animation: catFloat 3s ease-in-out infinite;
}

@keyframes catFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.auth-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-dim);
    font-size: 16px;
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
}

.auth-tab.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.auth-tab:not(.active):hover {
    color: var(--text);
}

.auth-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── CAT FACE (CSS art) ── */

/* Large cat face (auth, profile) */
.cat-face-large {
    width: 120px;
    height: 120px;
    position: relative;
}

.cat-head {
    width: 100%;
    height: 100%;
    background: #FFC8A2;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    /* Inner shadow for depth */
    box-shadow: inset 0 -20px 30px rgba(0, 0, 0, 0.08);
}

.cat-ear {
    width: 36px;
    height: 36px;
    background: #FFC8A2;
    position: absolute;
    top: -8px;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: -1;
}

.cat-ear::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #FFB0C0;
    clip-path: polygon(50% 20%, 15% 100%, 85% 100%);
    top: 10px;
    left: 8px;
}

.cat-ear-left {
    left: 12px;
    transform: rotate(-15deg);
}

.cat-ear-right {
    right: 12px;
    transform: rotate(15deg);
}

.cat-eye {
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 38%;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

.cat-eye-left {
    left: 24%;
}

.cat-eye-right {
    right: 24%;
}

.cat-pupil {
    width: 12px;
    height: 14px;
    background: #2D2D2D;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.cat-pupil::after {
    content: '';
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 2px;
}

.cat-nose {
    width: 10px;
    height: 7px;
    background: #FFB0C0;
    border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translateX(-50%);
}

.cat-mouth {
    width: 20px;
    height: 8px;
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translateX(-50%);
}

.cat-mouth::before,
.cat-mouth::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 8px;
    border-bottom: 2px solid #E08858;
    border-radius: 0 0 50% 50%;
    top: 0;
}

.cat-mouth::before { left: -2px; }
.cat-mouth::after { right: -2px; }

.cat-whisker {
    position: absolute;
    width: 28px;
    height: 2px;
    background: rgba(180, 140, 100, 0.3);
    border-radius: 1px;
}

.cat-whisker-left-1 { top: 55%; left: -14px; transform: rotate(-8deg); }
.cat-whisker-left-2 { top: 62%; left: -12px; transform: rotate(5deg); }
.cat-whisker-right-1 { top: 55%; right: -14px; transform: rotate(8deg); }
.cat-whisker-right-2 { top: 62%; right: -12px; transform: rotate(-5deg); }

/* Medium cat face (dashboard card) */
.cat-face-medium {
    width: 72px;
    height: 72px;
    position: relative;
    flex-shrink: 0;
}

.cat-face-medium .cat-head {
    width: 72px;
    height: 72px;
}

.cat-face-medium .cat-ear {
    width: 22px;
    height: 22px;
    top: -5px;
}

.cat-face-medium .cat-ear::after {
    width: 12px;
    height: 12px;
    top: 6px;
    left: 5px;
}

.cat-face-medium .cat-ear-left { left: 7px; }
.cat-face-medium .cat-ear-right { right: 7px; }

.cat-face-medium .cat-eye {
    width: 14px;
    height: 14px;
}

.cat-face-medium .cat-pupil {
    width: 8px;
    height: 9px;
}

.cat-face-medium .cat-pupil::after {
    width: 3px;
    height: 3px;
    top: 2px;
    right: 1px;
}

.cat-face-medium .cat-nose {
    width: 7px;
    height: 5px;
}

.cat-face-medium .cat-mouth {
    width: 14px;
    height: 6px;
}

.cat-face-medium .cat-mouth::before,
.cat-face-medium .cat-mouth::after {
    width: 8px;
    height: 6px;
    border-bottom-width: 1.5px;
}

.cat-face-medium .cat-whisker {
    width: 18px;
    height: 1.5px;
}

.cat-face-medium .cat-whisker-left-1 { left: -8px; }
.cat-face-medium .cat-whisker-left-2 { left: -6px; }
.cat-face-medium .cat-whisker-right-1 { right: -8px; }
.cat-face-medium .cat-whisker-right-2 { right: -6px; }

/* Mini cat face (nav, friend list) */
.cat-face-mini {
    width: 32px;
    height: 32px;
    position: relative;
}

.cat-face-mini .cat-head {
    width: 32px;
    height: 32px;
}

.cat-face-mini .cat-ear {
    width: 10px;
    height: 10px;
    top: -2px;
}

.cat-face-mini .cat-ear::after { display: none; }
.cat-face-mini .cat-ear-left { left: 3px; }
.cat-face-mini .cat-ear-right { right: 3px; }

.cat-face-mini .cat-eye {
    width: 7px;
    height: 7px;
}

.cat-face-mini .cat-pupil {
    width: 4px;
    height: 5px;
}

.cat-face-mini .cat-pupil::after {
    width: 2px;
    height: 2px;
    top: 1px;
    right: 0;
}

.cat-face-mini .cat-nose {
    width: 4px;
    height: 3px;
}

.cat-face-mini .cat-mouth,
.cat-face-mini .cat-whisker {
    display: none;
}

/* Inline mini for lists */
.cat-face-inline {
    width: 40px;
    height: 40px;
    position: relative;
    flex-shrink: 0;
}

.cat-face-inline .cat-head {
    width: 40px;
    height: 40px;
}

.cat-face-inline .cat-ear {
    width: 14px;
    height: 14px;
    top: -3px;
}

.cat-face-inline .cat-ear::after { display: none; }
.cat-face-inline .cat-ear-left { left: 4px; }
.cat-face-inline .cat-ear-right { right: 4px; }

.cat-face-inline .cat-eye {
    width: 9px;
    height: 9px;
}

.cat-face-inline .cat-pupil {
    width: 5px;
    height: 6px;
}

.cat-face-inline .cat-pupil::after {
    width: 2px;
    height: 2px;
    top: 1px;
    right: 0;
}

.cat-face-inline .cat-nose {
    width: 5px;
    height: 3px;
}

.cat-face-inline .cat-mouth,
.cat-face-inline .cat-whisker {
    display: none;
}

/* Profile page large cat wrap */
.cat-face-large-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── DASHBOARD ── */

.dashboard-profile {
    background: linear-gradient(135deg, var(--surface), rgba(124, 92, 252, 0.08));
    border-color: rgba(124, 92, 252, 0.2);
}

.profile-card-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.profile-card-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-username {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
}

.profile-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.profile-id {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.status-text {
    font-size: 12px;
    color: var(--text-dim);
}

.profile-bio {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

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

.profile-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

.profile-stat-icon {
    font-size: 18px;
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 800;
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* XP bar */
.profile-xp-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    margin-top: 14px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--pink));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ── DASHBOARD ACTIONS ── */

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.action-card:hover {
    background: var(--surface-hover);
    border-color: rgba(124, 92, 252, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.action-icon {
    font-size: 28px;
}

.action-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
}

/* ── SERVER STATS ── */

.server-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.server-stat {
    text-align: center;
    padding: 8px;
}

.server-stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.server-stat-label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}

/* ── ACTIVITY FEED ── */

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    transition: background var(--transition);
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.feed-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.feed-icon.visit { background: rgba(90, 141, 239, 0.15); }
.feed-icon.friend { background: rgba(124, 92, 252, 0.15); }
.feed-icon.gift { background: rgba(255, 107, 157, 0.15); }
.feed-icon.guestbook { background: rgba(251, 191, 36, 0.15); }

.feed-info {
    flex: 1;
    min-width: 0;
}

.feed-message {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── FRIENDS ── */

.friends-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: pointer;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.friend-avatar {
    position: relative;
    flex-shrink: 0;
}

.friend-online-dot {
    position: absolute;
    bottom: 0;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--surface);
}

.friend-online-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-meta {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
}

.friend-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── LEADERBOARD ── */

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    cursor: pointer;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.leaderboard-item.is-me {
    background: rgba(124, 92, 252, 0.1);
    border: 1px solid rgba(124, 92, 252, 0.2);
}

.lb-rank {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}

.lb-rank.gold { background: rgba(251, 191, 36, 0.2); color: var(--yellow); }
.lb-rank.silver { background: rgba(192, 192, 210, 0.15); color: #C0C0D2; }
.lb-rank.bronze { background: rgba(205, 127, 50, 0.15); color: #CD7F32; }

.lb-info {
    flex: 1;
    min-width: 0;
}

.lb-name {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-cat-name {
    font-size: 12px;
    color: var(--text-dim);
}

.lb-level {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
}

.lb-xp {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    flex-shrink: 0;
    margin-left: 4px;
}

/* ── GIFTS ── */

.gifts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gift-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 107, 157, 0.1);
}

.gift-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 107, 157, 0.1);
    flex-shrink: 0;
}

.gift-info {
    flex: 1;
    min-width: 0;
}

.gift-title {
    font-size: 15px;
    font-weight: 700;
}

.gift-sender {
    font-size: 13px;
    color: var(--text-dim);
}

.gift-msg {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 2px;
}

.gift-form {
    display: flex;
    flex-direction: column;
}

/* ── PROFILE PAGE ── */

.profile-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.profile-edit {
    margin-top: 14px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.profile-edit .form-group {
    flex: 1;
    margin-bottom: 0;
}

.color-palette {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.color-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 600;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* ── VISITORS ── */

.visitors-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.visitor-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background var(--transition);
}

.visitor-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.visitor-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.visitor-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── GUESTBOOK ── */

.guestbook-form {
    margin-bottom: 16px;
}

.guestbook-input-row {
    display: flex;
    gap: 8px;
}

.emoji-select {
    width: 60px;
    padding: 10px 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

.emoji-select:focus {
    border-color: var(--accent);
}

.guestbook-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
}

.guestbook-input-row input:focus {
    border-color: var(--accent);
}

.guestbook-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.guestbook-entry {
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    background: rgba(0, 0, 0, 0.15);
}

.guestbook-entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.guestbook-author {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
}

.guestbook-author:hover {
    text-decoration: underline;
}

.guestbook-emoji {
    font-size: 14px;
}

.guestbook-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}

.guestbook-text {
    font-size: 14px;
    color: var(--text);
    word-wrap: break-word;
}

/* ── SEARCH MODAL ── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    line-height: 1;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.search-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    outline: none;
}

.search-input-row input:focus {
    border-color: var(--accent);
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background var(--transition);
}

.search-item:hover {
    background: rgba(0, 0, 0, 0.25);
}

.search-item-info {
    flex: 1;
    min-width: 0;
}

.search-item-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.search-item-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.search-item-badge.is-friend {
    background: var(--green-dim);
    color: var(--green);
}

/* ── EMPTY & LOADING STATES ── */

.empty-state {
    text-align: center;
    padding: 30px 10px;
    color: var(--text-dim);
}

.empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    font-weight: 600;
}

.empty-state-sm {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px;
    color: var(--text-dim);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(124, 92, 252, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── TOASTS ── */

#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    max-width: 340px;
    word-wrap: break-word;
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
    color: var(--red);
}

.toast.success {
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.08);
    color: var(--green);
}

.toast.out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ── SCROLLBAR ── */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 92, 252, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 92, 252, 0.35);
}

/* ── LANGUAGE SELECTOR ── */

.lang-select-mini {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    padding: 4px 22px 4px 6px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-family: var(--font);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' fill='%238B85A0'%3E%3Cpath d='M0 0l4 5 4-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    outline: none;
    flex-shrink: 0;
}

.lang-select-mini:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.lang-select-mini option {
    background: var(--bg);
    color: var(--text);
}

.lang-select-auth {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    padding: 8px 30px 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%238B85A0'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
    transition: all var(--transition);
}

.lang-select-auth:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.04);
}

.lang-select-auth:focus {
    border-color: var(--accent);
}

.lang-select-auth option {
    background: var(--bg);
    color: var(--text);
}

/* ── RESPONSIVE ── */

@media (max-width: 640px) {
    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 8px 10px;
    }

    .nav-logo span:not(.nav-logo-icon) {
        display: none;
    }

    .dashboard-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .server-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-id-row {
        justify-content: center;
    }

    .profile-actions {
        justify-content: center;
    }

    .profile-edit {
        flex-direction: column;
    }

    .profile-stats-row {
        flex-wrap: wrap;
    }

    .profile-stat {
        min-width: calc(50% - 4px);
    }

    .guestbook-input-row {
        flex-direction: column;
    }

    .emoji-select {
        width: 100%;
    }

    .modal {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .modal-content {
        max-height: 85vh;
    }

    .auth-container {
        padding: 20px 16px;
        justify-content: flex-start;
        padding-top: 40px;
    }

    .cat-face-large {
        width: 90px;
        height: 90px;
    }

    .color-palette {
        flex-wrap: wrap;
    }
}

@media (max-width: 380px) {
    .page-content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .card {
        padding: 14px;
    }

    .profile-stat-value {
        font-size: 16px;
    }

    .profile-stat-icon {
        font-size: 14px;
    }
}
