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

:root {
    --bg: #07111f;
    --bg-soft: #0c192b;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --text: #122038;
    --muted: #75829a;
    --line: #e5eaf2;
    --primary: #5f63f2;
    --primary-dark: #4549d8;
    --cyan: #2cd5b4;
    --amber: #ffbd55;
    --purple: #9d70f8;
    --danger: #ed5f72;
    --shadow: 0 24px 70px rgba(20, 35, 64, .11);
    font-family: "Vazirmatn", Inter, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--surface-soft);
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
}

.brand-mark {
    display: grid;
    width: 2.9rem;
    height: 2.9rem;
    place-items: center;
    border-radius: .9rem;
    background: linear-gradient(135deg, var(--cyan), #74f0cc);
    color: #071421;
    box-shadow: 0 10px 30px rgba(44, 213, 180, .22);
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.03rem;
}

.brand small {
    margin-top: .08rem;
    color: #91a2ba;
    font-size: .68rem;
}

.brand-light {
    color: #fff;
}

.eyebrow {
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    padding: .75rem 1.15rem;
    border: 1px solid transparent;
    border-radius: .85rem;
    cursor: pointer;
    font-weight: 700;
    transition: .2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), #7679ff);
    color: #fff;
    box-shadow: 0 12px 28px rgba(95, 99, 242, .22);
}

.button-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #686cf7);
}

.button-secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--text);
}

.button-ghost {
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.button-wide {
    width: 100%;
}

.button-large {
    min-height: 3.25rem;
    padding-inline: 1.6rem;
}

.language-button,
.icon-button {
    display: grid;
    min-width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .8rem;
    background: rgba(255, 255, 255, .08);
    color: inherit;
    cursor: pointer;
    font-weight: 800;
}

.landing-body {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 20%, rgba(44, 213, 180, .14), transparent 30rem),
        radial-gradient(circle at 88% 72%, rgba(95, 99, 242, .22), transparent 36rem),
        var(--bg);
    color: #fff;
}

.landing-nav {
    display: flex;
    width: min(1180px, 92%);
    margin: auto;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
}

.landing-nav nav {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.landing-hero {
    display: grid;
    width: min(1180px, 92%);
    min-height: calc(100vh - 100px);
    margin: auto;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: 4rem;
    padding: 3rem 0 7rem;
}

.landing-hero h1 {
    max-width: 780px;
    margin: 1.2rem 0 1.25rem;
    font-size: clamp(3rem, 7vw, 6.6rem);
    line-height: 1.04;
    letter-spacing: -.055em;
}

[dir="rtl"] .landing-hero h1 {
    letter-spacing: -.02em;
}

.landing-hero p {
    max-width: 650px;
    color: #aab8cb;
    font-size: 1.12rem;
    line-height: 2;
}

.hero-actions {
    display: flex;
    gap: .8rem;
    margin-top: 2rem;
}

.hero-card {
    position: relative;
    min-height: 520px;
}

.quest-preview {
    position: absolute;
    z-index: 2;
    inset: 50% auto auto 50%;
    width: min(390px, 90%);
    padding: 1.6rem;
    transform: translate(-50%, -50%) rotate(2deg);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 2rem;
    background: rgba(14, 30, 50, .84);
    box-shadow: 0 45px 100px rgba(0, 0, 0, .35);
    backdrop-filter: blur(18px);
}

.quest-preview-head,
.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quest-preview-head span {
    color: var(--cyan);
}

.preview-balance {
    margin: 1.7rem 0;
    padding: 1.45rem;
    border-radius: 1.35rem;
    background: linear-gradient(135deg, rgba(95, 99, 242, .92), rgba(125, 92, 235, .88));
}

.preview-balance small,
.preview-balance strong {
    display: block;
}

.preview-balance strong {
    margin-top: .25rem;
    font-size: 2.35rem;
}

.preview-row {
    margin-top: .75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 1rem;
    color: #cfdaea;
}

.preview-row strong {
    color: var(--cyan);
}

.hero-orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
}

.orbit-one {
    inset: 4% 2% 5% 2%;
}

.orbit-two {
    inset: 15% 13%;
    border-color: rgba(44, 213, 180, .16);
}

.auth-body {
    min-height: 100vh;
    background: var(--bg);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(380px, .9fr) minmax(520px, 1.1fr);
}

.auth-visual {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 4.7rem);
    background:
        linear-gradient(160deg, rgba(7, 17, 31, .42), rgba(7, 17, 31, .94)),
        radial-gradient(circle at 80% 10%, rgba(95, 99, 242, .58), transparent 27rem),
        radial-gradient(circle at 20% 90%, rgba(44, 213, 180, .31), transparent 30rem),
        #0a1728;
    color: #fff;
}

.auth-visual-copy {
    max-width: 620px;
}

.auth-visual-copy h1 {
    margin: 1rem 0;
    font-size: clamp(2.6rem, 5vw, 5.4rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

[dir="rtl"] .auth-visual-copy h1 {
    letter-spacing: -.02em;
}

.auth-visual-copy p {
    color: #a9b7ca;
    line-height: 2;
}

.auth-security {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #a9b7ca;
    font-size: .85rem;
}

.status-dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 .28rem rgba(44, 213, 180, .12);
}

.auth-content {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 4rem 1.5rem;
    background: #f7f9fd;
}

.language-switch {
    position: absolute;
    inset-block-start: 1.5rem;
    inset-inline-end: 1.5rem;
    color: var(--text);
}

.language-switch .language-button {
    border-color: var(--line);
    background: #fff;
}

.auth-card {
    width: min(100%, 580px);
}

.auth-heading {
    margin-bottom: 2rem;
}

.auth-heading.centered {
    text-align: center;
}

.auth-heading h2 {
    margin: .65rem 0 .45rem;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -.035em;
}

.auth-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.stack-form {
    display: grid;
    gap: 1.1rem;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: .45rem;
    color: #35425a;
    font-size: .86rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 3.25rem;
    padding: .75rem .95rem;
    border: 1px solid var(--line);
    border-radius: .85rem;
    outline: 0;
    background: #fff;
    color: var(--text);
    font-weight: 500;
    transition: .2s ease;
}

.field input[type="file"] {
    padding: .67rem;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 .23rem rgba(95, 99, 242, .1);
}

.field small {
    color: var(--muted);
    font-weight: 400;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: #5f6b80;
    font-size: .86rem;
    cursor: pointer;
}

.check-field input {
    width: 1rem;
    height: 1rem;
    margin-top: .2rem;
    accent-color: var(--primary);
}

.auth-alternate {
    margin: 1.5rem 0 0;
    color: var(--muted);
    text-align: center;
}

.auth-alternate a,
.text-button {
    color: var(--primary);
    font-weight: 800;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: 1.2rem;
    padding: .9rem 1rem;
    border: 1px solid;
    border-radius: .9rem;
    font-size: .86rem;
    line-height: 1.7;
}

.alert ul {
    margin: .3rem 0 0;
    padding-inline-start: 1.1rem;
}

.alert-success {
    border-color: #b8eadf;
    background: #ebfbf7;
    color: #187760;
}

.alert-error {
    border-color: #ffd1d7;
    background: #fff2f4;
    color: #9e3040;
}

.alert-icon {
    display: grid;
    min-width: 1.35rem;
    height: 1.35rem;
    place-items: center;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
}

.verify-symbol {
    display: grid;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    place-items: center;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(95, 99, 242, .12), rgba(44, 213, 180, .15));
    color: var(--primary);
    font-size: 2rem;
}

