/* ===== QUEST SHOWCASE ===== */
.quest-showcase {
    padding: 30px 0 50px;
}

.showcase-header {
    margin-bottom: 26px;
}

.showcase-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.55);
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin-bottom: 14px;
}

.showcase-title {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.15;
}

.showcase-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    max-width: 620px;
    margin: 0;
}

.showcase-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 320px 200px;
    gap: 14px;
}

@media (max-width: 768px) {
    .showcase-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
}

.showcase-tile {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.showcase-tile-big {
    grid-row: span 2;
}

.showcase-tile-small {
    min-height: 152px;
}

.showcase-tile-wide {
    grid-column: span 1;
}

.showcase-tile-big.showcase-tile-wide {
    grid-column: 1;
}

.showcase-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.showcase-poster {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s;
}

.showcase-tile:hover .showcase-poster {
    transform: scale(1.05);
}

.showcase-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
}

.showcase-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.showcase-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
}

.showcase-tile-big .showcase-info {
    padding: 26px 28px;
}

.showcase-game-tag {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.showcase-game-name {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.showcase-tile-big .showcase-game-name {
    font-size: 36px;
    margin-bottom: 10px;
}

.showcase-game-meta {
    display: flex;
    gap: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 600;
    flex-wrap: wrap;
}

.showcase-tile-big .showcase-game-meta {
    font-size: 13px;
    gap: 18px;
}

.showcase-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 26px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.showcase-footer-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.showcase-cta {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.showcase-cta:hover {
    background: #fff;
    transform: translateY(-2px);
}

.home-popular-quests {
    padding: 0 0 40px;
}

.home-popular-quests .showcase-header {
    margin-bottom: 14px;
}

.home-popular-grid {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.home-popular-tile {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.home-popular-tile:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.home-popular-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: rgba(255, 255, 255, 0.06);
    background-size: cover;
    background-position: center 22%;
    background-repeat: no-repeat;
    transition: transform 0.35s ease;
}

.home-popular-tile:hover .home-popular-poster {
    transform: scale(1.04);
}

.home-popular-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.25));
}

.home-popular-shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 58%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
    pointer-events: none;
}

.home-popular-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.2;
}

.home-popular-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 10px 10px 11px;
}

.home-popular-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-popular-meta {
    margin-top: 2px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.2;
}

@media (max-width: 900px) {
    .home-popular-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .home-popular-tile {
        flex: none;
    }
}

@media (max-width: 560px) {
    .home-popular-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* ===== END QUEST SHOWCASE ===== */

/* Site features columns */
.site-features {
    padding: 30px 0 60px;
}

.features-section-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 28px;
    text-align: center;
    line-height: 1.15;
}

.features-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

@media (max-width: 900px) {
    .features-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .features-cols {
        grid-template-columns: 1fr;
    }
}

.feature-col {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 22px 20px;
    transition: all 0.2s;
}

.feature-col:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
}

.feature-col-num {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.feature-col-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}

.feature-col-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.feature-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #ffffff;
    font-weight: 600;
}

.feature-card ul {
    list-style: none;
}

.feature-card li {
    padding: 8px 0;
    color: #e0e0e0;
}

.feature-card li::before {
    content: '•';
    color: #ffffff;
    margin-right: 10px;
}

/* ===== HOME PAGE NEW SECTIONS ===== */

/* Hero CTA */
.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 52px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    text-decoration: none;
    box-shadow: none;
    font-family: inherit;
    line-height: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hero-cta:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: none;
}

.hero-cta:focus-visible,
.hero-login-btn:focus-visible {
    outline: 2px solid rgba(217, 249, 157, 0.9);
    outline-offset: 4px;
}

.hero-btn-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}

.hero-cta .hero-btn-icon:empty {
    display: none;
}

.hero-cta .hero-btn-icon {
    background: transparent;
    color: inherit;
}

.hero-login-btn .hero-btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ====== HOME PAGE: GAME-THEMED ====== */

/* Hero row — 1 big tile + 2 small */
.home-hero-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
    min-height: 280px;
}

@media (max-width: 768px) {
    .home-hero-row {
        grid-template-columns: 1fr;
    }
}

.home-hero-tile,
.home-hero-tile-small {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s;
    background: linear-gradient(135deg, #2d4a6f 0%, #1a2d4a 100%);
}

.home-hero-tile {
    min-height: 280px;
}

.home-hero-tile-small {
    min-height: 132px;
    background: linear-gradient(135deg, #6f4a4a 0%, #4a2d2d 100%);
}

.home-hero-tile-small:nth-child(3) {
    background: linear-gradient(135deg, #4a3a6f 0%, #2d1f4a 100%);
}

.home-hero-tile:hover,
.home-hero-tile-small:hover {
    transform: translateY(-3px);
}

.hht-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.hht-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 2;
}

.hht-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 22px;
    z-index: 2;
}

.home-hero-tile .hht-content {
    padding: 28px 30px;
}

.hht-tag {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-bottom: 6px;
}

.hht-title {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.home-hero-tile .hht-title {
    font-size: 32px;
}

.hht-meta {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 600;
}

.home-hero-tile .hht-meta {
    font-size: 14px;
}

/* Section blocks */
.home-section {
    margin-bottom: 24px;
}

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0;
}

.home-section-header .home-section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.home-expand-btn {
    padding: 7px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.home-expand-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Cards grid — Steam-style game cards */
.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.home-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
    background: var(--bg-color, #2d3a4a);
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.home-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.home-card-cover {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    min-height: 130px;
    position: relative;
    overflow: hidden;
}

.home-card-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.3) 100%);
}

.home-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.home-card-body {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.home-card-name {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-card-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 4px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.home-card.upcoming .home-card-cover {
    filter: brightness(0.9);
}

.home-hidden {
    display: none !important;
}

.home-cards.expanded .home-hidden {
    display: flex !important;
}
/* ====== END HOME ====== */

/* Section heading shared */
.home-section {
    margin-bottom: 50px;
}

.home-section-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
    color: #fff;
}

/* How it works */
.how-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.how-step {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 30px 25px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.how-step:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-5px);
}

.how-step-num {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.how-step-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.how-step-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.how-step-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    line-height: 1.5;
}

/* Welcome card */
.welcome-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 50px;
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.welcome-icon {
    font-size: 64px;
    flex-shrink: 0;
}

.welcome-content {
    flex: 1;
    min-width: 250px;
}

.welcome-title {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    margin-bottom: 16px;
}

.welcome-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.welcome-step-pill {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.welcome-step-pill.done {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.welcome-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.welcome-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.welcome-cta {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.welcome-cta:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Roadmap */
.roadmap {
    position: relative;
    padding-left: 30px;
}

.roadmap::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 50%, rgba(255, 255, 255, 0.2) 100%);
}

.roadmap-item {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.roadmap-item:hover {
    transform: translateX(5px);
}

.roadmap-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 22px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.roadmap-item.done::before {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.roadmap-item.in-progress::before {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }
    50% { box-shadow: 0 0 20px rgba(255, 107, 107, 1); }
}

.roadmap-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.roadmap-item.done .roadmap-status {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.roadmap-item.in-progress .roadmap-status {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.roadmap-item.planned .roadmap-status {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

.roadmap-title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.roadmap-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
}

/* FAQ */
.faq-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.faq-question {
    padding: 18px 22px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    user-select: none;
}

.faq-icon {
    font-size: 20px;
    color: #ffffff;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding: 0 22px 18px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

/* Community block */
.community-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 50px;
}

.community-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    text-decoration: none;
    cursor: pointer;
}

.community-card.discord:hover {
    border-color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.25);
}

.community-card.telegram:hover {
    border-color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.25);
}

.community-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.community-card.discord .community-icon {
    background: rgba(255, 255, 255, 0.15);
}

.community-card.telegram .community-icon {
    background: rgba(255, 255, 255, 0.15);
}

.community-content {
    flex: 1;
}

.community-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.community-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 10px;
}

.community-btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.community-card.discord .community-btn {
    background: rgba(255, 255, 255, 0.15);
}

.community-card.discord .community-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.community-card.telegram .community-btn {
    background: rgba(255, 255, 255, 0.15);
}

.community-card.telegram .community-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .how-steps {
        grid-template-columns: 1fr;
    }
    .community-block {
        grid-template-columns: 1fr;
    }
    .home-section-title {
        font-size: 22px;
    }
}
/* ===== END HOME PAGE NEW SECTIONS ===== */


footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px 0 15px;
    margin-top: 60px;
    position: relative;
    width: 100%;
    z-index: 100;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 5px;
}

.footer-section h4 {
    margin-bottom: 5px;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    display: block;
    padding: 2px 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #ffffff;
}

/* Leaderboard Styles */
.leaderboard-page {
    display: none;
    padding: 40px 0;
}

.leaderboard-page.active {
    display: block;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.leaderboard-header h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.leaderboard-header p {
    color: #ddd;
    margin-bottom: 5px;
}

.season-info {
    color: #ffffff;
    font-size: 14px;
}

.leaderboard-container {
    display: flex;
    gap: 30px;
}

.filters-sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 10px;
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: #e0e0e0;
    font-size: 14px;
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
    accent-color: #ffffff;
}

.leaderboard-main {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-bar {
    margin-bottom: 25px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
}

.leaderboard-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 150px 120px 120px 200px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #aaa;
    font-size: 14px;
}

.player-row {
    display: grid;
    grid-template-columns: 60px 1fr 150px 120px 120px 200px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    margin-bottom: 8px;
    align-items: center;
    transition: all 0.3s;
}

.player-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.rank {
    font-size: 18px;
    font-weight: bold;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.xp {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 100%);
    border-radius: 10px;
}

.edit-icon {
    color: #ffffff;
    cursor: pointer;
    font-size: 16px;
}

/* Leaderboard — live data states */
.lb-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
}

.player-row {
    cursor: pointer;
}

