/* ══════════════════════════════════════════════════════════════════════════
 * css/achievements.css — OnlineRealGames Exciting Gaming Challenge Experience
 * ══════════════════════════════════════════════════════════════════════════
 * Design Aesthetics:
 * - Authentic OnlineRealGames Identity: Warm cream & crisp white gaming surfaces
 * - Signature Red & Coral branding (#e62327, #f43f5e)
 * - Extended vibrant palette: Gold (rewards), Purple (epic), Blue (exploration),
 *   Emerald (completed), and Coral (streaks)
 * - Connected 8-milestone Adventure Path with custom illustrated SVG artwork
 * - "Today's Gaming Quest" prominent challenge card with real server progress
 * - Distinct 7-day activity calendar & countdown timer
 * - Full-width Exploration Quests with on-card completion indicators
 * - Accessible modals (Badge details, Celebratory unlock with sparkles, Points ledger)
 * - Zero unwanted bottom void: compact footer spacing and safe z-index
 * - Completely responsive across all viewports (320px to 1920px)
 * ══════════════════════════════════════════════════════════════════════════ */

:root {
    --ach-bg-base: #fcfbf9;
    --ach-bg-surface: #ffffff;
    --ach-bg-surface-soft: #f8fafc;
    --ach-bg-surface-elevated: #ffffff;
    
    --ach-border-subtle: #e2e8f0;
    --ach-border-strong: #cbd5e1;
    --ach-border-focus: #6366f1;

    --ach-text-main: #0f172a;
    --ach-text-muted: #475569;
    --ach-text-dim: #64748b;

    /* Theme Accent Colors */
    --ach-red: #e62327;
    --ach-red-hover: #b91c1c;
    --ach-coral: #f43f5e;
    --ach-coral-light: #fff1f2;
    --ach-gold: #f59e0b;
    --ach-gold-light: #fffbeb;
    --ach-gold-glow: rgba(245, 158, 11, 0.35);
    --ach-blue: #0284c7;
    --ach-cyan: #0284c7;
    --ach-cyan-light: #f0f9ff;
    --ach-emerald: #059669;
    --ach-emerald-light: #ecfdf5;
    --ach-purple: #7c3aed;
    --ach-purple-light: #f5f3ff;
    
    --ach-radius-sm: 8px;
    --ach-radius-md: 14px;
    --ach-radius-lg: 20px;
    --ach-radius-xl: 26px;
    
    --ach-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --ach-shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.6);
    --ach-shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(226, 232, 240, 0.8);
    --ach-shadow-glow: 0 0 24px rgba(245, 158, 11, 0.28);
}

/* ─── BASE PORTAL CONTAINER — FULL VIEWPORT EXPANSION ───────────── */
body.page-achievements .layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-achievements .main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.ach-portal {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    background-color: var(--ach-bg-base);
    font-family: var(--ff-body, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    color: var(--ach-text-main);
    /* Large desktop edge padding (16-24px per side): 20px top, 24px sides, 28px bottom */
    padding: 20px 24px 28px;
}

/* Wide desktop (>= 1600px): Uses full available space below header */
@media (min-width: 1600px) {
    .ach-portal {
        padding: 24px 24px 32px;
    }
}

/* Standard laptop (1024px to 1439px): 16-18px per side */
@media (max-width: 1439px) {
    .ach-portal {
        padding: 18px 18px 26px;
    }
}

/* Tablet (769px to 1023px): 12-14px per side */
@media (max-width: 1023px) {
    .ach-portal {
        padding: 16px 14px 22px;
    }
}

/* Mobile (< 768px): 10px per side */
@media (max-width: 768px) {
    .ach-portal {
        padding: 14px 10px 18px;
    }
}

/* Narrow mobile (<= 380px): 8px per side */
@media (max-width: 380px) {
    .ach-portal {
        padding: 10px 8px 14px;
    }
}

/* ─── COMMON BUTTONS & PILLS ────────────────────────────────────── */
.ach-btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--ach-red), #cc1e22);
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 700;
    padding: 11px 24px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(230, 35, 39, 0.25);
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}
.ach-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 35, 39, 0.38);
    color: #ffffff !important;
}
.ach-btn-save:focus-visible {
    outline: 2px solid var(--ach-red);
    outline-offset: 2px;
}

.ach-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #ffffff;
    color: var(--ach-text-main) !important;
    font-size: 17px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--ach-border-subtle);
    cursor: pointer;
    box-shadow: var(--ach-shadow-sm);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}
.ach-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}
.ach-btn-secondary:focus-visible {
    outline: 2px solid var(--ach-border-focus);
    outline-offset: 2px;
}

