@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Global Box Sizing & Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --glow: 0 0 120px rgba(59, 130, 246, 0.15);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.08), transparent 25%);
}

/* container and layout */
.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 2rem; 
}

/* Utilities */
.text-center { text-align: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }

/* Authentication Layouts */
.auth-container {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* glass cards */
.card { 
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px; 
    padding: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.15);
}

/* typography */
h1 { 
    font-size: 3.5rem; 
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

h3 { 
    color: #fff; 
    margin-top: 0;
    font-weight: 600;
}

p { 
    color: var(--text-muted); 
    line-height: 1.7; 
}

/* grid */
.grid { 
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
}

.col-span-2 { grid-column: span 2; }
@media (max-width: 768px) { .col-span-2 { grid-column: span 1; } }

/* bttns */
.btn-primary {
    background: var(--primary-gradient);
    color: white; 
    padding: 0.75rem 1.5rem; 
    border-radius: 8px; 
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.1);
    transition: opacity 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff; 
    padding: 0.75rem 1.5rem; 
    border: 1px solid var(--card-border); 
    border-radius: 8px; 
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    transition: background 0.2s;
    cursor: pointer;
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-icon {
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    display: inline-block;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }

/* forms */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); }

input, textarea, select {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #6366f1;
}

/* socials editor */
.social-editor-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.social-select {
    width: 140px;
    flex-shrink: 0;
}
.social-input {
    flex-grow: 1;
}

/* nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

nav .nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    text-decoration: none;
    letter-spacing: -0.03em;
}

nav .nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; transition: color 0.2s; }
nav a:hover, nav a.active { color: #fff; }
nav a.btn-logout { color: #ef4444; }
nav a.btn-logout:hover { color: #f87171; }

/* status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--card-border);
    margin-right: 10px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.bg-green { background-color: #10b981; }
.bg-gray { background-color: #6b7280; }

/* user badges */
.username-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.badge-list {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.4);
    color: #fff;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-badge:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.user-badge-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
}

.user-badge-icon svg,
.user-badge-icon img {
    width: 18px;
    height: 18px;
    display: block;
}

.badge-popover {
    position: fixed;
    z-index: 999;
    max-width: 260px;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    color: #f8fafc;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.badge-popover.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.badge-popover__title {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.badge-popover__desc {
    font-size: 0.85rem;
    color: rgba(248, 250, 252, 0.8);
    margin-bottom: 0.5rem;
}

.badge-popover__meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: rgba(248, 250, 252, 0.65);
}

.badge-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.badge-toggle {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
}

.badge-toggle input[type="checkbox"] {
    width: auto;
}

.badge-toggle-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.badge-toggle-icon svg,
.badge-toggle-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.badge-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.badge-toggle-name {
    font-weight: 600;
}

.badge-toggle-desc,
.badge-toggle-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive Headers */
.header-responsive {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap; /* Fix clipping: allow items to wrap if needed */
    gap: 1.5rem;     /* Space between items when wrapped */
}

