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

:root {
    --bg: #060810;
    --bg2: #0c0f1a;
    --bg3: #111520;
    --bg4: #1a1f2e;
    --border: #ffffff0f;
    --border2: #ffffff18;
    --border3: #ffffff28;
    --text: #e8eaf0;
    --text2: #8892a4;
    --text3: #5a6375;
    --gold: #f0b429;
    --gold2: #ffd166;
    --gold3: #c88a00;
    --green: #00d084;
    --green2: #00ff9d;
    --red: #ff4757;
    --red2: #ff6b7a;
    --blue: #4a9eff;
    --blue2: #7bb8ff;
    --purple: #8b5cf6;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font-head: -apple-system, 'Segoe UI', Arial, sans-serif;
    --font-mono: 'Courier New', Courier, monospace;
    --font-body: -apple-system, 'Segoe UI', Arial, sans-serif;
    --nav-bg: rgba(6, 8, 16, 0.92);
    --auth-overlay: linear-gradient(135deg, rgba(6, 8, 16, 0.92) 0%, rgba(6, 8, 16, 0.80) 50%, rgba(12, 15, 26, 0.93) 100%);
    --auth-card-bg: rgba(12, 15, 26, 0.88);
    --hero-bg1: #060810;
    --hero-bg2: #0c0f1a;
}

body.light {
    --bg: #f0f2f8;
    --bg2: #ffffff;
    --bg3: #f4f6fc;
    --bg4: #e8ecf5;
    --border: #1a1f2e18;
    --border2: #1a1f2e22;
    --border3: #1a1f2e38;
    --text: #0d1117;
    --text2: #3d4a5c;
    --text3: #8896aa;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --auth-overlay: linear-gradient(135deg, rgba(224, 229, 245, 0.88) 0%, rgba(210, 218, 240, 0.80) 50%, rgba(224, 229, 245, 0.92) 100%);
    --auth-card-bg: rgba(255, 255, 255, 0.92);
    --hero-bg1: #eef1fa;
    --hero-bg2: #e4e9f5;
}

.theme-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute
}

.theme-track {
    position: absolute;
    inset: 0;
    background: #2a2f3e;
    border-radius: 100px;
    transition: background 0.3s
}

body.light .theme-track {
    background: #d1d5e0
}

.theme-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3)
}

body.light .theme-thumb {
    transform: translateX(18px);
    background: #fff
}

.theme-toggle input:checked~.theme-track {
    background: #f0b429
}

.theme-toggle input:checked~.theme-thumb {
    transform: translateX(18px)
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    transition: background 0.3s, border-color 0.3s
}

.nav-logo {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px
}

.nav-logo span {
    color: var(--text)
}

.nav-links {
    display: flex;
    gap: 4px;
    margin-left: 24px
}

.nav-link {
    background: none;
    border: none;
    color: var(--text2);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg4);
    color: var(--text)
}

.nav-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center
}

.btn {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border2);
    color: var(--text2);
    padding: 7px 14px;
    font-size: 13px
}

.btn-ghost:hover {
    border-color: var(--border3);
    color: var(--text);
    background: var(--bg4)
}

.btn-gold {
    background: var(--gold);
    color: #000;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700
}

.btn-gold:hover {
    background: var(--gold2);
    transform: translateY(-1px)
}

.btn-green {
    background: var(--green);
    color: #000;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border3);
    color: var(--text);
    padding: 9px 20px;
    font-size: 14px
}

.btn-outline:hover {
    background: var(--bg4)
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 10px
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono)
}

.badge-bronze {
    background: #7c4a1e22;
    color: #a85c20;
    border: 1px solid #cd7c3a55
}

body.light .badge-bronze {
    background: #f5e6d8;
    color: #8b4513;
    border-color: #cd7c3a
}

.badge-silver {
    background: #94a3b822;
    color: #607080;
    border: 1px solid #94a3b855
}

body.light .badge-silver {
    background: #e8edf5;
    color: #445566;
    border-color: #8899aa
}

.badge-gold {
    background: #f0b42922;
    color: #c88a00;
    border: 1px solid #f0b42955
}

body.light .badge-gold {
    background: #fdf3d7;
    color: #8a6000;
    border-color: #d4a000
}

.badge-platinum {
    background: #e2e8f022;
    color: #94a3b8;
    border: 1px solid #e2e8f055
}

body.light .badge-platinum {
    background: #edf0f7;
    color: #445577;
    border-color: #8899bb
}

.badge-diamond {
    background: #7bb8ff22;
    color: #4a9eff;
    border: 1px solid #7bb8ff55
}

body.light .badge-diamond {
    background: #dceeff;
    color: #1a6fd4;
    border-color: #4a9eff
}

.badge-live {
    background: #00d08422;
    color: #00a066;
    border: 1px solid #00d08455;
    animation: pulse-badge 2s infinite
}

body.light .badge-live {
    background: #d4f5e9;
    color: #006644;
    border-color: #00b070
}

