/* ── Sign in page ── */
.signin-page {
    min-height: 100vh;
    background: #0a0a0a;
    color: #f4f4f5;
    font-family: 'IBM Plex Sans Arabic', 'Outfit', sans-serif;
}

.signin-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.signin-card {
    width: min(420px, 100%);
    background: #111111;
    border: 1px solid rgba(114, 177, 218, 0.28);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
}

.signin-title {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
}

.signin-sub {
    margin: 0 0 1.25rem;
    color: #a1a1aa;
    font-size: 0.92rem;
}

.signin-actions {
    display: grid;
    gap: 0.75rem;
}

.signin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    border: 1px solid transparent;
}

.signin-btn svg { width: 22px; height: 22px; }

.signin-btn--discord { background: #5865f2; }
.signin-btn--steam {
    background: #171a21;
    border-color: rgba(255, 255, 255, 0.12);
}

.signin-note {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: #71717a;
}

/* ── Profile page ── */
body.public-site.profile-page {
    background: var(--prof-bg);
}

body.public-site.profile-page::before,
body.public-site.profile-page::after {
    display: none;
}

.profile-page {
    --prof-accent: #72b1da;
    --prof-accent-soft: rgba(114, 177, 218, 0.14);
    --prof-accent-border: rgba(114, 177, 218, 0.38);
    --prof-accent-text: #b8dff0;
    --prof-bg: #0a0a0a;
    --prof-card: #111111;
    --prof-card-border: rgba(114, 177, 218, 0.28);
    --prof-text: #fafafa;
    --prof-muted: #a1a1aa;
    --prof-linked: #22c55e;
    color: var(--prof-text);
}

.profile-main {
    position: relative;
    z-index: 1;
    padding: 6.5rem 1.25rem 4rem;
}

.profile-wrap {
    max-width: 920px;
    margin: 0 auto;
}

.profile-alert {
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--prof-accent-soft);
    border: 1px solid var(--prof-accent-border);
    color: var(--prof-accent-text);
    font-size: 0.9rem;
}

/* User header — like reference top block */
.profile-user-header {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-user-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a2a35, #101820);
    border: 3px solid var(--prof-accent-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--prof-accent-text);
    overflow: hidden;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}

.profile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user-info {
    flex: 1;
    min-width: 200px;
}

.profile-user-info h1 {
    margin: 0 0 0.3rem;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    font-family: 'Outfit', 'IBM Plex Sans Arabic', sans-serif;
}

.profile-user-sub {
    margin: 0 0 0.65rem;
    color: var(--prof-muted);
    font-size: 0.95rem;
}

.profile-role-badge {
    display: inline-block;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    background: var(--prof-accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.profile-role-badge--staff {
    background: #5865f2;
}

.profile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.profile-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.86rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: var(--prof-text);
    white-space: nowrap;
}

.profile-action-btn--admin {
    background: var(--prof-accent);
    color: #fff;
}

.profile-action-btn--ghost {
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--prof-muted);
}

.profile-action-btn--ghost:hover {
    border-color: var(--prof-accent-border);
    color: var(--prof-text);
}

/* Account playcoin wallet */
.profile-wallet-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(232, 168, 56, 0.12), rgba(114, 177, 218, 0.08));
    border: 1px solid rgba(232, 168, 56, 0.28);
    border-radius: 16px;
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.5rem;
}

.profile-wallet-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.profile-wallet-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(232, 168, 56, 0.18);
    color: #f0c674;
}

.profile-wallet-icon svg {
    width: 22px;
    height: 22px;
}

.profile-wallet-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.profile-wallet-label {
    font-size: 0.82rem;
    color: var(--prof-muted);
}

.profile-wallet-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f0c674;
    letter-spacing: 0.01em;
}

.profile-wallet-note {
    font-size: 0.78rem;
    color: var(--prof-muted);
}

.profile-wallet-link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(232, 168, 56, 0.35);
    color: #f0c674;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-wallet-link:hover {
    background: rgba(232, 168, 56, 0.12);
    border-color: rgba(232, 168, 56, 0.55);
}

/* Linked accounts card */
.profile-linked-card {
    background: var(--prof-card);
    border: 1px solid var(--prof-card-border);
    border-radius: 16px;
    padding: 1.35rem 1.5rem 0.5rem;
    margin-bottom: 2rem;
}

.profile-linked-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.profile-linked-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.profile-linked-icon {
    width: 22px;
    height: 22px;
    color: var(--prof-accent);
    flex-shrink: 0;
}

.profile-linked-list {
    display: flex;
    flex-direction: column;
}

.profile-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-link-row:first-child {
    border-top: none;
}

.profile-link-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.profile-link-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-link-logo svg {
    width: 24px;
    height: 24px;
}

.profile-link-brand--discord .profile-link-logo {
    background: rgba(88, 101, 242, 0.18);
    color: #818cf8;
}

.profile-link-brand--steam .profile-link-logo {
    background: rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
}

.profile-link-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.profile-link-copy strong {
    font-size: 1rem;
    font-weight: 600;
}