.verify-tip {
    margin: 1.4rem 0;
    padding: .9rem;
    border-radius: .8rem;
    background: #eef2f9;
    color: var(--muted);
    text-align: center;
    font-size: .86rem;
}

.verify-logout {
    margin-top: 1rem;
    text-align: center;
}

.text-button {
    border: 0;
    background: none;
    cursor: pointer;
}

.panel-body {
    min-height: 100vh;
    background: #f4f7fb;
}

.panel-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 270px minmax(0, 1fr);
}

[dir="rtl"] .panel-shell {
    grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 1.6rem 1.15rem;
    background:
        radial-gradient(circle at 15% 5%, rgba(95, 99, 242, .22), transparent 17rem),
        #091625;
    color: #fff;
}

.sidebar .brand {
    padding: 0 .65rem 1.6rem;
}

.side-nav {
    display: grid;
    gap: .3rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 4px;
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.15);
    border-radius: 2px;
}

.side-label {
    margin: 1.1rem .8rem .35rem;
    color: #667b95;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.side-link {
    display: flex;
    width: 100%;
    min-height: 2.85rem;
    align-items: center;
    gap: .75rem;
    padding: .7rem .85rem;
    border: 0;
    border-radius: .8rem;
    background: transparent;
    color: #9eb0c5;
    cursor: pointer;
    text-align: start;
    transition: .18s ease;
}

.side-link:hover,
.side-link.active {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.side-link.active {
    box-shadow: inset 3px 0 var(--cyan);
}

[dir="rtl"] .side-link.active {
    box-shadow: inset -3px 0 var(--cyan);
}

.side-link.disabled {
    cursor: not-allowed;
    opacity: .55;
}

.side-icon {
    display: grid;
    width: 1.65rem;
    color: var(--cyan);
    place-items: center;
}

.sidebar-foot {
    margin-top: auto;
}

.sidebar-foot form,
.logout-link {
    width: 100%;
}

.logout-link {
    color: #ff9dab;
}

.panel-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: .75rem clamp(1.2rem, 3vw, 2.6rem);
    border-bottom: 1px solid rgba(225, 231, 240, .9);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(16px);
}

.topbar-date {
    color: var(--muted);
    font-size: .82rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.topbar .icon-button {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--text);
}