.badge-pending {
    background: #f0b42922;
    color: #c88a00;
    border: 1px solid #f0b42955
}

body.light .badge-pending {
    background: #fdf3d7;
    color: #8a6000;
    border-color: #d4a000
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.6
    }
}

.page {
    padding-top: 60px;
    min-height: 100vh
}

.hero {
    min-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 80px 24px 60px;
    overflow: hidden;
    background: var(--bg)
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.7
}

.hero-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(240, 180, 41, 0.12) 0%, transparent 70%);
    pointer-events: none
}

/* ==================== Hero sword-fight background animation ==================== */
.hero-swordfight {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.24;
}

body.light .hero-swordfight {
    opacity: 0.16;
}

.hero-swordfight svg {
    width: 100%;
    height: 100%;
    max-width: 1000px;
}

/* Each sword's outer <g> carries a STATIC svg transform attribute (position
   + base rotation) which CSS must never touch. The inner <g class="lp-sword-anim-*">
   is what gets animated — its local coordinate origin (0,0) already sits at
   the hilt, so transform-origin: 0 0 makes it pivot exactly like a real
   clash/parry motion. */
.lp-sword-anim-left {
    transform-origin: 0 0;
    animation: lpJoltLeft 3.2s ease-in-out infinite;
}

.lp-sword-anim-right {
    transform-origin: 0 0;
    animation: lpJoltRight 3.2s ease-in-out infinite;
}

@keyframes lpJoltLeft {
    0%, 42% { transform: rotate(0deg) scale(1); }
    48% { transform: rotate(3.5deg) scale(1.025); }
    53% { transform: rotate(-2deg) scale(0.99); }
    60%, 100% { transform: rotate(0deg) scale(1); }
}

@keyframes lpJoltRight {
    0%, 42% { transform: rotate(0deg) scale(1); }
    48% { transform: rotate(-3.5deg) scale(1.025); }
    53% { transform: rotate(2deg) scale(0.99); }
    60%, 100% { transform: rotate(0deg) scale(1); }
}

.lp-glint {
    animation: lpGlintSweep 2.6s ease-in-out infinite;
}

.lp-sword-anim-right .lp-glint {
    animation-delay: 1.1s;
}

@keyframes lpGlintSweep {
    0% { transform: translateX(-20px); opacity: 0; }
    12% { opacity: 0.9; }
    28% { opacity: 0; }
    100% { transform: translateX(340px); opacity: 0; }
}

.lp-clash-ring {
    transform-origin: center;
    animation: lpClashRing 3.2s ease-in-out infinite;
}

@keyframes lpClashRing {
    0%, 44% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1); }
    62% { opacity: 0; transform: scale(1.7); }
    100% { opacity: 0; transform: scale(0.3); }
}

.lp-clash-spike {
    transform-origin: center;
    animation: lpClashSpike 3.2s ease-in-out infinite;
}

@keyframes lpClashSpike {
    0%, 44% { opacity: 0; transform: scale(0.2); }
    49% { opacity: 1; transform: scale(1); }
    58% { opacity: 0; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(0.2); }
}

.lp-clash-particle {
    animation: lpClashParticle 3.2s ease-in-out infinite;
}

@keyframes lpClashParticle {
    0%, 46% { opacity: 0; transform: translate(0, 0) scale(1); }
    52% { opacity: 1; }
    72% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.3); }
    100% { opacity: 0; transform: translate(var(--px), var(--py)) scale(0.3); }
}

@media (max-width: 640px) {
    .hero-swordfight { display: none; }
}

.hero h1 {
    font-family: var(--font-head);
    font-size: clamp(42px, 7vw, 88px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    position: relative
}

.hero h1 em {
    font-style: normal;
    color: var(--gold)
}

.hero-sub {
    font-size: 18px;
    color: var(--text2);
    max-width: 520px;
    line-height: 1.7;
    margin: 20px auto 40px;
    position: relative
}

.hero-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin: 72px auto 0;
    width: 100%;
    max-width: 560px;
    position: relative
}

.hero-stat {
    background: var(--bg2);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center
}

.hero-stat-val {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    color: var(--gold);
    text-align: center;
    width: 100%
}

.hero-stat-label {
    font-size: 12px;
    color: var(--text3);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    width: 100%
}

.section {
    padding: 80px 24px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px
}

.section-title {
    font-family: var(--font-head);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 16px
}

.section-sub {
    color: var(--text2);
    font-size: 16px;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto
}

.how-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 48px
}

.how-step {
    background: var(--bg2);
    padding: 32px 24px;
    text-align: center
}

.step-num {
    font-family: var(--font-mono);
    font-size: 40px;
    font-weight: 700;
    color: var(--border3);
    margin-bottom: 16px;
    line-height: 1
}

.step-title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px
}

.step-desc {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.7
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 48px
}

.prize-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center
}

