@charset "utf-8";

/*!
 * op_menu_m.css - Modern Mobile Menu & Header Styles
 * Responsive Flexbox Layout, Ergonomic Touch Targets, Clean Dark Mode Synergy
 */

/* 1. Header Bar Container */
.m-menu {
    border-bottom: 1px solid var(--op-border-subtle, #e2e8f0);
}

.m-menu .m-wrap {
    background: var(--op-surface-card, #ffffff);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.m-menu .m-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 10px;
    box-sizing: border-box;
    gap: 8px;
    position: relative;
}

/* 2. Left Section: Hamburger & Mobile Logo */
.m-menu .m-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.m-menu .m-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--op-text-main, #334155);
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
}

.m-menu .m-btn:active {
    background: rgba(0, 0, 0, 0.06);
}

.m-menu .m-menu-btn {
    font-size: 18px;
    color: var(--op-text-main, #1e293b);
}

.m-menu .m-logo {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-size: 16px;
    font-weight: 700;
}

.m-menu .m-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

/* Bonus event flaming icon on mobile logo */
.m-menu .has-bonus-event .web_title_eng_m,
.has-bonus-event .m-menu .web_title_eng_m {
    position: relative;
}

.m-menu .has-bonus-event .web_title_eng_m:after,
.has-bonus-event .m-menu .web_title_eng_m:after {
    background: url('/img/burning_time.png') no-repeat;
    background-size: cover;
    display: block;
    position: absolute;
    width: 18px;
    height: 28px;
    content: '';
    right: -14px;
    top: -8px;
    margin-left: 0;
    margin-top: 0;
    pointer-events: none;
}

/* 3. Right Section: User Profile Pill, Search, Notification, Dark Toggle */
.m-menu .m-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 1;
    min-width: 0;
}

/* Combined User Profile Pill (Level icon + Nickname -> opens MyMenu) */
.m-menu .m-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px 4px 6px;
    background: var(--op-bg-subtle, #f1f5f9);
    border: 1px solid var(--op-border-subtle, #e2e8f0);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--op-text-main, #334155) !important;
    text-decoration: none !important;
    max-width: 125px;
    height: 32px;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 1;
}

.m-menu .m-user-pill:active {
    background: var(--op-border-subtle, #e2e8f0);
}

.m-menu .m-user-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.m-menu .m-user-icon img,
.m-menu .m-user-icon .icon_xp {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.m-menu .m-user-nick {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70px;
    letter-spacing: -0.02em;
}

/* Icon Buttons: Search, Alert, Theme */
.m-menu .m-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    font-size: 15px;
    color: var(--op-text-subtle, #64748b);
    position: relative;
    border-radius: 50%;
}

.m-menu .m-icon-btn:hover,
.m-menu .m-icon-btn:active {
    color: var(--op-primary, #3dbf62);
}

/* Alert Notification Badge (Contract with sidebar.js: .sidebarLabel, .sidebarCount) */
.m-menu .m-alert-btn {
    position: relative;
}

.m-menu .m-alert-btn .sidebarLabel {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-block;
    line-height: 1;
}

.m-menu .m-alert-btn .sidebarCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444 !important;
    color: #ffffff !important;
    font-size: 9px;
    font-weight: 700;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.4);
}

/* Guest Auth Links */
.m-menu .m-auth-link {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--op-text-main, #475569) !important;
    text-decoration: none !important;
    padding: 6px 4px;
    white-space: nowrap;
}

.m-menu .m-auth-link:hover,
.m-menu .m-auth-link:active {
    color: var(--op-primary, #3dbf62) !important;
}

.m-menu .m-auth-login {
    color: var(--op-primary, #3dbf62) !important;
    font-weight: 700;
}

.m-menu .m-divider {
    font-size: 10px;
    color: var(--op-border-subtle, #cbd5e1);
    padding: 0 1px;
    user-select: none;
}

/* 4. Sub-Navigation Bar (.m-sub) */
.m-menu .m-sub {
    background: var(--op-surface-ground, #f8fafc);
    border-top: 1px solid var(--op-border-subtle, #e2e8f0);
    border-bottom: 1px solid var(--op-border-subtle, #e2e8f0);
    height: 42px;
    line-height: 42px;
    padding: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.m-menu .m-nav-sub {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.m-menu .m-nav-sub::-webkit-scrollbar {
    display: none; /* WebKit */
}

.m-menu .m-nav-sub ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0 10px;
    gap: 6px;
    white-space: nowrap;
    height: 42px;
}

.m-menu .m-nav-sub ul li {
    display: inline-flex;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
}

.m-menu .m-nav-sub ul li a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--op-text-subtle, #64748b) !important;
    text-decoration: none !important;
    transition: all 0.15s ease;
    background: transparent;
}

.m-menu .m-nav-sub ul li a:hover {
    color: var(--op-text-main, #1e293b) !important;
}

.m-menu .m-nav-sub ul li.active a {
    background: var(--op-primary, #3dbf62) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(61, 191, 98, 0.35);
}

.m-menu .m-nav-sub ul li a .sub-new {
    font-size: 11px;
    color: #ef4444;
}

.m-menu .m-nav-sub ul li.active a .sub-new {
    color: #fef08a;
}

/* 5. Dark Mode Synergy */
html.theme-dark .m-menu .m-wrap,
body.theme-dark .m-menu .m-wrap,
body[data-theme="dark"] .m-menu .m-wrap {
    background: #141417;
}

html.theme-dark .m-menu .m-btn,
body.theme-dark .m-menu .m-btn,
body[data-theme="dark"] .m-menu .m-btn {
    color: #cbd5e1;
}

html.theme-dark .m-menu .m-btn:active,
body.theme-dark .m-menu .m-btn:active,
body[data-theme="dark"] .m-menu .m-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

html.theme-dark .m-menu .m-user-pill,
body.theme-dark .m-menu .m-user-pill,
body[data-theme="dark"] .m-menu .m-user-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: #272730;
    color: #e2e8f0 !important;
}

html.theme-dark .m-menu .m-user-pill:active,
body.theme-dark .m-menu .m-user-pill:active,
body[data-theme="dark"] .m-menu .m-user-pill:active {
    background: rgba(255, 255, 255, 0.14);
}

html.theme-dark .m-menu .m-icon-btn,
body.theme-dark .m-menu .m-icon-btn,
body[data-theme="dark"] .m-menu .m-icon-btn {
    color: #94a3b8;
}

html.theme-dark .m-menu .m-auth-link,
body.theme-dark .m-menu .m-auth-link,
body[data-theme="dark"] .m-menu .m-auth-link {
    color: #cbd5e1 !important;
}

html.theme-dark .m-menu .m-auth-login,
body.theme-dark .m-menu .m-auth-login,
body[data-theme="dark"] .m-menu .m-auth-login {
    color: #4ade80 !important;
}

html.theme-dark .m-menu .m-divider,
body.theme-dark .m-menu .m-divider,
body[data-theme="dark"] .m-menu .m-divider {
    color: #334155;
}

html.theme-dark .m-menu .m-sub,
body.theme-dark .m-menu .m-sub,
body[data-theme="dark"] .m-menu .m-sub {
    background: #18181d;
    border-color: #272730;
}

html.theme-dark .m-menu .m-nav-sub ul li a,
body.theme-dark .m-menu .m-nav-sub ul li a,
body[data-theme="dark"] .m-menu .m-nav-sub ul li a {
    color: #94a3b8 !important;
}

html.theme-dark .m-menu .m-nav-sub ul li.active a,
body.theme-dark .m-menu .m-nav-sub ul li.active a,
body[data-theme="dark"] .m-menu .m-nav-sub ul li.active a {
    background: #2ea050 !important;
    color: #ffffff !important;
}

/* 6. Small Screen Breakpoint Guard (<= 360px) */
@media (max-width: 360px) {
    .m-menu .m-bar {
        padding: 0 6px;
        gap: 4px;
    }
    .m-menu .m-user-nick {
        max-width: 50px;
    }
    .m-menu .m-btn {
        min-width: 34px;
        height: 34px;
    }
    .m-menu .m-icon-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }
}
