/* ============================================================
   Starelings â€” Dark Occult Fantasy Theme
   ============================================================ */

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

:root {
    --bg-deep: #06070c;
    --bg-sidebar: #0a0c14;
    --bg-card: #0d0f18;
    --border-obsidian: #1a1d2e;
    --text-primary: #e8eaf0;
    --text-muted: #8b8fa8;
    --accent-violet: #8b5cf6;
    --accent-fuchsia: #d946ef;
    --accent-glow: rgba(139, 92, 246, 0.45);
    --font-display: 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Segoe UI', system-ui, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

a {
    color: var(--accent-violet);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-fuchsia);
}

/* ---- App Layout ---- */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-obsidian);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-obsidian);
    margin-bottom: 1rem;
}

.sidebar-brand h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-fuchsia));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.sidebar-brand p {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    padding: 0 0.75rem;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
    box-shadow: inset 3px 0 0 var(--accent-violet);
}

.sidebar-resources {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-obsidian);
    font-size: 0.85rem;
}

.resource-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.resource-label {
    color: var(--text-muted);
}

.resource-value {
    color: #fbbf24;
    font-weight: 600;
}

.resource-value.tokens {
    color: var(--accent-fuchsia);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-deep);
    padding: 2rem;
}

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

.page-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---- Auth Pages ---- */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%), var(--bg-deep);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.12), 0 20px 60px rgba(0, 0, 0, 0.6);
}

.auth-card h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-fuchsia));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-obsidian);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-violet);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    text-align: center;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-fuchsia));
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(217, 70, 239, 0.45);
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Specimen Grid ---- */

.sanctuary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.specimen-card {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.25s, box-shadow 0.25s;
}

.specimen-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.specimen-meta {
    text-align: center;
    margin-top: 0.85rem;
}

.specimen-meta .specimen-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.specimen-meta .specimen-gen {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

/* Specimen renderer styles: public/css/stareling-specimen.css */

/* ---- Breeding Page ---- */

.breed-form {
    max-width: 720px;
}
.breed-selectors {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
}

.breed-divider {
    font-size: 2rem;
    color: var(--accent-fuchsia);
    text-align: center;
    padding-bottom: 0.5rem;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.breed-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
}

@media (max-width: 640px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
    }

    .sidebar-brand {
        width: 100%;
        padding: 0 0 1rem;
    }

    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0;
    }

    .sidebar-resources {
        width: 100%;
        display: flex;
        gap: 1.5rem;
        padding: 1rem 0 0;
    }

    .breed-selectors {
        grid-template-columns: 1fr;
    }

    .breed-divider {
        transform: rotate(90deg);
    }
}

/* ============================================================
   Community: Forums, Messages, Reports
   ============================================================ */

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-fuchsia));
    color: #fff;
    box-shadow: 0 0 10px var(--accent-glow);
}

.community-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.community-action-btn {
    width: auto !important;
    white-space: nowrap;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.breadcrumb a {
    color: var(--accent-violet);
}

.forum-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.forum-category-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.forum-category-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.12);
    color: inherit;
}

.forum-category-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.forum-category-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.forum-category-stats {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.forum-table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
}

.forum-table {
    width: 100%;
    border-collapse: collapse;
}

.forum-table th,
.forum-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-obsidian);
}

.forum-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.forum-table tr:last-child td {
    border-bottom: none;
}

.forum-thread-title {
    color: var(--text-primary);
    font-weight: 600;
}

.forum-thread-title:hover {
    color: var(--accent-fuchsia);
}

.forum-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem !important;
}