.prize-card.featured {
    border-color: var(--gold3);
    background: linear-gradient(135deg, var(--bg2) 0%, rgba(240, 180, 41, 0.06) 100%)
}

.prize-amount {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 4px
}

.prize-label {
    font-size: 12px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px
}

.prize-fee {
    font-size: 13px;
    color: var(--text2)
}

.ranks-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 48px;
    justify-content: center
}

.rank-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    flex: 1;
    min-width: 140px;
    max-width: 200px
}

.rank-icon {
    font-size: 24px
}

.rank-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 15px
}

.rank-req {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px
}

.faq-list {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-align: left
}

.faq-item {
    background: var(--bg2);
    padding: 20px 24px;
    cursor: pointer
}

.faq-q {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.faq-a {
    font-size: 13px;
    color: var(--text2);
    margin-top: 10px;
    line-height: 1.7;
    display: none
}

.faq-item.open .faq-a {
    display: block
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg)
}

.faq-arrow {
    transition: transform 0.2s;
    color: var(--text3);
    font-size: 18px
}

.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    position: relative;
    overflow: hidden
}

.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none
}

.auth-bg-overlay {
    position: absolute;
    inset: 0;
    background: var(--auth-overlay);
    z-index: 1
}

.auth-card {
    background: var(--auth-card-bg);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(12px);
    transition: background 0.3s, border-color 0.3s
}

.auth-title {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px
}

.auth-sub {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 32px
}

.form-group {
    margin-bottom: 16px
}

.form-label {
    font-size: 12px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
    font-family: var(--font-mono)
}

.form-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 8px;
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    outline: none;
    transition: border 0.15s
}

.form-input:focus {
    border-color: var(--gold3)
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text2)
}

.auth-switch a {
    color: var(--gold);
    cursor: pointer;
    font-weight: 600
}

.dash-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px)
}

.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    padding: 24px 0
}

.sidebar-section {
    margin-bottom: 8px
}

.sidebar-label {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 16px;
    margin-bottom: 6px;
    font-family: var(--font-mono)
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 13px;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
    margin: 0 8px;
    border-radius: 6px
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--bg4);
    color: var(--text)
}

.sidebar-link.active {
    color: var(--gold)
}

.sidebar-icon {
    font-size: 15px;
    width: 18px;
    text-align: center
}

.dash-content {
    padding: 28px;
    overflow-y: auto
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px
}

.dash-title {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px
}

.dash-sub {
    font-size: 13px;
    color: var(--text2)
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px
}

.kpi {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px
}

.kpi-label {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
    margin-bottom: 8px
}

.kpi-val {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 800
}

.kpi-val.gold {
    color: var(--gold)
}

.kpi-val.green {
    color: var(--green)
}

.kpi-val.red {
    color: var(--red)
}

.kpi-delta {
    font-size: 11px;
    margin-top: 4px
}

.kpi-delta.up {
    color: var(--green)
}

.card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px
}

