.sip-mobile-nav-host { display: none; }
.sip-wallet-summary { display:flex; align-items:center; gap:12px; flex:none; }
.sip-wallet-currency { display:flex; align-items:center; gap:6px; height:38px; padding:0 10px 0 6px; box-sizing:border-box; border:1px solid #2476a3; border-radius:12px; background:linear-gradient(135deg,#102f4a,#081d33); color:#edfaff; white-space:nowrap; }
.sip-wallet-currency[data-sip-wallet="RP"] { border-color:#74549e; background:linear-gradient(135deg,#282044,#111b32); }
.sip-wallet-currency img { width:28px; height:28px; object-fit:contain; flex:none; }
.sip-wallet-currency > span { display:flex; flex-direction:column; gap:1px; }
.sip-wallet-currency small { display:none; }
.sip-wallet-currency strong { font-size:14px; line-height:1.2; font-variant-numeric:tabular-nums; }
/* Outrank the legacy authenticated-state rules, including after route mounts. */
html body .header-wrap .header-body .header-right:has(.sip-wallet-summary) > :is(.info-balance,.sip-header-balance) { display:none!important; }
[data-sip-home-wallet] { display:grid; grid-template-columns:64px minmax(0,1fr); column-gap:12px; align-items:center; }
.sip-home-wallet-coin { width:64px; height:64px; object-fit:contain; grid-column:1; grid-row:1 / 3; }
.home-balance > img[data-sip-wallet-decoration], [data-sip-home-wallet] .icon-expand-1 { display:none!important; }
[data-sip-home-wallet] > :not(img) { grid-column:2; }
.home-balance:has([data-sip-home-wallet]) {
  background: radial-gradient(ellipse at 0 0,#007dff20,transparent 65%),linear-gradient(135deg,#00244b,#00192f) !important;
  box-shadow: inset 0 0 0 1px #164869,0 6px 18px #00000020 !important;
  color:#edfaff;
}
[data-sip-home-wallet-label] {
  background:none !important; color:#adbcd6 !important; -webkit-text-fill-color:#adbcd6;
}
[data-sip-home-wallet] > div > span:not(.iconfont) { color:#edfaff !important; }
@media(max-width:1023px) {
  .sip-wallet-summary { gap:8px; }
  .sip-wallet-currency { gap:4px; height:34px; padding:0 7px 0 4px; border-radius:10px; }
  .sip-wallet-currency img { width:24px; height:24px; }
  .sip-wallet-currency small { font-size:9px; }
  .sip-wallet-currency strong { font-size:12px; }
  body .header-wrap .header-right:has(.sip-wallet-summary) { gap:6px!important; }
  [data-sip-home-wallet] { grid-template-columns:40px minmax(0,1fr); gap:0 8px; }
  .sip-home-wallet-coin { width:40px; height:40px; }
}
.sip-mobile-page-heading { display: none; }
/* Keep local profile identity beside the avatar and its native edit control. */
.d13_ProfileInfoPanel_index_profile-info-panel-wrap .name-wrap:has([data-sip-local-profile]) {
  height:auto; min-height:48px; min-width:0; align-items:center;
}
[data-sip-local-profile] { display:flex; flex-direction:column; gap:3px; min-width:0; flex:1; margin:0; color:#f4f4f4; line-height:1.35; }
[data-sip-local-profile] strong { font-size:22px; font-weight:700; overflow-wrap:anywhere; }
[data-sip-local-profile] > span { font-size:14px; color:#a9bdd3; overflow-wrap:anywhere; }
.name-wrap:has([data-sip-local-profile]) > .name:empty { display:none; }
.name-wrap:has([data-sip-local-profile]) > .edit-mark-icon { flex:none; margin-left:8px; }
@media(max-width:680px) {
  .d13_ProfileInfoPanel_index_profile-info-panel-wrap .user-info-avatar { flex:none; }
  [data-sip-local-profile] strong { font-size:clamp(16px,4.5vw,21px); }
  [data-sip-local-profile] > span { font-size:12px; }
}
/* One desktop header row. Keep captured DOM in place so its navigation handlers
   and React ownership survive route changes. */
/* Native and guest-boot headers share geometry, regardless of lazy CSS order. */
.header-wrap .header-left > .icon-menu1 {
  display: inline-flex !important; align-items: center; justify-content: center;
  line-height: 1 !important;
}
.header-wrap .header-left > [data-tag="top-menu-trigger"] {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 40px; height: 40px; line-height: 1 !important;
}
.header-wrap .mobile-header-logo[data-sip-brand],
.header-wrap .mobile-header-logo[data-sip-brand] > a,
.header-wrap .mobile-header-logo .sip-brand-lockup {
  display: flex; align-items: center; justify-content: center;
  height: 40px; line-height: 1;
}
.header-wrap .mobile-header-logo .sip-brand-copy { display: none; }
body :is(.header-wrap,.mtt-live-header) .header-right .d15_Login_index_signup {
  box-sizing: border-box; flex-shrink: 0;
  height: 40px !important; padding: 0 20px !important;
  font-size: 16px !important; font-weight: 600 !important; line-height: 1 !important;
  border-radius: 10px !important; white-space: nowrap;
  align-items: center; justify-content: center;
}
@media (max-width: 480px) {
  body :is(.header-wrap,.mtt-live-header) .header-right .d15_Login_index_signup {
    height: 36px !important; padding: 0 12px !important; font-size: 14px !important;
    margin-inline: 0 !important;
  }
}
.header-wrap [data-sip-competition-nav],
.header-horizontal-nav [data-sip-mini-games-host],
.header-horizontal-nav [data-sip-sidebar-only-nav],
.header-horizontal-nav [data-sip-activity-center],
.header-horizontal-nav a[href^="/home/mall"],
.header-horizontal-nav a[href="/home/activity-center"],
.header-wrap a[href="/home/tourney"],
.header-wrap a[href="/home/competition"],
.global-side-menu [data-sip-competition-nav],
.global-side-menu [data-sip-retired-sidebar-nav],
.global-side-menu a[href="/home/entertainment-rooms"],
.global-side-menu a[href="/home/friend-table"],
.header-wrap .header-body .header-right [data-testid="header-language"],
.header-wrap .header-body .header-right > :has(.icon-language) { display: none !important; }

@media (min-width: 1024px) {
  .header-wrap { display: grid !important; grid-template-columns: minmax(0, 1fr); position: relative; }
  .header-wrap > .header-placeholder { grid-area: 1 / 1; width: 100%; height: 72px !important; z-index: 0 !important; }
  .header-wrap .header-body { min-height: 72px !important; height: 72px !important; }
  body .header-wrap .header-body {
    display:flex !important; align-items:center !important; gap:16px !important;
    box-sizing:border-box; padding:0 24px !important;
  }
  body .header-wrap .header-body > :is(.header-left,.header-center,.header-right) {
    position:static !important; transform:none !important; margin:0 !important;
    width:auto !important; flex:0 0 auto; min-width:0;
  }
  body .header-wrap .header-body > .header-right { margin-left:auto !important; }
  .header-wrap .header-center,
  .header-wrap .header-center .mobile-header-logo,
  .header-wrap .header-center .mobile-header-logo > a { padding:0 !important; margin:0 !important; width:auto !important; }
  .header-wrap .mobile-header-logo .sip-brand-copy { display:flex; flex-direction:column; }
  .header-wrap > .tw-w-full:has(> .header-horizontal-nav) {
    grid-area: 1 / 1; align-self: center; justify-self: center;
    width: max-content !important; max-width: calc(100% - 600px);
    min-width: 0; position: relative; z-index: 5 !important; pointer-events: none;
  }
  .header-wrap .header-horizontal-nav {
    width: max-content !important; max-width: 100% !important; margin: 0 !important;
    padding: 0 !important; gap: 0; height: 44px !important; grid-template-columns: minmax(0, 1fr) !important;
    background: transparent !important; pointer-events: auto;
  }
  .header-horizontal-nav .tw-flex.tw-h-40.tw-items-center.tw-gap-10 { gap: 2px !important; }
  .header-horizontal-nav > :first-child { min-width:0; overflow-x:auto; scrollbar-width:none; }
  .header-horizontal-nav .tw-gap-10 > .tw-relative { padding-inline: 10px !important; }
  .header-horizontal-nav .tw-text-16,
  .header-horizontal-nav .sip-mini-nav-trigger { font-size: 14px !important; }
  .header-horizontal-nav .sip-mini-nav-trigger { padding-inline: 10px; gap: 6px; }
  .header-wrap .header-left, .header-wrap .header-right { position: relative; z-index: 3; }
  .header-wrap .header-right { gap: 8px !important; }
  .header-wrap .sip-header-balance { min-width: 0 !important; }
  .header-wrap .sip-header-user { min-width: 42px !important; width: 42px; padding: 0 !important; justify-content: center !important; }
  .header-wrap .sip-header-user strong, .header-wrap .sip-header-user .icon-dropdown { display: none !important; }
  /* The captured native account control must match the compact live header. */
  html body .header-wrap .header-right .info-user {
    display:flex !important; align-items:center; justify-content:center;
    width:42px !important; min-width:42px !important; height:40px !important;
    padding:0 !important; gap:0 !important;
  }
  .header-wrap .header-right .info-user > :is(span,.icon-dropdown) { display:none !important; }
}

@media (max-width: 1023px) {
  /* The existing drawer keeps all navigation reachable on narrow screens. */
  .header-wrap > .tw-w-full:has(> .header-horizontal-nav) { display: none !important; }
  .header-wrap .header-placeholder { height: 64px !important; }
  .header-wrap .header-body .header-left > [data-tag="top-menu-trigger"] {
    display: inline-flex !important; align-items: center; justify-content: center;
    width: 40px !important; height: 40px !important; line-height: 1 !important;
    margin: 0 !important; transform: none !important; left: auto !important;
  }
  .header-wrap .header-body .mobile-header-logo[data-sip-brand] { height: 40px !important; }
  /* One mobile layout for both captured and native headers. Do not reintroduce
     the old logo-specific grid or reset the right group's auto margin. */
  body .header-wrap .header-body:has(.mobile-header-logo),
  body .header-wrap .header-body {
    display: flex !important; align-items: center !important; gap: 8px !important;
    width: 100% !important; height: 64px !important; min-height: 64px !important;
    box-sizing: border-box !important; padding: 0 12px !important;
  }
  body .header-wrap .header-body > .header-left,
  body .header-wrap .header-body > .header-center {
    display: flex !important; align-items: center !important; min-width: 0;
    position: static !important; transform: none !important; margin: 0 !important;
    padding: 0 !important; height: 40px !important; flex: 0 0 auto;
  }
  body .header-wrap .header-body > .header-center { width: 36px !important; }
  body .header-wrap .header-body > .header-right {
    display: flex !important; align-items: center !important; justify-content: flex-end;
    min-width: 0;
    position: static !important; transform: none !important; margin: 0 0 0 auto !important;
    width: auto !important; height: 40px !important; padding: 0 !important; flex: 0 1 auto;
  }
  html[data-sip-mobile-header="page"] .header-wrap .header-body > :is(.header-left,.header-center) { display: none !important; }
  html[data-sip-mobile-header="page"] .header-wrap .sip-mobile-page-heading {
    display: flex; order: -1; flex: 1 1 auto; align-items: center; gap: 8px;
    min-width: 0; height: 40px; color: #edfaff;
  }
  .sip-mobile-page-heading a { display: flex; flex: 0 0 40px; align-items: center; justify-content: center; width: 40px; height: 40px; color: inherit; }
  .sip-mobile-page-heading svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sip-mobile-page-heading > span { font-size: 18px; font-weight: 600; line-height: 1.3; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  body .header-wrap .header-body,
  body .mobile-bottom-nav .media-header {
    background: rgba(0, 25, 47, .82) !important;
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
  }
  body :is(#global-header,.box-top,.header-wrap,.header-placeholder) {
    background: transparent !important; background-image: none !important;
  }
  body .header-wrap .header-body .top-bg { background: transparent !important; }
  body .mobile-bottom-nav .media-header-row { color: #b8c9df !important; }
  body .mobile-bottom-nav .media-header-row.active,
  body .mobile-bottom-nav .media-header-row.active :is(span,.iconfont) { color: #00d8f5 !important; }
  body .mobile-bottom-nav .media-header-row.active .ripple { background: rgba(0, 125, 255, .18) !important; }
  .mobile-bottom-nav > .media-header:not(.sip-mobile-nav) { display: none !important; }
  body .mobile-bottom-nav:not(.sip-mobile-nav-host) { display: none !important; }
  #mtt-home-bottom-nav { display: none !important; }
  body .sip-mobile-nav-host:not([hidden]) {
    display: block !important; position: fixed; inset: auto 0 0;
    z-index: 1000; width: 100%; height: auto;
  }
  body:has(.sip-mobile-nav-host:not([hidden])) { padding-bottom: var(--sip-bottom-nav-height, 64px) !important; }
  .mobile-bottom-nav .sip-mobile-nav {
    display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav .sip-mobile-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 100% !important; min-width: 0;
    gap: 4px; height: 52px !important; min-height: 52px !important;
    text-decoration: none; font-size: clamp(10px, 2.7vw, 12px); line-height: 1.3; white-space: nowrap;
  }
  .mobile-bottom-nav .sip-mobile-nav .iconfont { font-size: 22px; line-height: 1; }
  .sf-design.sf-guest-view .sf-guest-opinion-choices,
  .sf-design.sf-guest-view .sf-guest-opinion-results { bottom: var(--sip-bottom-nav-height, 64px); }
  .sf-design.sf-guest-view { padding-bottom: calc(104px + var(--sip-bottom-nav-height, 64px) + env(safe-area-inset-bottom)); }
}