.profile-link-id {
    font-size: 0.82rem;
    color: var(--prof-muted);
    word-break: break-all;
    font-family: 'Outfit', monospace;
}

.profile-link-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}

.profile-link-status svg {
    width: 16px;
    height: 16px;
}

.profile-link-status--linked {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.profile-link-status--action {
    background: var(--prof-accent-soft);
    color: var(--prof-accent-text);
    border: 1px solid var(--prof-accent-border);
    transition: background 0.15s, color 0.15s;
}

.profile-link-status--action:hover {
    background: var(--prof-accent);
    color: #fff;
}

/* Characters section */
.profile-characters-section {
    margin-top: 0.5rem;
}

.profile-characters-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.profile-characters-head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.profile-characters-sub {
    margin: 0;
    font-size: 0.86rem;
    color: var(--prof-muted);
}

.profile-char-count {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--prof-accent-soft);
    border: 1px solid var(--prof-accent-border);
    color: var(--prof-accent-text);
    font-size: 0.88rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.profile-char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.profile-empty,
.profile-characters-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 120px;
    margin: 0;
    padding: 2rem 1rem;
    color: var(--prof-muted);
    font-size: 0.9rem;
    text-align: center;
}

.profile-characters-loading .rt-loader {
    flex: none;
}

/* Character detail cards */
.profile-char-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.015) 100%), var(--prof-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.profile-char-card:hover {
    border-color: var(--prof-accent-border);
    box-shadow: none;
}

.profile-char-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.25rem 1rem;
}

.profile-char-card-avatar {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #d6d6d6;
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.profile-char-card-avatar.is-fallback {
    background: #d6d6d6;
}

.profile-char-card-avatar-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    background: linear-gradient(180deg, #e2e2e2 0%, #cfcfcf 100%);
}

.profile-char-card-avatar-fallback svg {
    width: 36px;
    height: 36px;
    opacity: 1;
    filter: none;
}

.profile-char-card-avatar img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.profile-char-card-avatar.is-fallback img {
    display: none;
}

.profile-char-card-title {
    flex: 1;
    min-width: 0;
}

.profile-char-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.profile-char-card-title h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.profile-char-card-id {
    margin: 0;
    font-size: 0.76rem;
    color: var(--prof-muted);
    font-family: 'Outfit', monospace;
    word-break: break-all;
}

.profile-char-slot {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--prof-muted);
    font-family: 'Outfit', sans-serif;
}

.profile-char-card-highlight--solo {
    grid-template-columns: 1fr;
}

.profile-char-card-highlight {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
    background: rgba(114, 177, 218, 0.06);
    border-top: 1px solid rgba(114, 177, 218, 0.12);
    border-bottom: 1px solid rgba(114, 177, 218, 0.12);
}

.profile-char-card-highlight .profile-char-stat {
    padding: 0.85rem 1rem;
    border-top: none;
}

.profile-char-card-highlight .profile-char-stat + .profile-char-stat {
    border-inline-start: 1px solid rgba(114, 177, 218, 0.12);
}

.profile-char-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.profile-char-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 74px;
}

.profile-char-card-grid .profile-char-stat:nth-child(odd) {
    border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-char-stat--accent .profile-char-stat-value {
    color: var(--prof-accent-text);
    font-size: 0.95rem;
}

.profile-char-stat--coins .profile-char-stat-icon {
    background: rgba(232, 168, 56, 0.16);
    color: #f0c674;
}

.profile-char-stat--coins .profile-char-stat-value {
    color: #f0c674;
    font-size: 0.95rem;
}

.profile-char-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--prof-muted);
}

.profile-char-stat-icon svg {
    width: 16px;
    height: 16px;
}

.profile-char-stat--accent .profile-char-stat-icon {
    background: rgba(114, 177, 218, 0.2);
    color: var(--prof-accent);
}

.profile-char-stat-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.profile-char-stat-label {
    font-size: 0.74rem;
    color: var(--prof-muted);
}

.profile-char-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--prof-text);
    word-break: break-word;
}

.profile-empty-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--prof-card);
    border: 1px dashed var(--prof-card-border);
    border-radius: 16px;
}

.profile-empty-card p {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 600;
}

.profile-empty-card span {
    font-size: 0.86rem;
    color: var(--prof-muted);
}

.profile-page .pub-nav.scrolled .pub-nav-shell,
.profile-page .pub-nav-shell {
    border-color: rgba(114, 177, 218, 0.12);
}

@media (max-width: 768px) {
    .profile-user-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: right;
    }

    .profile-user-actions {
        margin-inline-start: 0;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }

    .profile-link-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-link-status {
        align-self: flex-end;
    }

    .profile-char-card-highlight {
        grid-template-columns: 1fr;
    }

    .profile-char-card-highlight .profile-char-stat + .profile-char-stat {
        border-inline-start: none;
        border-top: 1px solid rgba(114, 177, 218, 0.12);
    }

    .profile-char-card-grid {
        grid-template-columns: 1fr;
    }

    .profile-char-card-grid .profile-char-stat:nth-child(odd) {
        border-inline-end: none;
    }
}