.account-chip {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.account-chip img,
.avatar-fallback {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border-radius: .8rem;
    object-fit: cover;
}

.avatar-fallback {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    font-weight: 800;
}

.account-chip strong,
.account-chip small {
    display: block;
}

.account-chip strong {
    font-size: .84rem;
}

.account-chip small {
    color: var(--muted);
    font-size: .68rem;
}

.panel-content {
    width: min(1460px, 100%);
    margin: auto;
    padding: clamp(1.5rem, 3vw, 2.7rem);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.7rem;
}

.page-head h1 {
    margin: .4rem 0 .35rem;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -.035em;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

.live-badge,
.coin-chip,
.pill,
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .75rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
}

.live-badge {
    border: 1px solid #c9f0e7;
    background: #effbf8;
    color: #17816a;
}

.coin-chip {
    background: #fff7e6;
    color: #a0640a;
}

.coin-chip span {
    color: var(--amber);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-card {
    display: flex;
    min-height: 132px;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 12px 35px rgba(30, 45, 75, .045);
}

.metric-icon {
    display: grid;
    width: 3.35rem;
    height: 3.35rem;
    place-items: center;
    border-radius: 1rem;
    font-size: 1.25rem;
}

.metric-card strong,
.metric-card span {
    display: block;
}

.metric-card strong {
    font-size: 1.8rem;
}

.metric-card div > span {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .78rem;
}

.accent-blue .metric-icon {
    background: #edf0ff;
    color: var(--primary);
}

.accent-green .metric-icon {
    background: #eafaf6;
    color: #149979;
}

.accent-amber .metric-icon {
    background: #fff5df;
    color: #b8750c;
}

.accent-purple .metric-icon {
    background: #f4edff;
    color: #8650dd;
}

.content-card {
    padding: clamp(1.2rem, 2.5vw, 1.8rem);
    border: 1px solid var(--line);
    border-radius: 1.2rem;
    background: #fff;
    box-shadow: 0 12px 40px rgba(30, 45, 75, .045);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.card-head h2 {
    margin: .3rem 0 0;
    font-size: 1.18rem;
}

.card-description {
    margin: -.5rem 0 1.25rem;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.8;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}

th,
td {
    padding: .95rem;
    border-bottom: 1px solid #edf0f5;
    text-align: start;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
}

td {
    font-size: .84rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.pill {
    padding: .37rem .65rem;
}

.pill-success {
    background: #eafaf6;
    color: #168168;
}

.pill-muted {
    background: #eef1f6;
    color: #68758b;
}

.pill-warning {
    background: #fff5df;
    color: #b8750c;
}

.pill-danger {
    background: #fff2f4;
    color: #9e3040;
}

.empty-state {
    display: grid;
    min-height: 230px;
    place-items: center;
    align-content: center;
    color: var(--muted);
    text-align: center;
}

.empty-state > span {
    display: grid;
    width: 4rem;
    height: 4rem;
    place-items: center;
    border-radius: 1.2rem;
    background: #f0f3f8;
    color: var(--primary);
    font-size: 1.5rem;
}

.empty-state p {
    margin: .9rem 0 .25rem;
}

.empty-state small {
    color: #9aa5b6;
}

.activity-list {
    display: grid;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .85rem 0;
    border-bottom: 1px solid #edf0f5;
}

.activity-row:last-child {
    border-bottom: 0;
}

.activity-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: .75rem;
    background: #eafaf6;
    color: #148f72;
}

.activity-row div {
    flex: 1;
}

.activity-row strong,
.activity-row small {
    display: block;
}

.activity-row small {
    margin-top: .2rem;
    color: var(--muted);
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(260px, .36fr) minmax(0, .64fr);
    gap: 1rem;
}

.profile-identity {
    text-align: center;
}

.large-avatar {
    display: grid;
    width: 7.5rem;
    height: 7.5rem;
    margin: .5rem auto 1rem;
    place-items: center;
    overflow: hidden;
    border: .35rem solid #eef1ff;
    border-radius: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    font-size: 2.6rem;
    font-weight: 800;
}

.large-avatar.compact {
    width: 5.3rem;
    height: 5.3rem;
    margin: 0;
    border-radius: 1.4rem;
    font-size: 1.8rem;
}

.large-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-identity h2 {
    margin: 0;
}

.profile-identity p {
    margin: .35rem 0 .8rem;
    color: var(--muted);
    font-size: .84rem;
}

.role-badge {
    background: #edf0ff;
    color: var(--primary);
}

.identity-balance {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #fff7e5;
    color: #9d650d;
}

.identity-balance strong,
.identity-balance span {
    display: block;
}

.identity-balance strong {
    font-size: 1.8rem;
}

.identity-balance span {
    font-size: .72rem;
}

.detail-list {
    margin: 0;
}

.detail-list > div {
    display: grid;
    grid-template-columns: minmax(130px, .35fr) minmax(0, .65fr);
    gap: 1rem;
    padding: .95rem 0;
    border-bottom: 1px solid #edf0f5;
}

.detail-list > div:last-child {
    border-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: .8rem;
}

.detail-list dd {
    margin: 0;
    font-size: .86rem;
    font-weight: 700;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    align-items: start;
    gap: 1rem;
}

.avatar-editor {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.grow {
    flex: 1;
}

@media (max-width: 1080px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .landing-hero {
        gap: 1rem;
    }
}

@media (max-width: 860px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }

    .panel-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 1rem;
    }

    .side-nav {
        display: flex;
        overflow-x: auto;
        padding-bottom: .4rem;
    }

    .side-label,
    .side-link.disabled,
    .sidebar-foot {
        display: none;
    }

    .side-link {
        width: auto;
        min-width: max-content;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .landing-hero p {
        margin-inline: auto;
    }

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

    .hero-card {
        min-height: 430px;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .landing-nav .brand small,
    .landing-nav .button-ghost,
    .account-chip span:last-child,
    .topbar-date {
        display: none;
    }

    .landing-hero h1 {
        font-size: 3rem;
    }

    .hero-actions,
    .page-head {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .button,
    .page-head .button {
        width: 100%;
    }

    .field-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 110px;
    }

    .panel-content {
        padding: 1.1rem;
    }

    .topbar {
        padding: .65rem 1rem;
    }

    .avatar-editor {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
}

/* ════════════════════════════════════════════════════════════
   NEW HOMEPAGE
   ════════════════════════════════════════════════════════════ */

.container-wide {
    width: min(1200px, 92%);
    margin: 0 auto;
}

/* ── NAVIGATION ── */
.lnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(7, 17, 31, .72);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.lnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.lnav-links {
    display: flex;
    gap: 1.8rem;
}

.lnav-links a {
    color: #9fb0c6;
    font-size: .88rem;
    font-weight: 600;
    transition: color .2s;
}

.lnav-links a:hover {
    color: #fff;
}

.lnav-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .7rem;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: .82rem;
    transition: .2s;
}

.lang-pill:hover {
    background: rgba(255, 255, 255, .12);
}

.button-sm {
    min-height: 2.4rem;
    padding: .5rem 1rem;
    font-size: .85rem;
}

.lnav-ghost {
    border-color: rgba(255, 255, 255, .14);
    background: transparent;
}

.lnav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.lnav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: .3s;
}

.lnav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.lnav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.lnav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── HERO ── */
.lhero {
    position: relative;
    padding: 8rem 0 5rem;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.lhero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .06);
}

.orbit-1 {
    width: 600px;
    height: 600px;
    top: -10%;
    right: -8%;
    animation: orbit-spin 40s linear infinite;
}

.orbit-2 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    left: -5%;
    border-color: rgba(44, 213, 180, .1);
    animation: orbit-spin 30s linear infinite reverse;
}

.orbit-3 {
    width: 250px;
    height: 250px;
    top: 20%;
    left: 15%;
    border-color: rgba(157, 112, 248, .1);
    animation: orbit-spin 25s linear infinite;
}

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lhero-inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.lhero-title {
    margin: 1.2rem 0 1.25rem;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.15;
    letter-spacing: -.03em;
    color: #fff;
}

[dir="rtl"] .lhero-title {
    letter-spacing: -.01em;
}

.lhero-desc {
    max-width: 540px;
    color: #9fb0c6;
    font-size: 1.08rem;
    line-height: 2;
}

.lhero-cta {
    display: flex;
    gap: .8rem;
    margin-top: 2rem;
}

.button-lg {
    min-height: 3.2rem;
    padding: .8rem 1.6rem;
    font-size: 1rem;
}

.lhero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.lhero-stat strong {
    display: block;
    font-size: 1.6rem;
    color: var(--cyan);
}

.lhero-stat span {
    color: #75829a;
    font-size: .82rem;
}

/* Hero quest card */
.lhero-visual {
    display: flex;
    justify-content: center;
}

.lquest-card {
    width: min(360px, 90%);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1.6rem;
    background: rgba(14, 30, 50, .8);
    backdrop-filter: blur(20px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, .3);
    animation: quest-float 6s ease-in-out infinite;
}

@keyframes quest-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.lquest-head {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 1.2rem;
}

.lquest-logo {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border-radius: .7rem;
    background: linear-gradient(135deg, var(--cyan), #74f0cc);
    color: #071421;
    font-weight: 800;
    font-size: .85rem;
}

.lquest-title {
    color: #9fb0c6;
    font-size: .85rem;
    font-weight: 600;
}

.lquest-balance {
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.lquest-coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.lquest-coin-icon {
    color: var(--amber);
    font-size: 1.5rem;
}

.lquest-coin-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
}

.lquest-label {
    display: block;
    color: #75829a;
    font-size: .78rem;
    margin-top: .3rem;
}

.lquest-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem .5rem;
    border-radius: .8rem;
    color: #ccd6e3;
    font-size: .9rem;
    transition: background .2s;
}

.lquest-row:hover {
    background: rgba(255, 255, 255, .04);
}

.lquest-badge {
    background: rgba(44, 213, 180, .15);
    color: var(--cyan);
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
}

/* ── BANNER SLOT ── */
.l-banner-slot {
    padding: 1.5rem 0;
}

.l-banner {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    transition: transform .3s;
}

.l-banner:hover {
    transform: scale(1.01);
}

.l-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── SECTION HEADERS ── */
.lsec-head {
    text-align: center;
    margin-bottom: 3rem;
}

.lsec-head .eyebrow {
    display: block;
    margin-bottom: .6rem;
}

.lsec-head h2 {
    margin: 0;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    color: #fff;
    letter-spacing: -.02em;
}

/* ── HOW IT WORKS ── */
.lhow {
    padding: 5rem 0;
    background: linear-gradient(180deg, transparent, rgba(7, 17, 31, .4), transparent);
}

.lhow-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 4rem;
}