.ach-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.2;
}
.ach-pill--quest {
    background: #eef2ff;
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.15);
}
.ach-pill--done {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}
.ach-pill--active {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

/* ─── GUEST BANNER ──────────────────────────────────────────────── */
.ach-guest-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #fff7ed 0%, #fff1f2 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--ach-radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 18px -2px rgba(245, 158, 11, 0.12);
    flex-wrap: wrap;
}
.ach-guest-banner__info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 300px;
}
.ach-guest-banner__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #e11d48);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.25);
}
.ach-guest-banner__title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 19.5px;
    font-weight: 800;
    color: #9f1239;
    margin: 0 0 3px;
    letter-spacing: -0.01em;
}
.ach-guest-banner__desc {
    font-size: 16px;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}
.ach-guest-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── SECTION 1: GAMING ADVENTURE HERO ──────────────────────────── */
.ach-hero-section {
    background: var(--ach-bg-surface);
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-xl);
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--ach-shadow-md);
    position: relative;
    overflow: hidden;
}

.ach-hero-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ach-player-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 340px;
    min-width: 0;
}

.ach-avatar-frame {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #e62327);
    padding: 3px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(230, 35, 39, 0.22);
}
.ach-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #ffffff;
}
.ach-avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 26px;
    font-family: var(--ff-display, 'Poppins', sans-serif);
}
.ach-level-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.ach-player-info {
    min-width: 0;
}
.ach-hero-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: clamp(23px, 2.7vw, 29px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 3px;
    line-height: 1.2;
}
.ach-hero-subtitle {
    font-size: 16.5px;
    color: var(--ach-text-dim);
    margin: 0 0 8px;
    font-weight: 500;
}

.ach-player-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.ach-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    line-height: 1.3;
}
.ach-tag--player {
    background: #f1f5f9;
    color: #0f172a;
}
.ach-tag--rank {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.ach-tag--guest {
    background: #f3f4f6;
    color: #4b5563;
}
.ach-tag--tz {
    background: #eff6ff;
    color: #1d4ed8;
}

.ach-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ach-sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: 11px;
    padding: 8px 14px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--ach-text-muted);
    cursor: pointer;
    box-shadow: var(--ach-shadow-sm);
    transition: all 0.18s ease;
}
.ach-sound-toggle:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}
.ach-sound-toggle.is-active {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #059669;
}
.ach-btn-ledger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: 11px;
    padding: 8px 14px;
    font-size: 15.5px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    box-shadow: var(--ach-shadow-sm);
    transition: all 0.18s ease;
}
.ach-btn-ledger:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* Key Stats Strip — Full-Width 5-Column Grid */
.ach-stats-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .ach-stats-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 640px) {
    .ach-stats-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 360px) {
    .ach-stats-strip {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
.ach-stat-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-md);
    padding: 10px 12px;
    box-sizing: border-box;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ach-stat-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.ach-stat-chip__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}
.ach-stat-chip--gold .ach-stat-chip__icon {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}
.ach-stat-chip--cyan .ach-stat-chip__icon {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0284c7;
}
.ach-stat-chip--coral .ach-stat-chip__icon {
    background: linear-gradient(135deg, #ffe4e6, #fecdd3);
    color: #e11d48;
}
.ach-stat-chip--emerald .ach-stat-chip__icon {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}
.ach-stat-chip--purple .ach-stat-chip__icon {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

.ach-stat-chip__content {
    min-width: 0;
}
.ach-stat-chip__val {
    display: block;
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.ach-stat-chip__val small {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ach-text-dim);
}
.ach-stat-chip__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ach-text-dim);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Highlighted Next Reward Banner */
.ach-next-reward-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 60%, #fff7ed 100%);
    border: 2px solid #fde68a;
    border-radius: var(--ach-radius-lg);
    padding: 14px 18px;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.12);
    flex-wrap: wrap;
}
.ach-next-reward-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 320px;
    min-width: 0;
}
.ach-next-reward-art {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ach-next-reward-art svg {
    width: 48px;
    height: 48px;
    display: block;
}
.ach-next-reward-badge-tag {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    color: #b45309;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.ach-next-reward-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.25;
}
.ach-next-reward-msg {
    font-size: 15.5px;
    color: #475569;
    margin: 0;
}
.ach-next-reward-right {
    flex: 0 1 240px;
    min-width: 200px;
}
.ach-next-reward-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 5px;
}
.ach-next-reward-stat span {
    color: #d97706;
}
.ach-next-reward-track {
    width: 100%;
    height: 7px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.ach-next-reward-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #e11d48);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ─── SECTION 2: TODAY'S GAMING QUEST ──────────────────────────── */
.ach-daily-quest-section {
    margin-bottom: 22px;
}
.ach-daily-quest-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
    border: 1px solid #fed7aa;
    border-radius: var(--ach-radius-xl);
    padding: 18px 22px;
    box-shadow: 0 4px 18px -2px rgba(245, 158, 11, 0.12);
    flex-wrap: wrap;
    overflow: hidden;
}
.ach-daily-quest-card.is-completed {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-color: #a7f3d0;
    box-shadow: 0 4px 18px -2px rgba(16, 185, 129, 0.12);
}