.thread-flag {
    display: inline-block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.thread-flag.pinned {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.thread-flag.locked {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.forum-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.community-badge {
    display: inline-block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.badge-vip {
    background: rgba(217, 70, 239, 0.15);
    color: #f0abfc;
    border: 1px solid rgba(217, 70, 239, 0.35);
}

.badge-admin {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.35);
}

.forum-post-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.forum-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    padding: 1rem 1.15rem;
}

.forum-post-card.is-deleted {
    opacity: 0.65;
}

.forum-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.forum-post-header time {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.forum-post-body {
    line-height: 1.6;
    word-break: break-word;
}

.forum-post-footer {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-obsidian);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-violet);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
}

.btn-link:hover {
    color: var(--accent-fuchsia);
}

.deleted-notice {
    color: var(--text-muted);
    font-style: italic;
}

.forum-reply-box,
.community-form {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.forum-reply-box h3 {
    margin-bottom: 0.85rem;
    font-size: 1rem;
}

.forum-disabled-notice {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 1.5rem;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.pagination-link.active,
.pagination-link:hover {
    border-color: rgba(139, 92, 246, 0.45);
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.15);
}

.message-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.message-tabs a {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    color: var(--text-muted);
    font-size: 0.88rem;
}

.message-tabs a.active,
.message-tabs a:hover {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.4);
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 10px;
    color: inherit;
    transition: border-color 0.2s;
}

.message-row:hover {
    border-color: rgba(139, 92, 246, 0.35);
    color: inherit;
}

.message-row.unread {
    border-color: rgba(217, 70, 239, 0.45);
    box-shadow: inset 3px 0 0 var(--accent-fuchsia);
}

.message-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.message-preview {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-row-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-fuchsia);
    box-shadow: 0 0 8px var(--accent-fuchsia);
}

.message-view-card {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    padding: 1.25rem;
}

.message-view-body {
    line-height: 1.65;
    word-break: break-word;
}

.message-view-footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-obsidian);
}

.report-modal[hidden] {
    display: none !important;
}

.report-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 12, 0.82);
    backdrop-filter: blur(4px);
}

.report-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.2);
}

.report-modal-dialog h3 {
    margin-bottom: 1rem;
}

.report-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.banish-card h1 {
    color: #ef4444;
}

.admin-report-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    padding: 1.15rem;
}

.admin-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.report-type-badge {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    margin-right: 0.35rem;
}

.report-preview-box {
    margin: 0.75rem 0;
    padding: 0.85rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-obsidian);
    border-radius: 8px;
    font-size: 0.88rem;
}

.admin-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.85rem;
}

.moderation-profile .moderation-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.moderation-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .message-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-row-meta {
        align-items: flex-start;
    }

    .community-header-row {
        flex-direction: column;
    }
}

/* ============================================================
   Motion Sensitivity / Reduced Motion
   ============================================================ */

body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
    animation: none !important;
    transition: none !important;
}

body.no-motion .satellite-orbit,
body.no-motion .candle-flame,
body.no-motion .bubble,
body.no-motion .pupil,
body.no-motion .eyelid-top,
body.no-motion .eyelid-bottom {
    animation: none !important;
    transition: none !important;
}

/* GPU layer acceleration for eye tracking */
.iris-socket,
.mini-track,
.satellite-orbit,
.candle-flame,
.eyeball-pet {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.no-motion .iris-socket,
body.no-motion .mini-track,
body.no-motion .eyeball-pet {
    will-change: auto;
}

/* ============================================================
   User Profiles
   ============================================================ */

.sidebar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-obsidian);
    color: inherit;
    text-decoration: none;
}

.sidebar-profile-link:hover {
    color: inherit;
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.sidebar-profile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-profile-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.sidebar-profile-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-brand-compact {
    padding: 0 1.25rem 0.75rem !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

.sidebar-footer-tools {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-obsidian);
}

.motion-toggle-btn {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-obsidian);
    background: var(--bg-deep);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.motion-toggle-btn:hover,
.motion-toggle-btn[aria-pressed="true"] {
    border-color: rgba(139, 92, 246, 0.45);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.profile-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.profile-header-main {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid rgba(217, 70, 239, 0.35);
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.25);
}

.profile-header-info h2 {
    margin-bottom: 0.5rem;
}

.profile-stats-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-action-btn {
    width: auto !important;
    display: inline-block;
}

.profile-section-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.profile-showcase-section,
.profile-bio-section,
.profile-grid-section {
    margin-bottom: 2rem;
}

.profile-altar-frame {
    position: relative;
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 55%), var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: inset 0 0 40px rgba(139, 92, 246, 0.08), 0 8px 32px rgba(0, 0, 0, 0.45);
}