.lhow-step {
    flex: 0 0 22%;
    text-align: center;
    padding: 0 .8rem;
}

.lhow-num {
    display: inline-flex;
    width: 3.2rem;
    height: 3.2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7679ff);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(95, 99, 242, .3);
}

.lhow-step h3 {
    margin: 0 0 .5rem;
    color: #fff;
    font-size: 1.05rem;
}

.lhow-step p {
    margin: 0;
    color: #9fb0c6;
    font-size: .88rem;
    line-height: 1.8;
}

.lhow-connector {
    flex: 0 0 40px;
    height: 2px;
    background: rgba(95, 99, 242, .25);
    margin-top: 1.6rem;
}

/* Task types */
.ltask-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.ltask-card {
    padding: 2rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(14, 30, 50, .5);
    backdrop-filter: blur(10px);
    text-align: center;
}

.ltask-icon {
    font-size: 2.2rem;
    margin-bottom: .8rem;
}

.ltask-card h3 {
    margin: 0 0 .5rem;
    color: #fff;
    font-size: 1.1rem;
}

.ltask-card p {
    margin: 0 0 1rem;
    color: #9fb0c6;
    font-size: .88rem;
    line-height: 1.8;
}

.ltask-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: center;
}

.ltask-tag {
    display: inline-block;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #ccd6e3;
    font-size: .78rem;
    font-weight: 600;
}

.ltask-fixed {
    border-color: rgba(44, 213, 180, .15);
}

.ltask-variable {
    border-color: rgba(157, 112, 248, .15);
}

/* ── REWARDS ── */
.lrewards {
    padding: 5rem 0;
}

.lrewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.lreward-card {
    padding: 2rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(14, 30, 50, .5);
    text-align: center;
    transition: transform .3s, border-color .3s;
}

.lreward-card:hover {
    transform: translateY(-4px);
    border-color: rgba(95, 99, 242, .3);
}

.lreward-icon {
    font-size: 2.5rem;
    margin-bottom: .8rem;
}

.lreward-card h3 {
    margin: 0 0 .4rem;
    color: #fff;
    font-size: 1.05rem;
}

.lreward-card p {
    margin: 0 0 .8rem;
    color: #9fb0c6;
    font-size: .85rem;
}

.lreward-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: var(--amber);
    font-size: 1.1rem;
    font-weight: 700;
}

.lreward-coin {
    font-size: 1rem;
}

.lreward-value {
    margin-top: .3rem;
    color: #75829a;
    font-size: .82rem;
}

.lrewards-soon {
    text-align: center;
    color: #75829a;
    font-size: .9rem;
}

/* ── ABOUT ── */
.labout {
    padding: 5rem 0;
    background: linear-gradient(180deg, transparent, rgba(7, 17, 31, .4), transparent);
}

.labout-desc {
    text-align: center;
    max-width: 680px;
    margin: -1rem auto 3rem;
    color: #9fb0c6;
    font-size: 1.05rem;
    line-height: 2;
}

.labout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.labout-sites,
.labout-skills {
    padding: 2rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(14, 30, 50, .5);
}

.labout-sites h3,
.labout-skills h3 {
    margin: 0 0 1.2rem;
    color: #fff;
    font-size: 1.1rem;
}

.labout-site {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: .8rem;
    transition: background .2s;
    margin-bottom: .5rem;
}

.labout-site:hover {
    background: rgba(255, 255, 255, .04);
}

.labout-site-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.labout-site strong {
    display: block;
    color: #fff;
    font-size: .95rem;
    margin-bottom: .2rem;
}

.labout-site span {
    color: #75829a;
    font-size: .82rem;
}

.lskill-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
}

.lskill {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .8rem;
    border-radius: .7rem;
    background: rgba(255, 255, 255, .04);
    color: #ccd6e3;
    font-size: .88rem;
    font-weight: 600;
}

.lskill-icon {
    font-size: 1.2rem;
}

/* ── FAQ ── */
.lfaq {
    padding: 5rem 0;
}

.lfaq-list {
    max-width: 780px;
    margin: 0 auto;
}

.lfaq-item {
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 1rem;
    margin-bottom: .8rem;
    background: rgba(14, 30, 50, .5);
    overflow: hidden;
    transition: border-color .3s;
}

.lfaq-item[open] {
    border-color: rgba(95, 99, 242, .3);
}

.lfaq-q {
    padding: 1.1rem 1.4rem;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background .2s;
}

