:root {
    --bg: #0a0a0f;
    --bg-alt: #12121a;
    --bg-card: #16161f;
    --border: #2a2a35;
    --fg: #e8e8f0;
    --fg-dim: #a0a0b0;
    --accent: #00ff9d;
    --accent-dim: #00ff9d33;
    --danger: #ff4d6d;
    --success: #00ff9d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

.container {
    max-width: 620px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.container.wide { max-width: 860px; }

h1 {
    font-size: 1.6rem;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1.15rem;
    margin: 2rem 0 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* ── Forms ─────────────────────────────────────────── */
label {
    display: block;
    font-size: 0.85rem;
    color: var(--fg-dim);
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
}

input[type="file"] {
    color: var(--fg-dim);
    font-size: 0.85rem;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

legend {
    color: var(--fg-dim);
    font-size: 0.85rem;
    padding: 0 0.4rem;
}

/* ── Buttons ───────────────────────────────────────── */
button, .btn {
    display: inline-block;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 0.65rem 1.3rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

button:hover, .btn:hover { opacity: 0.9; }

button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-small {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

form.inline { display: inline; }

/* ── Messages ──────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 1rem 0;
}
.alert-error {
    background: #ff4d6d1a;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.alert-success {
    background: #00ff9d1a;
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* ── Dashboard nav ─────────────────────────────────── */
.dash-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-alt);
    font-size: 0.9rem;
}
.dash-nav strong { color: var(--fg); }
.dash-nav a { color: var(--fg-dim); text-decoration: none; }
.dash-nav a.active { color: var(--accent); font-weight: 600; }
.dash-nav .spacer { flex: 1; }

/* ── Language switch ───────────────────────────────── */
.lang-switch { display: inline-flex; gap: 0.5rem; }
.lang-switch a { color: var(--fg-dim); text-decoration: none; font-size: 0.8rem; opacity: 0.6; }
.lang-switch a.active { opacity: 1; font-weight: 700; color: var(--accent); }

/* ── Links list (dashboard) ───────────────────────── */
.link-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.link-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}
.link-row .title { flex: 1; min-width: 0; }
.link-row .title small { color: var(--fg-dim); display: block; overflow-wrap: break-word; }
.link-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ── Icon picker (dashboard link form) ────────────── */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    width: 64px;
}
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option-box {
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    transition: border-color 0.15s ease;
}
.icon-option-box img { width: 24px; height: 24px; }
.icon-option-none {
    font-size: 0.6rem;
    color: var(--fg-dim);
    text-align: center;
    line-height: 1.2;
    padding: 0.2rem;
}
.icon-option input:checked + .icon-option-box {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.icon-option-label {
    font-size: 0.65rem;
    color: var(--fg-dim);
    text-align: center;
    line-height: 1.1;
}

/* ── Avatar preview ────────────────────────────────── */
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin-bottom: 1rem;
    border: 2px solid var(--accent);
}

/* ── Misc ──────────────────────────────────────────── */
.muted { color: var(--fg-dim); font-size: 0.85rem; }
.center { text-align: center; }

/* ── Supporter star ────────────────────────────────── */
@keyframes ws-star-twinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(1.25) rotate(15deg); }
}
.supporter-star {
    display: inline-block;
    animation: ws-star-twinkle 1.8s ease-in-out infinite;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.6;
}
.badge-supporter {
    background: linear-gradient(135deg, #ffd76633, #ff9f4322);
    border: 1px solid #ffd766;
    color: #ffd766;
}
.badge-18plus {
    background: #ff4d6d22;
    border: 1px solid #ff4d6d;
    color: #ff4d6d;
}

/* ── User list ─────────────────────────────────────── */
.user-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}
@media (max-width: 720px) { .user-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .user-grid { grid-template-columns: 1fr; } }
.user-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    text-decoration: none;
    color: var(--fg);
    transition: border-color 0.15s ease;
}
.user-card:hover { border-color: var(--accent); }
.user-card .avatar {
    width: 56px; height: 56px; border-radius: 50%;
    object-fit: cover; margin-bottom: 0.6rem;
    background: var(--accent);
}
.user-card .name { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 0.4rem; }
.user-card .tagline {
    color: var(--fg-dim); font-size: 0.8rem; margin: 0.2rem 0 0.6rem;
    overflow-wrap: break-word;
}
.user-card .badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.user-search {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ── Admin table ───────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; font-size: 0.85rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--fg-dim); font-weight: 600; }