/* ===== Wide Recent Transactions card (dashboard) ===== */
.card-tx-wide {
    padding: 24px;
}
.card-tx-wide .card-title {
    font-size: 14px;
    margin-bottom: 18px;
}
.tx-row--wide {
    padding: 16px 4px;
}
.tx-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: var(--bg4);
}
.tx-icon--prize { background: #f0b42922; }
.tx-icon--dep { background: #00d08422; }
.tx-icon--wd { background: #ff475722; }

/* ===== Pagination (admin tables) ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border2);
    background: var(--bg3);
    color: var(--text2);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s ease;
}
.page-btn:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}
.page-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1300;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-dots {
    color: var(--text3);
    padding: 0 2px;
    font-size: 13px;
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px
}

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

.table th {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
    padding: 0 0 10px;
    text-align: left;
    border-bottom: 1px solid var(--border)
}

.table td {
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text2)
}

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

.profit-bar-wrap {
    background: var(--bg4);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-top: 4px
}

.profit-bar {
    height: 100%;
    background: var(--green);
    border-radius: 4px
}

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

.challenge-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: border 0.15s
}

.challenge-card:hover {
    border-color: var(--border3)
}

.cc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px
}

.cc-user {
    display: flex;
    align-items: center;
    gap: 10px
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-head);
    flex-shrink: 0
}

.cc-name {
    font-weight: 600;
    font-size: 14px
}

.cc-stats {
    font-size: 11px;
    color: var(--text2);
    margin-top: 2px
}

.cc-fee-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px
}

.cc-fee-cell {
    background: var(--bg4);
    padding: 12px
}

.cc-fee-label {
    font-size: 10px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono);
    margin-bottom: 4px
}

.cc-fee-val {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--gold)
}

.create-wrap {
    max-width: 600px
}

.prize-preview {
    background: var(--bg3);
    border: 1px solid var(--gold3);
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px
}

.prize-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px
}

.prize-row:last-child {
    border-bottom: none
}

.prize-row.total {
    font-weight: 700;
    font-size: 16px;
    color: var(--gold);
    padding-top: 16px;
    margin-top: 8px
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 12px
}

.range-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    min-width: 80px
}

input[type=range] {
    flex: 1;
    accent-color: var(--gold)
}

.vs-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 24px
}

.trader-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center
}

.trader-card.winning {
    border-color: var(--green)
}

.trader-card.losing {
    border-color: var(--red)
}

.vs-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 20px
}

.vs-text {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    color: var(--text3)
}

.equity-val {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 8px 0 4px
}

.equity-pct {
    font-size: 14px;
    font-weight: 600
}

.timer-box {
    background: var(--bg4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text2);
    text-align: center
}

.timer-val {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold);
    display: block;
    margin-top: 2px
}

.progress-wrap {
    background: var(--bg4);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
    margin: 16px 0
}

.progress-bar {
    height: 100%;
    border-radius: 100px
}

.wallet-split {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 16px
}

.tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

.tx-row:last-child {
    border-bottom: none
}

.tx-type {
    font-size: 13px;
    font-weight: 500
}

.tx-amount {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700
}

.tx-amount.dep {
    color: var(--green)
}

.tx-amount.wd {
    color: var(--red)
}

.tx-amount.prize {
    color: var(--gold)
}

.tx-date {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
    font-family: var(--font-mono)
}

.lb-podium {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px
}

.lb-podium-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s
}

.lb-podium-card:hover {
    transform: translateY(-3px)
}

.lb-podium-card.p1 {
    border-color: var(--gold3);
    background: linear-gradient(160deg, rgba(240, 180, 41, 0.08), var(--bg3) 60%)
}

.lb-podium-card.p2 {
    border-color: #94a3b844
}

.lb-podium-card.p3 {
    border-color: #cd7c3a44
}

.lb-podium-medal {
    font-size: 36px;
    margin-bottom: 10px;
    display: block
}

.lb-podium-name {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px
}

.lb-podium-earn {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    margin: 8px 0 4px
}

.lb-podium-wr {
    font-size: 12px;
    color: var(--text2)
}

.lb-podium-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px
}

.lb-podium-stat span {
    display: block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px
}

.lb-table-wrap {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    width: 100%
}

.lb-table-head {
    display: grid;
    grid-template-columns: 48px minmax(140px, 1fr) 80px 80px 100px 110px 100px;
    gap: 0;
    padding: 12px 20px;
    background: var(--bg4);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-mono)
}

.lb-table-row {
    display: grid;
    grid-template-columns: 48px minmax(140px, 1fr) 80px 80px 100px 110px 100px;
    gap: 0;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background 0.1s
}

.lb-table-row:last-child {
    border-bottom: none
}

.lb-table-row:hover {
    background: var(--bg4)
}

.lb-table-row.gold-row {
    background: linear-gradient(90deg, rgba(240, 180, 41, 0.07), transparent)
}

.lb-table-row.silver-row {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.05), transparent)
}

.lb-table-row.bronze-row {
    background: linear-gradient(90deg, rgba(205, 124, 58, 0.05), transparent)
}

.lb-num {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--text3)
}

.lb-user {
    display: flex;
    align-items: center;
    gap: 10px
}

.lb-username {
    font-weight: 600;
    font-size: 14px;
    color: var(--text)
}

.lb-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px
}

.lb-cell {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text2)
}

.lb-wr-bar {
    height: 4px;
    background: var(--bg4);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden
}

.lb-wr-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--green)
}

.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap
}

.admin-tab {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text2);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px
}

.admin-tab.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold)
}

/* ===== Admin notification toggle switches (Alerts tab) ===== */
.notify-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-block
}

.notify-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute
}

.notify-track {
    position: absolute;
    inset: 0;
    background: #2a2f3e;
    border-radius: 100px;
    transition: background 0.3s
}

body.light .notify-track {
    background: #d1d5e0
}

.notify-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3)
}

.notify-toggle input:checked~.notify-track {
    background: var(--green)
}

.notify-toggle input:checked~.notify-thumb {
    transform: translateX(18px)
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px
}

.stat-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px
}

.stat-card-val {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px
}

.stat-card-label {
    font-size: 12px;
    color: var(--text2)
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0
}

.text-gold {
    color: var(--gold)
}

.text-green {
    color: var(--green)
}

.text-red {
    color: var(--red)
}

.text-mono {
    font-family: var(--font-mono)
}

.mt-8 {
    margin-top: 8px
}

.mt-12 {
    margin-top: 12px
}

.mt-16 {
    margin-top: 16px
}

.mt-24 {
    margin-top: 24px
}

.mb-16 {
    margin-bottom: 16px
}

.flex {
    display: flex
}

.items-center {
    align-items: center
}

.gap-8 {
    gap: 8px
}

.gap-12 {
    gap: 12px
}

.justify-between {
    justify-content: space-between
}

.full-width {
    width: 100%
}