.lfaq-q::-webkit-details-marker {
    display: none;
}

.lfaq-q::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary);
    transition: transform .3s;
}

.lfaq-item[open] .lfaq-q::after {
    transform: rotate(45deg);
}

.lfaq-q:hover {
    background: rgba(255, 255, 255, .03);
}

.lfaq-a {
    padding: 0 1.4rem 1.2rem;
    color: #9fb0c6;
    font-size: .9rem;
    line-height: 2;
}

/* ── CONTACT ── */
.lcontact {
    padding: 5rem 0;
    background: linear-gradient(180deg, transparent, rgba(7, 17, 31, .4), transparent);
}

.lcontact-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 3rem;
    align-items: flex-start;
}

.lcontact-info h3 {
    margin: 0 0 1.5rem;
    color: #fff;
    font-size: 1.15rem;
}

.lcontact-detail {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.2rem;
    align-items: flex-start;
}

.lcontact-detail-icon {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: .7rem;
    background: rgba(95, 99, 242, .12);
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.lcontact-detail strong {
    display: block;
    color: #fff;
    font-size: .88rem;
    margin-bottom: .15rem;
}

.lcontact-detail a,
.lcontact-detail span {
    color: #9fb0c6;
    font-size: .85rem;
}

.lcontact-form {
    padding: 2rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(14, 30, 50, .5);
}

.lcontact-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.lcontact-form .field {
    display: block;
    margin-bottom: 1rem;
}

.lcontact-form .field span {
    display: block;
    margin-bottom: .4rem;
    color: #9fb0c6;
    font-size: .82rem;
    font-weight: 600;
}

.lcontact-form input,
.lcontact-form textarea {
    width: 100%;
    padding: .7rem 1rem;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: .7rem;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: .9rem;
    transition: border-color .2s;
}

.lcontact-form input:focus,
.lcontact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.lcontact-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* ── FOOTER ── */
.lfooter {
    padding: 3rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

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

.lfooter-tagline {
    margin: 1rem 0 0;
    color: #75829a;
    font-size: .85rem;
    line-height: 1.8;
    max-width: 300px;
}

.lfooter-col h4 {
    margin: 0 0 .8rem;
    color: #fff;
    font-size: .9rem;
}

.lfooter-col a {
    display: block;
    color: #75829a;
    font-size: .85rem;
    padding: .25rem 0;
    transition: color .2s;
}

.lfooter-col a:hover {
    color: #fff;
}

.lfooter-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: #536380;
    font-size: .82rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    .lnav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(7, 17, 31, .96);
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, .06);
        gap: .8rem;
    }

    .lnav-links.open {
        display: flex;
    }

    .lnav-toggle {
        display: flex;
    }

    .button-sm.lnav-ghost {
        display: none;
    }

    .lhero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .lhero-desc {
        margin: 0 auto;
    }

    .lhero-cta {
        justify-content: center;
    }

    .lhero-stats {
        justify-content: center;
    }

    .lhow-steps {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .lhow-step {
        flex: none;
        width: 100%;
        max-width: 340px;
    }

    .lhow-connector {
        width: 2px;
        height: 30px;
        margin: 0;
    }

    .ltask-types {
        grid-template-columns: 1fr;
    }

    .labout-grid {
        grid-template-columns: 1fr;
    }

    .lcontact-grid {
        grid-template-columns: 1fr;
    }

    .lcontact-fields {
        grid-template-columns: 1fr;
    }

    .lfooter-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 620px) {
    .lhero {
        min-height: auto;
        padding: 7rem 0 3rem;
    }

    .lhero-stats {
        gap: 1.5rem;
    }

    .lfooter-grid {
        grid-template-columns: 1fr;
    }

    .lsec-head h2 {
        font-size: 1.6rem;
    }
}

[dir="rtl"] .lhow-connector {
    transform: scaleX(-1);
}

/* ════════════════════════════════════════════════════════════
   SUPPORT TICKET SYSTEM
   ════════════════════════════════════════════════════════════ */

.ticket-list {
    display: flex;
    flex-direction: column;
}

.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.ticket-row:hover {
    background: rgba(95, 99, 242, .03);
}

.ticket-row:last-child {
    border-bottom: 0;
}

.ticket-row-main {
    flex: 1;
    min-width: 0;
}

.ticket-row-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .35rem;
}

.ticket-row-id {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ticket-row-subject {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-row-meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--muted);
}

.ticket-row-user {
    color: var(--text);
    font-weight: 600;
}

.ticket-row-messages {
    color: var(--muted);
}

.ticket-row-time {
    color: var(--muted);
}

.ticket-row-status {
    flex-shrink: 0;
}

/* ── Category badges ── */
.ticket-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
}

.ticket-badge-general {
    background: #edf0ff;
    color: var(--primary);
}

.ticket-badge-technical {
    background: #fff5df;
    color: #b8750c;
}

.ticket-badge-billing {
    background: #eafaf6;
    color: #149979;
}

.ticket-badge-account {
    background: #f4edff;
    color: #8650dd;
}

.ticket-badge-other {
    background: #eef1f6;
    color: #68758b;
}

/* ── Priority dots ── */
.ticket-priority-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-low {
    background: #149979;
}

.priority-medium {
    background: #b8750c;
}

.priority-high {
    background: #e8443d;
    box-shadow: 0 0 0 3px rgba(232, 68, 61, .15);
}