.hero-header {
    text-align: center; 
    padding: 6rem 0;
    /* Force centering via flex column */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-buttons {
    display: flex; 
    gap: 2rem; 
    justify-content: center;
}

/* Visual Profile Builder */
.settings-builder {
    position: relative;
}

.settings-header {
    margin-bottom: 2rem;
}

/* DESKTOP SIDE-BY-SIDE LAYOUT */
@media (min-width: 900px) {
    .settings-grid {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 2rem;
        align-items: start;
    }

    .builder-preview {
        position: sticky;
        top: 2rem;
        order: 2; 
        max-height: calc(100vh - 4rem);
        overflow: hidden;
    }

    .settings-panel {
        order: 1;
    }
}

.builder-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.builder-preview__meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.preview-pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.live-preview {
    padding: 2rem;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
}

.profile-container {
    display: flex; 
    justify-content: center; 
    min-height: 100vh; 
    align-items: center;
}

.profile-preview {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    isolation: isolate;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.profile-preview * {
    box-sizing: border-box;
}

.preview-modules {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-module {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: grab;
    position: relative; /* For remove button */
}

.remove-module-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.preview-module:hover .remove-module-btn {
    opacity: 1;
}

.preview-module.is-dragging {
    opacity: 0.5;
}

.preview-empty-state {
    cursor: default;
}

.module-handle {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: -0.1em;
}

.module-body {
    flex: 1;
}

.avatar-module {
    display: flex;
    justify-content: center;
}

.avatar-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.5rem;
    position: relative;
}

.username-module h2 {
    margin: 0;
    font-size: 2rem;
}

.splash-module p,
.bio-module p {
    margin: 0;
    color: var(--text-muted);
}

.socials-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-pill {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.empty-state {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.embed-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.embed-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* bttn modules */
.button-module {
    transition: transform 0.2s, background 0.2s;
}
.button-module:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
}

/* dc status bubble */
.discord-status-bubble {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    bottom: 5px;
    right: 5px;
    border: 3px solid var(--bg-color); /* match card bg to cutout */
    background: #747f8d; /* default/offline */
}
.discord-status-bubble.online { background: #3ba55c; }
.discord-status-bubble.idle { background: #faa61a; }
.discord-status-bubble.dnd { background: #ed4245; }

/* fixed footer */
.fixed-footer {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 1000;
}
.fixed-footer p { margin: 0; color: #fff; }

.settings-panel {
    margin-bottom: 3rem;
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap; 
}

.tab-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.9rem;
    flex: 1 1 auto; 
    text-align: center;
}

.tab-button.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.helper-text {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.modules-list {
    display: grid;
    gap: 0.75rem;
}

.modules-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
}

.modules-list-content {
    display: grid;
    gap: 0.2rem;
}

.modules-list-content span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modules-list-item .btn-secondary[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.settings-actions {
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.appearance-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.custom-css-editor.collapsed {
    display: none;
}

.premium-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.premium-badge.hidden {
    display: none;
}

.toolbox-fab {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    z-index: 50;
}

.toolbox-drawer {
    position: fixed;
    top: 0;
    right: -360px;
    width: 320px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    border-left: 1px solid var(--card-border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: right 0.3s ease;
    z-index: 100;
}

.toolbox-drawer.open {
    right: 0;
}

.toolbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbox-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.toolbox-section h4 {
    margin: 0 0 0.75rem;
}

.toolbox-modules {
    display: grid;
    gap: 0.75rem;
}

.toolbox-module-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem;
    display: grid;
    gap: 0.25rem;
    cursor: grab;
}

.toolbox-module-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.style-switcher {
    display: grid;
    gap: 0.5rem;
}

.style-button {
    width: 100%;
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
}

.style-button.active {
    color: #fff;
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.2);
}

/* splash */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.splash-content {
    text-align: center;
    animation: fadeIn 1s ease;
}

.splash-text {
    font-size: 4rem;
    margin: 0 0 1rem;
    color: #fff;
}

.splash-hint {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* theme presets */
/* modern (default) */
.theme-modern body, .profile-preview.theme-modern {
    background: rgba(255, 255, 255, 0.02);
}

/* light */
.theme-light body, .profile-preview.theme-light {
    background: #f8fafc;
    color: #0f172a;
}
.theme-light .profile-preview {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.theme-light h1, .theme-light h2, .theme-light h3 {
    background: none;
    -webkit-text-fill-color: #0f172a;
    color: #0f172a;
}
.theme-light .preview-module {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}
.theme-light .social-pill {
    background: #fff;
    border-color: #cbd5e1;
    color: #475569;
}
.theme-light p { color: #64748b; }

/* dark (flat) */
.theme-dark body, .profile-preview.theme-dark {
    background: #111;
    color: #eee;
}
.theme-dark .profile-preview {
    background: #1a1a1a;
    border: none;
}
.theme-dark .preview-module {
    background: #222;
    border: 1px solid #333;
}
.theme-dark .avatar-circle {
    background: #333;
    border-color: #444 !important;
}

/* retro (term) */
.theme-retro body, .profile-preview.theme-retro {
    background: #000000;
    color: #33ff00;
    font-family: 'Courier New', monospace;
}
.theme-retro .profile-preview {
    border: 2px solid #33ff00;
    background: #000;
    border-radius: 0;
}
.theme-retro .preview-module {
    border: 1px solid #33ff00;
    background: #001100;
    border-radius: 0;
}
.theme-retro h1, .theme-retro h2 {
    -webkit-text-fill-color: #33ff00;
    text-shadow: 0 0 5px #33ff00;
}
.theme-retro .avatar-circle {
    border-radius: 0;
    border: 2px solid #33ff00 !important;
    filter: grayscale(100%) contrast(1.2);
}
.theme-retro .social-pill {
    border-radius: 0;
    border: 1px solid #33ff00;
    background: #000;
    color: #33ff00;
}

/* cp */
.theme-cyberpunk body, .profile-preview.theme-cyberpunk {
    background: #050510;
    border: 1px solid rgba(255, 0, 200, 0.4);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.2);
    color: #fff;
}
.theme-cyberpunk .profile-preview {
    background: rgba(10, 10, 25, 0.95);
    overflow: hidden;
}
.theme-cyberpunk .preview-module {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    clip-path: polygon(5% 0, 100% 0, 100% 90%, 95% 100%, 0 100%, 0 10%);
}
.theme-cyberpunk .avatar-circle {
    background: linear-gradient(135deg, #ff4fd8, #38f9ff);
    border: 2px solid #fff !important;
}
.theme-cyberpunk .social-pill {
    background: rgba(255,0,200,0.2);
    border: 1px solid #ff00c8;
    color: #fff;
    text-shadow: 0 0 5px #ff00c8;
}

@media (max-width: 900px) {
    .builder-preview__header {
        flex-direction: column;
    }

    .toolbox-fab {
        right: 1rem;
        bottom: 1rem;
    }
}

/* Tutorial Modal */
.tutorial-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.tutorial-overlay.show {
    display: flex !important; /* Force flex centering */
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.tutorial-modal {
    background: #0f172a;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.blink-animation {
    animation: blink 3s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Mobile Responsive Improvements */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    .card {
        padding: 1.25rem;
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    
    nav .nav-links {
        width: 100%;
        gap: 0.75rem;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .header-responsive {
        flex-direction: column;
        align-items: center !important; /* FIXED: Center alignment on mobile */
        text-align: center;             /* FIXED: Text centering on mobile */
        gap: 1.5rem;
    }
    
    .header-responsive > div, 
    .header-responsive > a {
        width: 100%;
    }
    
    .header-responsive .btn-secondary,
    .header-responsive .btn-primary {
        display: block;
        text-align: center;
        margin: 0 auto;
    }

    .hero-header {
        padding: 3rem 0;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn-primary, 
    .hero-buttons .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .settings-grid {
        display: block; 
    }

    .profile-preview {
        padding: 1.5rem;
        border-radius: 16px;
        width: 100%;
    }
    
    .avatar-circle {
        width: 70px;
        height: 70px;
        font-size: 1.2rem;
    }
    
    .username-module h2 {
        font-size: 1.75rem;
    }
    
    .social-pill {
        font-size: 0.8rem;
    }
}

.status-thought-bubble {
    position: absolute;
    top: 0;
    
    /* Anchoring logic: Center + Radius + Gap */
    left: 50%; 
    right: auto;
    margin-left: 46px; 
    
    transform: translateY(-10%);
    
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem 0.9rem;
    border-radius: 14px;
    border-bottom-left-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    
    /* Truncation (default state) */
    white-space: nowrap;
    max-width: 220px;
    text-overflow: ellipsis;
    overflow: hidden;
    
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
    
    /* NEW: Interaction & Smoothness */
    pointer-events: auto; /* Allows hovering */
    cursor: default;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    animation: floatBubble 4s ease-in-out infinite;
}

/* NEW: Expand on Hover */
.status-thought-bubble:hover {
    max-width: 400px;    /* Give it plenty of room to grow sideways */
    white-space: normal; /* Allow text to wrap to multiple lines */
    z-index: 100;        /* Ensure it sits on top of everything else */
    transform: translateY(-15%) scale(1.02); /* Slight pop effect */
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

@keyframes floatBubble {
    0%, 100% { transform: translateY(-10%); }
    50% { transform: translateY(-20%); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .status-thought-bubble {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        margin-left: 36px; 
        transform: translateY(-5%);
        max-width: 180px; /* Smaller default width on mobile */
    }
    
    /* Ensure hover works nicely on mobile tap */
    .status-thought-bubble:hover {
        max-width: 280px;
        transform: translateY(-5%) scale(1.02);
    }
}