.ach-daily-quest-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 340px;
    min-width: 0;
}
.ach-daily-quest-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #c2410c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.18);
}
.ach-daily-quest-card.is-completed .ach-daily-quest-icon-wrap {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.18);
}

.ach-daily-quest-eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 3px;
}
.ach-daily-quest-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 21px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.25;
}
.ach-daily-quest-desc {
    font-size: 16px;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

.ach-daily-quest-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.ach-daily-quest-stats {
    text-align: right;
}
.ach-daily-quest-reward {
    font-size: 17px;
    font-weight: 800;
    color: #d97706;
}
.ach-daily-quest-prog {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ach-text-dim);
}
.ach-btn-quest-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0f172a;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 11px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    transition: all 0.18s ease;
    white-space: nowrap;
}
.ach-btn-quest-action:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
}
.ach-daily-quest-card.is-completed .ach-btn-quest-action {
    background: #059669;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}
.ach-daily-quest-card.is-completed .ach-btn-quest-action:hover {
    background: #047857;
}

/* ─── SECTION 3: EMPTY HERO FOR NEW PLAYERS ─────────────────────── */
.ach-empty-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border: 2px dashed #fde68a;
    border-radius: var(--ach-radius-xl);
    padding: 20px 24px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.ach-empty-hero__illustration {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}
.ach-empty-hero__content {
    flex: 1 1 320px;
}
.ach-empty-hero__title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px;
}
.ach-empty-hero__desc {
    font-size: 16.5px;
    color: #475569;
    margin: 0 0 12px;
    line-height: 1.45;
}
.ach-empty-hero__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ─── SECTION 4: THE ORG ADVENTURE PATH (8 BADGES) ──────────────── */
.ach-quest-section {
    margin-bottom: 24px;
}
.ach-section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ach-section-tag {
    font-size: 14px;
    font-weight: 800;
    color: #0284c7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}
.ach-section-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: clamp(23px, 2.4vw, 27px);
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
}
.ach-section-subtitle {
    font-size: 16px;
    color: var(--ach-text-dim);
    margin: 3px 0 0;
}
.ach-section-hint {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 999px;
}

/* Adventure Track Grid — Full-Width 4-Column Responsive Grid */
.ach-adventure-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    .ach-adventure-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .ach-adventure-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 440px) {
    .ach-adventure-track {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.ach-badge-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-lg);
    padding: 16px 14px;
    box-shadow: var(--ach-shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.ach-badge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ach-shadow-lg);
}
.ach-badge-card:focus-visible {
    outline: 2px solid var(--ach-border-focus);
    outline-offset: 2px;
}

/* Card Step & Status Pill */
.ach-badge-card__step {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 10px;
}
.ach-badge-status-pill {
    font-size: 13px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
}
.ach-badge-status-pill--done {
    background: #ecfdf5;
    color: #059669;
}
.ach-badge-status-pill--next {
    background: #fffbeb;
    color: #d97706;
}
.ach-badge-status-pill--lock {
    background: #f1f5f9;
    color: #64748b;
}

/* Artwork Frame */
.ach-badge-card__artwork {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ach-badge-card:hover .ach-badge-card__artwork {
    transform: scale(1.08);
}
.ach-badge-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Card States: Unlocked, Next, Locked */
.ach-badge-card--unlocked {
    border-color: #a7f3d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.ach-badge-card--unlocked:hover {
    border-color: #6ee7b7;
    box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.18);
}

.ach-badge-card--next {
    border: 2px solid #f59e0b;
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), 0 8px 20px -4px rgba(245, 158, 11, 0.16);
}
.ach-badge-card--next:hover {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 12px 26px -4px rgba(245, 158, 11, 0.24);
}

.ach-badge-card--locked {
    opacity: 0.92;
    background: #ffffff;
}
.ach-badge-card--locked:hover {
    border-color: #cbd5e1;
}