.profile-altar-frame::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(217, 70, 239, 0.15);
    border-radius: 12px;
    pointer-events: none;
}

.profile-inspect-link {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.profile-single-specimen {
    max-width: 360px;
    margin: 0 auto 1.5rem;
}

.user-custom-profile {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: normal;
    isolation: isolate;
}

/* Reset site-wide * { margin:0 } so Toyhouse-style layouts keep their spacing */
.user-custom-profile :where(
    h1, h2, h3, h4, h5, h6,
    p, ul, ol, li, dl, dt, dd,
    blockquote, figure, figcaption,
    table, thead, tbody, tfoot, tr, th, td,
    section, article, header, footer, nav, main, aside,
    pre, hr
) {
    all: revert;
    color: inherit;
    font-family: inherit;
}

.user-custom-profile img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.user-custom-profile a {
    color: var(--accent-violet);
}

.user-custom-profile a:hover {
    color: var(--accent-fuchsia);
}

.user-custom-profile table {
    border-collapse: collapse;
    max-width: 100%;
}

.profile-specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.profile-specimen-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s;
}

.profile-specimen-link:hover {
    transform: translateY(-2px);
    color: inherit;
}

.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.profile-html-section {
    margin-top: 0.5rem;
}

.profile-html-editor {
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    min-height: 280px;
    tab-size: 2;
}

.avatar-preview-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

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

@media (max-width: 640px) {
    .profile-header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats-list {
        justify-content: center;
    }

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

/* ---- Expansion Suite ---- */

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.coi-warning-banner {
    font-weight: 500;
}

.gold-text {
    color: #fbbf24;
    font-weight: 600;
}

.sanctuary-specimen-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: transform 0.2s;
}

.sanctuary-specimen-link:hover {
    transform: translateY(-3px);
    color: inherit;
}

/* Staring Contest */

.game-hud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.game-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    min-width: 120px;
}

.game-stat span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.game-stat strong {
    font-size: 1.35rem;
    color: var(--accent-fuchsia);
}

.stare-contest-arena {
    position: relative;
    height: 420px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.08) 0%, transparent 70%), #04050a;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.arena-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 5;
    text-align: center;
    padding: 1rem;
}

.elder-watcher {
    position: absolute;
    width: 150px;
    height: 108px;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: none;
    will-change: left, top;
}

.elder-sclera {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 40% 35%, #fef3c7, #e5e7eb 60%, #9ca3af);
    border-radius: 50% / 55%;
    box-shadow: 0 0 30px rgba(217, 70, 239, 0.5), inset 0 -8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.elder-iris {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62%;
    height: 62%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #c084fc, #7c3aed 45%, #4c1d95);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4);
}

.elder-pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42%;
    height: 52%;
    background: #050508;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(217, 70, 239, 0.6);
}

.elder-lid {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: #1a1025;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}

.elder-lid-top { top: 0; border-radius: 50% 50% 0 0; }
.elder-lid-bottom { bottom: 0; border-radius: 0 0 50% 50%; }

.elder-watcher.blinking .elder-lid,
.elder-watcher.fake-blink .elder-lid {
    opacity: 0.85;
}

.elder-watcher.warning-state .elder-sclera {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.65), inset 0 -8px 20px rgba(0, 0, 0, 0.3);
}

.warning-blink {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
    z-index: 10;
    animation: warning-pulse 0.4s ease infinite alternate;
}

@keyframes warning-pulse {
    from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
    to { box-shadow: 0 0 24px rgba(239, 68, 68, 1); }
}

.game-results {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-obsidian);
    border-radius: 12px;
}

/* Inspect & Pedigree */

.inspect-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inspect-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-obsidian);
    padding-bottom: 0.5rem;
}

.inspect-tabs a {
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, background 0.2s;
}

.inspect-tabs a:hover,
.inspect-tabs a.active {
    color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.1);
}

.inspect-panel {
    margin-bottom: 2rem;
}