.player-row.is-me {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.player-row.is-me:hover {
    background: rgba(56, 189, 248, 0.18);
}

.lb-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-you {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 999px;
    padding: 1px 7px;
}

.player-row .rank.rank-1,
.player-row .rank.rank-2,
.player-row .rank.rank-3 {
    font-size: 20px;
    font-weight: 800;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
}

.player-row .rank.rank-1 {
    background-image: linear-gradient(135deg, #ffe89a, #ffba00);
    text-shadow: 0 0 14px rgba(255, 186, 0, 0.45);
}

.player-row .rank.rank-2 {
    background-image: linear-gradient(135deg, #f4f6fb, #aab4c5);
    text-shadow: 0 0 14px rgba(200, 210, 225, 0.4);
}

.player-row .rank.rank-3 {
    background-image: linear-gradient(135deg, #f0b27a, #c77b30);
    text-shadow: 0 0 14px rgba(199, 123, 48, 0.4);
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lb-myrank {
    color: #fff;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-myrank-pos {
    font-size: 22px;
    font-weight: 700;
    color: #38bdf8;
}

.lb-myrank-val {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

.lb-tip {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Quests Page */
.quests-page {
    display: none;
    padding: 40px 0;
}

.quests-page.active {
    display: block;
}

.quick-start {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.45s ease;
}

.quick-start.quick-start-hidden {
    display: none;
}

.quick-start h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 600;
}

.quick-start ul {
    list-style: none;
}

.quick-start li {
    padding: 8px 0;
    color: #e0e0e0;
}

.quick-start li::before {
    content: '•';
    color: #ffffff;
    margin-right: 10px;
}

/* Interactive Quick Start */
.qs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.qs-header h3 {
    margin-bottom: 0 !important;
}

.qs-progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.qs-progress-bar {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.qs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.qs-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.qs-step {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.qs-step:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.qs-step.done {
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.qs-step.done:hover {
    background: rgba(74, 222, 128, 0.12);
}

.qs-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
    background: transparent;
    margin-top: 1px;
}

.qs-step.done .qs-checkbox {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}

.qs-checkbox::after {
    content: '+';
    color: #000;
    font-weight: bold;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.qs-step.done .qs-checkbox::after {
    opacity: 1;
}

.qs-step-content {
    flex: 1;
    min-width: 0;
}

.qs-step-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qs-step.done .qs-step-title {
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.6);
}

.qs-step-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.4;
}

.qs-step-action {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.qs-step.done .qs-step-action {
    color: #ffffff;
}

.qs-reward {
    margin-top: 15px;
    padding: 12px 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.4s ease;
}

.qs-reward.show {
    display: flex;
}

.qs-reward-icon {
    font-size: 28px;
}

.qs-reward-text {
    flex: 1;
    color: #fff;
    font-size: 14px;
}

.qs-reward-text strong {
    color: #ffffff;
}

.qs-reset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.qs-reset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .qs-steps {
        grid-template-columns: 1fr;
    }
}

/* Quest filter behavior */
.quest-card.hidden {
    display: none !important;
}

.quests-grid.empty::after {
    content: 'Nothing found — try relaxing the filters';
    display: block;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.filter-count-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

.section-title-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

.quests-layout {
    display: flex;
    gap: 20px;
}

.quests-filters {
    width: 200px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 18px;
    border-radius: 10px;
    height: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 90px;
    flex-shrink: 0;
}

.quests-filters .filter-group {
    margin-bottom: 18px;
}

.quests-filters .filter-group h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.quests-filters .filter-option {
    padding: 5px 0;
    font-size: 13px;
}

.quests-content {
    flex: 1;
    min-width: 0;
}

.trending-section,
.popular-section,
.quests-section {
    margin-bottom: 40px;
}

.quests-section.hidden {
    display: none !important;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 600;
}

.quests-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.quest-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
}

.quest-card:hover {
    transform: translateY(-5px);
}

.quest-image {
    width: 100%;
    height: 110px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 42px;
}

/* Quest image with photo background */
.quest-image.has-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-size: 0;
}

.quest-image.has-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
}

.quest-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: 0.2px;
}

.star {
    color: #ffffff;
}

.quest-info {
    padding: 12px;
}

.quest-title {
    font-size: 14px;
    margin-bottom: 4px;
    color: #fff;
    font-weight: 600;
}

.quest-meta {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 10px;
}

.invite-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 5px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
}

.invite-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* Play quest button */
.quest-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.play-quest-btn {
    width: 100%;
    padding: 8px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.view-quest-btn {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    font-size: 13px;
    font-family: inherit;
}

.view-quest-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.view-quest-btn.completed {
    background: rgba(134, 239, 172, 0.12);
    border-color: rgba(134, 239, 172, 0.35);
    color: #86efac;
}

.view-quest-btn.completed:hover {
    background: rgba(134, 239, 172, 0.18);
    border-color: rgba(134, 239, 172, 0.5);
}

.play-quest-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.play-quest-btn.completed {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.play-quest-btn.completed:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Quest Modal */
.quest-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.quest-modal.active {
    display: flex;
}

.quest-modal-content {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.quest-modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.quest-modal-title {
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}

.quest-modal-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    margin-top: 4px;
}

.quest-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.75);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.25s;
    flex-shrink: 0;
}

.quest-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: scale(1.05);
}

.quest-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.quest-progress-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.quest-combo-streak {
    color: #ffb347;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.quest-combo-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8c42 0%, #ff3d81 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    box-shadow: 0 0 14px rgba(255, 100, 80, 0.45);
    animation: questComboPulse 1.2s ease-in-out infinite;
}

.quest-combo-active-hint {
    margin: -10px 0 16px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 120, 60, 0.14);
    border: 1px solid rgba(255, 140, 80, 0.35);
    color: #ffd0a8;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.quest-combo-xp-note {
    color: #ffb347;
    font-weight: 700;
}

.quest-combo-burst {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    z-index: 20;
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.quest-combo-burst.show {
    opacity: 1;
    transform: scale(1);
}

.quest-combo-burst-icon {
    font-size: 42px;
    animation: questComboPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-combo-burst-text {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 120, 60, 0.6);
}

.quest-combo-burst-sub {
    color: rgba(255, 220, 180, 0.9);
    font-size: 14px;
    font-weight: 600;
}

@keyframes questComboPop {
    0% { transform: scale(0.4); opacity: 0; }
    60% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes questComboPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 100, 80, 0.35); }
    50% { box-shadow: 0 0 18px rgba(255, 100, 80, 0.65); }
}

.quest-modal-body {
    position: relative;
    padding: 25px 30px;
}

.quest-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.65) 0%, #ffffff 100%);
    border-radius: 10px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.quest-question {
    color: #fff;
    font-size: 18px;
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 500;
}

.quest-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quest-option {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
    text-align: left;
    font-family: inherit;
}

.quest-option:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateX(4px);
}

.quest-option.correct {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.quest-option.wrong {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.65);
}

.quest-option:disabled {
    cursor: default;
}

/* ===== Quest question types ===== */
.quest-type-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.quest-type-boss {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
}

.quest-type-blitz {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fde68a;
}

.quest-question-boss {
    font-size: 18px;
    color: #fecaca;
}

.quest-q-image-wrap {
    margin: 12px 0 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-height: 220px;
}

.quest-q-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    object-position: center;
}