.cta-section {
    background: linear-gradient(135deg, var(--bg2), var(--bg3));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    margin: 40px 0
}

.footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text3);
    font-size: 13px;
    background: var(--bg2)
}

select.form-input {
    cursor: pointer
}

body.light .sidebar {
    background: var(--bg2);
    border-color: var(--border)
}

body.light .card {
    background: var(--bg2)
}

body.light .kpi {
    background: var(--bg3)
}

body.light .how-step {
    background: var(--bg2)
}

body.light .prize-card {
    background: var(--bg2)
}

body.light .faq-item {
    background: var(--bg2)
}

body.light .challenge-card {
    background: var(--bg2)
}

body.light .lb-podium-card {
    background: var(--bg2)
}

body.light .lb-table-wrap {
    background: var(--bg2)
}

body.light .lb-table-head {
    background: var(--bg3)
}

body.light .lb-table-row:hover {
    background: var(--bg3)
}

body.light .stat-card {
    background: var(--bg2)
}

body.light .admin-tab {
    background: var(--bg2);
    color: var(--text2)
}

body.light .trader-card {
    background: var(--bg2)
}

body.light .timer-box {
    background: var(--bg3)
}

body.light .cc-fee-cell {
    background: var(--bg3)
}

body.light .prize-preview {
    background: var(--bg3)
}

body.light .btn-ghost {
    color: var(--text2);
    border-color: var(--border3)
}

body.light .btn-ghost:hover {
    background: var(--bg4);
    color: var(--text)
}

body.light .btn-outline {
    color: var(--text);
    border-color: var(--border3)
}

body.light .btn-outline:hover {
    background: var(--bg4)
}

body.light .form-input {
    background: var(--bg3);
    color: var(--text);
    border-color: var(--border2)
}

body.light .step-num {
    color: var(--border3)
}

body.light .hero-glow {
    background: radial-gradient(ellipse, rgba(240, 180, 41, 0.18) 0%, transparent 70%)
}

body.light .cta-section {
    background: linear-gradient(135deg, var(--bg2), var(--bg3))
}

body.light .how-steps {
    background: var(--border);
    border-color: var(--border)
}

body.light .hero-stats {
    background: var(--border)
}

body.light .auth-card {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12)
}

/* ==================== Mobile sidebar drawer (hidden on desktop) ==================== */
.mobile-menu-btn {
    display: none;
}
.mobile-sidebar-overlay {
    display: none;
}
.sidebar-mobile-close {
    display: none;
}

@media(max-width:768px) {
    .dash-layout {
        grid-template-columns: 1fr;
        position: relative;
    }

    /* Sidebar becomes an off-canvas drawer, opened via the hamburger button */
    .sidebar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 78%;
        max-width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .sidebar-mobile-close {
        display: flex;
        justify-content: flex-end;
        padding: 10px 16px 0;
        font-size: 16px;
        color: var(--text2);
        cursor: pointer;
    }
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 50;
        margin: 12px 16px 0;
        background: var(--bg3);
        border: 1px solid var(--border2);
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
        padding: 8px 14px;
        border-radius: 8px;
        cursor: pointer;
        /* Prevent the grid item from stretching to the full column width,
           which made the button look oversized on Support / Open Challenges /
           Active Competition pages compared to others. */
        justify-self: start;
        align-self: start;
        width: max-content;
        max-width: calc(100% - 32px);
    }
    .mobile-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 150;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease;
    }
    .mobile-sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    /* General spacing & layout fixes for small screens */
    .dash-content {
        padding: 16px 14px 40px;
        overflow-x: hidden;
    }
    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 20px;
    }
    .dash-title {
        font-size: 19px;
    }
    .dash-header > button,
    .dash-header > .btn {
        align-self: stretch;
    }

    nav {
        padding: 0 12px;
        gap: 8px;
    }
    .nav-logo {
        font-size: 15px;
    }
    .nav-links {
        margin-left: 8px;
        gap: 2px;
        overflow-x: auto;
        max-width: 38vw;
    }
    .nav-link {
        font-size: 11px;
        padding: 5px 8px;
        white-space: nowrap;
    }
    .nav-right {
        gap: 6px;
    }
    .nav-right > div {
        display: none;
    }
    .nav-right .btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .card, .pc-card, .kpi {
        padding: 14px;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .two-col {
        grid-template-columns: 1fr
    }

    .vs-layout {
        grid-template-columns: 1fr
    }

    .lb-row {
        grid-template-columns: 30px 1fr 60px 60px 80px;
        font-size: 12px;
        padding: 10px 8px;
    }

    .create-wrap {
        max-width: 100%;
    }
    .prize-preview {
        padding: 16px;
    }
    .range-wrap {
        flex-wrap: wrap;
    }
    .range-val {
        min-width: 60px;
    }

    /* Hero / landing page */
    .hero h1 {
        font-size: 30px;
        line-height: 1.2;
    }
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .how-steps {
        grid-template-columns: 1fr;
    }

    /* Modals (profile modal, blocked-users modal, MT5 assignment modal, etc.) */
    .mt5-modal > div,
    .profile-modal-card {
        max-width: 94vw !important;
        width: 94vw !important;
        padding: 18px !important;
        max-height: 88vh;
        overflow-y: auto;
    }

    /* Challenge card meta row — wrap instead of overflowing */
    .cc-fee-row {
        flex-wrap: wrap;
    }
}