.inspect-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.mutation-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.mutation-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

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

.eligibility-list li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.eligibility-list li.ok { color: #86efac; }
.eligibility-list li.bad { color: #fca5a5; }

.pedigree-tree-wrap {
    overflow-x: auto;
    padding: 1rem 0 2rem;
}

.pedigree-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.pedigree-children {
    display: flex;
    gap: 2rem;
    position: relative;
    padding-top: 1rem;
}

.pedigree-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 1px;
    background: rgba(139, 92, 246, 0.35);
}

.pedigree-branch {
    position: relative;
    padding-top: 0.75rem;
}

.pedigree-branch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 0.75rem;
    background: rgba(139, 92, 246, 0.35);
}

.pedigree-mini-card {
    display: block;
    transform: scale(0.55);
    transform-origin: top center;
    width: 280px;
    margin: -2rem auto;
    text-decoration: none;
    color: inherit;
}

.pedigree-mini-card:hover {
    filter: drop-shadow(0 0 12px rgba(217, 70, 239, 0.4));
}

.pedigree-empty {
    width: 100px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.pedigree-ancestor-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    max-width: 160px;
    padding: 0.45rem 0.65rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: var(--accent-violet);
    font-size: 0.78rem;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pedigree-ancestor-chip:hover {
    background: rgba(217, 70, 239, 0.16);
    color: var(--accent-fuchsia);
}

/* Embed Modal */

.embed-modal[hidden] { display: none; }

.embed-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.embed-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.embed-modal-dialog {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 14px;
    padding: 1.5rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.embed-snippet-block {
    margin: 1rem 0;
}

.embed-snippet-block label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.embed-copy-field {
    width: 100%;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    background: #0a0b12;
    border: 1px solid var(--border-obsidian);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem;
    margin-bottom: 0.35rem;
    resize: vertical;
}

/* Abyssal Well */

.abyssal-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.abyssal-form {
    max-width: 480px;
}

.abyssal-reward-preview {
    padding: 0.75rem;
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.abyssal-submit-btn {
    background: linear-gradient(135deg, #4c1d95, #7c3aed);
}

.abyssal-altar {
    position: relative;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.abyssal-vortex {
    position: relative;
    width: 260px;
    height: 260px;
}

.vortex-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(217, 70, 239, 0.7);
    border-right-color: rgba(139, 92, 246, 0.4);
    animation: vortex-spin 3s linear infinite;
}

.vortex-ring-2 {
    inset: 20px;
    animation-duration: 2.2s;
    animation-direction: reverse;
    border-top-color: rgba(99, 102, 241, 0.6);
}

.vortex-ring-3 {
    inset: 40px;
    animation-duration: 1.6s;
    border-top-color: rgba(236, 72, 153, 0.5);
}

.vortex-core {
    position: absolute;
    inset: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a12 0%, #1e1b4b 40%, transparent 70%);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(139, 92, 246, 0.3);
}

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

.ritual-particles {
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.abyssal-success ~ .abyssal-layout .ritual-particles,
.abyssal-success + .abyssal-layout .ritual-particles {
    opacity: 1;
}

/* Breeding Goals */

.goals-layout {
    display: grid;
    grid-template-columns: minmax(280px, 400px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.goal-trait-grid,
.goal-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.color-picker-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.color-picker-row input[type="color"] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border-obsidian);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.goal-card {
    margin-bottom: 1rem;
}

.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.goal-card-header h4 {
    margin: 0;
    color: var(--accent-violet);
}

.goal-trait-summary {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.goal-trait-summary li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
}

.color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.match-badge {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.match-badge strong {
    display: block;
    margin-bottom: 0.2rem;
}

.match-high {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.match-mid {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.match-low {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #c4b5fd;
}

.btn-link.danger-link {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
}

@media (max-width: 900px) {
    .abyssal-layout,
    .goals-layout {
        grid-template-columns: 1fr;
    }

    .abyssal-altar {
        order: -1;
        height: 280px;
    }

    .stare-contest-arena {
        height: 320px;
    }
}