.quest-options-tf {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quest-option-tf {
    min-height: 52px;
    font-size: 16px;
    font-weight: 700;
}

.quest-type-hint,
.quest-blitz-sub-label {
    margin: 0 0 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.quest-order-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quest-order-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-order-item.correct {
    border-color: rgba(134, 239, 172, 0.45);
    background: rgba(34, 197, 94, 0.12);
}

.quest-order-item.wrong {
    border-color: rgba(248, 113, 113, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.quest-order-num {
    flex: 0 0 22px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
}

.quest-order-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.35;
}

.quest-order-btns {
    display: flex;
    gap: 4px;
}

.quest-order-move {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
}

.quest-order-move:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.quest-match-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quest-match-row.correct {
    border-color: rgba(134, 239, 172, 0.45);
}

.quest-match-row.wrong {
    border-color: rgba(248, 113, 113, 0.4);
}

.quest-match-left {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
}

.quest-match-select {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 13px;
}

.quest-submit-answer {
    margin-top: 12px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.quest-submit-answer:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
}

.quest-blitz-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.quest-blitz-timer {
    font-size: 22px;
    font-weight: 800;
    color: #fde68a;
}

.quest-blitz-progress {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.quest-blitz.blitz-pass {
    border: 1px solid rgba(134, 239, 172, 0.35);
    border-radius: 12px;
    padding: 12px;
}

.quest-blitz.blitz-fail {
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: 12px;
    padding: 12px;
}

.quest-blitz-result {
    text-align: center;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quest-play-boss .quest-boss-wrap {
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 12px;
    padding: 12px;
    background: rgba(127, 29, 29, 0.12);
}

.cq-type-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

.cq-q-type,
.cq-tf-correct,
.cq-blitz-correct {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.cq-order-items,
.cq-match-pairs,
.cq-blitz-subs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.cq-order-item,
.cq-match-left,
.cq-match-right,
.cq-blitz-q,
.cq-blitz-opt,
.cq-q-image {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.cq-match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
}

.cq-match-arrow {
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}

.cq-blitz-sub {
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.cq-add-order-item,
.cq-add-match-pair {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.quest-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    display: none;
}

.quest-feedback.show {
    display: block;
    animation: slideIn 0.3s ease;
}

.quest-feedback.correct-feedback {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.quest-feedback.wrong-feedback {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.72);
}

.quest-next-btn {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
    display: none;
}

.quest-next-btn.show {
    display: block;
}

.quest-next-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
    transform: translateY(-1px);
}

/* Quest results screen */
.quest-results {
    text-align: center;
    padding: 20px 0;
}

.quest-results-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: slideUp 0.5s ease;
}

.quest-results-title {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.quest-results-score {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-bottom: 25px;
}

.coop-race-win-banner {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(134, 239, 172, 0.15);
    border: 1px solid rgba(134, 239, 172, 0.35);
    color: #86efac;
    font-size: 15px;
    font-weight: 600;
}

.coop-race-loss-banner {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fcd34d;
    font-size: 15px;
}

.coop-race-defeat {
    text-align: center;
    padding: 28px 16px;
}

.coop-race-defeat-icon {
    font-size: 72px;
    margin-bottom: 12px;
}

.coop-race-defeat-title {
    margin: 0 0 10px;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
}

.coop-race-defeat-text {
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
}

.coop-together-play-hint {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #93c5fd;
    font-size: 13px;
    text-align: center;
}

.coop-together-help {
    display: inline-block;
    margin-bottom: 6px;
    color: #93c5fd;
    font-size: 14px;
}

.quest-rating-prompt {
    margin: 8px 0 24px;
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
}

.quest-rating-prompt-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.quest-rating-prompt-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.quest-rating-input {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.quest-rate-star {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.35);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    font-family: inherit;
    padding: 0;
}

.quest-rate-star:hover,
.quest-rate-star.active {
    background: rgba(252, 211, 77, 0.12);
    border-color: rgba(252, 211, 77, 0.45);
    color: #fcd34d;
    transform: translateY(-1px);
}

.quest-finish-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.quest-rewards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quest-reward-combo .quest-reward-value {
    color: #ffb347;
}

.quest-reward-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.quest-reward-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-reward-value {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.quest-results-actions {
    display: flex;
    gap: 10px;
}

.quest-results-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.quest-retry-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.quest-retry-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.quest-finish-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Quest preview (View) */
.quest-preview-desc {
    color: rgba(255, 255, 255, 0.82);
    font-size: 15px;
    line-height: 1.55;
    margin: 0 0 16px;
}

.quest-preview-mode {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.quest-mode-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.quest-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.quest-mode-btn.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.quest-preview-coop {
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.quest-preview-coop.hidden {
    display: none;
}

.coop-intro,
.coop-hint,
.coop-empty {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 12px;
}

.coop-type-picker {
    margin-bottom: 14px;
}

.coop-type-picker-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 8px;
}

.coop-host-only {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.coop-type-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.coop-type-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
}

.coop-type-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.coop-type-btn.active {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
}

.coop-type-btn-title {
    font-size: 13px;
    font-weight: 700;
}

.coop-type-btn-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.coop-type-locked {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.coop-type-locked-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.coop-type-locked-value {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.coop-type-locked-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.quest-diff-btn.locked,
.quest-diff-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.quest-mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coop-status {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.coop-status-ready {
    border: 1px solid rgba(134, 239, 172, 0.35);
    color: #bbf7d0;
}

.coop-status-pending {
    border: 1px solid rgba(252, 211, 77, 0.3);
    color: #fde68a;
}

.coop-status-declined {
    color: #fca5a5;
}

.coop-friends-wrap {
    position: relative;
    z-index: 2;
}

.coop-lobby-roster {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
}

.coop-lobby-title {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.coop-lobby-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.coop-lobby-member {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.coop-lobby-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.coop-lobby-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.coop-lobby-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(134, 239, 172, 0.15);
    color: #86efac;
    white-space: nowrap;
}

.coop-lobby-badge-wait {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

.coop-friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.coop-friend-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.coop-friend-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.coop-friend-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.coop-friend-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

.coop-friend-action {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.coop-cancel-btn {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
}

.coop-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.coop-reset-btn {
    display: block;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 12px;
    cursor: pointer;
}

.coop-reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.quest-preview-start:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.coop-invite-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    pointer-events: none;
}

.coop-invite-toast.show {
    pointer-events: auto;
}

.coop-toast-card {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(20, 20, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.coop-toast-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.coop-toast-actions {
    display: flex;
    gap: 8px;
}

.coop-toast-accept,
.coop-toast-join {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.coop-toast-decline {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    cursor: pointer;
}

.quest-preview-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quest-preview-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 14px;
}

.quest-preview-label {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.quest-preview-value {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.quest-preview-xp {
    color: var(--gold-bright, #fff);
}

.quest-preview-difficulty-easy { color: #86efac; }
.quest-preview-difficulty-medium { color: #fcd34d; }
.quest-preview-difficulty-hard { color: #f87171; }

.quest-preview-diff-hint {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 14px;
}

.quest-preview-difficulties {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quest-diff-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
}

.quest-diff-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
}

.quest-diff-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.quest-diff-btn.done {
    opacity: 0.72;
}

.quest-diff-btn.done::after {
    content: '+';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 12px;
    color: #86efac;
}

.quest-diff-btn {
    position: relative;
}

.quest-diff-btn-label {
    font-size: 14px;
    font-weight: 700;
}

.quest-diff-btn-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.quest-preview-actions {
    display: flex;
}

.quest-preview-start {
    width: 100%;
    margin-bottom: 0;
}

.quest-finish-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.completed-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.85);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

/* Profile Page */
.profile-page {
    display: none;
    padding: 40px 0;
}

.profile-page.active {
    display: block;
}

/* Settings Page */
.settings-page {
    display: none;
    padding: 0;
}

.settings-page.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.settings-header {
    text-align: center;
    margin-bottom: 40px;
}

.settings-header h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.settings-header p {
    color: #ddd;
}

.settings-content {
    width: 100%;
    flex: 1;
    min-height: 0;
    margin: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Settings sidebar nav */
.settings-nav {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 10px;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
    overflow-y: auto;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
    margin-bottom: 2px;
}

.settings-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.settings-nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.settings-nav-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
}

.settings-panels {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.settings-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.settings-panel.active {
    display: flex;
}

.settings-section {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 28px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

.settings-section h3 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.setting-item {
    margin-bottom: 20px;
}

/* === Settings: clean block structure === */
.settings-block {
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-block:first-of-type {
    border-top: none;
    padding-top: 0;
}

.settings-block-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-block-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.settings-avatar-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.settings-banner-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.settings-banner-preview {
    width: 220px;
    height: 72px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-banner-preview.has-image {
    border-color: rgba(255, 255, 255, 0.28);
}

.settings-banner-placeholder {
    color: rgba(255, 255, 255, 0.42);
    font-size: 12px;
    font-weight: 600;
}

.settings-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.settings-avatar-hint {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    margin-top: 2px;
}

.settings-divider-soft {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
    text-align: center;
    position: relative;
    padding: 10px 0 14px;
}

.settings-divider-soft::before,
.settings-divider-soft::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 70px);
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.settings-divider-soft::before { left: 0; }
.settings-divider-soft::after { right: 0; }

.settings-field {
    margin-bottom: 16px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.settings-field label {
    display: block;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.settings-field input[type="text"],
.settings-field textarea {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.settings-field input[type="text"]:focus,
.settings-field textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.settings-field input[type="text"]::placeholder,
.settings-field textarea::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.settings-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.settings-field-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin-top: 6px;
}

/* Danger button (delete account, etc) */
.danger-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 80, 80, 0.4);
    border-radius: 10px;
    color: #ff8080;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.danger-btn:hover {
    background: rgba(255, 80, 80, 0.12);
    border-color: rgba(255, 80, 80, 0.7);
    color: #fff;
}

@media (max-width: 900px) {
    .settings-content {
        flex-direction: column;
        min-height: 0;
    }
    .settings-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 10px;
        gap: 6px;
        flex-shrink: 0;
    }
    .settings-nav-item {
        flex-shrink: 0;
        white-space: nowrap;
    }
    .settings-panels {
        min-height: 0;
        flex: 1;
    }
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item textarea,
.setting-item select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="number"]:focus,
.setting-item textarea:focus,
.setting-item select:focus {
    outline: none;
    border-color: #ffffff;
}

.setting-item textarea {
    resize: vertical;
}

.setting-item input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #ffffff;
}

.setting-item label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.avatar-option {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.35);
}

.profile-pic-container {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 10px;
}

.current-profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.current-profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-pic-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-pic-btn,
.remove-pic-btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.upload-pic-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #000;
}

.upload-pic-btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

.remove-pic-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.remove-pic-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.save-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-shrink: 0;
    margin: 0;
    padding: 16px 28px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.save-btn,
.cancel-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.save-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #000;
}

.save-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-layout {
    display: flex;
    gap: 30px;
    align-items: stretch;
    margin-bottom: 0;
}

.friends-sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 14px;
    height: calc(100vh - 330px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
}

.friends-sidebar h3 {
    margin-bottom: 16px;
    color: #ffffff;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.friends-count-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
}

.add-friend-container {
    margin-bottom: 14px;
    position: relative;
    flex-shrink: 0;
}

.add-friend-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
}

.add-friend-wrapper {
    flex: 1;
    min-width: 0;
}

.add-friend-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    caret-color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.add-friend-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.add-friend-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.add-friend-btn {
    flex-shrink: 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.add-friend-btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

.add-friend-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* Section labels (Pinned / All) */
.friends-section-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 8px 4px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.friends-list {
    overflow-y: auto;
    flex: 1;
    margin: 0 -6px;
    padding: 0 2px;
}

.friends-list::-webkit-scrollbar {
    width: 4px;
}

.friends-list::-webkit-scrollbar-track {
    background: transparent;
}

.friends-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.friend-item:nth-child(n+6) {
    display: none;
}

.expand-friends-btn {
    margin-top: 12px;
    padding: 9px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.expand-friends-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.view-all-achievements-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 13px;
}

.view-all-achievements-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ===== ACHIEVEMENTS MODAL ===== */
.achievements-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2500;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.achievements-modal.active { display: flex; }

.achievements-modal-content {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    width: 1320px;
    max-width: calc(100vw - 32px);
    height: 860px;
    max-height: calc(100vh - 32px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    overscroll-behavior: contain;
}

.achievements-modal-header {
    padding: 22px 30px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
}

.achievements-modal-header h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.am-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.achievements-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-family: inherit;
    flex-shrink: 0;
}

/* Two-column layout: filter sidebar + achievements panel */
.am-content {
    display: flex;
    gap: 24px;
    align-items: stretch;
    padding: 0 30px 30px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.am-nav {
    width: 220px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.am-nav-progress {
    padding: 8px 10px 14px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.am-nav-progress .am-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}

.am-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), #fff);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0;
}

.am-nav-progress .am-progress-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.am-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
    margin-bottom: 2px;
}

.am-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.am-nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.am-nav-count {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 11px;
    padding: 2px 8px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.am-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.am-panel {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.am-panel-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 16px 22px 0;
    flex-shrink: 0;
}

.am-body {
    padding: 14px 22px 60px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    overscroll-behavior: contain;
}

.am-body::-webkit-scrollbar { width: 6px; }
.am-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }

.am-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.am-grid .am-card {
    padding: 10px 8px 8px;
    gap: 5px;
}

.am-grid .am-icon {
    width: 46px;
    height: 46px;
    font-size: 22px;
}

.am-grid .am-name {
    font-size: 11px;
    line-height: 1.2;
}

.am-grid .am-date {
    font-size: 8px;
    margin-top: 0;
}

/* Short viewports: allow scroll inside the grid area */
@media (max-height: 900px) {
    .am-body {
        overflow-y: auto;
    }
}

@media (max-width: 900px) {
    .achievements-modal-content {
        width: calc(100vw - 32px);
        height: min(860px, calc(100vh - 32px));
    }
    .am-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .am-body {
        overflow-y: auto;
    }
    .am-content {
        flex-direction: column;
        padding: 0 20px 20px;
    }
    .am-nav {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px;
    }
    .am-nav-progress {
        width: 100%;
        margin-bottom: 6px;
        padding-bottom: 10px;
    }
    .am-nav-item {
        flex: 1 1 auto;
        min-width: 120px;
        justify-content: center;
        margin-bottom: 0;
    }
    .am-panel-title {
        padding: 18px 20px 0;
        font-size: 18px;
    }
    .am-body {
        padding: 14px 20px 20px;
    }
}

.am-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 16px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.25s;
    overflow: visible;
}

.am-card.legendary {
    box-shadow: 0 0 18px rgba(212, 216, 224, 0.08);
}

.am-card.locked { opacity: 0.45; }
.am-card.locked .am-icon { filter: grayscale(1); }
.am-card.locked .am-icon .achievement-img { filter: grayscale(1); }
.am-card.locked:hover { opacity: 0.7; }

.am-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    z-index: 5;
}

.am-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.25s;
    overflow: hidden;
}

.am-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.am-desc {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    line-height: 1.3;
}

.am-date {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    margin-top: 4px;
}

.am-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.am-empty-icon {
    font-size: 42px;
    opacity: 0.5;
    margin-bottom: 10px;
}
/* ===== END ACHIEVEMENTS MODAL ===== */

/* Friends Page */
.friends-page {
    display: none;
    padding: 40px 0;
}

.friends-page.active {
    display: block;
}

.friends-content {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 220px);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
}

.friends-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.friends-panel-header {
    padding: 22px 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.friends-panel-title {
    flex: 1;
    min-width: 0;
}

.friends-panel-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.friends-panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Dedicated friend profile modal ===== */
.fp-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2100;
    animation: fadeIn 0.25s ease;
    padding: 20px;
}

.fp-modal.active {
    display: flex;
}

.fp-modal-content {
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    width: 100%;
    max-width: 760px;
    height: min(88vh, 820px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.28s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.fp-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.fp-modal-header h2 {
    color: #fff;
    font-size: 18px;
    margin: 0;
    flex: 1;
}

.fp-modal-back,
.fp-modal-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fp-modal-back:hover,
.fp-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.fp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 26px;
}

.fp-modal-body::-webkit-scrollbar {
    width: 7px;
}
.fp-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* ===== Friend profile page (in-flow, same layout as own profile) ===== */
.friend-page {
    animation: fadeIn 0.25s ease;
}

/* Back button reuses logout button styling */
.friend-page-back-btn {
    cursor: pointer;
}

.close-modal-btn {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.42);
    transform: scale(1.04);
}

/* Friends page subtitle */
.fm-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin-top: 4px;
}

/* Friends page sidebar nav */
.fm-nav {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    padding: 14px 10px;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    overflow-y: auto;
    min-height: 0;
}

.fm-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    text-align: left;
    flex-shrink: 0;
}

.fm-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.fm-nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.fm-nav-count {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    font-size: 11px;
    padding: 2px 8px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.fm-nav-item.active .fm-nav-count {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* Search */
.fm-search-wrap {
    padding: 16px 16px 8px;
    flex-shrink: 0;
}

.fm-search {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.fm-search:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.fm-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* List */
.fm-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-list::-webkit-scrollbar {
    width: 5px;
}
.fm-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.fm-section-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 10px 8px 4px;
}

.fm-friend:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.fm-friend.active,
.fm-friend.pinned {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.fm-friend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}

.fm-pin-btn {
    flex-shrink: 0;
    min-width: 62px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 244, 212, 0.75);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.fm-pin-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.fm-pin-btn.is-pinned {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.38);
    color: #ffffff;
}

.fm-friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden;
}

.fm-friend-info {
    flex: 1;
    min-width: 0;
}

.fm-friend-name {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
}

.fm-friend-name .dev-badge-wrap {
    flex: none;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
}

.fm-friend-name .fm-pin-badge {
    font-size: 10px;
    opacity: 0.6;
}

.fm-friend-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fm-friend-sub.is-online {
    color: rgba(134, 239, 172, 0.9);
}

.fm-friend-sub.is-offline {
    color: rgba(255, 255, 255, 0.42);
}

.fm-friend.pending .fm-friend-sub {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.fm-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 14px;
}

.fm-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Right side - profile */
.friend-profile-column {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.friend-profile-column::-webkit-scrollbar {
    width: 6px;
}
.friend-profile-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

/* Stats grid */
.fm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.fm-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.fm-stat-value {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.fm-stat-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Activity chart (7-day) */
.fm-activity {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.fm-activity-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fm-activity-total {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 500;
}

.fm-activity-chart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    height: 80px;
}

.fm-activity-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.fm-activity-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: background 0.2s;
    position: relative;
}

.fm-activity-bar:hover {
    background: rgba(255, 255, 255, 0.4);
}

.fm-activity-bar::before {
    content: attr(data-xp) ' XP';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.fm-activity-bar:hover::before {
    opacity: 1;
}

.fm-activity-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 600;
}

/* Common quests */
.fm-quests-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fm-quest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.fm-quest-icon {
    font-size: 20px;
}

.fm-quest-name {
    flex: 1;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.fm-quest-score {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.friend-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: transparent;
    border: none;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.friend-list-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.friend-list-item.active {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.friend-list-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    flex-shrink: 0;
}

.friend-list-info {
    flex: 1;
}

.friend-list-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.friend-list-status {
    color: #ffffff;
    font-size: 12px;
    font-style: italic;
}

.friend-profile-column {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.friend-profile-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

.friend-profile-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.friend-profile-view {
    display: none;
}

.friend-profile-view.active {
    display: block;
}

.friend-profile-header-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
}

.friend-profile-top {
    display: flex;
    gap: 25px;
    align-items: center;
    margin-bottom: 20px;
}

.friend-profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    flex-shrink: 0;
    overflow: hidden;
}

.friend-profile-info-section {
    flex: 1;
}

.friend-profile-name-large {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.friend-profile-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.friend-profile-stats .is-online {
    color: rgba(134, 239, 172, 0.95);
}

.friend-profile-stats .is-offline {
    color: rgba(255, 255, 255, 0.45);
}

.friend-profile-actions {
    display: flex;
    gap: 10px;
}

.friend-action-btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.message-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.25);
}

.remove-friend-large-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.remove-friend-large-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pin-friend-large-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.pin-friend-large-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.25);
}

.friend-profile-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.friend-profile-section h3 {
    color: #fff;
    font-size: 20px;
    margin-bottom: 20px;
}

.friend-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.friend-achievement-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.friend-achievement-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.friend-achievement-name {
    font-size: 12px;
    color: #ddd;
}

/* ===== Friend modal: full profile sections ===== */
.friend-profile-bio {
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.fp-section-count {
    color: rgba(255, 255, 255, 0.45);
    font-size: 15px;
    font-weight: 600;
}

/* Favorite games inside the modal reuse .fav-game styles */
.fav-games-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Friend's friends mini-grid */
.fp-friends-mini {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.fp-friend-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.fp-friend-mini-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.fp-friend-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: flex-end;
    gap: 4px;
}

.fp-friend-mini-lvl {
    font-size: 11px;
    color: #ffffff;
}

.fp-empty-mini,
.fp-loading-mini {
    grid-column: 1 / -1;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    padding: 10px 0;
}

/* Guestbook inside the modal: keep it scrollable so the section doesn't grow forever */
.fp-guestbook .gb-list {
    max-height: 360px;
    overflow-y: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes acceptFriend {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        background: rgba(255, 255, 255, 0.15);
    }
    100% {
        transform: scale(1);
    }
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.friend-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.friend-item.pinned {
    display: flex !important;
}

.friend-item.unpinned {
    display: none !important;
}

/* Sidebar shows pinned friends only — pin/unpin is in All Friends modal */
.friends-sidebar .pin-friend-btn {
    display: none !important;
}

.friend-item > span {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pin-friend-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    position: relative;
}

.pin-friend-btn::before {
    content: 'P';
    font-size: 11px;
    filter: grayscale(1) brightness(2);
}

.friend-item:hover .pin-friend-btn {
    opacity: 0.8;
}

.friend-item.pinned .pin-friend-btn {
    opacity: 0.9;
}

.friend-item.pinned .pin-friend-btn::before {
    filter: none;
}

.pin-friend-btn:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.1);
}

.friend-item.pending-request {
    opacity: 0.65;
    background: rgba(255, 255, 255, 0.03);
}

.pending-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    flex: none !important;
    margin-right: 4px;
}

.cancel-request-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.cancel-request-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.remove-friend-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    width: 22px;
    height: 22px;
    border-radius: 6px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.friend-item:hover .remove-friend-btn {
    opacity: 0.7;
}

.remove-friend-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    opacity: 1 !important;
}

/* Friend avatar */
.friend-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.friend-avatar img,
.fm-friend-avatar img,
.friend-profile-avatar-large img,
.fp-friend-mini-avatar img,
.fsr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Friend info column (name + subtitle) */
.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.friend-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
}

.friend-name .dev-badge-wrap {
    flex: none;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
    align-self: center;
}

.friend-sub {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.coop-friend-presence.is-online {
    color: rgba(134, 239, 172, 0.95);
}

.coop-friend-presence.is-offline {
    color: rgba(255, 255, 255, 0.45);
}

.friend-sub.is-online {
    color: rgba(134, 239, 172, 0.9);
}

.friend-sub.is-offline {
    color: rgba(255, 255, 255, 0.42);
}

.profile-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 330px);
}

.profile-header {
    background: rgba(22, 26, 36, 0.94);
    padding: 0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.profile-hero-banner {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.profile-hero-banner-media {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center 22%;
    background-repeat: no-repeat;
    transform: scale(1.06);
    filter: blur(1px);
    transition: background-image 0.35s ease;
}

.profile-hero-banner-media:not(.has-image) {
    background-image: linear-gradient(135deg, #2a3142 0%, #171c28 52%, #0d1018 100%);
    filter: none;
    transform: none;
    inset: 0;
}

.profile-hero-banner-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.62) 42%,
        rgba(4, 6, 10, 0.88) 78%,
        rgba(24, 28, 38, 0.96) 100%
    );
    pointer-events: none;
}

.profile-hero-banner-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 128px;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        rgba(24, 28, 38, 0) 0%,
        rgba(24, 28, 38, 0.55) 45%,
        rgba(24, 28, 38, 0.92) 82%,
        rgb(24, 28, 38) 100%
    );
    pointer-events: none;
}

.profile-hero-content {
    position: relative;
    z-index: 2;
    padding: 30px 30px 34px;
}

.profile-header > .profile-section {
    padding: 18px 30px 0;
    position: relative;
    z-index: 2;
    margin-top: 0;
    border-top: none;
    background: rgb(24, 28, 38);
}

.profile-header > .profile-section + .profile-section {
    margin-top: 26px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-header > .profile-section.profile-achievements-section {
    background: rgb(24, 28, 38);
}

.profile-header > .profile-section.profile-ranks-section {
    background: transparent;
    border-top: none;
    margin-top: 10px;
    padding: 0 30px 30px;
}

.profile-header > .profile-section.profile-achievements-section + .profile-section.profile-ranks-section {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

.profile-ranks-section .ranks-grid {
    margin-top: 12px;
}

.profile-header > .profile-section:last-child {
    padding-bottom: 30px;
    border-radius: 0 0 10px 10px;
}

.profile-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-hero-content .profile-name,
.profile-hero-content .profile-level,
.profile-hero-content .profile-xp {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.profile-hero-content .profile-bio-block p {
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.profile-bio-block {
    margin-top: 20px;
    width: 100%;
}

.profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-rank-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    align-self: center;
}

.profile-name {
    font-size: 28px;
    color: #fff;
    margin: 0;
    font-weight: 700;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dev-badge-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.72em;
    height: 0.72em;
    min-width: 0.72em;
    min-height: 0.72em;
    flex-shrink: 0;
    align-self: flex-end;
    background: transparent;
    line-height: 0;
    vertical-align: bottom;
}

.profile-name .dev-badge-wrap {
    width: 0.65em;
    height: 0.65em;
    min-width: 0.65em;
    min-height: 0.65em;
}

/* profile hero: developer badge lives on the XP row, not beside the name */
.profile-name .dev-badge-wrap {
    display: none;
}

.dev-badge {
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.profile-level {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
}

.profile-xp-bar {
    margin: 0;
}

.profile-xp {
    margin: 0;
    font-size: 11px;
    line-height: 1.3;
}

.profile-xp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.profile-xp-row .profile-xp {
    flex: 1;
    min-width: 0;
}

.profile-dev-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.profile-dev-badge .dev-badge-wrap {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
}

.profile-dev-badge[hidden] {
    display: none !important;
}

.profile-section h3,
.profile-section-header h3 {
    font-size: 22px;
    color: #fff;
    font-weight: 700;
    margin: 0;
}

.view-all-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.view-all-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Achievements - Steam-style tile cards */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.achievement-card {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    cursor: default;
    transition: transform 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
    overflow: visible;
}

/* Pinned profile achievements: top glow like ranks */
.achievement-card.pinned {
    overflow: hidden;
    --ach-accent: #38bdf8;
    --ach-glow: rgba(56, 189, 248, 0.14);
    --ach-glow-hover: rgba(56, 189, 248, 0.34);
    --ach-border: rgba(56, 189, 248, 0.2);
    --ach-border-hover: rgba(56, 189, 248, 0.52);
}

.achievement-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 9px 9px 0 0;
    background: var(--ach-accent);
    opacity: 0.42;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.25s, box-shadow 0.25s;
}

.achievement-card.pinned::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(180deg, var(--ach-glow) 0%, transparent 100%);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.25s, background 0.25s;
}

.achievement-card.pinned.common {
    --ach-accent: #38bdf8;
    --ach-glow: rgba(34, 211, 238, 0.13);
    --ach-glow-hover: rgba(56, 189, 248, 0.32);
    --ach-border: rgba(56, 189, 248, 0.2);
    --ach-border-hover: rgba(56, 189, 248, 0.52);
    border-color: var(--ach-border);
}

.achievement-card.pinned.rare {
    --ach-accent: #60a5fa;
    --ach-glow: rgba(59, 130, 246, 0.13);
    --ach-glow-hover: rgba(96, 165, 250, 0.32);
    --ach-border: rgba(96, 165, 250, 0.2);
    --ach-border-hover: rgba(96, 165, 250, 0.52);
    border-color: var(--ach-border);
}

.achievement-card.pinned.epic {
    --ach-accent: #a78bfa;
    --ach-glow: rgba(124, 58, 237, 0.13);
    --ach-glow-hover: rgba(167, 139, 250, 0.32);
    --ach-border: rgba(167, 139, 250, 0.2);
    --ach-border-hover: rgba(167, 139, 250, 0.52);
    border-color: var(--ach-border);
}

.achievement-card.pinned.legendary {
    --ach-accent: #d4d8e0;
    --ach-glow: rgba(212, 216, 224, 0.14);
    --ach-glow-hover: rgba(212, 216, 224, 0.38);
    --ach-border: rgba(212, 216, 224, 0.22);
    --ach-border-hover: rgba(212, 216, 224, 0.58);
    border-color: var(--ach-border);
    box-shadow: 0 0 18px rgba(212, 216, 224, 0.06);
}

.achievement-card.pinned.legendary::before {
    background: linear-gradient(90deg, #9aa0ac, #d4d8e0, #ffffff);
}

.achievement-card.pinned:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ach-border-hover);
    z-index: 5;
}

.achievement-card.pinned:hover::before {
    opacity: 1;
    box-shadow: 0 0 14px var(--ach-accent);
}

.achievement-card.pinned:hover::after {
    opacity: 1;
    background: linear-gradient(180deg, var(--ach-glow-hover) 0%, transparent 72%);
}

.achievement-card.pinned.legendary:hover {
    box-shadow: 0 0 22px rgba(212, 216, 224, 0.14);
}

.achievement-card.pinned.legendary:hover::before {
    box-shadow: 0 0 16px rgba(212, 216, 224, 0.55);
}

.achievement-card:not(.pinned):hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.achievement-icon {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.25s;
    overflow: hidden;
}

.achievement-icon .achievement-img,
.am-icon .achievement-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.achievement-card:hover .achievement-icon,
.achievement-card.pinned:hover .achievement-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.achievement-name {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.achievement-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    line-height: 1.25;
}

/* Locked (not yet earned) achievements in the profile preview */
.achievement-card.locked { opacity: 0.4; }
.achievement-card.locked .achievement-icon { filter: grayscale(1); }
.achievement-card.locked .achievement-icon .achievement-img { filter: grayscale(1); }
.achievement-card.locked:hover {
    opacity: 0.65;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}
.achievement-card.locked:hover .achievement-icon { transform: none; }

.achievement-slot-empty {
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.achievement-slot-empty::before {
    display: none;
}

.achievement-slot-empty:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.32);
    border-style: dashed;
}

.achievement-slot-readonly {
    cursor: default;
    pointer-events: none;
    opacity: 0.35;
}

.achievement-slot-readonly:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.16);
}

.achievement-slot-plus {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1;
    transition: all 0.25s;
}

.achievement-slot-empty:hover .achievement-slot-plus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
}