/* ── Priority selector (radio buttons) ── */
.priority-select {
    display: block;
    text-align: center;
    padding: .5rem .4rem;
    border: 2px solid var(--line);
    border-radius: .7rem;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.priority-select:hover {
    border-color: var(--muted);
}

.priority-select-low.priority-active {
    border-color: #149979;
    background: rgba(20, 153, 121, .08);
    color: #149979;
}

.priority-select-medium.priority-active {
    border-color: #b8750c;
    background: rgba(184, 117, 12, .08);
    color: #b8750c;
}

.priority-select-high.priority-active {
    border-color: #e8443d;
    background: rgba(232, 68, 61, .08);
    color: #e8443d;
}

/* ── Conversation / chat UI ── */
.ticket-conversation {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-message {
    display: flex;
    gap: .8rem;
    align-items: flex-start;
}

.ticket-message-avatar {
    flex-shrink: 0;
}

.ticket-message-avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 800;
    font-size: .82rem;
}

.ticket-message-body {
    flex: 1;
    min-width: 0;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.ticket-message-staff .ticket-message-body {
    background: rgba(95, 99, 242, .05);
    border-color: rgba(95, 99, 242, .12);
}

.ticket-message-internal {
    background: rgba(255, 193, 7, .06) !important;
    border-color: rgba(255, 193, 7, .25) !important;
    border-style: dashed !important;
}

.ticket-message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
    gap: .5rem;
}

.ticket-message-header strong {
    font-size: .82rem;
}

.ticket-message-header small {
    color: var(--muted);
    font-size: .75rem;
    white-space: nowrap;
}

.ticket-message-text {
    font-size: .9rem;
    line-height: 1.85;
    color: var(--text);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .ticket-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
    }

    .ticket-row-status {
        align-self: flex-start;
    }

    .ticket-row-meta {
        gap: .4rem;
    }
}

@media (max-width: 620px) {
    .ticket-conversation {
        gap: .8rem;
    }

    .ticket-message {
        gap: .5rem;
    }

    .ticket-message-avatar span {
        width: 30px;
        height: 30px;
        font-size: .72rem;
    }

    .ticket-message-body {
        padding: .8rem 1rem;
    }
}

/* ════════════════════════════════════════════════════════════
   TASK MANAGEMENT CARDS
   ════════════════════════════════════════════════════════════ */

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

.task-card {
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 45, 75, .04);
    transition: box-shadow .2s, transform .2s;
}

.task-card:hover {
    box-shadow: 0 12px 32px rgba(30, 45, 75, .08);
    transform: translateY(-2px);
}

.task-card-inactive {
    opacity: .6;
}

.task-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .8rem;
}

.task-card-icon {
    font-size: 2rem;
}

.task-card-badges {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.task-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
}

.task-mode-fixed {
    background: #eafaf6;
    color: #149979;
}

.task-mode-variable {
    background: #f4edff;
    color: #8650dd;
}

.task-card-title {
    margin: 0 0 .4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.task-card-desc {
    margin: 0 0 .8rem;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.6;
}

.task-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    margin-bottom: 1rem;
    padding: .8rem;
    border-radius: .7rem;
    background: var(--surface-soft);
}

.task-card-detail {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.task-detail-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.task-detail-value {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
}

.task-coins {
    color: var(--amber);
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: .8rem;
    border-top: 1px solid var(--line);
}

.task-card-actions {
    display: flex;
    gap: .4rem;
}

.task-toggle {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    background: none;
}

.task-toggle-active {
    border-color: #b8eadf;
    background: #ebfbf7;
    color: #187760;
}

.task-toggle-inactive {
    border-color: #ffd1d7;
    background: #fff2f4;
    color: #9e3040;
}

@media (max-width: 620px) {
    .task-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════════
   USER TASK PANEL – Daily mission cards & detail page
   ════════════════════════════════════════════════════════════ */

.back-link {
    display: inline-block;
    margin-bottom: .5rem;
    color: var(--muted);
    font-size: .82rem;
    text-decoration: none;
    transition: color .2s;
}
.back-link:hover { color: var(--primary); }

.user-task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.user-task-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 45, 75, .04);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .25s, transform .25s;
}

.user-task-card:hover {
    box-shadow: 0 12px 32px rgba(30, 45, 75, .1);
    transform: translateY(-3px);
}

.user-task-completed {
    background: #f8fdf9;
    border-color: #d1fae5;
    opacity: .85;
}
.user-task-completed:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(30, 45, 75, .04);
}

.user-task-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .8rem;
}

.user-task-icon {
    font-size: 2rem;
    line-height: 1;
}

.user-task-badge-done {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #eafaf6;
    color: #168168;
    font-size: .75rem;
    font-weight: 700;
}

.user-task-badge-coins {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #fff5df;
    color: #b8750c;
    font-size: .75rem;
    font-weight: 700;
}

.user-task-title {
    margin: 0 0 .4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.user-task-desc {
    margin: 0 0 .8rem;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.6;
}

.user-task-meta {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: .8rem;
    border-top: 1px solid var(--line);
}

.user-task-meta-item {
    font-size: .75rem;
    color: var(--muted);
}

/* ─── Task Detail Page ──────────────────────────────── */

.user-task-detail-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}

.user-task-detail-main {
    padding: 0;
    overflow: hidden;
}

.user-task-detail-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.user-task-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
}

.user-task-detail-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.user-task-detail-header h2 {
    margin: 0 0 .5rem;
    font-size: 1.25rem;
}

.user-task-detail-badges {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.user-task-badge-reward {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #fff5df;
    color: #b8750c;
    font-size: .8rem;
    font-weight: 700;
}

.user-task-badge-duration {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #edf0ff;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 700;
}

.user-task-badge-reset {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #eafaf6;
    color: #168168;
    font-size: .8rem;
    font-weight: 700;
}

.user-task-detail-section {
    padding: 1.25rem 1.5rem;
}

.user-task-detail-section h3 {
    margin: 0 0 .6rem;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.user-task-detail-section p {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.8;
}

.user-task-instructions {
    padding: 1rem;
    background: #f5f8fc;
    border-radius: .75rem;
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .88rem;
    line-height: 1.9;
}

.user-task-status-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 1.5rem 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: .75rem;
}

.user-task-status-done {
    background: #eafaf6;
    border: 1px solid #b8eadf;
}

.user-task-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.user-task-status-done .user-task-status-icon {
    background: #d1fae5;
    color: #168168;
}

.user-task-status-box strong {
    display: block;
    font-size: .95rem;
    color: #168168;
}

.user-task-status-box span {
    font-size: .82rem;
    color: #149979;
}

.user-task-action-area {
    padding: 1.5rem;
    text-align: center;
}

.user-task-start-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #5f63f2 0%, #4549d8 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(95, 99, 242, .3);
}
.user-task-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(95, 99, 242, .4);
}
.user-task-start-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.user-task-hint {
    margin: .6rem 0 0;
    font-size: .78rem;
    color: var(--muted);
}

/* ─── Sidebar ────────────────────────────────────────── */