@media(max-width:480px) {
    .dash-title { font-size: 17px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .hero h1 { font-size: 25px; }
    .hero-stats { grid-template-columns: 1fr; }
    .nav-links { max-width: 28vw; }
}
/* ============================================================
   Admin Pending Challenges — participant cards (Send Account flow)
   ============================================================ */
.pc-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
}
.pc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.pc-card-id {
    font-family: var(--font-mono);
    color: var(--text3);
    font-size: 12px;
}
.pc-card-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text2);
}
.pc-card-meta strong {
    color: var(--gold);
    font-family: var(--font-mono);
}
.pc-participants {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 720px) {
    .pc-participants { grid-template-columns: 1fr; }
}
.pc-participant {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 14px;
}
.pc-participant-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}
.pc-participant-sub {
    font-size: 12px;
    color: var(--text3);
    margin-bottom: 10px;
}
.pc-flag-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.pc-flag {
    flex: 1;
    text-align: center;
    font-size: 11px;
    padding: 6px 4px;
    border-radius: 8px;
    border: 1px solid var(--border2);
    color: var(--text3);
}
.pc-flag.is-set {
    color: var(--green);
    border-color: #00d08455;
    background: #00d08412;
}
.pc-actions {
    display: flex;
    gap: 8px;
}
.pc-card-footer {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* ===== Generic modal overlay (Send Account, ticket compose, etc.) ===== */
.ta-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}
.ta-modal-box {
    background: var(--bg2);
    border: 1px solid var(--border3);
    border-radius: 16px;
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.ta-modal-title {
    color: var(--gold);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}
.ta-modal-sub {
    color: var(--text2);
    font-size: 13px;
    margin-bottom: 18px;
}
.ta-modal-section {
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.ta-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.ta-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ============================================================
   Support Tickets
   ============================================================ */
.tk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.tk-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tk-row {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    flex-wrap: wrap;
}
.tk-row:hover {
    border-color: var(--border3);
}
.tk-row-main {
    min-width: 0;
    flex: 1;
}
.tk-row-subject {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}
.tk-row-preview {
    font-size: 12px;
    color: var(--text3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 520px;
}
.tk-row-side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.tk-row-date {
    font-size: 11px;
    color: var(--text3);
    font-family: var(--font-mono);
}
.tk-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tk-status-open {
    background: #f0b42922;
    color: #c88a00;
    border: 1px solid #f0b42955;
}
.tk-status-answered {
    background: #4a9eff22;
    color: #4a9eff;
    border: 1px solid #4a9eff55;
}
.tk-status-closed {
    background: #94a3b822;
    color: #607080;
    border: 1px solid #94a3b855;
}
.tk-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 4px 16px;
    max-height: 480px;
    overflow-y: auto;
}
.tk-msg {
    max-width: 75%;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
}
.tk-msg-user {
    align-self: flex-end;
    background: var(--gold);
    color: #1a1300;
    border-bottom-right-radius: 4px;
}
.tk-msg-admin {
    align-self: flex-start;
    background: var(--bg4);
    color: var(--text);
    border: 1px solid var(--border2);
    border-bottom-left-radius: 4px;
}
.tk-msg-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.65;
    margin-bottom: 4px;
}
.tk-msg-time {
    font-size: 10px;
    opacity: 0.55;
    margin-top: 6px;
}
.tk-reply-box {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.tk-reply-box textarea {
    flex: 1;
    resize: vertical;
    min-height: 56px;
}
.tk-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text2);
}

/* ==================== Colorful sidebar icon chips ====================
   Every sidebar item gets the same rounded, colorful "sticker" treatment
   (previously only Wallet/Support looked distinct). Color is set per
   item via a modifier class so the whole sidebar feels unified. */
.sidebar-icon-chip {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    line-height: 1;
}
.chip-blue   { background: rgba(74,158,255,0.16); }
.chip-gold   { background: rgba(240,180,41,0.16); }
.chip-green  { background: rgba(0,208,132,0.16); }
.chip-red    { background: rgba(255,71,87,0.16); }
.chip-purple { background: rgba(139,92,246,0.16); }
.chip-pink   { background: rgba(255,121,198,0.16); }
.chip-teal   { background: rgba(45,212,191,0.16); }
.chip-orange { background: rgba(255,159,67,0.16); }

.sidebar-link {
    gap: 12px;
}

