/* =========================================================
   DASHBOARD PAGE BASE
   Uses theme variables from base.css
   ========================================================= */

body.dashboard-page {
    background: var(--page-bg);
    color: var(--text-main);
}

body.dashboard-page p {
    line-height: 1.6;
    color: var(--text-muted);
}


/* =========================================================
   PAGE LAYOUT
   ========================================================= */

.page-content {
    flex: 1;
    width: 100%;
    padding: 32px;
    box-sizing: border-box;
}

.dashboard-grid {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 24px;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-box {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.large-box {
    min-height: 320px;
}

.small-box {
    min-height: 148px;
}

.bottom-box {
    grid-column: 1 / -1;
    min-height: 320px;
}


/* =========================================================
   MODULE ROADMAP
   ========================================================= */

.roadmap-box {
    padding: 16px 20px;
}

.roadmap-wrapper {
    width: 100%;
}

.roadmap-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.roadmap-heading {
    margin: 0;
    color: var(--text-main);
    font-size: 2rem;
    font-weight: 800;
}

.roadmap-arrow-button {
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    color: var(--text-main);
    font-size: 1.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.roadmap-arrow-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

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

.roadmap-page-info {
    margin-bottom: 14px;
    color: var(--text-main);
    font-weight: 700;
}

.roadmap-container {
    --roadmap-background-image: none;
    position: relative;
    min-height: 490px;
    border-radius: 32px;
    background-color: var(--panel-bg);
    background-image: var(--roadmap-background-image);
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    border: 2px solid var(--border-light);
    overflow: hidden;
}

.roadmap-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.roadmap-nodes {
    position: relative;
    width: 100%;
    min-height: 450px;
}

.roadmap-loading,
.roadmap-empty {
    margin: 0;
    padding: 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
}

.roadmap-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 150px;
    text-align: center;
    text-decoration: none;
}

.roadmap-node-circle {
    width: 110px;
    height: 110px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #dff5ff;
    border: 10px solid #27ecec;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.roadmap-node-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.roadmap-fallback-icon {
    font-size: 42px;
    line-height: 1;
}

.roadmap-node-title {
    color: var(--text-main);
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
}

.roadmap-node-status {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.roadmap-node.available .roadmap-node-circle {
    box-shadow:
        0 0 0 5px rgba(39, 236, 236, 0.15),
        0 0 28px rgba(39, 236, 236, 0.7);
    animation: roadmapGlow 1.7s ease-in-out infinite alternate;
}

.roadmap-node.completed .roadmap-node-circle {
    border-color: var(--success-main);
    background: #eaffef;
    box-shadow: 0 0 25px rgba(52, 213, 111, 0.55);
}

.roadmap-node.locked {
    pointer-events: none;
    opacity: 0.45;
}

.roadmap-node.locked .roadmap-node-circle {
    border-color: #b8c0c8;
    background: #dbe3ea;
    filter: grayscale(100%);
}

@keyframes roadmapGlow {
    from {
        box-shadow:
            0 0 0 4px rgba(39, 236, 236, 0.12),
            0 0 16px rgba(39, 236, 236, 0.35);
    }

    to {
        box-shadow:
            0 0 0 6px rgba(39, 236, 236, 0.2),
            0 0 30px rgba(39, 236, 236, 0.78);
    }
}

/* =========================================================
   ROADMAP MODULE NAME PILLS
   ========================================================= */

.roadmap-module-label {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;

    display: flex;
    justify-content: center;

    pointer-events: none;
}

.roadmap-module-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    max-width: 180px;
    padding: 9px 16px;

    border-radius: 999px;

    background: rgba(24, 41, 78, 0.88);
    color: #ffffff;

    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.18),
        0 0 14px rgba(77, 231, 255, 0.35),
        0 0 28px rgba(77, 231, 255, 0.22);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.roadmap-module.completed .roadmap-module-pill,
.roadmap-node.completed .roadmap-module-pill {
    background: rgba(25, 80, 55, 0.9);

    box-shadow:
        0 0 0 1px rgba(52, 211, 153, 0.35),
        0 0 14px rgba(52, 211, 153, 0.38),
        0 0 28px rgba(52, 211, 153, 0.24);
}

.roadmap-module.locked .roadmap-module-pill,
.roadmap-node.locked .roadmap-module-pill {
    background: rgba(50, 60, 82, 0.82);
    color: rgba(255, 255, 255, 0.78);

    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 12px rgba(180, 190, 210, 0.16);
}


/* =========================================================
   BADGE STORE
   ========================================================= */

.store-container {
    padding: 28px 32px 34px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.store-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.store-title {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.store-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.store-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(244, 197, 66, 0.14);
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 999px;
    padding: 10px 18px;
}

.store-balance-icon {
    font-size: 1rem;
}

.store-balance-amount {
    font-weight: 800;
    font-size: 1.1rem;
    color: #a06200;
}

.store-balance-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 200px));
    gap: 34px 49px;
    justify-content: start;
    align-items: start;
}