.user-task-detail-sidebar h3 {
    margin: 0 0 1rem;
    font-size: .95rem;
}

.user-task-info-list {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.user-task-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--line);
}

.user-task-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.user-task-info-label {
    font-size: .82rem;
    color: var(--muted);
}

.user-task-info-value {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
}

.user-task-coins {
    color: var(--amber);
}

/* ─── Modal ──────────────────────────────────────────── */

.user-task-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
}

.user-task-modal-content {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,.15);
}

.user-task-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.user-task-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.user-task-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0 .25rem;
}

.user-task-modal-body {
    text-align: center;
}

.user-task-modal-body p {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1rem;
}

.user-task-modal-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--line);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: tq-spin .8s linear infinite;
}

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

/* ─── In-Progress Status ──────────────────────────────── */

.user-task-status-progress {
    background: #fff5df;
    border: 1px solid #ffe0a8;
}

.user-task-status-icon-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff5df;
    color: #b8750c;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-task-status-progress strong {
    display: block;
    font-size: .95rem;
    color: #b8750c;
}

.user-task-status-progress span {
    font-size: .82rem;
    color: #9a7014;
}

/* ─── Search Hint ─────────────────────────────────────── */

.user-task-search-hint {
    padding: 1rem;
    background: #f5f8fc;
    border-radius: .75rem;
    border: 1px solid var(--line);
}

.user-task-search-hint p {
    margin: 0 0 .8rem;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.8;
}

.user-task-url-preview {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    background: #fff;
    border: 1px dashed var(--primary);
    border-radius: .5rem;
    direction: ltr;
    text-align: left;
}

.user-task-url-label {
    font-size: .78rem;
    color: var(--muted);
    white-space: nowrap;
}

.user-task-url-preview code {
    font-size: .82rem;
    color: var(--primary);
    font-weight: 600;
    word-break: break-all;
}

/* ─── Embed Code Box ──────────────────────────────────── */

.user-task-embed-box {
    padding: 1rem;
    background: #f5f8fc;
    border-radius: .75rem;
    border: 1px solid var(--line);
}

.user-task-embed-box p {
    margin: 0 0 .8rem;
    color: var(--muted);
    font-size: .82rem;
}

.user-task-embed-code {
    margin: 0;
    padding: .8rem;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: .5rem;
    overflow-x: auto;
    font-size: .75rem;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
}

.user-task-embed-code code {
    font-family: 'Courier New', monospace;
}

/* ─── In-Progress badge in card grid ──────────────────── */

.user-task-badge-progress {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: #fff5df;
    color: #b8750c;
    font-size: .75rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .user-task-detail-layout {
        grid-template-columns: 1fr;
    }
    .user-task-grid {
        grid-template-columns: 1fr;
    }
}
.notice {
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    line-height: 1.8;
}

.notice p {
    margin: .35rem 0 0;
}

.notice-info {
    color: #1e40af;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.notice-danger {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.field input[type="file"] {
    padding: .65rem;
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: .7rem;
}

/* ════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — SIDEBAR DRAWER + PANEL OVERHAUL
   ════════════════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: .7rem;
    cursor: pointer;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2.5px;
    border-radius: 2px;
    background: var(--text);
    transition: .25s;
}

.sidebar-close-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: .7rem;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 1.4rem;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* ── TABLE mobile card layout ── */
@media (max-width: 860px) {
    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap th,
    .table-wrap td,
    .table-wrap tr {
        display: block;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tr {
        padding: 1rem;
        margin-bottom: .75rem;
        border: 1px solid var(--line);
        border-radius: .8rem;
        background: #fff;
    }

    .table-wrap td {
        padding: .4rem 0;
        border-bottom: none;
        white-space: normal;
        text-align: start;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .5rem;
    }

    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        font-size: .75rem;
        min-width: 80px;
    }

    .table-wrap td:last-child {
        border-bottom: 0;
    }
}

/* ── MAIN RESPONSIVE ── */
@media (max-width: 860px) {
    /* Sidebar becomes hidden drawer */
    .panel-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 999;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        overflow-y: auto;
        padding-bottom: 2rem;
    }

    [dir="rtl"] .sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    .sidebar-toggle-input:checked ~ .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle-input:checked ~ .sidebar-overlay {
        display: block;
    }

    .sidebar-close-btn {
        display: grid;
    }

    .sidebar-head {
        margin-bottom: .5rem;
    }

    .sidebar .brand {
        padding: 0;
    }

    /* Restore sidebar nav to vertical in drawer */
    .side-nav {
        display: flex;
        flex-direction: column;
        overflow-x: visible;
        padding-bottom: 0;
    }

    .side-label,
    .side-link.disabled,
    .sidebar-foot {
        display: block;
    }

    .side-link {
        width: 100%;
        min-width: 0;
    }

    /* Hamburger visible */
    .hamburger-btn {
        display: flex;
    }

    /* Topbar adjustments */
    .topbar {
        min-height: 60px;
        padding: .6rem 1rem;
    }

    .topbar-date {
        font-size: .78rem;
    }

    /* Account chip: show only avatar */
    .account-chip span:last-child {
        display: none;
    }

    /* Page head stacks vertically */
    .page-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-head .button {
        width: 100%;
    }

    /* Panel content padding */
    .panel-content {
        padding: 1rem;
    }

    /* Content cards */
    .content-card {
        padding: 1rem;
        border-radius: 1rem;
    }

    .card-head {
        flex-wrap: wrap;
    }

    /* Settings/profile grids */
    .settings-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    /* Detail list */
    .detail-list > div {
        grid-template-columns: 1fr;
        gap: .3rem;
    }

    /* Notice */
    .notice {
        padding: .7rem .8rem;
        font-size: .85rem;
    }

    /* Avatar editor */
    .avatar-editor {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── SMALL PHONES ── */
@media (max-width: 480px) {
    .metric-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .metric-card {
        min-height: auto;
        padding: 1rem;
    }

    .metric-card strong {
        font-size: 1.5rem;
    }

    .metric-icon {
        width: 2.8rem;
        height: 2.8rem;
        font-size: 1.1rem;
    }

    .page-head h1 {
        font-size: 1.5rem;
    }

    .panel-content {
        padding: .8rem;
    }

    .topbar {
        padding: .5rem .8rem;
    }

    .hamburger-btn {
        width: 36px;
        height: 36px;
        padding: 7px;
    }

    .sidebar {
        width: 260px;
    }

    /* User task cards */
    .user-task-grid {
        grid-template-columns: 1fr;
    }

    .user-task-card {
        padding: 1rem;
    }

    /* Task card details */
    .task-card-details {
        grid-template-columns: 1fr;
        gap: .4rem;
    }

    /* Modals */
    .user-task-modal-content {
        min-width: auto;
        width: calc(100% - 2rem);
        padding: 1.5rem;
    }

    /* Buttons full width in forms */
    .stack-form .button {
        width: 100%;
    }

    /* Two-column grid in admin views */
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    [style*="grid-template-columns:minmax(0"] {
        grid-template-columns: 1fr !important;
    }

    /* Coin balance chips */
    .coin-chip {
        font-size: .75rem;
        padding: .35rem .6rem;
    }

    /* Activity rows */
    .activity-row {
        gap: .5rem;
    }

    .activity-icon {
        width: 2rem;
        height: 2rem;
        font-size: .85rem;
    }

    /* Support chat */
    .chat-messages {
        max-height: 50vh;
    }

    .chat-bubble {
        max-width: 90% !important;
        padding: .7rem .9rem !important;
        font-size: .85rem;
    }

    /* Game grid */
    .game-grid {
        grid-template-columns: 1fr;
    }
}

/* ── FLAT PICKER / DATETIME INPUTS ── */
@media (max-width: 860px) {
    .field input[type="date"],
    .field input[type="datetime-local"],
    .field input[type="time"] {
        font-size: .85rem;
    }
}

/* ── SAFE AREA (notch phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}

/* ── LANDSCAPE PHONE ── */
@media (max-width: 860px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }

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

/* ── REFERRAL SYSTEM ── */
.referral-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.referral-stat-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.referral-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.referral-stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.referral-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    line-height: 1.2;
}