.achievement-slot-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    transition: color 0.25s;
}

.achievement-slot-empty:hover .achievement-slot-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Achievement requirement tooltip (shown on hover) */
.ach-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    min-width: 140px;
    max-width: 200px;
    padding: 8px 10px;
    background: rgba(18, 18, 18, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ach-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(18, 18, 18, 0.96);
}

.achievement-card:hover .ach-tooltip,
.am-card:hover .ach-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Modal cards: tooltip below so the top row is not clipped */
.am-card .ach-tooltip,
.achievement-card.pinned .ach-tooltip {
    bottom: auto;
    top: calc(100% + 10px);
    z-index: 40;
}

.am-card .ach-tooltip::after,
.achievement-card.pinned .ach-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: rgba(18, 18, 18, 0.96);
}

/* ===== GUESTBOOK v2 - Twitter-style ===== */
.guestbook-section {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
}

.gb-container {
    display: flex;
    flex-direction: column;
}

.gb-composer {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    transition: border-color 0.25s;
}

.gb-composer:focus-within {
    border-color: rgba(255, 255, 255, 0.35);
}

.gb-composer-top {
    display: flex;
    gap: 12px;
}

.gb-composer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.gb-composer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gb-composer-fields {
    flex: 1;
    min-width: 0;
}

.gb-composer-name {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 0;
    display: inline-flex;
    align-items: flex-end;
    gap: 6px;
}