/* The badge card itself is now invisible */
.store-item {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-height: auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;

    transition: transform 0.18s ease;
}

.store-item:hover {
    transform: translateY(-3px);
}

/* Badge image floats on its own */
.badge-preview {
    width: 185px;
    height: 185px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    border-radius: 0;
}

.store-badge-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;

    object-fit: contain;
    display: block;

    filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.16));
}

/* Floating cost + button row */
.store-floating-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.store-item-cost {
    font-weight: 800;
    font-size: 0.9rem;
    color: #a06200;

    background: rgba(244, 197, 66, 0.16);
    border: 1px solid rgba(244, 197, 66, 0.45);
    border-radius: 999px;

    padding: 8px 14px;
    white-space: nowrap;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.store-btn {
    background: linear-gradient(135deg, #1fc9c5, #2d8fc0);
    color: #ffffff;

    border: none;
    border-radius: 999px;

    padding: 8px 16px;

    font-size: 0.9rem;
    font-weight: 800;

    cursor: pointer;
    white-space: nowrap;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        filter 0.15s ease;
}

.store-btn:hover:not(:disabled) {
    opacity: 0.92;
    transform: translateY(-1px) scale(1.03);
}

.store-btn:disabled {
    cursor: not-allowed;
    transform: none;
}

.store-btn-purchase {
    background: linear-gradient(135deg, #39d98a, #1fbf75);
}

.store-btn-owned {
    background: linear-gradient(135deg, #e8c15a, #c9951a) !important;
    color: #ffffff !important;
    opacity: 1;
}

.store-btn-locked {
    background: #c8d1df;
    color: #6f7f96;
}

/* =========================================================
   LEADERBOARDS
   ========================================================= */

.leaderboard-box {
    overflow: hidden;
}

.leaderboard-container {
    height: 100%;
    box-sizing: border-box;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaderboard-title {
    margin: 0;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 800;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
}

.leaderboard-loading,
.leaderboard-empty {
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel-bg);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 6px 10px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.leaderboard-entry:hover {
    transform: translateY(-1px);
    background: var(--card-bg);
}

.lb-rank {
    min-width: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.82rem;
    font-weight: 800;
}

.rank-gold {
    color: #d4a017;
}

.rank-silver {
    color: #8f9ba8;
}

.rank-bronze {
    color: #b87333;
}

.lb-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--panel-bg);
    border: 1.5px solid var(--border-soft);
    flex-shrink: 0;
}

.lb-name {
    flex: 1;
    color: var(--text-main);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 700;
}

.lb-name:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lb-points {
    color: var(--text-main);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 800;
}

.lb-trophy {
    font-size: 0.85rem;
    line-height: 1;
}

.leaderboard-title a {
    color: inherit;
    text-decoration: none;
}

.leaderboard-title a:hover {
    text-decoration: underline;
    text-underline-offset: 6px;
}

/* =========================================================
   FULL LEADERBOARDS PAGE
   ========================================================= */

.full-leaderboards-page {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.full-leaderboards-header {
    color: var(--text-main);
}

.full-leaderboards-header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
}

.full-leaderboards-header p {
    margin-top: 8px;
    color: var(--text-muted);
}

.full-leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.full-leaderboard-box {
    padding: 28px;
}

.full-leaderboard-box .leaderboard-title {
    margin-bottom: 18px;
}

.full-leaderboard-box .leaderboard-list {
    gap: 12px;
    overflow: visible;
}

.full-leaderboard-box .leaderboard-entry {
    padding: 12px 16px;
}

.full-leaderboard-box .lb-rank {
    font-size: 1rem;
    min-width: 28px;
}

.full-leaderboard-box .lb-avatar {
    width: 38px;
    height: 38px;
}

.full-leaderboard-box .lb-name {
    font-size: 1rem;
}

.full-leaderboard-box .lb-points {
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .full-leaderboards-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   RESPONSIVE DASHBOARD
   ========================================================= */

@media (max-width: 900px) {
    .page-content {
        padding: 20px;
    }

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

    .bottom-box {
        grid-column: auto;
    }

    .right-column {
        gap: 20px;
    }

    .large-box,
    .bottom-box {
        min-height: 240px;
    }

    .small-box {
        min-height: 120px;
    }

    .store-container {
        padding: 18px 16px;
    }

    .store-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .roadmap-heading {
        font-size: 1.5rem;
    }

    .roadmap-container,
    .roadmap-nodes {
        min-height: 460px;
    }

    .roadmap-node {
        width: 120px;
    }

    .roadmap-node-circle {
        width: 88px;
        height: 88px;
        border-width: 8px;
    }

    .roadmap-node-title {
        font-size: 13px;
    }

    .roadmap-node-status {
        font-size: 12px;
    }
}