.ach-badge-card__title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.25;
}
.ach-badge-card__requirement {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ach-badge-card__reward {
    font-size: 15.5px;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ach-badge-card__progress-wrap {
    width: 100%;
    margin-top: auto;
}
.ach-badge-card__progress-bar {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 3px;
}
.ach-badge-card__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.ach-badge-card--next .ach-badge-card__progress-fill {
    background: linear-gradient(90deg, #f59e0b, #e11d48);
}
.ach-badge-card__progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* ─── SECTION 5: STREAKS & ACTIVITY ─────────────────────────────── */
.ach-streaks-section {
    margin-bottom: 24px;
}
.ach-streaks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.ach-streak-card {
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-xl);
    padding: 18px 20px;
    box-shadow: var(--ach-shadow-md);
    box-sizing: border-box;
}

.ach-streak-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.ach-streak-badge-flame {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(135deg, #f59e0b, #e11d48);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
}
.ach-streak-badge-flame--emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.ach-streak-count {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}
.ach-streak-label {
    font-size: 15.5px;
    color: var(--ach-text-dim);
    margin-top: 2px;
}

.ach-streak-motivation {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: var(--ach-radius-sm);
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 600;
    color: #c2410c;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
}

/* 7-Day Activity Calendar Strip */
.ach-calendar-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.ach-calendar-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 12px;
}
.ach-calendar-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--ach-border-subtle);
    border-radius: 9px;
    padding: 7px 2px;
    text-align: center;
    transition: transform 0.18s ease;
}
.ach-calendar-tile:hover {
    transform: translateY(-2px);
}
.ach-calendar-tile__day {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}
.ach-calendar-tile__num {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 17.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 1px 0 3px;
}
.ach-calendar-tile__dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #ffffff;
}

.ach-calendar-tile--qualified {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.ach-calendar-tile--qualified .ach-calendar-tile__num {
    color: #059669;
}
.ach-calendar-tile--qualified .ach-calendar-tile__dot {
    background: #10b981;
}

.ach-calendar-tile--today {
    border-color: #f43f5e;
    box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.2);
}

.ach-countdown-note {
    font-size: 15px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ach-countdown-note strong {
    color: #0f172a;
    font-family: monospace;
    font-size: 15.5px;
}

/* Weekly streak specifics */
.ach-weekly-rule-box {
    background: #f8fafc;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-md);
    padding: 10px 12px;
    margin-bottom: 12px;
}
.ach-weekly-rule-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px;
}
.ach-weekly-rule-text {
    font-size: 15px;
    color: #475569;
    margin: 0;
    line-height: 1.45;
}

.ach-weekly-bonus-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--ach-radius-md);
    padding: 10px 12px;
}
.ach-weekly-bonus-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #059669;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.ach-weekly-bonus-text strong {
    display: block;
    font-size: 16px;
    color: #065f46;
}
.ach-weekly-bonus-text span {
    display: block;
    font-size: 14.5px;
    color: #047857;
}

/* ─── SECTION 6: ENHANCED FULL-WIDTH EXPLORATION QUESTS ─────────── */
.ach-secondary-section {
    margin-bottom: 0;
}

.ach-secondary-card--full {
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-xl);
    padding: 22px 24px;
    box-shadow: var(--ach-shadow-md);
    box-sizing: border-box;
    width: 100%;
}

.ach-secondary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.ach-secondary-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 3px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ach-counter-badge {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.ach-secondary-sub {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.45;
}

/* Enhanced Milestone Grid — Explicit 3x2 Grid (3 columns, 2 rows) on Desktop */
.ach-milestone-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .ach-milestone-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        gap: 12px;
    }
}

.ach-milestone-card {
    background: #f8fafc;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.ach-milestone-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

.ach-milestone-card--done {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    border-color: #a7f3d0;
}
.ach-milestone-card--done:hover {
    border-color: #6ee7b7;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.14);
}

.ach-milestone-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.ach-milestone-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ach-milestone-card--done .ach-milestone-card__icon {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.ach-milestone-card__titles {
    min-width: 0;
    flex: 1 1 auto;
}
.ach-milestone-card__name {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 17.5px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.25;
}
.ach-milestone-badge {
    font-size: 13.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ach-milestone-badge--done {
    background: #ecfdf5;
    color: #059669;
}
.ach-milestone-badge--pending {
    background: #f1f5f9;
    color: #64748b;
}

.ach-milestone-card__reward {
    flex-shrink: 0;
}
.ach-reward-chip {
    font-size: 14.5px;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.ach-reward-chip.is-earned {
    color: #047857;
    background: #dcfce7;
}

.ach-milestone-card__desc {
    font-size: 15.5px;
    color: #475569;
    margin: 0 0 10px;
    line-height: 1.4;
}

.ach-milestone-card__progress-wrap {
    margin-top: auto;
}
.ach-milestone-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14.5px;
    color: #64748b;
    margin-bottom: 4px;
}
.ach-milestone-card__count strong {
    color: #0f172a;
}
.ach-milestone-card__pct {
    font-weight: 700;
    color: #0f172a;
}
.ach-milestone-card--done .ach-milestone-card__pct {
    color: #059669;
}
.ach-milestone-card__bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.ach-milestone-card__fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #3b82f6);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.ach-milestone-card--done .ach-milestone-card__fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* ─── MODALS & CELEBRATION ───────────────────────────────────────── */
.ach-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    z-index: 100010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.ach-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.ach-modal-panel {
    background: #ffffff;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-xl);
    padding: 24px 22px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.25);
    position: relative;
    box-sizing: border-box;
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.ach-modal-backdrop.is-open .ach-modal-panel {
    transform: scale(1);
}

.ach-modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ach-modal-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ach-modal-artwork-box {
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ach-modal-artwork-box svg {
    width: 90px;
    height: 90px;
    display: block;
}
.ach-modal-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 5px;
}
.ach-modal-desc {
    font-size: 16.5px;
    color: #475569;
    margin: 0 0 16px;
    line-height: 1.45;
}

.ach-modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--ach-border-subtle);
    border-radius: var(--ach-radius-md);
    padding: 10px 12px;
    margin-bottom: 16px;
    text-align: left;
}
.ach-modal-stat-item {
    display: flex;
    flex-direction: column;
}
.ach-modal-stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}
.ach-modal-stat-val {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2px;
}
.ach-modal-stat-val--gold {
    color: #d97706;
}
.ach-modal-stat-val--blue {
    color: #0284c7;
}