.gb-text-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    resize: none;
    padding: 8px 0 4px;
    min-height: 40px;
    max-height: 140px;
    font-family: inherit;
    line-height: 1.5;
}

.gb-text-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.gb-composer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gb-counter-input {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
}

.gb-counter-input.warn { color: rgba(255, 255, 255, 0.85); }
.gb-counter-input.over { color: rgba(255, 255, 255, 1); }

.gb-send-btn {
    padding: 8px 22px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.gb-send-btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

.gb-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* List header */
.gb-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 6px;
}

.gb-sort {
    display: flex;
    gap: 4px;
}

.gb-sort-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.gb-sort-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.04);
}

.gb-sort-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.gb-total {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Messages */
.gb-list {
    display: flex;
    flex-direction: column;
}

.gb-msg {
    display: flex;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    animation: gbFade 0.3s ease;
}

@keyframes gbFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.gb-msg:last-child {
    border-bottom: none;
}

.gb-msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.gb-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gb-msg-body {
    flex: 1;
    min-width: 0;
}

.gb-msg-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.gb-msg-name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: flex-end;
    gap: 5px;
}

.gb-msg-handle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.gb-msg-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.gb-msg-time::before {
    content: '·';
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.3);
}

.gb-msg-text {
    color: rgba(255, 255, 255, 0.92);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.gb-msg-actions {
    display: flex;
    gap: 4px;
    margin-left: -8px;
}

.gb-action {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    padding: 6px 8px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    font-family: inherit;
}

.gb-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.gb-action.liked {
    color: #fff;
}

.gb-action.liked .gb-action-icon {
    transform: scale(1.1);
}

.gb-action-icon {
    font-size: 13px;
    transition: transform 0.2s;
}

.gb-action-count {
    font-variant-numeric: tabular-nums;
}

.gb-msg-delete {
    position: absolute;
    top: 14px;
    right: 4px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: all 0.2s;
}

.gb-msg:hover .gb-msg-delete {
    opacity: 1;
}

.gb-msg-delete:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.gb-empty {
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.gb-empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.gb-empty-text {
    font-size: 14px;
}
/* ===== END GUESTBOOK v2 ===== */

.ranks-section {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Ranks - tile cards like achievements */
.ranks-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.rank-badge {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    padding: 12px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    cursor: default;
    transition: transform 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
    overflow: hidden;
    width: auto;
    height: auto;
    font-weight: 600;
    font-size: 11px;
    --rank-accent: #38bdf8;
    --rank-glow: rgba(56, 189, 248, 0.14);
    --rank-glow-hover: rgba(56, 189, 248, 0.34);
    --rank-border: rgba(56, 189, 248, 0.2);
    --rank-border-hover: rgba(56, 189, 248, 0.52);
}

.rank-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 9px 9px 0 0;
    background: var(--rank-accent);
    opacity: 0.42;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.25s, box-shadow 0.25s;
}

.rank-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52%;
    background: linear-gradient(180deg, var(--rank-glow) 0%, transparent 100%);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.25s, background 0.25s;
}

.rank-badge.rank-epic {
    --rank-accent: #38bdf8;
    --rank-glow: rgba(34, 211, 238, 0.13);
    --rank-glow-hover: rgba(56, 189, 248, 0.32);
    --rank-border: rgba(56, 189, 248, 0.2);
    --rank-border-hover: rgba(56, 189, 248, 0.52);
    border-color: var(--rank-border);
}

.rank-badge.rank-warrior {
    --rank-accent: #60a5fa;
    --rank-glow: rgba(59, 130, 246, 0.13);
    --rank-glow-hover: rgba(96, 165, 250, 0.32);
    --rank-border: rgba(96, 165, 250, 0.2);
    --rank-border-hover: rgba(96, 165, 250, 0.52);
    border-color: var(--rank-border);
}

.rank-badge.rank-grandmaster {
    --rank-accent: #818cf8;
    --rank-glow: rgba(99, 102, 241, 0.13);
    --rank-glow-hover: rgba(129, 140, 248, 0.32);
    --rank-border: rgba(129, 140, 248, 0.2);
    --rank-border-hover: rgba(129, 140, 248, 0.52);
    border-color: var(--rank-border);
}

.rank-badge.rank-master {
    --rank-accent: #a78bfa;
    --rank-glow: rgba(124, 58, 237, 0.13);
    --rank-glow-hover: rgba(167, 139, 250, 0.32);
    --rank-border: rgba(167, 139, 250, 0.2);
    --rank-border-hover: rgba(167, 139, 250, 0.52);
    border-color: var(--rank-border);
}

.rank-badge.rank-elite {
    --rank-accent: #d4d8e0;
    --rank-glow: rgba(212, 216, 224, 0.14);
    --rank-glow-hover: rgba(212, 216, 224, 0.38);
    --rank-border: rgba(212, 216, 224, 0.22);
    --rank-border-hover: rgba(212, 216, 224, 0.58);
    border-color: var(--rank-border);
    box-shadow: 0 0 18px rgba(212, 216, 224, 0.06);
}

.rank-badge.rank-elite::before {
    background: linear-gradient(90deg, #9aa0ac, #d4d8e0, #ffffff);
}

.rank-badge:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--rank-border-hover);
}