.referral-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
    margin-top: 0.25rem;
}

.referral-stat-success .referral-stat-value { color: var(--success, #10b981); }
.referral-stat-warning .referral-stat-value { color: var(--warning, #f59e0b); }
.referral-stat-danger .referral-stat-value { color: var(--danger, #ef4444); }
.referral-stat-coins .referral-stat-value { color: var(--accent, #6366f1); }

.referral-code-box {
    text-align: center;
    padding: 1.5rem;
}

.referral-code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--accent, #6366f1);
    background: var(--bg-muted, #f3f4f6);
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg, 12px);
    font-family: monospace, sans-serif;
    direction: ltr;
}

.referral-link-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 500px;
    margin-inline: auto;
}

.referral-link-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border, #d1d5db);
    border-radius: var(--radius, 8px);
    font-size: 0.85rem;
    font-family: monospace, sans-serif;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #111827);
}

.referral-hint {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
}

/* ── REFERRAL TERMS ── */
.referral-terms-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-muted, #fafafa);
    scroll-behavior: smooth;
}

.referral-terms-content::-webkit-scrollbar {
    width: 6px;
}

.referral-terms-content::-webkit-scrollbar-track {
    background: var(--border, #e5e7eb);
    border-radius: 3px;
}

.referral-terms-content::-webkit-scrollbar-thumb {
    background: var(--text-secondary, #9ca3af);
    border-radius: 3px;
}

.terms-section {
    margin-bottom: 1.5rem;
}

.terms-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #111827);
}

.terms-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary, #4b5563);
}

.terms-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius, 8px);
    padding: 1rem;
}

.terms-warning h3 {
    color: #92400e;
}

.terms-warning p {
    color: #78350f;
}

/* ── MOBILE REFERRAL ── */
@media (max-width: 860px) {
    .referral-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .referral-code {
        font-size: 1.5rem;
        padding: 0.5rem 1.5rem;
    }

    .referral-link-box {
        flex-direction: column;
    }
}

/* ── AUTH RULES LINK ── */
.auth-rules-link {
    margin-bottom: 0.5rem;
}

.auth-rules-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent, #6366f1);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--accent, #6366f1);
    border-radius: var(--radius, 8px);
    transition: all 0.2s;
}

.auth-rules-link a:hover {
    background: var(--accent, #6366f1);
    color: #fff;
}

/* ── REFERRAL INVITE ON REGISTER ── */
.referral-invite-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg, 12px);
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}

.referral-invite-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.referral-invite-banner p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #3730a3;
}

.referral-rules-box {
    background: var(--bg-muted, #f9fafb);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 1rem;
    margin-bottom: 1rem;
}

.referral-rules-box h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.referral-rules-scroll {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 8px);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
}

.referral-rules-scroll::-webkit-scrollbar {
    width: 5px;
}

.referral-rules-scroll::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 3px;
}

.referral-rules-scroll p {
    margin: 0.4rem 0;
}

.referral-rules-scroll strong {
    color: var(--text-primary, #111827);
}

.terms-warning-inline {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius, 8px);
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

.terms-warning-inline p {
    color: #78350f;
    margin: 0.2rem 0;
}

/* ── TERMS PAGE ── */
.terms-page-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    background: var(--bg-muted, #fafafa);
}

.terms-page-content::-webkit-scrollbar {
    width: 6px;
}

.terms-page-content::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 3px;
}

.terms-page-content .terms-section {
    margin-bottom: 1.25rem;
}

.terms-page-content .terms-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary, #111827);
}

.terms-page-content .terms-section p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary, #4b5563);
}

/* ── REFERRAL ACCEPTANCE BOX ── */
.referral-acceptance-box {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg, 12px);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.referral-acceptance-box p {
    font-size: 0.9rem;
    color: #92400e;
    margin-bottom: 0.75rem;
}

/* ── PERMANENT REFERRAL RULES ── */
.referral-rules-permanent .terms-section {
    margin-bottom: 1rem;
}

.referral-rules-permanent .terms-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary, #111827);
}

.referral-rules-permanent .terms-section p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary, #4b5563);
}

.referral-rules-permanent .terms-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius, 8px);
    padding: 0.75rem;
}

.referral-rules-permanent .terms-warning h3 {
    color: #92400e;
}

.referral-rules-permanent .terms-warning p {
    color: #78350f;
}