.ach-feature-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    padding: 11px 18px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    transition: all 0.18s ease;
}
.ach-feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.4);
}
.ach-feature-btn.is-equipped {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    box-shadow: none;
    cursor: default;
}

/* Celebration Modal Specifics */
.ach-celebration-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fffbf0 100%);
    border: 2px solid #fde68a;
    border-radius: var(--ach-radius-xl);
    padding: 26px 20px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 24px 48px -10px rgba(245, 158, 11, 0.35);
}
.ach-celebration-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fef08a, #f59e0b);
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
    animation: achPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes achPop {
    0% { transform: scale(0.6); opacity: 0; }
    80% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.ach-celebration-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 5px;
}
.ach-celebration-msg {
    font-size: 16.5px;
    color: #475569;
    margin: 0 0 14px;
}
.ach-celebration-points {
    font-size: 19px;
    font-weight: 800;
    color: #d97706;
    background: #fef3c7;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
}
.ach-celebration-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Points Ledger Modal */
.ach-ledger-panel {
    max-width: 540px;
    text-align: left;
}
.ach-ledger-head {
    margin-bottom: 14px;
}
.ach-ledger-title {
    font-family: var(--ff-display, 'Poppins', sans-serif);
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 2px;
}
.ach-ledger-sub {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}
.ach-ledger-list {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

/* ─── COMPREHENSIVE RESPONSIVE DESIGN (MOBILE & TABLET) ─────────── */
@media (max-width: 768px) {
    /* Edge padding & Container */
    .ach-portal {
        padding: 12px 10px 20px;
    }

    /* Guest Banner */
    .ach-guest-banner {
        padding: 14px 14px;
        gap: 12px;
        margin-bottom: 14px;
        border-radius: var(--ach-radius-md);
    }
    .ach-guest-banner__info {
        gap: 12px;
        flex: 1 1 100%;
    }
    .ach-guest-banner__icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
        border-radius: 10px;
    }
    .ach-guest-banner__title {
        font-size: 17px;
        margin-bottom: 2px;
    }
    .ach-guest-banner__desc {
        font-size: 13.5px;
    }
    .ach-guest-banner__actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .ach-guest-banner__actions .ach-btn-save,
    .ach-guest-banner__actions .ach-btn-secondary {
        flex: 1 1 0;
        padding: 10px 12px;
        font-size: 14px;
        text-align: center;
        justify-content: center;
        min-height: 42px;
        box-sizing: border-box;
    }

    /* Hero Section */
    .ach-hero-section {
        padding: 14px 12px;
        border-radius: var(--ach-radius-lg);
        margin-bottom: 14px;
    }
    .ach-hero-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }
    .ach-player-profile {
        gap: 12px;
        /* The header is a COLUMN here, so the desktop "flex: 1 1 340px"
           became a 340px HEIGHT and left a big empty gap. Size to content. */
        flex: 0 0 auto;
    }
    .ach-avatar-frame {
        width: 52px;
        height: 52px;
        padding: 2.5px;
    }
    .ach-level-badge {
        font-size: 11px;
        font-weight: 800;
        padding: 2px 6px;
        bottom: -2px;
        right: -2px;
    }
    .ach-hero-title {
        font-size: clamp(19px, 5vw, 23px);
        line-height: 1.2;
        margin: 0 0 4px;
    }
    .ach-hero-subtitle {
        font-size: 14px;
        margin: 0 0 8px;
    }
    .ach-player-tags {
        gap: 5px;
    }
    .ach-tag {
        font-size: 12px;
        padding: 3px 8px;
        gap: 4px;
        border-radius: 6px;
    }
    .ach-header-controls {
        width: 100%;
        display: flex;
        gap: 8px;
        margin-top: 2px;
    }
    .ach-sound-toggle,
    .ach-btn-ledger {
        flex: 1 1 0;
        justify-content: center;
        padding: 8px 10px;
        font-size: 13.5px;
        border-radius: 10px;
        min-height: 40px;
        box-sizing: border-box;
    }

    /* Key Stats Strip — Symmetrical Balanced Grid (Total Points featured full-width + 2x2 grid) */
    .ach-stats-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
    }
    .ach-stat-chip {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 12px;
    }
    .ach-stat-chip:first-child {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
        border-color: #fde68a;
        padding: 10px 14px;
    }
    .ach-stat-chip__icon {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 9px;
        flex-shrink: 0;
    }
    .ach-stat-chip:first-child .ach-stat-chip__icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .ach-stat-chip__val {
        font-size: 17px;
        line-height: 1.15;
    }
    .ach-stat-chip:first-child .ach-stat-chip__val {
        font-size: 21px;
    }
    .ach-stat-chip__val small {
        font-size: 12px;
        font-weight: 700;
    }
    .ach-stat-chip__label {
        font-size: 11px;
        letter-spacing: 0.03em;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Next Reward Banner */
    .ach-next-reward-banner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 14px;
    }
    .ach-next-reward-left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }
    .ach-next-reward-art {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }
    .ach-next-reward-art svg {
        width: 42px;
        height: 42px;
    }
    .ach-next-reward-badge-tag {
        font-size: 11px;
        letter-spacing: 0.04em;
    }
    .ach-next-reward-title {
        font-size: 16px;
        line-height: 1.25;
        margin: 0 0 2px;
    }
    .ach-next-reward-msg {
        font-size: 13.5px;
    }
    .ach-next-reward-right {
        width: 100%;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
    }
    .ach-next-reward-stat {
        font-size: 13.5px;
        margin-bottom: 5px;
    }
    .ach-next-reward-track {
        height: 8px;
    }

    /* Section Headers */
    .ach-section-header {
        margin-bottom: 12px;
        gap: 6px;
    }
    .ach-section-title {
        font-size: 19.5px;
        line-height: 1.25;
    }
    .ach-section-subtitle {
        font-size: 13.5px;
        margin: 2px 0 0;
    }

    /* Today's Gaming Quest Card */
    .ach-daily-quest-section {
        margin-bottom: 18px;
    }
    .ach-daily-quest-card {
        padding: 14px;
        gap: 12px;
        border-radius: var(--ach-radius-lg);
        flex-direction: column;
        align-items: stretch;
    }
    .ach-daily-quest-main {
        gap: 12px;
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;   /* same 340px-height gap as the hero — size to content */
    }
    .ach-daily-quest-icon-wrap {
        width: 42px;
        height: 42px;
        font-size: 20px;
        border-radius: 11px;
    }
    .ach-daily-quest-title {
        font-size: 18px;
        line-height: 1.25;
        margin-bottom: 2px;
    }
    .ach-daily-quest-desc {
        font-size: 13.5px;
        line-height: 1.4;
    }
    .ach-daily-quest-meta {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .ach-daily-quest-stats {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 7px 12px;
        background: rgba(254, 243, 199, 0.45);
        border: 1px solid rgba(254, 215, 170, 0.6);
        border-radius: 10px;
        box-sizing: border-box;
    }
    .ach-daily-quest-card.is-completed .ach-daily-quest-stats {
        background: rgba(209, 250, 229, 0.45);
        border-color: rgba(167, 243, 208, 0.6);
    }
    .ach-daily-quest-reward {
        font-size: 14.5px;
        font-weight: 800;
    }
    .ach-daily-quest-prog {
        font-size: 13px;
        font-weight: 700;
    }
    .ach-btn-quest-action {
        width: 100%;
        justify-content: center;
        padding: 11px 16px;
        font-size: 15px;
        border-radius: 10px;
        min-height: 42px;
        box-sizing: border-box;
    }

    /* Empty State Hero */
    .ach-empty-hero {
        padding: 16px 14px;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
        border-radius: var(--ach-radius-lg);
        margin-bottom: 18px;
    }
    .ach-empty-hero__content {
        /* column layout: the desktop "flex: 1 1 320px" became a 320px height
           (empty space) and, with align-items:flex-start, the text ran off the
           right edge. Full width, sized to content. */
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }
    .ach-empty-hero__illustration {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 12px;
    }
    .ach-empty-hero__title {
        font-size: 18.5px;
        margin-bottom: 3px;
    }
    .ach-empty-hero__desc {
        font-size: 13.5px;
        line-height: 1.45;
        margin-bottom: 12px;
    }
    .ach-empty-hero__actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .ach-empty-hero__actions .ach-btn-save,
    .ach-empty-hero__actions .ach-btn-secondary {
        flex: 1 1 auto;   /* share the row by text length so neither label is cut */
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 10px 6px;
        gap: 6px;
        font-size: 13px;
        justify-content: center;
        text-align: center;
        min-height: 42px;
        box-sizing: border-box;
    }

    /* The ORG Adventure Path (8 Badges) — Crisp 2-Column Mobile Quest Map */
    .ach-quest-section {
        margin-bottom: 20px;
    }
    .ach-adventure-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .ach-badge-card {
        padding: 10px 8px;
        border-radius: 12px;
        min-width: 0;
    }
    .ach-badge-card__step {
        font-size: 10.5px;
        letter-spacing: 0.04em;
        margin-bottom: 6px;
        gap: 4px;
    }
    .ach-badge-status-pill {
        font-size: 9.5px;
        padding: 2px 6px;
        font-weight: 800;
        border-radius: 6px;
        white-space: nowrap;
    }
    .ach-badge-card__artwork {
        width: 56px;
        height: 56px;
        margin-bottom: 6px;
    }
    .ach-badge-card__artwork svg {
        width: 56px;
        height: 56px;
    }
    .ach-badge-card__title {
        font-size: 15px;
        line-height: 1.25;
        margin-bottom: 3px;
    }
    .ach-badge-card__reward {
        font-size: 12px;
        padding: 2px 7px;
        margin-bottom: 6px;
        border-radius: 999px;
    }
    .ach-badge-card__progress-wrap {
        width: 100%;
    }
    .ach-badge-card__progress-bar {
        height: 5px;
        margin-bottom: 3px;
    }
    .ach-badge-card__progress-text {
        font-size: 11.5px;
        font-weight: 700;
    }

    /* Streaks & Activity Calendar */
    .ach-streaks-section {
        margin-bottom: 20px;
    }
    .ach-streaks-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .ach-streak-card {
        padding: 14px 12px;
        border-radius: 16px;
    }
    .ach-streak-header {
        gap: 10px;
        margin-bottom: 10px;
    }
    .ach-streak-badge-flame {
        width: 42px;
        height: 42px;
        font-size: 20px;
        border-radius: 11px;
    }
    .ach-streak-count {
        font-size: 22px;
    }
    .ach-streak-label {
        font-size: 13px;
    }
    .ach-streak-motivation {
        font-size: 13px;
        padding: 7px 10px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    .ach-calendar-title {
        font-size: 12.5px;
        margin-bottom: 6px;
    }
    .ach-calendar-strip {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-bottom: 10px;
    }
    .ach-calendar-tile {
        padding: 5px 1px;
        border-radius: 7px;
    }
    .ach-calendar-tile__day {
        font-size: 10.5px;
        letter-spacing: 0;
    }
    .ach-calendar-tile__num {
        font-size: 14.5px;
        margin: 1px 0 2px;
    }
    .ach-calendar-tile__dot {
        width: 13px;
        height: 13px;
        font-size: 9px;
    }
    .ach-countdown-note {
        font-size: 12.5px;
        line-height: 1.4;
        flex-wrap: wrap;
    }
    .ach-countdown-note strong {
        font-size: 13.5px;
    }
    .ach-weekly-rule-box {
        padding: 8px 10px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    .ach-weekly-rule-text {
        font-size: 13px;
    }
    .ach-weekly-bonus-banner {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 10px;
    }
    .ach-weekly-bonus-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 7px;
    }
    .ach-weekly-bonus-text strong {
        font-size: 13.5px;
    }
    .ach-weekly-bonus-text span {
        font-size: 12.5px;
    }

    /* Playtime Quests (Milestones) */
    .ach-secondary-card--full {
        padding: 14px 12px;
        border-radius: 16px;
    }
    .ach-secondary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 12px;
    }
    .ach-secondary-title {
        font-size: 19px;
    }
    .ach-secondary-sub {
        font-size: 13.5px;
        margin: 0;
    }
    .ach-counter-badge {
        font-size: 12.5px;
        padding: 4px 10px;
        align-self: flex-start;
    }
    .ach-milestone-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .ach-milestone-card {
        padding: 10px 12px;
        border-radius: 12px;
    }
    .ach-milestone-card__head {
        gap: 10px;
        margin-bottom: 6px;
    }
    .ach-milestone-card__icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        border-radius: 9px;
    }
    .ach-milestone-card__name {
        font-size: 15px;
        line-height: 1.25;
    }
    .ach-milestone-badge {
        font-size: 10.5px;
        padding: 2px 6px;
    }
    .ach-reward-chip {
        font-size: 12.5px;
        padding: 3px 8px;
    }
    .ach-milestone-card__meta {
        font-size: 12.5px;
        margin-bottom: 3px;
    }
    .ach-milestone-card__bar {
        height: 5px;
    }

    /* Modals & Dialogs on Mobile */
    .ach-modal-backdrop {
        padding: 12px;
    }
    .ach-modal-panel {
        padding: 20px 16px;
        border-radius: 18px;
        max-width: min(390px, calc(100vw - 24px));
    }
    .ach-modal-close-btn {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    .ach-modal-artwork-box {
        width: 72px;
        height: 72px;
        margin: 0 auto 8px;
    }
    .ach-modal-artwork-box svg {
        width: 72px;
        height: 72px;
    }
    .ach-modal-title {
        font-size: 20px;
        margin-bottom: 4px;
    }
    .ach-modal-desc {
        font-size: 14px;
        margin-bottom: 12px;
    }
    .ach-modal-stats-grid {
        gap: 6px;
        padding: 8px 10px;
        margin-bottom: 14px;
        border-radius: 10px;
    }
    .ach-modal-stat-label {
        font-size: 11px;
    }
    .ach-modal-stat-val {
        font-size: 14.5px;
    }
    .ach-feature-btn {
        font-size: 15px;
        padding: 10px 14px;
        border-radius: 10px;
        min-height: 42px;
        box-sizing: border-box;
    }

    /* Points Ledger Panel on Mobile */
    .ach-ledger-panel {
        padding: 18px 14px;
        border-radius: 18px;
        max-width: min(440px, calc(100vw - 24px));
    }
    .ach-ledger-title {
        font-size: 19px;
    }
    .ach-ledger-sub {
        font-size: 13.5px;
    }
    .ach-ledger-list {
        max-height: 50vh;
    }

    /* Celebration Modal on Mobile */
    .ach-celebration-panel {
        padding: 20px 14px;
        border-radius: 18px;
        max-width: min(360px, calc(100vw - 24px));
    }
    .ach-celebration-icon {
        width: 58px;
        height: 58px;
        font-size: 28px;
        border-radius: 16px;
        margin-bottom: 8px;
    }
    .ach-celebration-title {
        font-size: 20px;
        margin-bottom: 3px;
    }
    .ach-celebration-msg {
        font-size: 14px;
        margin-bottom: 10px;
    }
    .ach-celebration-points {
        font-size: 16px;
        padding: 6px 14px;
        margin-bottom: 14px;
    }
    .ach-celebration-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .ach-celebration-actions .ach-btn-save,
    .ach-celebration-actions .ach-btn-secondary {
        width: 100%;
        justify-content: center;
        font-size: 15px;
        padding: 10px;
        min-height: 42px;
        box-sizing: border-box;
    }
}