.rank-badge:hover::before {
    opacity: 1;
    box-shadow: 0 0 14px var(--rank-accent);
}

.rank-badge:hover::after {
    opacity: 1;
    background: linear-gradient(180deg, var(--rank-glow-hover) 0%, transparent 72%);
}

.rank-badge.rank-elite:hover {
    box-shadow: 0 0 22px rgba(212, 216, 224, 0.14);
}

.rank-badge.rank-elite:hover::before {
    box-shadow: 0 0 16px rgba(212, 216, 224, 0.55);
}

/* Inner circular icon container (mirrors achievement-icon) */
.rank-badge .rank-icon,
.rank-badge .rank-img {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.25s;
    object-fit: cover;
}

.rank-badge img.rank-img {
    background: rgba(255, 255, 255, 0.06);
}

.rank-badge:hover .rank-icon,
.rank-badge:hover .rank-img {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.rank-badge .rank-name {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: 0;
}

/* Locked (not yet earned) ranks: muted but readable */
.rank-badge.locked {
    filter: grayscale(0.75) brightness(0.88);
    opacity: 0.78;
}

.rank-badge.locked .rank-name {
    color: rgba(255, 255, 255, 0.72);
}

.rank-badge.locked::before {
    background: rgba(255, 255, 255, 0.22) !important;
    opacity: 0.45 !important;
    box-shadow: none !important;
}

.rank-badge.locked::after {
    display: block;
    opacity: 0.25;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 100%);
}

.rank-badge.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    opacity: 0.88;
}

.rank-badge.locked:hover::before {
    opacity: 0.55 !important;
    box-shadow: none !important;
}