/* ==================== Chat Room ==================== */
.chatroom-wrap {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 16px;
    height: calc(100vh - 200px);
    min-height: 480px;
}
.chatroom-main {
    display: flex;
    flex-direction: column;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.chatroom-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.chat-msg-row.is-me {
    flex-direction: row-reverse;
}
.chat-msg-bubble {
    max-width: 68%;
    background: var(--bg4);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 8px 12px;
}
.chat-msg-row.is-me .chat-msg-bubble {
    background: rgba(240,180,41,0.12);
    border-color: rgba(240,180,41,0.35);
}
.chat-msg-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chat-msg-author:hover { text-decoration: underline; }
/* Blue "verified admin" badge — shown next to the real admin's name in the
   public chat room and private messages so traders can trust who they're
   talking to. Generic checkmark-in-a-circle pattern (not any specific
   platform's trademarked icon). */
.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--blue);
    flex-shrink: 0;
}
.verified-badge svg { width: 9px; height: 9px; display: block; }

.chat-msg-text {
    font-size: 13.5px;
    margin-top: 3px;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg-time {
    font-size: 10px;
    color: var(--text3);
    margin-top: 4px;
}
.chatroom-input-row {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
}
.chatroom-input-row textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 100px;
}
.chatroom-online {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    overflow-y: auto;
}
.chatroom-online-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text3);
    font-family: var(--font-mono);
    margin-bottom: 10px;
}
.online-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.online-user-row:hover { background: var(--bg4); }
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--green);
}
.online-user-name {
    font-size: 13px;
    font-weight: 600;
}

/* ==================== Public profile modal ==================== */
.profile-modal-card {
    background: var(--bg2);
    padding: 28px;
    border-radius: 16px;
    max-width: 380px;
    width: 100%;
    border: 1px solid var(--border3);
    text-align: center;
}
.profile-modal-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 18px 0;
}
.profile-modal-stat {
    background: var(--bg3);
    border-radius: 10px;
    padding: 10px 6px;
}
.profile-modal-stat-val { font-weight: 700; font-size: 15px; }
.profile-modal-stat-label { font-size: 10px; color: var(--text3); text-transform: uppercase; margin-top: 2px; }

/* ==================== Private Messages ==================== */
.pm-wrap {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    height: calc(100vh - 200px);
    min-height: 480px;
}
.pm-list {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow-y: auto;
}
.pm-conv-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.pm-conv-row:hover, .pm-conv-row.active { background: var(--bg4); }
.pm-conv-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.pm-conv-preview {
    font-size: 12px;
    color: var(--text3);
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pm-unread-badge {
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    margin-left: auto;
}
.pm-thread {
    display: flex;
    flex-direction: column;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.pm-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}
.pm-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pm-challenge-card {
    background: linear-gradient(135deg, rgba(240,180,41,0.14), rgba(139,92,246,0.10));
    border: 1px solid rgba(240,180,41,0.35);
    border-radius: 12px;
    padding: 14px;
    max-width: 78%;
}
.pm-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text3);
    text-align: center;
    padding: 30px;
}
.sidebar-badge-dot {
    background: var(--red);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: auto;
}

.sidebar-badge-new {
    background: var(--gold);
    color: #000;
    font-size: 9px;
    font-weight: 800;
    border-radius: 8px;
    padding: 1px 6px;
    margin-left: auto;
    letter-spacing: 0.5px;
    animation: pulseBadge 1.6s ease-in-out infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (max-width: 860px) {
    .chatroom-wrap { grid-template-columns: 1fr; height: auto; }
    .chatroom-online { max-height: 220px; }
    .pm-wrap { grid-template-columns: 1fr; height: auto; }
    .pm-list { max-height: 260px; }
}

/* ==================== Avatar picker (Profile page) ==================== */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}
.avatar-tile {
    position: relative;
    background: var(--bg3);
    border: 2px solid var(--border2);
    border-radius: 12px;
    padding: 10px 6px 8px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.avatar-tile:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}