/* Very narrow mobile screens (<= 360px) */
@media (max-width: 360px) {
    .ach-calendar-strip {
        gap: 2px;
    }
    .ach-calendar-tile {
        padding: 4px 0;
    }
    .ach-calendar-tile__day {
        font-size: 9.5px;
    }
    .ach-calendar-tile__num {
        font-size: 13.5px;
    }
    .ach-badge-card {
        padding: 8px 6px;
    }
    .ach-badge-card__step {
        font-size: 9.5px;
    }
    .ach-badge-status-pill {
        font-size: 8.5px;
        padding: 1px 4px;
    }
    .ach-badge-card__artwork {
        width: 48px;
        height: 48px;
    }
    .ach-badge-card__artwork svg {
        width: 48px;
        height: 48px;
    }
    .ach-badge-card__title {
        font-size: 14px;
    }
}

/* Accessibility: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── NEXT REWARD: wide points & progress area (2026-10-28) ──────────
   The points / % / progress bar block on the right now stretches across
   about half the banner instead of a narrow 240px column, with a thicker
   bar so progress is easy to read. Phones keep the stacked layout. */
@media (min-width: 769px) {
    .ach-next-reward-banner {
        flex-wrap: nowrap;
        gap: 28px;
    }
    .ach-next-reward-left {
        flex: 1 1 0;
    }
    .ach-next-reward-right {
        flex: 0 0 50%;
        max-width: 50%;
        min-width: 0;
    }
    .ach-next-reward-stat {
        font-size: 16px;
        margin-bottom: 8px;
    }
    .ach-next-reward-track {
        height: 10px;
    }
}