.rank-badge.locked:hover .rank-icon,
.rank-badge.locked:hover .rank-img {
    transform: none;
}

        .challenges-sidebar {
    width: 350px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 10px;
    height: calc(100vh - 330px);
    
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.challenges-sidebar.profile-board-sidebar {
    height: calc(100vh - 330px);
    max-height: none;
    overflow: hidden;
    align-self: auto;
    position: static;
    top: auto;
    padding: 16px 18px;
}

.challenges-sidebar.profile-board-sidebar h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

.challenges-sidebar.profile-board-sidebar .stats-section + .stats-section {
    margin-top: 12px;
    padding-top: 12px;
}

.challenges-sidebar.profile-board-sidebar .stats-section-header {
    margin-bottom: 6px;
}

.challenges-sidebar.profile-board-sidebar .stats-section-title {
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.9px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-users {
    gap: 3px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-user {
    padding: 4px 8px;
    gap: 7px;
    border-radius: 6px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-rank {
    width: 14px;
    font-size: 11px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-name {
    font-size: 12px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-xp,
.challenges-sidebar.profile-board-sidebar .profile-top-you {
    font-size: 10px;
}

.challenges-sidebar.profile-board-sidebar .profile-top-empty,
.challenges-sidebar.profile-board-sidebar .fav-game-empty {
    padding: 8px;
    font-size: 11px;
}

.challenges-sidebar.profile-board-sidebar .fav-game {
    padding: 5px 8px;
    gap: 8px;
    margin-bottom: 2px;
}

.challenges-sidebar.profile-board-sidebar .fav-game-icon {
    width: 44px;
    height: 26px;
}

.challenges-sidebar.profile-board-sidebar .fav-game-name {
    font-size: 11px;
}

.challenges-sidebar.profile-board-sidebar .fav-game-stats {
    font-size: 9px;
}

.challenges-sidebar.profile-board-sidebar .profile-social-list {
    gap: 4px;
}

.challenges-sidebar.profile-board-sidebar .profile-social-link {
    gap: 8px;
    padding: 2px 0;
    font-size: 11px;
}

.challenges-sidebar.profile-board-sidebar .profile-social-icon {
    width: 24px;
    height: 24px;
}

.challenges-sidebar h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 600;
    flex-shrink: 0;
}

.challenge-item {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.challenge-item:last-child {
    border-bottom: none;
}

.challenge-title {
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
}

.challenge-desc {
    font-size: 13px;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.challenge-progress {
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 8px;
}

/* Compact version for Quests page (same width as filters) */
.challenges-sidebar-compact {
    width: 200px !important;
    padding: 18px !important;
    height: fit-content !important;
    position: sticky;
    top: 90px;
    flex-shrink: 0;
    max-height: calc(100vh - 110px);
}

.challenges-sidebar-compact h3 {
    font-size: 16px;
    margin-bottom: 14px;
}

.challenges-sidebar-compact .challenge-item {
    padding: 10px 0;
}

.challenges-sidebar-compact .challenge-title {
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.35;
}

.challenges-sidebar-compact .challenge-desc {
    font-size: 11px;
}

.challenges-sidebar-compact .challenge-item p {
    font-size: 12px !important;
}

#quests-stats-sidebar h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}

.quests-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.quests-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 8px;
}

.quests-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    line-height: 1.35;
}

.quests-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: #c8b6ff;
    flex-shrink: 0;
}

.quests-stat-divider {
    height: 1px;
    margin: 10px 0 12px;
    background: rgba(255, 255, 255, 0.12);
}

.quests-stat-level-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.quests-stat-xp-left {
    font-size: 12px;
    color: #ddd;
    margin-bottom: 8px;
}

.quests-stat-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-bottom: 6px;
}

.quests-stat-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c5cff, #b06cff);
    transition: width 0.35s ease;
}

.quests-stat-xp-sub {
    font-size: 11px;
    color: #aaa;
}

.activity-log {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
}

.activity-log::-webkit-scrollbar {
    width: 6px;
}

.activity-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.activity-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* === STATS: Favorite Games & Social === */
.stats-section {
    margin-bottom: 0;
}

.stats-section + .stats-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.stats-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stats-section-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
}

.fav-game-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-style: italic;
    padding: 12px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.profile-top-all-btn {
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.profile-top-all-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.profile-top-users {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-top-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-style: italic;
    padding: 12px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.profile-top-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.profile-top-user:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
}

.profile-top-user.is-me {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.profile-top-rank {
    width: 18px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.profile-top-rank.is-1 { color: #fbbf24; }
.profile-top-rank.is-2 { color: #d1d5db; }
.profile-top-rank.is-3 { color: #d97706; }

.profile-top-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-top-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-top-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-top-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-top-you {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 500;
}

.profile-top-xp {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* === Settings: Favorite games picker (inline) === */
.settings-section-hint {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    line-height: 1.5;
    margin: -4px 0 16px;
}

.settings-fav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.settings-fav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s;
}

.settings-fav-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-fav-card.selected {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.45);
}

.settings-fav-head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.settings-fav-icon {
    width: 72px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.settings-fav-name {
    flex: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.settings-fav-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.settings-fav-card.selected .settings-fav-rank {
    display: flex;
}

.settings-fav-desc-input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-fav-desc-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.35);
}

.settings-fav-desc-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.settings-ach-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.settings-ach-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s;
}

.settings-ach-card:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.settings-ach-card.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.settings-ach-card.locked {
    opacity: 0.42;
    filter: grayscale(0.85);
}

.settings-ach-head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.settings-ach-card.locked .settings-ach-head {
    cursor: not-allowed;
}

.settings-ach-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.settings-ach-icon .achievement-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.settings-ach-info {
    flex: 1;
    min-width: 0;
}

.settings-ach-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-ach-rarity {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-ach-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.settings-ach-card.selected .settings-ach-rank {
    display: flex;
}

.settings-ach-card.common.selected { border-color: rgba(56, 189, 248, 0.45); }
.settings-ach-card.rare.selected { border-color: rgba(96, 165, 250, 0.45); }
.settings-ach-card.epic.selected { border-color: rgba(167, 139, 250, 0.45); }
.settings-ach-card.legendary.selected { border-color: rgba(212, 216, 224, 0.5); }

.fav-game {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
    margin-bottom: 4px;
}

.fav-game:hover {
    background: rgba(255, 255, 255, 0.05);
}

.fav-game-icon {
    width: 56px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.fav-game-icon img,
.settings-fav-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.fav-game-info {
    flex: 1;
    min-width: 0;
}

.fav-game-name {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-game-stats {
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    line-height: 1.3;
    margin-top: 2px;
}

.fav-game-medal {
    font-size: 16px;
    opacity: 0.85;
}

.profile-social-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-social-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    line-height: 1.4;
    font-style: italic;
}

.profile-social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s;
}

.profile-social-link:hover {
    opacity: 0.85;
    transform: translateX(2px);
}

.profile-social-icon,
.settings-social-label-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.profile-social-icon svg,
.settings-social-label-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.social-icon-discord { background: #5865F2; }
.social-icon-telegram { background: #26A5E4; }
.social-icon-twitter { background: #000000; }
.social-icon-youtube { background: #FF0000; }
.social-icon-twitch { background: #9146FF; }
.social-icon-instagram {
    background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #8134af 100%);
}
.social-icon-steam { background: #171a21; }

.profile-social-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-social-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-social-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: center;
}

.settings-social-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
}

.settings-social-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.settings-social-input:focus {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.09);
}

.settings-social-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 720px) {
    .settings-social-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(5px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}

.activity-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

@media (max-width: 1024px) {
    .leaderboard-container,
    .quests-layout,
    .profile-layout {
        flex-direction: column;
    }

    .filters-sidebar,
    .quests-filters,
    .friends-sidebar,
    .challenges-sidebar {
        width: 100%;
    }

    .quests-filters {
        position: static;
    }

    .quests-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .quests-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quests-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 32px;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .player-row,
    .table-header {
        grid-template-columns: 50px 1fr 100px;
        font-size: 12px;
    }

    .player-row .xp,
    .player-row .progress-bar,
    .table-header :nth-child(4),
    .table-header :nth-child(5) {
        display: none;
    }
}

/* ===== REAL FRIENDS: search dropdown + requests ===== */
.friends-empty-hint {
    padding: 16px 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    line-height: 1.5;
}

.friend-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    overflow: hidden;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.fsr-hint {
    padding: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.fsr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fsr-item:last-child { border-bottom: none; }

.fsr-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    overflow: hidden;
}

.fsr-info { flex: 1; min-width: 0; }

.fsr-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
}

.fsr-name .dev-badge-wrap {
    flex: none;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
}

.fsr-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.fsr-add {
    background: rgba(255, 255, 255, 0.92);
    color: #14141e;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.fsr-add:hover:not(:disabled) { transform: translateY(-1px); }

.fsr-add:disabled {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    cursor: default;
}

/* Friend level badge (replaces pin/remove buttons in the sidebar) */
.friend-level-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* Incoming request row */
.friend-item.incoming-request {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.friend-item.incoming-request .friend-avatar::after { display: none; }

.accept-friend-btn,
.decline-friend-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}

.accept-friend-btn {
    background: rgba(80, 220, 120, 0.85);
    color: #06301a;
    font-weight: 700;
}

.accept-friend-btn:hover { background: #6ef0a0; }

.decline-friend-btn {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.decline-friend-btn:hover {
    background: rgba(255, 90, 90, 0.7);
    color: #fff;
}

/* Dynamic quest grids — pagination */
.quests-load-more {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.quests-load-more:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.showcase-emoji-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.quest-image-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.quest-image-initial .quest-initial {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== AST hidden admin panel ===== */
#ast-admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#ast-admin-overlay.active {
    display: flex;
}

.ast-admin-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-radius: 16px;
    background: rgba(18, 16, 8, 0.92);
    border: 1px solid rgba(255, 200, 60, 0.35);
    box-shadow: 0 0 40px rgba(255, 180, 0, 0.18), 0 20px 60px rgba(0, 0, 0, 0.6);
    color: #f6e7c0;
}

.ast-admin-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: rgba(246, 231, 192, 0.6);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.ast-admin-close:hover {
    color: #ffd76b;
    background: rgba(255, 215, 107, 0.1);
}

.ast-admin-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ast-admin-orb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 16px rgba(255, 190, 0, 0.5);
}

.ast-admin-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffd76b;
}

.ast-admin-sub {
    font-size: 12px;
    color: rgba(246, 231, 192, 0.55);
}

.ast-admin-total {
    margin-left: auto;
    font-size: 20px;
    font-weight: 700;
    color: #ffd76b;
    white-space: nowrap;
}

.ast-admin-grant {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ast-admin-grant input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 200, 60, 0.25);
    border-radius: 8px;
    color: #f6e7c0;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
}

.ast-admin-grant #ast-grant-name {
    flex: 1;
    min-width: 120px;
}

.ast-admin-grant #ast-grant-amount {
    width: 70px;
}

.ast-admin-grant button {
    border: 1px solid rgba(255, 200, 60, 0.4);
    background: rgba(255, 200, 60, 0.12);
    color: #ffd76b;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ast-admin-grant button:hover {
    background: rgba(255, 200, 60, 0.22);
}

.ast-admin-status {
    font-size: 13px;
    min-height: 16px;
    color: #ffd76b;
}

.ast-admin-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

.ast-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.ast-admin-row:nth-child(odd) {
    background: rgba(255, 200, 60, 0.06);
}

.ast-admin-name {
    font-size: 14px;
    color: #f6e7c0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ast-admin-bal {
    font-size: 15px;
    font-weight: 700;
    color: #ffd76b;
    margin-left: 12px;
}

.ast-admin-empty {
    text-align: center;
    padding: 18px;
    color: rgba(246, 231, 192, 0.5);
    font-size: 14px;
}

/* stats */
.ast-admin-stats {
    display: flex;
    gap: 8px;
}

.ast-stat {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    border-radius: 10px;
    background: rgba(255, 200, 60, 0.07);
    border: 1px solid rgba(255, 200, 60, 0.16);
}

.ast-stat span {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffd76b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ast-stat label {
    font-size: 11px;
    color: rgba(246, 231, 192, 0.55);
}

/* toolbar */
.ast-admin-toolbar {
    display: flex;
    gap: 8px;
}

.ast-admin-toolbar #ast-search {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 200, 60, 0.25);
    border-radius: 8px;
    color: #f6e7c0;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
}

.ast-admin-toolbar button {
    border: 1px solid rgba(255, 200, 60, 0.3);
    background: rgba(255, 200, 60, 0.1);
    color: #ffd76b;
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ast-admin-toolbar #ast-info-btn {
    width: 38px;
    flex-shrink: 0;
}

.ast-admin-toolbar button:hover {
    background: rgba(255, 200, 60, 0.2);
}

/* info */
.ast-admin-info {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 200, 60, 0.18);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(246, 231, 192, 0.82);
    max-height: 240px;
    overflow-y: auto;
}

.ast-admin-info p { margin: 0 0 8px; }
.ast-admin-info ul { margin: 0 0 8px; padding-left: 18px; }
.ast-admin-info li { margin-bottom: 3px; }
.ast-info-h {
    color: #ffd76b;
    font-weight: 700;
    margin-top: 4px !important;
}

.ast-tier-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ast-tier-li {
    display: grid;
    grid-template-columns: 96px 42px 1fr;
    align-items: center;
    gap: 8px;
}

.ast-tier-range {
    font-size: 12px;
    color: rgba(246, 231, 192, 0.6);
}

.ast-tier-desc {
    font-size: 12px;
    color: rgba(246, 231, 192, 0.6);
}

/* tier badge */
.ast-tier-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid transparent;
}

.ast-tier-spark         { color: #d8c089; background: rgba(216, 192, 137, 0.12); border-color: rgba(216, 192, 137, 0.3); }
.ast-tier-shard         { color: #e0b85a; background: rgba(224, 184, 90, 0.14); border-color: rgba(224, 184, 90, 0.35); }
.ast-tier-core          { color: #ffcf5a; background: rgba(255, 207, 90, 0.16); border-color: rgba(255, 207, 90, 0.4); }
.ast-tier-orb           { color: #ffd76b; background: rgba(255, 215, 107, 0.2); border-color: rgba(255, 215, 107, 0.5); }
.ast-tier-constellation { color: #fff0b8; background: rgba(255, 200, 60, 0.26); border-color: rgba(255, 200, 60, 0.6); }
.ast-tier-singularity   { color: #1a1305; background: linear-gradient(135deg, #ffe89a, #ffba00); border-color: #ffba00; }
.ast-tier-none          { color: rgba(246, 231, 192, 0.4); background: rgba(255, 255, 255, 0.04); }

/* mass actions */
.ast-admin-mass {
    display: flex;
    gap: 8px;
}

.ast-admin-mass #ast-mass-amount {
    width: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 200, 60, 0.25);
    border-radius: 8px;
    color: #f6e7c0;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
}

.ast-admin-mass button {
    flex: 1;
    border: 1px solid rgba(255, 200, 60, 0.4);
    background: rgba(255, 200, 60, 0.12);
    color: #ffd76b;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.ast-admin-mass button:hover { background: rgba(255, 200, 60, 0.22); }

/* row layout with inline buttons + tier */
.ast-admin-row {
    display: grid;
    grid-template-columns: 104px 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.ast-row-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1px solid rgba(255, 200, 60, 0.3);
    background: rgba(255, 200, 60, 0.1);
    color: #ffd76b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.ast-row-btn:hover { background: rgba(255, 200, 60, 0.25); }

.ast-admin-bal {
    min-width: 48px;
    text-align: right;
}

/* ===================== COMMUNITY QUESTS ===================== */

/* Full page: preview / play / create (community + game quests) */
.quest-play-page,
.community-quest-page {
    display: none;
    padding: 40px 0 80px;
}
.quest-play-page.active,
.community-quest-page.active {
    display: block;
}
.cq-page-shell {
    max-width: 720px;
    margin: 0 auto;
}
.cq-page-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.cq-page-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}
.cq-page-header {
    margin-bottom: 22px;
}
.cq-page-header-compact {
    margin-bottom: 16px;
}
.cq-page-title {
    margin: 0 0 6px;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}
.cq-page-sub {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
}
.cq-play-card,
.cq-editor-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.cq-page-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cq-create-btn {
    margin-left: auto;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(124, 92, 255, 0.5);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.25), rgba(56, 189, 248, 0.18));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cq-create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(124, 92, 255, 0.35);
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.4), rgba(56, 189, 248, 0.3));
}

.cq-empty {
    padding: 26px 18px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.92rem;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

/* Community quest cards reuse the standard .quest-card look.
   Preview uses the shared #quest-modal; only delete needs extra rules. */
.cq-quest-card.is-done { box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.35); }
.cq-quest-card .quest-actions { grid-template-columns: 1fr; }

.cq-del-btn {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.32);
    color: #fca5a5;
}
.cq-del-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
}

.cq-preview-list {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cq-preview-list li {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    line-height: 1.4;
}
.cq-preview-qnum {
    color: #a78bfa;
    font-weight: 700;
    margin-right: 6px;
}
.cq-preview-more {
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
    border-style: dashed;
}

/* ----- shared modal ----- */
.cq-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(5, 6, 14, 0.74);
    backdrop-filter: blur(6px);
}
.cq-modal-overlay.active { display: flex; }

.cq-modal, .cq-play {
    position: relative;
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 26px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(160deg, rgba(24, 24, 40, 0.98), rgba(16, 16, 28, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.cq-play { max-width: 520px; }

.cq-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}
.cq-modal-close:hover { background: rgba(255, 255, 255, 0.14); }

.cq-modal-title { margin: 0 0 4px; color: #fff; font-size: 1.3rem; }
.cq-modal-sub { margin: 0 0 18px; color: rgba(255, 255, 255, 0.55); font-size: 0.88rem; }

.cq-field { margin-bottom: 14px; }
.cq-field label { display: block; margin-bottom: 5px; font-size: 0.8rem; color: rgba(255, 255, 255, 0.7); font-weight: 600; }
.cq-opt { color: rgba(255, 255, 255, 0.4); font-weight: 400; }
.cq-field input[type="text"],
.cq-field textarea,
.cq-q-text, .cq-q-explain, .cq-opt-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
}
.cq-field input:focus,
.cq-field textarea:focus,
.cq-q-text:focus, .cq-q-explain:focus, .cq-opt-input:focus {
    outline: none;
    border-color: rgba(124, 92, 255, 0.6);
    background: rgba(124, 92, 255, 0.08);
}
.cq-field-row { display: flex; gap: 12px; }
.cq-diff-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.cq-diff-hint {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}
.cq-field-emoji { flex: 0 0 76px; }
.cq-field-emoji input { text-align: center; font-size: 1.3rem; }
.cq-field-title { flex: 1 1 auto; }

.cq-questions-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0 10px;
    font-weight: 700;
    color: #fff;
}
.cq-qcount { font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); font-weight: 500; }

.cq-q-card {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 12px;
}
.cq-q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cq-q-num { font-weight: 700; color: #a78bfa; font-size: 0.85rem; }
.cq-q-del {
    border: none;
    background: none;
    color: #fca5a5;
    cursor: pointer;
    font-size: 0.78rem;
}
.cq-q-del:hover { text-decoration: underline; }
.cq-q-text { margin-bottom: 10px; }
.cq-opts-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
}
.cq-opts-hint {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.72rem;
}
.cq-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cq-opt-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.cq-opt-row.is-correct-pick {
    border-color: rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
}
.cq-mark-correct {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.45);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cq-mark-correct:hover {
    border-color: rgba(34, 197, 94, 0.5);
    color: #86efac;
}
.cq-mark-correct.active {
    border-color: rgba(34, 197, 94, 0.65);
    background: rgba(34, 197, 94, 0.22);
    color: #86efac;
}
.cq-correct-field { margin-top: 10px; margin-bottom: 10px; }
.cq-correct-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
}
.cq-correct-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    color: #fff;
    font-size: 0.9rem;
    font-family: inherit;
}
.cq-correct-select:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.65);
    background: rgba(34, 197, 94, 0.12);
}
.cq-opt-input { flex: 1 1 auto; }
.cq-opt-del {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 0.72rem;
}
.cq-add-opt, .cq-add-q {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.75);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}
.cq-add-opt { margin-bottom: 8px; }
.cq-add-q { display: block; width: 100%; margin-bottom: 16px; }
.cq-add-opt:hover, .cq-add-q:hover { border-color: rgba(124, 92, 255, 0.5); color: #fff; }
.cq-q-explain { margin-top: 4px; }

.cq-modal-foot { display: flex; gap: 10px; justify-content: flex-end; }
.cq-btn-primary {
    padding: 10px 20px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, #7c5cff, #38bdf8);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
}
.cq-btn-primary:hover { filter: brightness(1.1); }
.cq-btn-primary:disabled { opacity: 0.6; cursor: default; }
.cq-btn-ghost {
    padding: 10px 18px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}
.cq-btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ----- player ----- */
.cq-play-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.cq-play-name { font-weight: 700; color: #fff; font-size: 0.95rem; }
.cq-play-progress { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); white-space: nowrap; }
.cq-play-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-bottom: 18px; }
.cq-play-bar span { display: block; height: 100%; background: linear-gradient(90deg, #7c5cff, #38bdf8); transition: width 0.3s ease; }
.cq-play-q { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 16px; line-height: 1.4; }
.cq-play-opts { display: flex; flex-direction: column; gap: 10px; }
.cq-play-opt {
    text-align: left;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.cq-play-opt:hover:not(:disabled) { border-color: rgba(124, 92, 255, 0.55); background: rgba(124, 92, 255, 0.1); }
.cq-play-opt:disabled { cursor: default; }
.cq-play-opt.is-correct { border-color: #22c55e; background: rgba(34, 197, 94, 0.18); }
.cq-play-opt.is-wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.16); }
.cq-play-explain {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 11px;
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    line-height: 1.45;
}
.cq-play-next { margin-top: 18px; width: 100%; }

.cq-result { text-align: center; padding: 18px 6px; }
.cq-result-emoji { font-size: 3rem; margin-bottom: 8px; }
.cq-result-title { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 6px; }
.cq-result-score { color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; margin-bottom: 10px; }
.cq-result-xp { font-size: 1.3rem; font-weight: 800; color: #fbbf24; margin-bottom: 20px; }
.cq-result-xp-muted { font-size: 0.9rem; font-weight: 600; color: rgba(255, 255, 255, 0.5); }
.cq-result-actions { display: flex; gap: 10px; justify-content: center; }