.avatar-tile.selected {
    border-color: var(--green);
    background: rgba(0,208,132,0.07);
}
.avatar-tile-img {
    width: 56px;
    height: 56px;
    margin: 0 auto 6px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
}
.avatar-tile-label {
    font-size: 10.5px;
    color: var(--text2);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar-tile-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(240,180,41,0.18);
    color: var(--gold);
    border-radius: 6px;
    padding: 1px 5px;
}
.avatar-tile-check {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media(max-width:768px) {
    .avatar-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}
@media(max-width:480px) {
    .avatar-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Compact avatar grid when placed inside the narrower profile sidebar card */
.avatar-grid-compact {
    grid-template-columns: repeat(3, 1fr);
}
@media(max-width:480px) {
    .avatar-grid-compact { grid-template-columns: repeat(2, 1fr); }
}

.avatar-tile.locked {
    opacity: 0.55;
}
.avatar-tile.locked:hover {
    opacity: 0.8;
}

/* ==================== Shared emoji/sticker picker ====================
   Rendered as a fixed-position panel attached directly to <body>, so it
   is never clipped by a parent card's overflow:hidden and never visually
   "escapes" its box. */
.emoji-picker-floating {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    background: var(--bg2);
    border: 1px solid var(--border3);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    z-index: 99999;
    width: 260px;
}
.emoji-picker-item {
    font-size: 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    padding: 3px;
    line-height: 1.2;
}
.emoji-picker-item:hover {
    background: var(--bg4);
}
@media(max-width:480px) {
    .emoji-picker-floating { width: 220px; grid-template-columns: repeat(6, 1fr); }
}

/* ==================== Create Challenge — open challenges + polish ==================== */
.form-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}
.create-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 600px) minmax(260px, 320px);
    gap: 20px;
    align-items: start;
}
.open-challenges-sidebar {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    position: sticky;
    top: 16px;
}
.open-challenge-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.open-challenge-card {
    background: var(--bg4);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 14px;
}
@media(max-width:1100px) {
    .create-page-layout {
        grid-template-columns: 1fr;
    }
    .open-challenges-sidebar {
        position: static;
    }
}
@media(max-width:768px) {
    .open-challenge-stack { gap: 10px; }
}

/* ============================================================
   Mobile UX overhaul — Part 2
   Chat room, private messages, leaderboard, wallet, and forms
   all used fixed pixel widths / multi-column grids that never
   adapted below tablet width. This section tunes them properly
   for phone-sized screens instead of just falling back to
   horizontal scrolling or squished columns.
   ============================================================ */

/* ----- Chat room & private messages ----- */
@media (max-width: 768px) {
    .chatroom-wrap, .pm-wrap {
        height: calc(100vh - 230px);
        min-height: 420px;
    }
    .chatroom-online { max-height: 140px; }
    .pm-list { max-height: 200px; }
    .chatroom-messages, .pm-thread-messages {
        padding: 12px;
        gap: 8px;
    }
    .chat-msg-bubble {
        max-width: 85%;
        padding: 7px 10px;
    }
    .chat-msg-text { font-size: 13px; }
    .chatroom-input-row, .pm-thread .chatroom-input-row {
        padding: 10px;
        gap: 8px;
    }
    .chatroom-input-row textarea {
        font-size: 13px;
        min-height: 38px;
    }
    .chatroom-input-row .btn-gold {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    .pm-thread-header {
        padding: 12px;
        gap: 8px;
    }
    .pm-thread-header .btn-ghost {
        padding: 5px 8px;
        font-size: 10px;
    }
    .pm-conv-preview { max-width: 130px; }
    .pm-challenge-card { max-width: 92%; }
    .online-user-name, .pm-conv-name { font-size: 12.5px; }
}
@media (max-width: 420px) {
    .chat-msg-bubble { max-width: 90%; }
    .chatroom-online-title { font-size: 10px; }
    .pm-conv-preview { max-width: 95px; }
    .pm-thread-header > div > div:first-child { font-size: 13px; }
}

/* ----- Leaderboard ----- */
@media (max-width: 700px) {
    .lb-podium {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .lb-table-head, .lb-table-row {
        grid-template-columns: 28px 1fr 64px 90px;
        padding: 12px 14px;
    }
    /* Hide Wins / Losses / Rank-badge columns on phones — Win Rate and
       Earnings carry the same information more compactly. The full
       breakdown is still one tap away via the user's profile card. */
    .lb-table-head > span:nth-child(3),
    .lb-table-head > span:nth-child(4),
    .lb-table-head > span:nth-child(7),
    .lb-table-row > :nth-child(3),
    .lb-table-row > :nth-child(4),
    .lb-table-row > :nth-child(7) {
        display: none;
    }
}
@media (max-width: 480px) {
    .lb-podium-card { padding: 18px 12px; }
    .lb-podium-earn { font-size: 17px; }
}

/* ----- Wallet ----- */
/* Desktop / tablet: hide the mobile-only history toggle button so the
   transaction history card always renders side-by-side with deposit/withdraw. */
.wallet-history-toggle {
    display: none;
}

@media (max-width: 768px) {
    .wallet-split {
        grid-template-columns: 1fr;
    }
    /* Mobile: hide the history card by default and reveal it via the toggle
       button. Deposits/withdrawals stay the primary action; history is one tap away. */
    #walletHistoryCard {
        display: none;
    }
    #walletHistoryCard.mobile-open {
        display: block;
    }
    .wallet-history-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        margin: 4px 0 16px;
        padding: 11px 14px;
        background: var(--bg3);
        border: 1px solid var(--border2);
        color: var(--text);
        font-size: 13px;
        font-weight: 600;
        border-radius: 8px;
        cursor: pointer;
    }
    .wallet-history-toggle:hover {
        background: var(--bg2);
    }
}

/* ----- Auth forms (login / register) ----- */
@media (max-width: 480px) {
    .auth-card { padding: 24px 18px; }
    .auth-title { font-size: 22px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
}
