/* ============================================================================
 * BattleMath Offline — Vietnamese Typography, Cartoon Coin & Anti-Overflow Polish
 * 100% Offline stylesheet (zero external URLs).
 * Companion to css/fonts_vi.css (Baloo 2 + Nunito + Mitr local WOFF2 bundles).
 * ============================================================================ */

/* ----------------------------------------------------------------------------
 * 1. Typography System (Playful Baloo 2 Display + Crisp Nunito UI + Thai Mitr)
 * ---------------------------------------------------------------------------- */

:root {
  --bm-emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji';
  --bm-font-ui: 'Nunito', 'Mitr', var(--bm-emoji), system-ui, sans-serif;
  --bm-font-display: 'Baloo 2', 'Nunito', var(--bm-emoji), sans-serif;
  --bm-scroll-thumb: linear-gradient(180deg, rgba(111, 195, 255, 0.72), rgba(255, 201, 60, 0.8));
  --bm-scroll-thumb-h: linear-gradient(90deg, rgba(111, 195, 255, 0.72), rgba(255, 201, 60, 0.8));
  --bm-scroll-thumb-hover: linear-gradient(180deg, rgba(77, 168, 255, 0.94), rgba(255, 184, 0, 0.96));
  --bm-scroll-thumb-h-hover: linear-gradient(90deg, rgba(77, 168, 255, 0.94), rgba(255, 184, 0, 0.96));
  --bm-scroll-ff: rgba(77, 168, 255, 0.58) transparent;
}

/* Keep authentic Mitr typography when Thai mode is selected */
html[lang="th"] {
  --bm-font-ui: 'Mitr', 'Nunito', var(--bm-emoji), system-ui, sans-serif;
  --bm-font-display: 'Mitr', 'Nunito', var(--bm-emoji), sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bm-scroll-thumb: linear-gradient(180deg, rgba(139, 211, 255, 0.58), rgba(255, 201, 60, 0.76));
    --bm-scroll-thumb-h: linear-gradient(90deg, rgba(139, 211, 255, 0.58), rgba(255, 201, 60, 0.76));
    --bm-scroll-thumb-hover: linear-gradient(180deg, rgba(139, 211, 255, 0.88), rgba(255, 201, 60, 0.96));
    --bm-scroll-thumb-h-hover: linear-gradient(90deg, rgba(139, 211, 255, 0.88), rgba(255, 201, 60, 0.96));
    --bm-scroll-ff: rgba(255, 201, 60, 0.56) transparent;
  }
}

:root[data-theme="dark"] {
  --bm-scroll-thumb: linear-gradient(180deg, rgba(139, 211, 255, 0.58), rgba(255, 201, 60, 0.76));
  --bm-scroll-thumb-h: linear-gradient(90deg, rgba(139, 211, 255, 0.58), rgba(255, 201, 60, 0.76));
  --bm-scroll-thumb-hover: linear-gradient(180deg, rgba(139, 211, 255, 0.88), rgba(255, 201, 60, 0.96));
  --bm-scroll-thumb-h-hover: linear-gradient(90deg, rgba(139, 211, 255, 0.88), rgba(255, 201, 60, 0.96));
  --bm-scroll-ff: rgba(255, 201, 60, 0.56) transparent;
}

body {
  font-family: var(--bm-font-ui);
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Display headings, Hero h1, modal titles, big CTAs, math equations, choices,
 * combo pills, stage headers, and Gacha headings -> Baloo 2 (or Mitr in TH) */
.logo,
.logo span,
.st,
.shead h2,
.ssec,
.ttlh,
.ihead b,
.ztitle,
.dish,
.wh b,
.zone .zh b,
.coll .bh,
.clouds b,
.box h1,
.brf h1,
.box button:not(.rst):not(.lb):not(.vt):not(.dinf),
.evbox small,
.evbox b,
.evbox button,
.dhand b,
.dhand button,
.gbox2 h2,
.gback b,
.gsign b,
.gbadge,
.bigb,
.lvb,
.wkb,
.dfire,
.dss,
.gobtn,
.dcard b,
.smed,
.rwl,
.hofs b,
.sum .big,
#qtext,
#choices button,
#pqt,
#pch button,
.dqt,
.dch button,
.dval,
.dangt b#dang,
.dbl i,
.dbal b,
.dsum b,
#cmb,
#cmb b,
#chr,
#mtg,
.combo,
.bossin b,
.pvban,
.dn,
.skc,
.skt,
.bigsym,
.plus,
.nd .no,
.isle .iname,
.sign,
.pill,
.chip,
.dwind,
#dttl,
.buy .price {
  font-family: var(--bm-font-display);
}

/* Keep secondary subtitles crisp in Nunito for clean display/body hierarchy */
.bigb small,
.lvb small,
.dcard small,
.isle .iname small,
.sign small,
.ztitle small,
.box h1 small,
.dss small,
#dttl small {
  font-family: var(--bm-font-ui);
}

/* Preserve monospace room codes and italic serif info icon */
.dncode b {
  font-family: ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
}

.dinf {
  font-family: Georgia, serif;
}

/* ----------------------------------------------------------------------------
 * 2. Banana Pro Golden Coin Icon (.bm-coin)
 * ---------------------------------------------------------------------------- */

.bm-coin {
  position: relative;
  display: inline-block;
  width: 1.24em;
  height: 1.24em;
  min-width: 1.24em;
  flex-shrink: 0;
  border-radius: 0;
  vertical-align: -0.22em;
  margin-right: 0.18em;
  box-sizing: border-box;
  line-height: 1;
  border: none;
  box-shadow: none;
  background: url('../img/icons/math_coin.png') center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.22));
}

.bm-coin::before,
.bm-coin::after {
  content: none;
  display: none;
}

/* Solo flying / floating coins stay perfectly centered */
.cfly .bm-coin,
.dn.coin .bm-coin,
.bm-coin.solo {
  margin-right: 0;
}

#coinpill .bm-coin {
  width: 19px;
  height: 19px;
  min-width: 19px;
  vertical-align: -0.24em;
  margin-right: 2px;
}

.buy .price .bm-coin {
  width: 15px;
  height: 15px;
  min-width: 15px;
  vertical-align: -0.2em;
  margin-right: 2px;
}

.cfly .bm-coin {
  width: 24px;
  height: 24px;
  min-width: 24px;
  vertical-align: middle;
}

/* ----------------------------------------------------------------------------
 * 3. Top Bar (Home .hbar & Battle .hud) — Crisp Single-Line Fit
 * ---------------------------------------------------------------------------- */

.hbar {
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.hbar .chip {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: clamp(12.5px, 3.4vw, 14.5px);
  padding: 4px 10px;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.hbar .stc small {
  font-family: var(--bm-font-ui);
  font-weight: 700;
}

.hbar .ib {
  min-width: 40px;
  min-height: 38px;
  padding: 4px 8px;
  justify-content: center;
  flex-shrink: 0;
}

.dseg {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 245px;
}

.dsb {
  white-space: nowrap;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  padding: 4px 6px;
  gap: 3px;
  line-height: 1.25;
  min-width: 0;
}

/* Battle HUD */
.hud {
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
}

.hud .pill {
  font-size: clamp(13px, 3.5vw, 15px);
  padding: 4px 9px;
  line-height: 1.25;
  white-space: nowrap;
}

#menu {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud .dlk {
  flex-shrink: 0;
  font-size: clamp(12px, 3.1vw, 13.5px);
  padding: 4px 8px !important;
  line-height: 1.25;
}

.hud .ib {
  min-width: 38px;
  min-height: 34px;
  padding: 3px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#coinpill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

@media (max-width: 390px) {
  .hbar {
    gap: 4px;
  }
  .hbar .chip {
    padding: 3px 7px;
    font-size: 12.5px;
  }
  .hbar .ib {
    min-width: 36px;
    min-height: 36px;
    padding: 3px 6px;
  }
  .dsb {
    font-size: 11px;
    padding: 4px 3px;
    gap: 2px;
  }
  .hud {
    gap: 4px;
  }
  .hud .pill {
    padding: 3px 7px;
    font-size: 12.5px;
  }
  .hud .ib {
    min-width: 34px;
    padding: 3px 5px;
  }
}

/* ----------------------------------------------------------------------------
 * 4. Bottom 5-Tab Navigation Bar (#nav)
 * ---------------------------------------------------------------------------- */

#nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
}

#nav button {
  font-size: clamp(10px, 2.7vw, 12px);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: -0.01em;
  padding: 5px 2px;
  min-width: 0;
  gap: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

#nav button b {
  font-size: clamp(19px, 5vw, 22px);
  line-height: 1.15;
}

@media (max-width: 380px) {
  #nav {
    gap: 2px;
    padding-left: 4px;
    padding-right: 4px;
  }
  #nav button {
    font-size: clamp(9.5px, 2.65vw, 11px);
    padding: 4px 1px;
    letter-spacing: -0.02em;
  }
}

/* ----------------------------------------------------------------------------
 * 5. Settings 3-Way Language Switcher & Segmented Pills
 * ---------------------------------------------------------------------------- */

.lrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.lrow b {
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
}

.lrow span {
  display: inline-flex;
  flex-wrap: nowrap;
  flex-shrink: 0;
  max-width: 100%;
  border: 3px solid #1E2A44;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

#ovbox .lrow .lb {
  flex: 0 1 auto;
  margin: 0;
  width: auto;
  white-space: nowrap;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px 10px;
}

#ovbox .d2q .lb,
#ovbox .dnm .lb {
  white-space: nowrap;
  font-family: var(--bm-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px 10px;
}

.vrow b {
  line-height: 1.35;
}

@media (max-width: 390px) {
  .lrow {
    justify-content: center;
  }
  #ovbox .lrow .lb {
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* ----------------------------------------------------------------------------
 * 6. Home Mode Buttons & School Card
 * ---------------------------------------------------------------------------- */

.subt {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.42;
  padding: 0 6px;
}

.bigb {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  column-gap: 0;
  row-gap: 3px;
  padding: 13px 16px;
  line-height: 1.26;
  text-align: center;
}

.bigb small {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  opacity: 0.88;
  text-wrap: balance;
}

.hm2 {
  gap: 8px;
}

.hm2 .bigb {
  font-size: clamp(16.5px, 4.4vw, 19.5px);
  padding: 11px 10px;
  line-height: 1.25;
  gap: 3px;
}

.hm2 .bigb small {
  font-size: clamp(11px, 2.9vw, 12px);
  line-height: 1.35;
  margin-top: 2px;
}

.hmon {
  padding: 12px 14px;
  font-size: clamp(18px, 4.8vw, 21px);
}

.hmrow {
  gap: 8px;
}

.hmb {
  font-family: var(--bm-font-ui);
  font-size: clamp(12.5px, 3.3vw, 14px);
  font-weight: 800;
  line-height: 1.32;
  padding: 7px 10px;
  -webkit-text-stroke: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.scard {
  padding: 9px 12px;
  gap: 10px;
}

.scard .sinfo {
  min-width: 0;
  gap: 2px;
}

.scard .sinfo b {
  font-family: var(--bm-font-display);
  font-size: 16.5px;
  line-height: 1.28;
}

.scard small {
  font-size: 12.5px;
  line-height: 1.38;
}

.note {
  font-size: 13px;
  line-height: 1.42;
}

/* ----------------------------------------------------------------------------
 * 7. World Map, Island Labels, Zone Headers & Stage List
 * ---------------------------------------------------------------------------- */

.isle .iname {
  width: max-content;
  max-width: min(165px, 44cqw);
  padding: 4px 10px;
  font-size: clamp(11.5px, 3vw, 13.5px);
  font-weight: 700;
  line-height: 1.28;
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: normal;
}

.isle .iname small {
  font-size: clamp(10px, 2.5vw, 11.5px);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1px;
}

.isle.bossi .iname {
  white-space: normal;
  width: max-content;
  max-width: min(168px, 46cqw);
  padding: 4px 9px;
  font-size: clamp(11px, 2.8vw, 12.5px);
  line-height: 1.26;
  text-wrap: balance;
}

/* Island region & stage path signposts: wrap cleanly into 1-2 centered lines */
.sign {
  white-space: normal;
  max-width: min(152px, 40cqw);
  padding: 2px 8px;
  line-height: 1.28;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.sign small {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.28;
}

.zmap .sign {
  max-width: min(148px, 38cqw);
  padding: 2px 7px;
  font-size: clamp(10px, 2.1cqh, 12px);
  line-height: 1.26;
}

.zmap .sign small {
  font-size: clamp(9.5px, 1.85cqh, 10.5px);
  line-height: 1.25;
}

.ihead {
  gap: 8px;
  min-width: 0;
}

.ihead b {
  font-size: clamp(17px, 4.6vw, 20px);
  line-height: 1.28;
  min-width: 0;
  overflow-wrap: break-word;
}

.back {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.ztitle {
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: clamp(16px, 4.3vw, 18.5px);
  line-height: 1.32;
}

.ztitle small {
  white-space: nowrap;
  font-weight: 700;
}

.zmode {
  flex-wrap: wrap;
  gap: 6px;
}

.zmb {
  font-size: clamp(12px, 3.2vw, 13.5px);
  padding: 5px 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.ipg {
  white-space: nowrap;
  padding: 6px 12px;
  line-height: 1.25;
}

.snode {
  width: min(136px, 36%);
}

.snode .sl {
  font-size: 11.5px;
  line-height: 1.32;
  padding: 3px 5px 1px;
  text-wrap: balance;
}

.wh b {
  line-height: 1.3;
}

.wh span,
.wh .req,
.zone .req {
  line-height: 1.38;
}

.lvb {
  line-height: 1.3;
  gap: 3px;
}

.lvb small {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.38;
}

/* ----------------------------------------------------------------------------
 * 8. Battle & Practice Screens (Banner, Question Box, Choices, Summon Bar)
 * ---------------------------------------------------------------------------- */

#bubble {
  padding: 6px 12px;
  min-height: 38px;
  font-size: 13.5px;
  line-height: 1.38;
  gap: 8px;
}

#msg {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

#bossbar {
  font-size: 14.5px;
  line-height: 1.36;
  padding: 7px 12px;
}

#qcard {
  padding: 12px 12px 10px;
  gap: 8px;
}

#cmb,
#chr,
#mtg {
  line-height: 1.25;
  padding: 3px 10px;
  max-width: calc(100% - 16px);
}

#qtext {
  font-size: clamp(22px, 6.2vw, 30px);
  font-weight: 700;
  line-height: 1.28;
  padding: 2px 4px;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
}

#qtext.long {
  font-size: clamp(15.5px, 4.1vw, 19px);
  font-weight: 600;
  line-height: 1.44;
  text-wrap: pretty;
}

#pqt {
  font-size: clamp(32px, 9vw, 44px);
  font-weight: 700;
  line-height: 1.22;
  padding: 2px 4px;
  overflow-wrap: break-word;
}

#pqt.long {
  font-size: clamp(17px, 4.5vw, 22px);
  font-weight: 600;
  line-height: 1.44;
  text-wrap: pretty;
}

.qhl {
  padding: 0 4px;
  border-radius: 6px;
  text-underline-offset: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Answer buttons: support clean 2-line wrap for multi-word Vietnamese answers */
#choices,
#pch,
.dch {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#choices.c4,
.dch.c4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#choices button,
#pch button,
.dch button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  min-width: 0;
  padding: 6px 8px;
  font-size: clamp(16px, 4.6vw, 23px);
  font-weight: 700;
  line-height: 1.24;
  overflow-wrap: break-word;
  word-break: normal;
  text-wrap: balance;
  transition: transform 0.08s ease, background-color 0.15s ease;
}

#pch button {
  font-size: clamp(18px, 5vw, 28px);
  padding: 10px 8px;
  min-height: 60px;
}

#hint {
  min-height: 24px;
  font-size: 13.5px;
  line-height: 1.38;
}

#hint.good {
  font-size: clamp(11.5px, 3.2vw, 14px);
  line-height: 1.35;
}

#ph {
  font-size: clamp(14.5px, 3.9vw, 17px);
  line-height: 1.44;
  padding: 2px 4px;
}

/* Hero Summon bar */
#shop {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.buy {
  min-width: 0;
  padding: 4px 2px 5px;
  gap: 2px;
}

.buy .price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: clamp(11px, 2.9vw, 12.5px);
  font-weight: 700;
  line-height: 1.25;
  padding: 1px 7px;
  white-space: nowrap;
  max-width: calc(100% - 4px);
}

/* Stage callouts & tags */
.u .tag {
  line-height: 1.28;
  padding: 1px 6px;
  white-space: nowrap;
}

.skc {
  line-height: 1.28;
  padding: 5px 10px;
}

.skt {
  line-height: 1.28;
}

.pvban {
  line-height: 1.3;
  max-width: 92%;
  white-space: normal;
  text-align: center;
}

/* Modals (Victory / Defeat / Stage Briefing / Settings) */
.box {
  padding: 20px 18px;
  gap: 11px;
}

.box h1,
.brf h1 {
  line-height: 1.32;
  text-wrap: balance;
}

.box h1 small {
  display: inline-block;
  font-size: 0.62em;
  font-weight: 700;
  line-height: 1.38;
  margin-top: 2px;
}

.box p {
  font-size: 15px;
  line-height: 1.48;
}

.box ul {
  font-size: 15px;
  line-height: 1.58;
}

.box button:not(.rst):not(.lb):not(.vt):not(.dinf) {
  line-height: 1.28;
  padding: 12px 14px;
}

.brf p {
  line-height: 1.44;
}

.brf ul {
  line-height: 1.48;
}

.brf .brow {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
}

#ovbox .brf .brow button {
  font-size: clamp(13px, 3.4vw, 15px);
  padding: 9px 6px;
  line-height: 1.26;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.difs .dfb,
#ovbox .difs .dfb {
  font-size: clamp(12.5px, 3.2vw, 14px);
  padding: 7px 4px;
  line-height: 1.28;
  min-width: 0;
  white-space: normal;
}

.chbox {
  font-size: 13.5px;
  line-height: 1.44;
  padding: 8px 11px;
}

.toast {
  line-height: 1.38;
  padding: 9px 16px;
}

/* ----------------------------------------------------------------------------
 * 9. Deck, Gacha, Collection, Shop, Practice & School Polish
 * ---------------------------------------------------------------------------- */

/* Filter & Banner Tabs */
.dtabs {
  gap: 5px;
}

.dt {
  font-size: clamp(12.5px, 3.3vw, 14.5px);
  font-weight: 700;
  padding: 6px 4px;
  line-height: 1.25;
  min-width: 0;
  white-space: nowrap;
}

.btabs .dt {
  font-size: clamp(11.5px, 3vw, 13.5px);
  padding: 5px 4px;
  line-height: 1.25;
  white-space: normal;
  text-wrap: balance;
}

.btabs .dt small {
  display: block;
  font-size: 10.5px;
  line-height: 1.25;
}

.stabs .dt {
  font-size: clamp(12.5px, 3.3vw, 14px);
  padding: 6px 6px;
  line-height: 1.25;
  white-space: nowrap;
}

.mini {
  font-size: clamp(13px, 3.5vw, 14.5px);
  font-weight: 700;
  padding: 8px 8px;
  line-height: 1.28;
  white-space: nowrap;
}

/* Deck Roster */
.rost {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.rc {
  min-width: 0;
  padding: 7px 5px;
  gap: 3px;
}

.rc span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.32;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.rc small {
  font-size: 11px;
  line-height: 1.32;
}

/* Gacha */
.wallet {
  flex-wrap: wrap;
  gap: 6px;
}

.wallet span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  padding: 3px 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.gtabs {
  gap: 5px;
}

.gtab {
  min-width: 0;
  font-size: clamp(11px, 2.95vw, 12.5px);
  font-weight: 700;
  padding: 7px 5px;
  line-height: 1.28;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.gsign b {
  font-size: clamp(15px, 4vw, 18px);
  letter-spacing: 1px;
}

.grates {
  font-size: 12px;
  line-height: 1.4;
}

.pity {
  height: auto;
  min-height: 20px;
  padding: 1px 0;
  font-size: 11px;
}

.pity span {
  display: block;
  line-height: 1.35;
  padding: 0 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gbtns .bigb.sm {
  font-size: clamp(14.5px, 3.8vw, 17px);
  padding: 10px 8px;
  min-height: 54px;
  line-height: 1.26;
}

.gbtns .bigb.sm small {
  font-size: 11.5px;
  line-height: 1.32;
}

.gc {
  width: 84px;
  padding: 5px 4px;
}

.gc small {
  font-size: 11px;
  line-height: 1.32;
  text-align: center;
}

.gfront span {
  font-size: 11.5px;
  line-height: 1.28;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.gfront small {
  font-size: 10.5px;
  line-height: 1.3;
  text-align: center;
}

/* Collection Cards & Monster Book */
.coll {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cc {
  min-width: 0;
  padding: 8px 7px;
  gap: 4px;
}

.cc span {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.32;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.cc small {
  font-size: 11px;
  line-height: 1.36;
}

.cc .lvb {
  font-size: 11.5px;
  line-height: 1.25;
  padding: 2px 7px;
}

.cc .afl {
  font-size: 11.5px;
  line-height: 1.36;
  text-align: center;
}

.bars label {
  height: 17px;
  line-height: 17px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 6px;
}

.shp {
  height: 19px;
  line-height: 19px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0 6px;
}

.cc .sk {
  font-size: 11px;
  line-height: 1.42;
  padding: 4px 6px;
  overflow-wrap: break-word;
}

.cc .sk .s15,
.cc .sk .s20 {
  font-size: 11px;
  line-height: 1.38;
}

.upb {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 7px 6px;
}

.gsb {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  padding: 5px 8px;
}

.bkz {
  gap: 5px;
  padding: 2px 2px 7px;
}

.bzb {
  font-size: 12px;
  padding: 5px 9px;
  line-height: 1.25;
}

.bk {
  min-width: 0;
  padding: 6px 4px;
  gap: 2px;
}

.bk b {
  font-size: 11.5px;
  line-height: 1.3;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.bk small {
  font-size: 10.5px;
  line-height: 1.3;
}

/* Shop Screen */
.shead {
  gap: 8px;
  flex-wrap: wrap;
}

.smed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 15px;
  padding: 4px 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.shg {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.shg.d4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.sit {
  padding: 7px 5px;
  gap: 3px;
}

.sit b {
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.sit small {
  font-size: 10.5px;
  line-height: 1.32;
}

.sbuy {
  font-size: 11.5px;
  line-height: 1.25;
  padding: 5px 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.srow {
  padding: 7px 9px;
  gap: 8px;
  line-height: 1.34;
}

.srow > span,
.srow > div {
  min-width: 0;
  flex: 1;
}

.srow small {
  font-size: 11.5px;
  line-height: 1.36;
}

.srow .sbuy {
  flex-shrink: 0;
  min-width: 78px;
}

.stl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 6px;
}

.stl .srow {
  font-size: 12.5px;
  padding: 6px 7px;
  gap: 5px;
}

.stl .srow .sbuy {
  min-width: 58px;
  padding: 4px 6px;
}

@media (max-width: 380px) {
  .stl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .shg.d4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Practice Grade / Topic Tabs */
.ptabs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
}

.ptb {
  min-width: 0;
  padding: 5px 2px;
  font-size: clamp(9.5px, 2.5vw, 11px) !important;
  line-height: 1.25;
}

.mode,
.tp {
  font-size: clamp(13px, 3.5vw, 14.5px);
  padding: 7px 12px;
  line-height: 1.32;
  text-align: center;
}

.pn.many .tp {
  font-size: 13px;
  padding: 5px 9px;
  min-height: 34px;
  line-height: 1.32;
}

/* School, Hall of Fame, XP Bar & Quests / 7-Day Login */
.xbar {
  height: 19px;
}

.xbar span {
  font-size: 11px;
  line-height: 15px;
}

.hofs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.hofs div {
  padding: 7px 8px;
  min-width: 0;
}

.hofs small {
  font-size: 11.5px;
  line-height: 1.34;
}

.trow {
  gap: 7px;
}

.tro {
  padding: 6px 5px;
  min-width: 0;
}

.tro small {
  font-size: 11.5px;
  line-height: 1.32;
}

.bdg2 {
  padding: 7px 10px;
  gap: 9px;
}

.bdg2 b {
  font-size: 13.5px;
  line-height: 1.34;
}

.bdg2 small {
  font-size: 11.5px;
  line-height: 1.38;
}

.ttr {
  padding: 6px 9px;
  gap: 8px;
}

.ttr b {
  font-size: 13.5px;
  line-height: 1.34;
}

.ttr small {
  font-size: 11.5px;
  line-height: 1.36;
}

.ttb {
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
  line-height: 1.25;
}

.sk2 {
  padding: 8px 10px;
  gap: 10px;
  line-height: 1.36;
}

.sk2 small {
  font-size: 12px;
  line-height: 1.38;
}

.chr2 {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 9px;
  line-height: 1.36;
}

.chr2 > span {
  min-width: 0;
  overflow-wrap: break-word;
}

.chr2 span small {
  font-size: 12px;
  line-height: 1.36;
  margin-top: 2px;
}

.chr2 button {
  white-space: nowrap;
  padding: 5px 11px;
  font-size: 12.5px;
  line-height: 1.25;
  flex-shrink: 0;
}

/* 7-Day Login Tiles */
.lgrid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.lgd {
  min-width: 0;
  padding: 7px 4px;
  gap: 2px;
  font-size: 12px;
  line-height: 1.28;
  text-align: center;
}

.lgd b {
  font-size: 11.5px;
  line-height: 1.26;
  white-space: nowrap;
}

.lgd small {
  font-size: 10.5px;
  line-height: 1.28;
  overflow-wrap: break-word;
}

@media (max-width: 360px) {
  .lgrid {
    gap: 4px;
  }
  .lgd {
    padding: 6px 2px;
    font-size: 11px;
  }
  .lgd b {
    font-size: 10.5px;
  }
}

/* ----------------------------------------------------------------------------
 * 10. Cannon Duel & 2-Player / Online Polish
 * ---------------------------------------------------------------------------- */

.dcard {
  padding: 8px 11px;
  gap: 10px;
}

.dcard b {
  font-size: 16.5px;
  line-height: 1.28;
}

.dcard small {
  font-size: 12.5px;
  line-height: 1.36;
}

#dttl {
  font-size: clamp(13.5px, 3.6vw, 15.5px);
  line-height: 1.28;
}

#dttl small {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 8px;
  line-height: 1.22;
}

.dwind {
  font-size: clamp(12px, 3.2vw, 14px);
  padding: 3px 9px;
  line-height: 1.25;
}

#dturn {
  line-height: 1.28;
}

.dmsg {
  line-height: 1.38;
}

.dbal {
  line-height: 1.36;
  padding: 4px 10px;
}

.desk {
  line-height: 1.32;
}

.dlab {
  width: auto;
  min-width: 58px;
  max-width: 84px;
  font-size: clamp(13px, 3.5vw, 15px);
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
}

.dangt {
  line-height: 1.25;
}

.dss {
  width: auto;
  min-width: 82px;
  max-width: 106px;
  padding: 4px 6px;
  font-size: 14.5px;
  line-height: 1.22;
}

.dss small {
  font-size: 10.5px;
  line-height: 1.22;
  white-space: nowrap;
}

/* Cannon Duel Item Chips (Dịch chuyển, Bắn đôi, Lặng gió, Hồi máu) */
.ditems {
  gap: 5px;
  align-items: stretch;
}

.dit {
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 3px;
  gap: 1px;
  line-height: 1.2;
  justify-content: center;
}

.dit small {
  font-size: clamp(9.5px, 2.5vw, 10.5px);
  font-weight: 700;
  line-height: 1.24;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.dit b {
  font-size: 11px;
  line-height: 1.22;
}

/* Cannon Duel Item Shop */
.dshl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.dsi {
  min-width: 0;
  padding: 7px 9px;
  gap: 2px;
}

.dsi span {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.32;
}

.dsi small {
  font-size: 11.5px;
  line-height: 1.36;
}

.dsi em {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  line-height: 1.25;
}

/* Cannon Duel Quiz & Answer Balloons */
.dqt {
  font-size: clamp(20px, 5.8vw, 28px);
  font-weight: 700;
  line-height: 1.28;
  overflow-wrap: break-word;
}

#duel .dqt.long {
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 600;
  line-height: 1.44;
}

.dqi,
.dqh,
.dqss,
.dpmt {
  line-height: 1.38;
}

.dbl i {
  font-weight: 700;
  line-height: 1.15;
  padding: 2px;
  text-align: center;
}

.dbl i.sm {
  font-size: 13px;
}

.d2h .dhb {
  width: 88px;
  height: 106px;
  padding: 4px 3px;
}

.d2h .dhb span {
  font-size: 11px;
  line-height: 1.25;
  max-height: 30px;
  overflow-wrap: break-word;
}

.dhow ol,
.dtut p,
.d2s p,
.dnwait,
.dnerr {
  line-height: 1.48;
}

/* ----------------------------------------------------------------------------
 * 11. Sleek 5px Custom Scrollbar (Sky-Blue & Gold Theme, Light & Dark Modes)
 * ---------------------------------------------------------------------------- */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bm-scroll-ff);
}

#home.g,
#home.g * {
  scrollbar-color: rgba(255, 201, 60, 0.56) transparent;
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--bm-scroll-thumb);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:horizontal {
  background: var(--bm-scroll-thumb-h);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--bm-scroll-thumb-hover);
}

*::-webkit-scrollbar-thumb:horizontal:hover {
  background: var(--bm-scroll-thumb-h-hover);
}

#home.g *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(166, 232, 255, 0.6), rgba(255, 201, 60, 0.8));
}

#home.g *::-webkit-scrollbar-thumb:horizontal {
  background: linear-gradient(90deg, rgba(166, 232, 255, 0.6), rgba(255, 201, 60, 0.8));
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

/* ----------------------------------------------------------------------------
 * 12. Round 2 Surgical Polish Fixes (High-Specificity Overrides)
 * ---------------------------------------------------------------------------- */

/* 12.1 Zone & Island Stage Map Sign Pills — strictly contained, never overflow right border */
.sea,
.ibig,
.zmap {
  container-type: size;
}

#hs .zmap .lmk .sign,
#hs .zmap .lmk.lb .sign,
#hs .ibig .ireg .sign,
html.ls #hs .zmap .lmk .sign,
html.ls #hs .ibig .ireg .sign {
  box-sizing: border-box;
  width: auto;
  max-width: min(168px, 44cqw);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
  padding: 3px 8px;
  line-height: 1.25;
}

#hs .snode .sl,
#hs .snode.sboss .sl {
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
}

/* 12.2 Gacha Machine Nameplate — single centered horizontal line above capsule chute */
#gmach .gbody2 .gbadge,
.gm2 .gbody2 .gbadge {
  box-sizing: border-box;
  left: 92px;
  top: 26px;
  width: auto;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9.5px;
  line-height: 1.2;
  letter-spacing: 0;
  padding-block: 2px;
  padding-inline: 4px;
}

/* 12.3 Online Duel & 2-Player Modal Footer Button Row — centered / full-width alignment */
#ovbox .brf.d2s .brow,
#ovbox .brf.dns .brow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

#ovbox .brf .brow:has(> button:only-child),
#ovbox .brf.dns .brow:has(> button:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

#ovbox .brf .brow button:only-child,
#ovbox .brf.dns .brow button:only-child {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
  text-align: center;
  padding: 10px 14px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  #nav button,
  #choices button,
  #pch button,
  .dch button {
    transition: none;
  }
}

/* ============================================================================
 * 13. Standard Fixed Mobile-Portrait Phone Shell (Zero-Bug 1:1 Architecture)
 * ============================================================================ */

/* 13.1 Desktop & Tablet (>= 481px): Seamless Centered 430px Portrait Column (No Phone Bezel) */
@media (min-width: 481px) {
  html,
  html.ls {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    background: linear-gradient(180deg, #88cfff 0%, #bfe8ff 60%, #eaf6ff 100%);
  }

  html:has(#home.g) {
    background: radial-gradient(circle at 50% 35%, #4a3590 0%, #2a1d5e 100%);
  }

  body,
  html.ls body {
    position: relative;
    width: min(100%, 430px);
    height: 100vh;
    height: 100dvh;
    max-width: 430px;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(180deg, #88cfff 0%, #bfe8ff 60%, #eaf6ff 100%);
  }
}

/* 13.2 Real Smartphones (<= 480px): Full-Bleed Edge-to-Edge Native View */
@media (max-width: 480px) {
  html,
  body,
  html.ls,
  html.ls body {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: block;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  body,
  html.ls body {
    position: relative;
    background: linear-gradient(180deg, #88cfff 0%, #bfe8ff 60%, #eaf6ff 100%);
  }
}

/* 13.3 Contain All App Layers & Overlays Inside body
 *      (9 position:fixed -> position:absolute; .cfly stays position:fixed so
 *      coinFly() getBoundingClientRect() coordinates remain 1:1 exact!) */
.app,
html.web .app {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  zoom: 1 !important;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

#home {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: hidden;
  box-sizing: border-box;
}

#hs {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 12px 12px;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

#ov {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}

#duel {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden;
  box-sizing: border-box;
}

.dhand,
.evo {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.gov {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.clouds {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.toast {
  position: absolute !important;
  max-width: calc(100% - 28px);
}

.dtut {
  position: absolute !important;
  width: min(calc(100% - 24px), 380px);
}

/* 13.4 Viewport-Unit Leak Fixes & Compact Portrait Scaling (430x696 -> 430x860 & 360x640) */
.box,
html.ls #ovbox {
  max-height: calc(100% - 24px);
  max-width: calc(100% - 24px);
}

.brf .bscene {
  max-height: min(17vh, 136px);
}

html.web #stage,
#stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 148px;
  max-height: 245px;
}

svg.geo,
#pqt svg.geo {
  max-height: 136px;
}

.gcd {
  width: min(28vw, 112px, 17vh);
}

.gcards.n1 .gcd {
  width: min(46vw, 164px, 30vh);
}

/* Keep #nav always docked horizontally at the bottom inside #home */
#nav,
html.ls #nav {
  order: 0 !important;
  flex: 0 0 auto;
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 3px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box;
}

#nav button,
html.ls #nav button {
  min-height: 54px;
  max-height: none;
  flex: none;
  padding: 5px 2px;
  gap: 3px;
  font-size: clamp(10px, 2.7vw, 12px);
  white-space: nowrap;
}

#nav button b,
html.ls #nav button b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  line-height: 1;
}

/* Balanced vertical proportions on Home so 430x696 (1280x720) & 360x640 stay crisp */
#hs[data-scr="home"] .hero-area {
  padding: 4px 0 0;
}

#hs[data-scr="home"] .logo {
  font-size: clamp(32px, 5.4vh, 46px);
}

#hs[data-scr="home"] .logo span {
  font-size: clamp(38px, 6.2vh, 54px);
}

#hs[data-scr="home"] .parade {
  height: 92px;
  margin: 0 -12px;
  padding: 0 12px;
}

#hs[data-scr="home"] .scard {
  margin: 2px 0 4px;
  padding: 7px 10px;
}

#hs[data-scr="home"] .bigb {
  min-height: 54px;
  padding: 9px 12px;
}

#hs[data-scr="home"] .hmon {
  margin-top: 2px;
  padding: 9px 12px;
}

/* 13.5 Portrait-Lock Guard: Neutralize legacy html.ls landscape rules if ever toggled */
html.ls #home {
  flex-direction: column !important;
  padding-top: env(safe-area-inset-top, 0px) !important;
}

html.ls #hs {
  max-width: none !important;
  padding: 10px 12px 12px !important;
  gap: 8px !important;
}

html.ls #hs[data-scr="home"],
html.ls #hs[data-scr="deck"],
html.ls #hs[data-scr="shop"],
html.ls #hs[data-scr="map"] {
  display: flex !important;
  flex-direction: column !important;
}

html.ls #hs[data-scr="home"] .hcol,
html.ls #hs[data-scr="shop"] .scol {
  display: contents !important;
}

html.ls #hs[data-scr="home"] .hmon small {
  display: block !important;
}

html.ls #hs[data-scr="gacha"] .gwrap {
  display: flex !important;
  flex-direction: column !important;
}

html.ls #hs[data-scr="school"] .hofs {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.ls #hs[data-scr="school"] .hofb {
  display: flex !important;
  flex-direction: column !important;
}

html.ls #hs[data-scr="map"] > .ztitle {
  white-space: normal !important;
  overflow: visible !important;
}

html.ls #hs[data-scr="map"] > .ztitle small {
  display: inline !important;
}

html.ls .sea .boat {
  left: 2% !important;
  top: 1.2% !important;
  animation-name: boat !important;
}

html.ls .app {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 6px 10px 10px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

html.ls #stwrap {
  display: contents !important;
}

html.ls #stage {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 148px !important;
  max-height: 245px !important;
  flex: 1 1 auto !important;
  translate: none !important;
  scale: 1 !important;
}

html.ls #choices {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

html.ls #choices.c4 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.ls #duel {
  flex-direction: column !important;
  gap: 6px !important;
  padding: max(6px, env(safe-area-inset-top, 0px)) 10px max(8px, env(safe-area-inset-bottom, 0px)) !important;
}

html.ls .dpan {
  flex: 0 0 auto !important;
  margin: 0 !important;
  overflow: visible !important;
  max-height: none !important;
}

html.ls .dch {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

html.ls .dch.c4 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.ls .dit small {
  display: block !important;
}

html.ls #ov {
  padding: 0 !important;
}

html.ls #ovbox.cols2,
html.ls #ovbox:has(.d2s) {
  display: flex !important;
  column-count: auto !important;
  max-width: calc(100% - 24px) !important;
}

html.ls .d2g {
  display: flex !important;
  flex-direction: column !important;
}

/* ============================================================================
 * 14. Banana Pro Custom Icon Styling (.bm-ic & Battle Stun FX)
 * ============================================================================ */

/* 14.1 Base inline custom icon + specificity shield against card/map `img` rules */
.bm-ic,
img.bm-ic,
.sit img.bm-ic,
.bk img.bm-ic,
.gc img.bm-ic,
.gm img.bm-ic,
.rc img.bm-ic,
.cc img.bm-ic,
.foes img.bm-ic,
.foes .bossp img.bm-ic,
.brf .foes img.bm-ic,
.brf .foes .bossp img.bm-ic,
.snode img.bm-ic,
.ireg img.bm-ic,
.lmk img.bm-ic,
.zmap .lmk img.bm-ic,
.zmap .lmk.lb img.bm-ic,
.gfront img.bm-ic,
.dcard img.bm-ic,
.dhand img.bm-ic,
.dnf img.bm-ic,
html.ls .ireg img.bm-ic,
html.ls .zmap .lmk img.bm-ic,
html.ls .zmap .lmk.lb img.bm-ic {
  display: inline-block;
  width: 1.28em;
  height: 1.28em;
  max-width: none;
  max-height: none;
  vertical-align: -0.24em;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
  image-rendering: auto;
  transform: none;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.16));
}

/* Keep lock/star/medal icons crisp and full-color even on silhouetted cards/nodes */
.rc.lock img.bm-ic,
.cc.lock img.bm-ic,
.bk.unk img.bm-ic,
.gm.lock img.bm-ic,
.lmk.lk img.bm-ic,
.ireg.fog img.bm-ic {
  opacity: 1;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.16));
}

/* 14.2 Bottom Navigation Bar */
#nav .ni .bm-ic,
#nav button .bm-ic,
#nav button b .bm-ic {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin: 0;
}

/* 14.3 Home Big Mode Cards & Subtitles */
.bigb .bm-ic,
.hmon .bm-ic {
  width: 28px;
  height: 28px;
  vertical-align: -0.26em;
  margin-right: 4px;
}

.bigb small .bm-ic,
.hmon small .bm-ic {
  width: 15px;
  height: 15px;
  vertical-align: -0.18em;
  margin-right: 2px;
}

/* 14.4 Top Bar & Currency Pills */
.hbar .bm-ic,
.hwal .bm-ic,
.wallet .bm-ic,
.hud .bm-ic,
#coinpill .bm-ic,
.smed .bm-ic {
  width: 19px;
  height: 19px;
  vertical-align: -0.24em;
  margin-right: 2px;
}

/* 14.5 Shop Weekly Decorations & Shop Purchase Buttons */
.sit .sem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-height: 54px;
}

.sem .bm-ic,
.sdec .sem .bm-ic,
.sit .sem .bm-ic,
.sit .sem img.bm-ic {
  width: 52px;
  height: 52px;
  vertical-align: middle;
  margin: 0;
}

.sit .sbuy img.bm-ic,
.sbuy .bm-ic {
  width: 16px;
  height: 16px;
  vertical-align: -0.22em;
  margin-right: 2px;
}

/* 14.6 Practice Topic Tabs */
.ptb i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ptabs button .bm-ic,
.ptabs .ptb .bm-ic,
.ptabs .ptb i .bm-ic {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto 2px;
}

/* 14.7 School Skills, Hall of Fame Badges & Collection Skill Icons */
.sk .bm-ic,
.sk2 > span:first-child .bm-ic,
.bdg .bm-ic,
.bdg2 .be .bm-ic,
.ach .bm-ic {
  width: 24px;
  height: 24px;
  vertical-align: -0.22em;
}

.tro span .bm-ic {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin: 0;
}

.cc .sk img.bm-ic {
  width: 17px;
  height: 17px;
  vertical-align: -0.22em;
  margin-right: 2px;
}

/* 14.8 Cannon Duel Items, Shop & Battle Chalk Cannon */
.dit .bm-ic,
.dsi .bm-ic {
  width: 22px;
  height: 22px;
  vertical-align: -0.24em;
}

.dit .bm-ic {
  margin: 0 auto 1px;
}

.dsi em .bm-ic {
  width: 17px;
  height: 17px;
  vertical-align: -0.2em;
  margin-right: 2px;
}

.cannon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cannon .bm-ic {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin: 0;
}

/* 14.9 Modal & Section Headers */
.st .bm-ic,
.box h1 .bm-ic,
.brf h1 .bm-ic,
.shh .bm-ic,
.shead h2 .bm-ic,
.ssec .bm-ic,
.dish .bm-ic,
.ttlh .bm-ic,
.ihead b .bm-ic,
.ztitle .bm-ic,
.gbox2 h2 .bm-ic {
  width: 1.3em;
  height: 1.3em;
  vertical-align: -0.22em;
  margin-right: 3px;
}

/* 14.10 Audio & Settings Icon Buttons */
#ovbox .vt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#sndbtn .bm-ic,
#bgmbtn .bm-ic,
.sico .bm-ic,
#setbtn .bm-ic,
.cfg .bm-ic,
#cfg .bm-ic,
#bS .bm-ic,
#bM .bm-ic,
#tgS .bm-ic,
#tgM .bm-ic,
.hud .ib .bm-ic,
.hbar .ib .bm-ic,
#ovbox .vt .bm-ic {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin: 0;
}

/* 14.11 Battle HUD, Enemy Skills, Stars, Map & Modal Micro-Polish */
#bubble span:first-child .bm-ic {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin: 0;
}

.u .mtb .bm-ic {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin: 0;
}

.u .ski .bm-ic {
  width: 15px;
  height: 15px;
  vertical-align: middle;
  margin: 0;
}

.sic .bm-ic {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin: 0;
}

.box .stars .bm-ic,
.brf .dst .bm-ic {
  width: 34px;
  height: 34px;
  vertical-align: middle;
  margin: 0 2px;
}

.sea .boat .bm-ic {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin: 0;
}

.cfly .bm-ic {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin: 0;
}

.hmb .bm-ic {
  width: 18px;
  height: 18px;
  vertical-align: -0.22em;
  margin-right: 2px;
}

.wkb .bm-ic {
  width: 19px;
  height: 19px;
  vertical-align: -0.22em;
  margin-right: 3px;
}

.skl .bm-ic {
  width: 16px;
  height: 16px;
  vertical-align: -0.22em;
  margin-right: 2px;
}

.dcard > i img.bm-ic {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin: 0;
}

.dcard em img.bm-ic {
  width: 16px;
  height: 16px;
  vertical-align: -0.2em;
  margin: 0 1px;
}

.lgd .bm-ic {
  width: 20px;
  height: 20px;
  vertical-align: -0.2em;
}

/* 14.12 Battle Stun Overlay -> Banana Pro Dizzy FX */
.u.stun::before {
  content: '';
  width: 22px;
  height: 22px;
  top: -10px;
  background: url('../img/icons/fx_dizzy.png') center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.28));
}

/* ==========================================================================
   15. Final Micro-Polish (Round 2 Visual Audit Fixes)
   ========================================================================== */
/* 15.1 Home Hero floating math symbols clear of Vietnamese subtitle */
.hero-area .sym.a { left: 3%; top: 10%; font-size: 26px; z-index: 1; }
.hero-area .sym.b { right: 4%; top: 8%; font-size: 26px; z-index: 1; }
.hero-area .sym.c { left: 3%; top: 72%; font-size: 24px; opacity: 0.72; z-index: 1; }
.hero-area .sym.d { right: 3%; top: 72%; font-size: 24px; opacity: 0.72; z-index: 1; }
.hero-area .subt {
  position: relative;
  z-index: 2;
  padding-inline: 10px;
}

/* 15.2 Collection sub-tabs: never split Vietnamese words mid-word ("Sổ Tay / Quỷ") */
#hs .btabs .dt {
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  font-size: 11.5px;
  line-height: 1.22;
  padding: 5px 4px;
}

/* 15.3 Practice topic tabs: spacious 4-column grid so long topic names breathe */
#hs .ptabs {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 5px;
}
#hs .ptabs button {
  padding: 6px 4px;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  min-height: 58px;
}

/* 15.4 Online / 2P hero selector cards: unclipped full Vietnamese hero names */
#ovbox .d2h .dhb {
  width: 86px;
  height: auto !important;
  min-height: 98px;
  padding: 6px 4px 8px;
  overflow: visible;
  justify-content: flex-start;
  gap: 4px;
}
#ovbox .d2h .dhb img:not(.bm-ic) {
  height: 54px;
  flex: 0 0 54px;
}
#ovbox .d2h .dhb span {
  font-size: 10.5px;
  line-height: 1.22;
  white-space: normal;
  overflow: visible;
}

/* 15.5 World Map Page 1 & 2 clean ocean gaps between ALL 5 islands, pills & pagination */
#hs .sea .isle .iname {
  font-size: 10.5px;
  padding: 2px 7px;
  max-width: min(132px, 37cqw);
}
#hs .sea .isle[data-i="2"],
#hs .sea .isle[data-i="6"] {
  top: 38% !important;
}
#hs .sea .isle[data-i="3"],
#hs .sea .isle[data-i="7"] {
  left: 4% !important;
  top: 61% !important;
}
#hs .sea .isle.bossi {
  left: 47% !important;
  top: 71% !important;
  transform: none !important;
}
#hs .sea .isle.bossi .iname {
  font-size: 10px;
  padding: 2px 6px;
  max-width: min(122px, 34cqw);
}

/* ============================================================================
 * 16. Atmospheric Banana Pro Locked-Stage Fog Mist & Island Map Ambient Fix
 * ============================================================================ */

/* 16.1 Sprite-anchored Banana Pro crescent mist (.fogc) — never stretched to wide signposts */
#hs .zmap .lmk.lk .fogc,
#hs .zmap .lmk.lb.lk .fogc,
#hs .ibig .ireg.fog .fogc {
  position: absolute;
  left: 50%;
  right: auto;
  top: -4px;
  bottom: auto;
  transform: translateX(-50%);
  border-radius: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  opacity: 0.96;
  background: url('../img/icons/map_fog_mist.png') center bottom / 100% auto no-repeat;
  filter: drop-shadow(0 3px 4px rgba(24, 42, 78, 0.24));
  animation: bmFogFloat 4.2s ease-in-out infinite;
}

@keyframes bmFogFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-2.5px);
  }
}

/* Sprite-matched mist proportions so the darkened building peeks cleanly through the upper gap */
#hs .zmap .lmk.lk .fogc {
  width: clamp(68px, 19cqh, 102px);
  height: clamp(48px, 13.5cqh, 74px);
  top: 2px;
}

#hs .zmap .lmk.lb.lk .fogc {
  width: clamp(92px, 26cqh, 136px);
  height: clamp(66px, 18.5cqh, 96px);
  top: 4px;
}

#hs .ibig .ireg.fog .fogc {
  width: 112px;
  height: 82px;
  top: 2px;
}

/* 16.2 Darkened mysterious landmark silhouettes peeking behind mist */
#hs .zmap .lmk.lk > img:not(.bm-ic),
#hs .ibig .ireg.fog > img:not(.bm-ic) {
  position: relative;
  z-index: 1;
  opacity: 0.92;
  filter: grayscale(0.62) saturate(0.55) brightness(0.76) contrast(0.96) drop-shadow(0 3px 0 rgba(20, 35, 65, 0.28));
}

#hs .zmap .lmk.lb.lk > img:not(.bm-ic) {
  filter: grayscale(0.45) saturate(0.7) brightness(0.74) contrast(1.02) drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

/* 16.3 Crisp golden Banana Pro padlock medallion anchored at mist base */
#hs .zmap .lmk.lk .fogc::after,
#hs .ibig .ireg.fog .fogc::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(24, 38, 68, 0.86) url('../img/icons/ui_lock.png') center / 16px 16px no-repeat;
  border: 2px solid #FFC93C;
  box-shadow: 0 2px 4px rgba(15, 25, 48, 0.45);
  z-index: 3;
}

#hs .zmap .lmk.lb.lk .fogc::after {
  width: 28px;
  height: 28px;
  background-size: 19px 19px;
  border-color: #E9D5FF;
}

/* 16.4 Signpost layering & refined locked plaque contrast */
#hs .zmap .lmk .sign,
#hs .ibig .ireg .sign {
  position: relative;
  z-index: 4;
}

#hs .zmap .lmk.lk .sign,
#hs .ibig .ireg.fog .sign {
  background: #8F755D;
}

#hs .ibig .ireg.fog .sign {
  width: auto;
  max-width: min(145px, 42cqw);
}

#hs .zmap .lmk.lb.lk .sign {
  background: #5D3878;
}

/* World Map locked regular island plaque contrast so unlocked island pops */
#hs .sea .isle.soon:not(.bossi) .iname {
  background: #E2E8F0;
  color: #334155;
  border-color: #475569;
  box-shadow: 0 3px 0 #475569;
}

/* 16.5 Night (body.dif1) & Storm (body.dif2) atmospheric mist tinting */
body.dif1 #hs .zmap .lmk.lk .fogc,
body.dif1 #hs .zmap .lmk.lb.lk .fogc,
body.dif1 #hs .ibig .ireg.fog .fogc {
  filter: brightness(0.76) hue-rotate(12deg) saturate(1.22) drop-shadow(0 3px 5px rgba(10, 18, 42, 0.42));
}

body.dif2 #hs .zmap .lmk.lk .fogc,
body.dif2 #hs .zmap .lmk.lb.lk .fogc,
body.dif2 #hs .ibig .ireg.fog .fogc {
  filter: brightness(0.64) hue-rotate(28deg) saturate(1.32) drop-shadow(0 3px 6px rgba(12, 8, 28, 0.55));
}

/* 16.6 Island Map ambient clouds & birds fix (.ibig .iwrap > .cld / .bird) */
.ibig .iwrap > .isimg {
  pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(20, 60, 110, 0.35));
}

.ibig .iwrap > .cld {
  z-index: 3;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: 0.92;
  filter: drop-shadow(0 26px 0 rgba(20, 60, 110, 0.18));
  animation: cld 38s linear infinite;
}

.ibig .iwrap > .cld.c1 {
  top: 6%;
  width: 110px;
  left: -30%;
}

.ibig .iwrap > .cld.c2 {
  top: 52%;
  width: 84px;
  left: -30%;
  animation-duration: 55s;
  animation-delay: -24s;
}

.ibig .iwrap > .bird {
  z-index: 3;
  pointer-events: none;
  width: 22px;
  image-rendering: pixelated;
  animation: bird 16s linear infinite, flap 0.5s steps(2) infinite;
}

.ibig .iwrap > .bird.b1 {
  top: 18%;
  left: 110%;
}

.ibig .iwrap > .bird.b2 {
  top: 23%;
  left: 118%;
  width: 16px;
  animation-delay: -1.2s, -0.25s;
}

body.dif1 .ibig .iwrap > .cld {
  opacity: 0.3;
}

body.dif2 .ibig .iwrap > .cld {
  filter: brightness(0.55);
  opacity: 0.8;
}

body.dif1 .ibig .iwrap > .bird,
body.dif2 .ibig .iwrap > .bird {
  display: none;
}

/* 16.7 Explicit compact star icon sizing inside Gacha machine nameplate */
.gbadge .bm-ic-sm {
  width: 11px;
  height: 11px;
  vertical-align: -0.14em;
  margin: 0 1px;
}

/* 16.8 Respect reduced motion preference for fog drift & island ambient sprites */
@media (prefers-reduced-motion: reduce) {
  #hs .zmap .lmk.lk .fogc,
  #hs .zmap .lmk.lb.lk .fogc,
  #hs .ibig .ireg.fog .fogc,
  .ibig .iwrap > .cld,
  .ibig .iwrap > .bird {
    animation: none;
  }
}

/* ============================================================================
 * 17. Google Account, Mandatory Login & Unique Name Gates, Cloud Save & Duel UI
 *     Chunky #1E2A44 cartoon styling tuned for 430px portrait & 360px phones
 * ============================================================================ */

/* 17.1 Home Top Bar Account Avatar Button (.hbar .acc-btn, #accBtn) */
.hbar .acc-btn,
.hbar button.acc-btn,
#accBtn {
  min-width: 38px;
  min-height: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 3px solid #1E2A44;
  background: #fff;
  color: #1E2A44;
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  box-shadow: 0 2px 0 #1E2A44;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.hbar .acc-btn:hover,
#accBtn:hover {
  background: #F4FAFF;
  transform: translateY(-1px);
  box-shadow: 0 3px 0 #1E2A44;
}

.hbar .acc-btn:active,
#accBtn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #1E2A44;
}

#home.g .hbar .acc-btn,
#home.g #accBtn {
  box-shadow: 0 2px 0 #1E2A44, 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.acc-btn img.acc-av,
#accBtn img.acc-av {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.acc-btn .acc-av:not(img),
#accBtn .acc-av:not(img) {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #EAF2FF;
  color: #1E2A44;
  font-family: var(--bm-font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.acc-btn svg.acc-g,
#accBtn svg.acc-g {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.acc-btn .acc-dot,
#accBtn .acc-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid #1E2A44;
  border-radius: 50%;
  background: #94A3B8;
  pointer-events: none;
  z-index: 2;
}

.acc-btn .acc-dot.on,
#accBtn .acc-dot.on {
  background: #22C55E;
}

.acc-btn .acc-dot.sync,
#accBtn .acc-dot.sync {
  background: #FFC93C;
  animation: bmAccSyncPulse 1.1s ease-in-out infinite;
}

.acc-btn .acc-dot.off,
#accBtn .acc-dot.off {
  background: #94A3B8;
}

.acc-btn .acc-dot.warn,
.acc-btn .acc-dot.err,
#accBtn .acc-dot.warn,
#accBtn .acc-dot.err {
  background: #E4524B;
}

@keyframes bmAccSyncPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.7);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 0 0 4px rgba(255, 201, 60, 0);
  }
}

/* 17.2 Settings Account & Cloud Save Card */
.acc-card {
  background: #F4FAFF;
  color: #1E2A44;
  border: 2.5px solid #1E2A44;
  border-radius: 16px;
  padding: 10px 12px;
  margin: 8px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: 0 3px 0 rgba(30, 42, 68, 0.14);
}

.acc-card p,
.acc-card small {
  margin: 0;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  line-height: 1.38;
  color: #475569;
}

.btn-google,
#ovbox .btn-google,
#ovbox button.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  min-height: 40px;
  background: #fff !important;
  color: #1E2A44 !important;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-ui);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.btn-google:hover:not(:disabled),
#ovbox .btn-google:hover:not(:disabled) {
  background: #F4FAFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #1E2A44;
}

.btn-google:active:not(:disabled),
#ovbox .btn-google:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

.btn-google:disabled,
#ovbox .btn-google:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 0 #1E2A44;
}

.btn-google svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.acc-head .acc-av,
.acc-head img.acc-av {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  border: 2.5px solid #1E2A44;
  background: #EAF2FF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.2);
}

.acc-head .acc-av:not(img) {
  display: grid;
  place-items: center;
  font-family: var(--bm-font-display);
  font-weight: 700;
  font-size: 16px;
}

.acc-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.acc-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.acc-name {
  font-family: var(--bm-font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.24;
  color: #1E2A44;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-edit-name,
#ovbox .acc-edit-name,
#ovbox button.acc-edit-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  width: auto !important;
  margin: 0 !important;
  padding: 3px 9px !important;
  min-height: 24px;
  border: 1.8px solid #1E2A44;
  border-radius: 999px;
  background: #FFF4B8 !important;
  color: #1E2A44 !important;
  box-shadow: 0 1.5px 0 #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.acc-edit-name:hover:not(:disabled),
#ovbox .acc-edit-name:hover:not(:disabled) {
  background: #FFE77A !important;
  transform: translateY(-0.5px);
}

.acc-edit-name:active:not(:disabled),
#ovbox .acc-edit-name:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.acc-edit-name:disabled,
#ovbox .acc-edit-name:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.acc-edit-name .bm-ic,
.acc-edit-name img.bm-ic {
  width: 13px;
  height: 13px;
  vertical-align: -0.14em;
}

.acc-mail {
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  color: #5B6B86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-cloud-note,
.acc-card .acc-cloud-note {
  margin: 0;
  padding: 0 2px;
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.38;
  color: #475569;
  overflow-wrap: break-word;
}

.acc-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid #CBD5E1;
  background: #EEF2F7;
  color: #475569;
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.acc-sync.ok {
  background: #E6F9EE;
  color: #15803D;
  border-color: #86EFAC;
}

.acc-sync.busy {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}

.acc-sync.warn {
  background: #FEE2E2;
  color: #B91C1C;
  border-color: #FCA5A5;
}

.acc-sync.off {
  background: #EEF2F7;
  color: #475569;
  border-color: #CBD5E1;
}

.acc-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.acc-acts button,
#ovbox .acc-acts button {
  width: 100%;
  margin: 0;
  padding: 7px 8px;
  min-height: 36px;
  border: 2px solid #1E2A44;
  border-radius: 12px;
  box-shadow: 0 2px 0 #1E2A44;
  background: #FFC93C;
  color: #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.22;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.acc-acts button:last-child:not(:only-child),
#ovbox .acc-acts button:last-child:not(:only-child),
.acc-acts button.acc-out,
#ovbox .acc-acts button.acc-out {
  background: #fff;
  color: #1E2A44;
}

.acc-acts button:hover:not(:disabled),
#ovbox .acc-acts button:hover:not(:disabled) {
  filter: brightness(1.03);
}

.acc-acts button:last-child:not(:only-child):hover:not(:disabled),
#ovbox .acc-acts button:last-child:not(:only-child):hover:not(:disabled),
.acc-acts button.acc-out:hover:not(:disabled),
#ovbox .acc-acts button.acc-out:hover:not(:disabled) {
  background: #FEE2E2;
  color: #B91C1C;
  filter: none;
}

.acc-acts button:active:not(:disabled),
#ovbox .acc-acts button:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.acc-acts button:disabled,
#ovbox .acc-acts button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Shared Account & Gate Status Banner (.fb-status) */
.fb-status {
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid #C9DDF0;
  background: #EEF6FF;
  color: #1E2A44;
  text-align: left;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.fb-status:empty {
  display: none;
}

.fb-status.ok {
  background: #E6F9EE;
  border-color: #22C55E;
  color: #15803D;
}

.fb-status.err,
.fb-status.bad,
.fb-status.warn {
  background: #FEE2E2;
  border-color: #E4524B;
  color: #B91C1C;
}

.fb-status.busy {
  background: #FEF3C7;
  border-color: #FFC93C;
  color: #92400E;
}

/* 17.3 Synchronized Mandatory Login Gate (#authGate) & Unique Name Gate (#nameGate) */
.bm-gate {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  padding-top: max(14px, env(safe-area-inset-top, 14px));
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  background: radial-gradient(circle at 50% 20%, rgba(190, 232, 255, 0.88), rgba(114, 186, 245, 0.90));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.bm-gate.off {
  display: none !important;
}

.bm-gate-name,
#nameGate {
  z-index: 9600;
}

@keyframes bmGatePop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bmGateSpin {
  to {
    transform: rotate(360deg);
  }
}

.gate-card {
  width: 100%;
  max-width: 376px;
  margin: auto;
  background: #FFFDF7;
  border: 3px solid #1E2A44;
  border-radius: 26px;
  box-shadow: 0 9px 0 #1E2A44, 0 22px 46px rgba(17, 36, 70, 0.28);
  padding: 18px 18px 20px;
  text-align: center;
  position: relative;
  animation: bmGatePop 0.28s cubic-bezier(.22, 1.2, .36, 1) both;
  color: #1E2A44;
  font-family: var(--bm-font-ui);
  box-sizing: border-box;
}

.gate-card .fb-status {
  margin-top: 10px;
  text-align: center;
}

.gate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 28px;
}

.gate-top:empty {
  display: none;
}

.gate-lang {
  display: inline-flex;
  align-items: center;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.16);
  flex-shrink: 0;
}

.gate-lang:only-child {
  margin: 0 auto;
}

.gl-b {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 4px 10px;
  min-height: 26px;
  background: #FFFFFF;
  color: #475569;
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.gl-b + .gl-b {
  border-left: 1.8px solid #1E2A44;
}

.gl-b:hover:not(.on) {
  background: #F1F8FF;
  color: #1E2A44;
}

.gl-b.on {
  background: #FFD84D;
  color: #1E2A44;
}

.gate-close {
  appearance: none;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  margin: 0;
  border: 2px solid #1E2A44;
  border-radius: 50%;
  background: #FFFFFF;
  color: #1E2A44;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.14s ease;
}

.gate-close:only-child {
  margin-left: auto;
}

.gate-close:hover:not(:disabled) {
  background: #FEE2E2;
  color: #B91C1C;
}

.gate-close:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.gate-close.off {
  display: none !important;
}

.gate-hero {
  width: 64px;
  height: 64px;
  margin: 2px auto 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE77A 0%, #F8B62D 100%);
  border: 3px solid #1E2A44;
  box-shadow: 0 4px 0 #1E2A44;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.gate-hero .bm-ic,
.gate-hero img.bm-ic {
  width: 38px;
  height: 38px;
  vertical-align: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(30, 42, 68, 0.22));
}

.gate-hero img:not(.bm-ic) {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.gate-title {
  font-family: var(--bm-font-display, 'Baloo 2', 'Nunito', sans-serif);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
  margin: 10px 0 4px;
  color: #1E2A44;
  overflow-wrap: break-word;
}

.gate-sub {
  font-family: var(--bm-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin: 0 0 14px;
  line-height: 1.4;
  overflow-wrap: break-word;
}

.gate-perks {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  width: 100%;
  box-sizing: border-box;
}

.gate-perk {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 12px;
  background: #F1F8FF;
  border: 2px solid #C8E2FA;
  border-radius: 14px;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  color: #1E3A5F;
  box-sizing: border-box;
  min-width: 0;
}

.gate-perk .bm-ic,
.gate-perk img.bm-ic,
.gate-perk img {
  width: 22px;
  height: 22px;
  min-width: 22px;
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: 0;
  display: block;
}

.gate-perk > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.btn-google.gate-google {
  min-height: 48px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 800;
  border: 2.5px solid #1E2A44;
  border-radius: 16px;
  box-shadow: 0 4px 0 #1E2A44;
  background: #FFFFFF !important;
  color: #1E2A44 !important;
}

.btn-google.gate-google:hover:not(:disabled) {
  background: #F4FAFF !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #1E2A44;
}

.btn-google.gate-google:active:not(:disabled) {
  transform: translateY(2.5px);
  box-shadow: 0 1.5px 0 #1E2A44;
}

.btn-google.gate-google:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 0 #1E2A44;
}

.btn-google.gate-google svg {
  width: 20px;
  height: 20px;
}

.gate-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 10px;
}

.gate-loading.off,
.gate-body.off {
  display: none !important;
}

.gate-spin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid #DBEAFE;
  border-top-color: #2563EB;
  box-sizing: border-box;
  animation: bmGateSpin 0.8s linear infinite;
}

.gate-load-txt {
  font-family: var(--bm-font-ui);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.35;
  color: #1E3A5F;
  margin: 0;
}

.gate-foot-note {
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.38;
  color: #64748B;
  margin: 10px 0 0;
}

/* Unique Player Name Setup & Rename Gate Elements */
.name-av-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 2px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.name-av-wrap img:not(.bm-ic),
.name-av-wrap .name-av {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #1E2A44;
  background: #EAF2FF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
  box-shadow: 0 3px 0 #1E2A44;
}

.name-av-wrap .name-av:not(img) {
  display: grid;
  place-items: center;
  font-family: var(--bm-font-display, 'Baloo 2', 'Nunito', sans-serif);
  font-size: 22px;
  font-weight: 800;
}

.name-av-badge {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE77A 0%, #F5B82E 100%);
  border: 2px solid #1E2A44;
  box-shadow: 0 1.5px 0 #1E2A44;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  color: #1E2A44;
  pointer-events: none;
  box-sizing: border-box;
}

.name-av-badge .bm-ic,
.name-av-badge img.bm-ic {
  width: 13px;
  height: 13px;
  vertical-align: 0;
}

.name-field-wrap {
  position: relative;
  width: 100%;
  margin: 2px 0 0;
  box-sizing: border-box;
}

.name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 52px 11px 14px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  font-family: var(--bm-font-display, 'Baloo 2', 'Nunito', sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: #1E2A44;
  background: #FFFFFF;
  outline: none;
  box-shadow: inset 0 2px 0 rgba(30, 42, 68, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.name-input::placeholder {
  color: #94A3B8;
  font-weight: 600;
}

.name-input:focus {
  border-color: #0EA5E9;
  box-shadow: 0 0 0 3.5px rgba(14, 165, 233, 0.25);
}

.name-input.is-ok {
  border-color: #2EC27E;
  background: #F7FEF9;
}

.name-input.is-ok:focus {
  border-color: #2EC27E;
  box-shadow: 0 0 0 3.5px rgba(46, 194, 126, 0.24);
}

.name-input.is-err {
  border-color: #E11D48;
  background: #FFF8F8;
}

.name-input.is-err:focus {
  border-color: #E11D48;
  box-shadow: 0 0 0 3.5px rgba(225, 29, 72, 0.2);
}

.name-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 800;
  color: #64748B;
  pointer-events: none;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.name-count.is-err {
  color: #BE123C;
}

.name-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  margin: 8px 0 12px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.8px solid #CBD5E1;
  background: #F1F5F9;
  color: #475569;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  text-align: center;
  box-sizing: border-box;
  overflow-wrap: break-word;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.name-check.idle {
  background: #F1F5F9;
  color: #475569;
  border-color: #CBD5E1;
}

.name-check.busy {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #93C5FD;
}

.name-check.ok {
  background: #DCFCE7;
  color: #166534;
  border-color: #86EFAC;
}

.name-check.err {
  background: #FEE2E2;
  color: #991B1B;
  border-color: #FCA5A5;
}

.name-check .bm-ic,
.name-check img.bm-ic {
  width: 15px;
  height: 15px;
  vertical-align: -0.15em;
}

.name-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 2.5px solid #1E2A44;
  border-radius: 15px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #052E16;
  font-family: var(--bm-font-display, 'Baloo 2', 'Nunito', sans-serif);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 4px 0 #1E2A44;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.name-submit:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #1E2A44;
}

.name-submit:active:not(:disabled) {
  transform: translateY(2.5px);
  box-shadow: 0 1.5px 0 #1E2A44;
}

.name-submit:disabled {
  background: #E2E8F0;
  color: #64748B;
  border-color: #94A3B8;
  box-shadow: 0 2px 0 #94A3B8;
  cursor: not-allowed;
  opacity: 0.78;
  transform: none;
  filter: none;
}

.name-alt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.name-alt-row:empty,
.name-alt-row.off {
  display: none !important;
}

.name-alt-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 14px;
  min-height: 32px;
  border: 2px solid #CBD5E1;
  border-radius: 999px;
  background: #F8FAFC;
  color: #475569;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.name-alt-btn:hover:not(:disabled) {
  background: #EEF6FF;
  border-color: #1E2A44;
  color: #1E2A44;
}

.name-alt-btn.danger:hover:not(:disabled) {
  background: #FEE2E2;
  border-color: #FCA5A5;
  color: #B91C1C;
}

.name-alt-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.name-alt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 17.4 Online Duel Modal Enhancements */
/* Locked Official Player Identity Pill (replaces editable #dnk input) */
.dn-name-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: #F4FAFF;
  border: 2px solid #1E2A44;
  border-radius: 14px;
  margin: 4px 0 8px;
  color: #1E2A44;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.14);
}

.dn-name-val {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  font-family: var(--bm-font-display, 'Baloo 2', 'Nunito', sans-serif);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.24;
  color: #1E2A44;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-name-val > span,
.dn-name-val > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-name-val img:not(.bm-ic),
.dn-name-val .dn-av,
.dn-name-val .acc-av {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  border: 2px solid #1E2A44;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: #fff;
  box-sizing: border-box;
}

.dn-name-val .dn-av:not(img),
.dn-name-val .acc-av:not(img) {
  display: grid;
  place-items: center;
  background: #DCEBFF;
  color: #1E2A44;
  font-size: 12px;
  font-weight: 800;
}

.dn-name-val .bm-ic,
.dn-name-val img.bm-ic {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: 0;
}

.dn-rename-btn,
#ovbox .dn-rename-btn,
#ovbox button.dn-rename-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  width: auto !important;
  margin: 0 !important;
  padding: 4px 10px !important;
  min-height: 28px;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  background: #FFF4B8 !important;
  color: #1E2A44 !important;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.dn-rename-btn:hover:not(:disabled),
#ovbox .dn-rename-btn:hover:not(:disabled) {
  background: #FFE77A !important;
  transform: translateY(-0.5px);
}

.dn-rename-btn:active:not(:disabled),
#ovbox .dn-rename-btn:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.dn-rename-btn:disabled,
#ovbox .dn-rename-btn:disabled {
  background: #E2E8F0 !important;
  color: #64748B !important;
  border-color: #94A3B8;
  box-shadow: none;
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.dn-rename-btn .bm-ic,
.dn-rename-btn img.bm-ic {
  width: 13px;
  height: 13px;
  vertical-align: -0.14em;
}

.dn-user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #EEF7FF;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 12px;
  padding: 5px 8px;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
  box-sizing: border-box;
}

.dn-user-bar img:not(.bm-ic),
.dn-user-bar .dn-av,
.dn-user-bar .acc-av {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  border: 2px solid #1E2A44;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: #fff;
  box-sizing: border-box;
}

.dn-user-bar .dn-av:not(img),
.dn-user-bar .acc-av:not(img) {
  display: grid;
  place-items: center;
  background: #DCEBFF;
  color: #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12px;
  font-weight: 700;
}

.dn-user-bar > span,
.dn-user-bar .dn-uname {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1E2A44;
}

.dn-user-bar .dn-online,
.dn-user-bar .dn-on {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #15803D;
  background: #E6F9EE;
  border: 1.5px solid #86EFAC;
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.dn-user-bar .dn-online::before,
.dn-user-bar .dn-on::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
}

.dn-user-bar .dn-dot,
.dn-user-bar .acc-dot {
  position: static;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22C55E;
  border: 1.5px solid #1E2A44;
  flex-shrink: 0;
  box-sizing: border-box;
}

.dn-login-cta {
  background: #FFF9E6;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  line-height: 1.38;
  box-sizing: border-box;
}

.dn-login-cta b {
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  color: #1E2A44;
}

.dn-login-cta p,
.dn-login-cta small {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: #64748B;
}

/* Host Waiting Lobby Public / Private Toggle */
.dn-pub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.dn-pub-row > b {
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: #1E2A44;
  white-space: nowrap;
  flex-shrink: 0;
}

.dn-pub-row > span {
  display: flex;
  flex: 1;
  min-width: 0;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.dn-pub-row > button,
#ovbox .dn-pub-row > button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 6px 8px;
  min-height: 34px;
  border: 2px solid #1E2A44;
  border-radius: 11px;
  background: #fff;
  color: #1E2A44;
  box-shadow: none;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.dn-pub-row > button.on,
#ovbox .dn-pub-row > button.on {
  background: #FFC93C;
  box-shadow: 0 2px 0 #1E2A44;
}

.dn-pub-row.d2q,
.dn-pub-row.dnm {
  gap: 0;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.dn-pub-row.d2q > button,
.dn-pub-row.dnm > button,
#ovbox .dn-pub-row.d2q > button,
#ovbox .dn-pub-row.dnm > button,
#ovbox .dn-pub-row > span button {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 6px 8px;
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #1E2A44;
  box-shadow: none;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.24;
  white-space: nowrap;
}

.dn-pub-row.d2q > button + button,
.dn-pub-row.dnm > button + button,
#ovbox .dn-pub-row > span button + button {
  border-left: 2px solid #1E2A44;
}

.dn-pub-row.d2q > button.on,
.dn-pub-row.dnm > button.on,
#ovbox .dn-pub-row.d2q > button.on,
#ovbox .dn-pub-row.dnm > button.on,
#ovbox .dn-pub-row > span button.on {
  background: #FFC93C;
  box-shadow: none;
}

/* Live Public Rooms List */
.dnrooms-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #1E2A44);
}

.dnrooms {
  max-height: 152px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: #F1F6FD;
  border: 2px solid #C9DDF0;
  border-radius: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.dnroom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 10px;
  padding: 6px 8px;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.14);
  transition: background-color 0.12s ease;
}

.dnroom-row:hover {
  background: #F8FCFF;
}

.dnroom-row img:not(.bm-ic),
.dnroom-row .dnroom-av,
.dnroom-row .dn-av,
.dnroom-row .acc-av {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid #1E2A44;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: #EAF2FF;
  box-sizing: border-box;
}

.dnroom-row .dnroom-av:not(img),
.dnroom-row .dn-av:not(img),
.dnroom-row .acc-av:not(img) {
  display: grid;
  place-items: center;
  background: #DCEBFF;
  color: #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12px;
  font-weight: 700;
}

.dnroom-row > span,
.dnroom-row > div,
.dnroom-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.dnroom-row b,
.dnroom-name {
  font-family: var(--bm-font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  color: #1E2A44;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dnroom-row small,
.dnroom-meta {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.26;
  color: #5B6B86;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dnroom-row button,
#ovbox .dnroom-row button {
  flex-shrink: 0;
  width: auto !important;
  margin: 0 !important;
  padding: 5px 10px !important;
  min-height: 30px;
  border: 2px solid #1E2A44;
  border-radius: 9px;
  background: linear-gradient(180deg, #FFD75E 0%, #FFC93C 100%);
  color: #1E2A44;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.dnroom-row button:active:not(:disabled),
#ovbox .dnroom-row button:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.dnrooms-empty {
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.38;
  color: #64748B;
  padding: 8px 4px;
  text-align: center;
}

/* Opponent Card Google Avatar Badge — preserves 54px hero sprite (.dnf img) */
.dnf {
  position: relative;
  min-width: 0;
}

.dnf > span {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.dnf > span b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dnf .dn-av-badge,
.dnf img.dn-av-badge {
  width: 22px;
  height: 22px;
  min-width: 22px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-sizing: border-box;
}

.dnf .dn-av-badge {
  border: 2px solid #1E2A44;
  background: #fff;
  box-shadow: 0 1px 0 rgba(30, 42, 68, 0.28);
  flex-shrink: 0;
  overflow: hidden;
  display: inline-block;
  vertical-align: -5px;
  margin-right: 4px;
}

.dnf .dn-av-badge img {
  display: block;
  border: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.dnf > .dn-av-badge {
  position: absolute;
  left: 39px;
  bottom: 3px;
  margin: 0;
  z-index: 2;
  pointer-events: none;
}

/* 17.5 Compact Small-Phone Adjustments (<= 390px) */
@media (max-width: 390px) {
  .hbar .acc-btn,
  .hbar button.acc-btn,
  #accBtn {
    min-width: 34px;
    min-height: 34px;
    width: 34px;
    height: 34px;
  }
  .acc-btn svg.acc-g,
  #accBtn svg.acc-g {
    width: 18px;
    height: 18px;
  }
  .acc-card {
    padding: 9px 10px;
  }
  .acc-acts button,
  #ovbox .acc-acts button {
    font-size: 12px;
    padding: 6px 6px;
  }
  .bm-gate {
    padding: 10px;
  }
  .gate-card {
    padding: 15px 14px 16px;
    border-radius: 22px;
  }
  .gate-hero {
    width: 56px;
    height: 56px;
  }
  .gate-hero .bm-ic,
  .gate-hero img.bm-ic {
    width: 32px;
    height: 32px;
  }
  .gate-title {
    font-size: 21px;
    margin: 8px 0 4px;
  }
  .gate-sub {
    font-size: 12.5px;
    margin-bottom: 11px;
  }
  .gate-perk {
    padding: 7px 10px;
    font-size: 12px;
    gap: 8px;
  }
  .gate-perk .bm-ic,
  .gate-perk img.bm-ic,
  .gate-perk img {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }
  .btn-google.gate-google {
    min-height: 44px;
    font-size: 14px;
    padding: 9px 12px;
  }
  .name-input {
    font-size: 16px;
    padding: 10px 48px 10px 12px;
  }
  .name-submit {
    min-height: 44px;
    font-size: 15px;
  }
  .dn-name-lock {
    padding: 7px 9px;
    gap: 6px;
  }
  .dn-name-val {
    font-size: 13.5px;
  }
  .dn-rename-btn,
  #ovbox .dn-rename-btn,
  #ovbox button.dn-rename-btn {
    font-size: 11.5px;
    padding: 4px 8px !important;
  }
  .dnroom-row {
    gap: 6px;
    padding: 5px 6px;
  }
}

@media (max-height: 620px) {
  .gate-card {
    padding: 12px 14px 14px;
  }
  .gate-perks {
    gap: 5px;
    margin-bottom: 10px;
  }
}

/* 17.6 Respect reduced motion preference for Section 17 */
@media (prefers-reduced-motion: reduce) {
  .acc-btn .acc-dot.sync,
  #accBtn .acc-dot.sync,
  .gate-card,
  .gate-spin {
    animation: none;
  }
  .hbar .acc-btn,
  #accBtn,
  .btn-google,
  #ovbox .btn-google,
  .acc-acts button,
  #ovbox .acc-acts button,
  .acc-edit-name,
  #ovbox .acc-edit-name,
  .gate-close,
  .gl-b,
  .name-input,
  .name-check,
  .name-submit,
  .name-alt-btn,
  .dn-rename-btn,
  #ovbox .dn-rename-btn,
  .dnroom-row button,
  #ovbox .dnroom-row button {
    transition: none;
  }
}

/* ============================================================================
 * 18. Account Center, 5-Tab Leaderboard, Public Profile, Friends & Duel Series
 *     Playful pastel-cartoon identity · explicit light cards / #1E2A44 ink
 *     360px–430px portrait zero-overflow · 100% offline (zero external URLs)
 * ============================================================================ */

/* 18.1 Home Twin Online + Leaderboard Row (.hm2.hm-online) & Duel BXH Shortcut */
.hm2.hm-online,
#hs[data-scr="home"] .hm2.hm-online {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  min-width: 0;
  box-sizing: border-box;
}

.hm2.hm-online .bigb,
.hm2.hm-online #goN,
.hm2.hm-online #goRank,
#hs[data-scr="home"] .hm2.hm-online .bigb,
#hs[data-scr="home"] .hm2.hm-online .hmon,
html.ls #hs[data-scr="home"] .hm2.hm-online .bigb,
html.ls #hs[data-scr="home"] .hm2.hm-online .hmon {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  min-height: 54px !important;
  padding: 9px 8px !important;
  border: 3px solid #1E2A44;
  border-radius: 20px;
  box-shadow: 0 4px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: clamp(15px, 4vw, 17.5px) !important;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  row-gap: 2px;
  text-align: center;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}

.hm2.hm-online .bigb small,
.hm2.hm-online #goN small,
.hm2.hm-online #goRank small,
html.ls #hs[data-scr="home"] .hm2.hm-online .hmon small {
  display: block !important;
  flex: 0 0 100%;
  width: 100%;
  margin-top: 2px;
  font-family: var(--bm-font-ui);
  font-size: clamp(10.5px, 2.8vw, 11.5px);
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm2.hm-online .bigb .bm-ic,
.hm2.hm-online .bigb > img,
#goRank .bm-ic,
#goRank > img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: -0.24em;
  margin-right: 4px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.24));
}

.hm2.hm-online .bigb small .bm-ic,
.hm2.hm-online .bigb small img {
  width: 14px;
  height: 14px;
  vertical-align: -0.18em;
  margin-right: 2px;
}

.hm2.hm-online #goN {
  background: linear-gradient(180deg, #60A5FA 0%, #3B82F6 55%, #2563EB 100%) !important;
  color: #FFFFFF !important;
  text-shadow: 0 1px 0 rgba(30, 42, 68, 0.35);
}

.hm2.hm-online #goN small {
  color: rgba(255, 255, 255, 0.94);
  opacity: 1;
}

#goRank,
.hm2.hm-online #goRank {
  background: linear-gradient(180deg, #FFE15D 0%, #FFC93C 52%, #F59E0B 100%) !important;
  color: #1E2A44 !important;
  border: 3px solid #1E2A44;
  box-shadow: 0 4px 0 #1E2A44;
}

#goRank small,
.hm2.hm-online #goRank small {
  color: #451A03;
  opacity: 0.9;
}

.hm2.hm-online .bigb:hover:not(:disabled),
#goRank:hover:not(:disabled) {
  filter: brightness(1.03);
}

.hm2.hm-online .bigb:active:not(:disabled),
#goRank:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #1E2A44;
}

/* Compact Leaderboard Shortcut inside Online Duel Header (dnDraw) */
#ovbox .dns h1:has(.dn-bxh-btn) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dn-bxh-btn,
#ovbox .dn-bxh-btn,
#ovbox button.dn-bxh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  width: auto !important;
  margin: 0 0 0 auto !important;
  padding: 4px 10px !important;
  min-height: 30px;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  background: linear-gradient(180deg, #FFE15D 0%, #F59E0B 100%) !important;
  color: #1E2A44 !important;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}

.dn-bxh-btn:hover:not(:disabled),
#ovbox .dn-bxh-btn:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(-0.5px);
}

.dn-bxh-btn:active:not(:disabled),
#ovbox .dn-bxh-btn:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.dn-bxh-btn img,
.dn-bxh-btn .bm-ic {
  width: 16px;
  height: 16px;
  object-fit: contain;
  margin: 0;
  flex-shrink: 0;
}

/* 18.2 Account Center / Profile Hub (.prof-scr) */
#hs[data-scr="profile"],
.prof-scr {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  color: #1E2A44;
  box-sizing: border-box;
}

.prof-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.prof-head h1,
.prof-head h2,
.prof-head .prof-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--bm-font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.85);
}

.prof-back,
.prof-set-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  min-height: 40px;
  padding: 6px 11px;
  border: 2.5px solid #1E2A44;
  border-radius: 13px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.14s ease;
}

.prof-set-btn {
  width: 40px;
  padding: 0;
}

.prof-back:hover,
.prof-set-btn:hover {
  background: #EEF8FF;
}

.prof-back:active,
.prof-set-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

.prof-back img,
.prof-back .bm-ic,
.prof-set-btn img,
.prof-set-btn .bm-ic {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin: 0;
  flex-shrink: 0;
}

/* Hero Banner & Tier Avatar Frames */
.prof-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  background: linear-gradient(155deg, #FFFDF7 0%, #EEF8FF 56%, #FFF6D6 100%);
  color: #1E2A44;
  border: 3px solid #1E2A44;
  border-radius: 20px;
  box-shadow: 0 4px 0 #1E2A44;
  box-sizing: border-box;
}

.av-ring {
  position: relative;
  width: 64px;
  height: 64px;
  min-width: 64px;
  padding: 4px;
  border-radius: 50%;
  border: 2.5px solid #1E2A44;
  background: linear-gradient(135deg, #CBD5E1 0%, #94A3B8 100%);
  box-shadow: 0 3px 0 #1E2A44;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.av-ring.sm {
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 3px;
}

.av-ring > img,
.av-ring .prof-av {
  width: 56px;
  height: 56px;
  min-width: 56px;
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  border: 2px solid #FFFDF7;
  background: #EAF2FF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
}

.av-ring.sm > img,
.av-ring.sm .prof-av {
  width: 44px;
  height: 44px;
  min-width: 44px;
}

.av-ring .prof-av:not(img) {
  display: grid;
  place-items: center;
  background: #DCEBFF;
  font-family: var(--bm-font-display);
  font-size: 22px;
  font-weight: 800;
}

.av-ring.av-bronze {
  background: linear-gradient(135deg, #F5B971 0%, #CD7F32 55%, #8C4A18 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 0 2px rgba(205, 127, 50, 0.28);
}

.av-ring.av-silver {
  background: linear-gradient(135deg, #FFFFFF 0%, #CBD5E1 52%, #64748B 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 0 2px rgba(148, 163, 184, 0.36);
}

.av-ring.av-gold {
  background: linear-gradient(135deg, #FFF3A1 0%, #FFD84D 48%, #D97706 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 12px rgba(255, 216, 77, 0.56);
}

.av-ring.av-platinum {
  background: linear-gradient(135deg, #CCFBF1 0%, #38BDF8 50%, #0284C7 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 12px rgba(14, 165, 233, 0.45);
}

.av-ring.av-diamond {
  background: linear-gradient(135deg, #E0F2FE 0%, #60A5FA 42%, #8B5CF6 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 14px rgba(139, 92, 246, 0.52);
}

.av-ring.av-grandmaster {
  background: linear-gradient(135deg, #FFE15D 0%, #F43F5E 48%, #7C3AED 100%);
  box-shadow: 0 3px 0 #1E2A44, 0 0 16px rgba(244, 63, 94, 0.52);
}

.prof-id-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prof-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.prof-name-row b,
.prof-name-row .prof-name {
  font-family: var(--bm-font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  max-width: 100%;
  min-width: 0;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1.8px solid #D97706;
  background: #FFF4CC;
  color: #78350F;
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.prof-title-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.prof-meta-row img.prof-tier-ic,
.prof-meta-row img.tier-ic,
.prof-meta-row > img:not(.bm-ic) {
  width: 26px;
  height: 26px;
  min-width: 26px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 0 rgba(30, 42, 68, 0.25));
}

.prof-meta-row .prof-lv,
.prof-meta-row .prof-tier-txt {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #CBD5E1;
  color: #1E2A44;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.prof-elo-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 14px;
  border: 2.5px solid #1E2A44;
  background: linear-gradient(180deg, #FFE15D 0%, #FFC93C 100%);
  color: #1E2A44;
  box-shadow: 0 2.5px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

.prof-elo-pill small {
  font-family: var(--bm-font-ui);
  font-size: 10px;
  font-weight: 800;
  color: #5C3D00;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

/* 3-Tab Profile Segmented Pill Bar */
.prof-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  padding: 4px;
  background: #DCEEFF;
  border: 2.5px solid #1E2A44;
  border-radius: 16px;
  box-shadow: 0 3px 0 #1E2A44;
  box-sizing: border-box;
}

.ptab-b {
  min-height: 38px;
  min-width: 0;
  padding: 6px 6px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #334155;
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.14s ease, transform 0.08s ease;
}

.ptab-b:hover:not(.on) {
  background: rgba(255, 255, 255, 0.55);
  color: #1E2A44;
}

.ptab-b.on {
  background: #FFD84D;
  color: #1E2A44;
  border-color: #1E2A44;
  box-shadow: 0 2px 0 #1E2A44;
}

.ptab-b:active {
  transform: translateY(1px);
}

/* Reusable Profile Section Card */
.prof-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  background: #FFFDF7;
  color: #1E2A44;
  border: 2.5px solid #1E2A44;
  border-radius: 18px;
  box-shadow: 0 4px 0 #1E2A44;
  box-sizing: border-box;
}

.prof-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  min-width: 0;
  font-family: var(--bm-font-display);
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.25;
  color: #1E2A44;
}

.prof-sec-h span,
.prof-sec-h b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prof-sec-h small {
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 700;
  color: #5B6B86;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Trophy / Deco Pin Shelf (.pin-shelf) & Collapsible Picker (.deco-grid) */
.pin-shelf {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.pin-slot {
  position: relative;
  aspect-ratio: 1;
  min-height: 52px;
  min-width: 0;
  padding: 4px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFDF7 0%, #FFF3C4 100%);
  color: #1E2A44;
  box-shadow: 0 2.5px 0 #1E2A44;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.14s ease;
}

.pin-slot img {
  width: 34px;
  height: 34px;
  max-width: 82%;
  max-height: 82%;
  object-fit: contain;
  display: block;
}

.pin-slot:active {
  transform: translateY(1.5px);
  box-shadow: 0 1px 0 #1E2A44;
}

.pin-slot.empty {
  border-style: dashed;
  border-color: #94A3B8;
  background: #F1F5F9;
  color: #94A3B8;
  box-shadow: none;
  font-family: var(--bm-font-display);
  font-size: 20px;
  font-weight: 800;
}

.pin-slot.active {
  border-color: #0EA5E9;
  background: #E0F2FE;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.3), 0 3px 0 #1E2A44;
  transform: translateY(-1px);
}

.deco-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-height: 224px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  background: #F4FAFF;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.deco-grid.off {
  display: none;
}

.deco-grid > button,
.deco-grid .deco-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 62px;
  min-width: 0;
  padding: 6px 4px;
  border: 2px solid #1E2A44;
  border-radius: 12px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.18);
  font-family: var(--bm-font-ui);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}

.deco-grid > button img,
.deco-grid .deco-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.deco-grid > button span,
.deco-grid .deco-item span {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deco-grid > button.on,
.deco-grid > button.pinned,
.deco-grid .deco-item.on,
.deco-grid .deco-item.pinned {
  background: #FEF3C7;
  border-color: #D97706;
  box-shadow: 0 0 0 2px rgba(255, 216, 77, 0.68);
}

/* 10-Domain Math Mastery Bars (.mastery-list) */
.mastery-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.m-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px;
  background: #F8FBFF;
  color: #1E2A44;
  border: 1.8px solid #CBD5E1;
  border-radius: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.m-row-top,
.m-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  color: #1E2A44;
}

.m-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-stat,
.m-acc {
  flex-shrink: 0;
  font-family: var(--bm-font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: #1E2A44;
  white-space: nowrap;
}

.m-stat small,
.m-cnt {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  margin-left: 4px;
}

.m-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #E2E8F0;
  border: 1.5px solid #1E2A44;
  overflow: hidden;
  box-sizing: border-box;
}

.m-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8 0%, #0EA5E9 100%);
  transition: width 0.35s ease;
}

.m-fill.hi {
  background: linear-gradient(90deg, #4ADE80 0%, #22C55E 100%);
}

.m-fill.mid {
  background: linear-gradient(90deg, #FFE15D 0%, #F59E0B 100%);
}

.m-fill.lo {
  background: linear-gradient(90deg, #FB7185 0%, #F43F5E 100%);
}

.m-weak-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 40px;
  margin-top: 2px;
  padding: 8px 12px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  background: linear-gradient(180deg, #38BDF8 0%, #0EA5E9 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(12, 74, 110, 0.4);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}

.m-weak-cta:hover:not(:disabled) {
  filter: brightness(1.04);
}

.m-weak-cta:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

/* PvP Stats Grid & 20-Match History */
.pvp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

.pvp-grid.cols4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.pvp-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 6px;
  background: #F4FAFF;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 14px;
  box-shadow: 0 2.5px 0 rgba(30, 42, 68, 0.16);
  text-align: center;
  box-sizing: border-box;
}

.pvp-stat-card b {
  font-family: var(--bm-font-display);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
  color: #1E2A44;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pvp-stat-card small {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: #5B6B86;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-height: 290px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  min-width: 0;
  padding: 7px 9px;
  background: #FFFDF7;
  color: #1E2A44;
  border: 2px solid #CBD5E1;
  border-radius: 13px;
  box-sizing: border-box;
}

.match-row > img,
.match-row .m-mode-ic {
  width: 24px;
  height: 24px;
  min-width: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-row .m-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.match-row .m-opp,
.match-row .m-info b {
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-row .m-meta,
.match-row .m-info small {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: #64748B;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mres {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.8px solid #94A3B8;
  background: #F1F5F9;
  color: #475569;
  font-family: var(--bm-font-display);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.mres.win {
  background: #DCFCE7;
  color: #15803D;
  border-color: #22C55E;
}

.mres.loss {
  background: #FFE4E6;
  color: #BE123C;
  border-color: #F43F5E;
}

.mres.draw {
  background: #F1F5F9;
  color: #475569;
  border-color: #94A3B8;
}

.melo {
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
  font-family: var(--bm-font-display);
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  white-space: nowrap;
}

.melo.up,
.melo.pos {
  color: #15803D;
}

.melo.dn,
.melo.neg {
  color: #E11D48;
}

/* Account Diagnostics, Devices, Backup Tools & Danger Zone */
.diag-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  background: #F4FAFF;
  color: #1E2A44;
  border: 2px solid #C9DDF0;
  border-radius: 14px;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  box-sizing: border-box;
}

.diag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.diag-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #E2E8F0;
  border: 1.5px solid #1E2A44;
  overflow: hidden;
  box-sizing: border-box;
}

.diag-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38BDF8 0%, #22C55E 100%);
  transition: width 0.3s ease;
}

.diag-fill.warn {
  background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%);
}

.diag-fill.high {
  background: linear-gradient(90deg, #FB7185 0%, #F43F5E 100%);
}

.dev-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.dev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: #FFFDF7;
  color: #1E2A44;
  border: 1.8px solid #CBD5E1;
  border-radius: 11px;
  font-size: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.dev-row.cur {
  background: #EEFBF3;
  border-color: #22C55E;
}

.dev-row b,
.dev-row .dev-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.dev-row small,
.dev-row .dev-time {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748B;
  white-space: nowrap;
}

.acc-tool-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

.tool-btn,
#ovbox .tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 7px 10px;
  border: 2px solid #1E2A44;
  border-radius: 12px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 2.5px 0 #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.14s ease;
}

.tool-btn:hover:not(:disabled),
#ovbox .tool-btn:hover:not(:disabled) {
  background: #EEF8FF;
}

.tool-btn:active:not(:disabled),
#ovbox .tool-btn:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 1px 0 #1E2A44;
}

.forget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  background: #F8FAFC;
  color: #1E2A44;
  border: 1.8px solid #CBD5E1;
  border-radius: 12px;
  font-family: var(--bm-font-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  box-sizing: border-box;
}

.forget-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #0EA5E9;
  flex-shrink: 0;
  cursor: pointer;
}

.danger-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  background: #FFF1F2;
  color: #881337;
  border: 2.5px solid #F43F5E;
  border-radius: 18px;
  box-shadow: 0 4px 0 #9F1239;
  box-sizing: border-box;
}

.danger-zone .prof-sec-h,
.danger-zone b {
  color: #9F1239;
}

.danger-zone p,
.danger-zone small {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.42;
  color: #881337;
}

.btn-danger-solid,
#ovbox .btn-danger-solid,
#ovbox button.btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 14px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  background: linear-gradient(180deg, #FB7185 0%, #E11D48 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(136, 19, 55, 0.45);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.14s ease;
}

.btn-danger-solid:hover:not(:disabled),
#ovbox .btn-danger-solid:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-danger-solid:active:not(:disabled),
#ovbox .btn-danger-solid:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

.btn-danger-solid:disabled,
#ovbox .btn-danger-solid:disabled {
  background: #E2E8F0 !important;
  color: #64748B !important;
  border-color: #94A3B8;
  box-shadow: none;
  text-shadow: none;
  opacity: 0.72;
  cursor: not-allowed;
}

/* Delete Account Confirmation Modal (.del-acc-box) inside #ovbox */
.del-acc-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  color: #1E2A44;
  background: #FFFDF7;
  min-width: 0;
  box-sizing: border-box;
}

.del-acc-box h1,
.del-acc-box h2,
.del-acc-box h3 {
  margin: 0;
  font-family: var(--bm-font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: #BE123C;
  text-align: center;
}

.del-acc-box p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: #334155;
}

.del-acc-warn {
  padding: 9px 11px;
  border-radius: 13px;
  border: 2px solid #F43F5E;
  background: #FFF1F2;
  color: #881337;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
}

.del-acc-in {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 2.5px solid #1E2A44;
  border-radius: 12px;
  background: #FFFFFF;
  color: #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 15px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
}

.del-acc-in:focus {
  border-color: #E11D48;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22);
}

.del-acc-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.del-acc-cancel,
#ovbox .del-acc-cancel,
#ovbox button.del-acc-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 12px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  background: #F1F5F9 !important;
  color: #1E2A44 !important;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-sizing: border-box;
}

/* 18.3 5-Tab Global Leaderboard Screen (.rank-scr) */
#hs[data-scr="rank"],
.rank-scr {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  min-width: 0;
  color: #1E2A44;
  padding-bottom: 4px;
  box-sizing: border-box;
}

.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.rank-head h1,
.rank-head h2,
.rank-head .rank-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: var(--bm-font-display);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1.5px 0 rgba(255, 255, 255, 0.85);
}

.rank-back,
.rank-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 40px;
  min-height: 40px;
  padding: 6px 11px;
  border: 2.5px solid #1E2A44;
  border-radius: 13px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.14s ease;
}

.rank-ref {
  width: 40px;
  padding: 0;
  font-size: 16px;
}

.rank-back:hover,
.rank-ref:hover {
  background: #EEF8FF;
}

.rank-back:active,
.rank-ref:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

.rank-ref.spin {
  animation: bmRankSpin 0.8s linear infinite;
}

@keyframes bmRankSpin {
  to {
    transform: rotate(360deg);
  }
}

/* 5-Tab Equal Pills (.rank-tabs) */
.rank-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 4px;
  background: #DCEEFF;
  border: 2.5px solid #1E2A44;
  border-radius: 16px;
  box-shadow: 0 3px 0 #1E2A44;
  box-sizing: border-box;
}

.rtab-b {
  min-height: 38px;
  min-width: 0;
  padding: 5px 2px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #334155;
  font-family: var(--bm-font-display);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.14s ease, transform 0.08s ease;
}

.rtab-b:hover:not(.on) {
  background: rgba(255, 255, 255, 0.55);
  color: #1E2A44;
}

.rtab-b.on {
  background: #FFD84D;
  color: #1E2A44;
  border-color: #1E2A44;
  box-shadow: 0 2px 0 #1E2A44;
}

.rtab-b:active {
  transform: translateY(1px);
}

.rtab-b img,
.rtab-b .bm-ic {
  width: 15px;
  height: 15px;
  object-fit: contain;
  margin: 0;
}

/* Language Filter + Weekly Countdown Row */
.rank-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.rank-langs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.rlang-b {
  min-height: 32px;
  padding: 4px 9px;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  background: #FFFDF7;
  color: #334155;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.15);
  font-family: var(--bm-font-ui);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.12s ease, transform 0.08s ease;
}

.rlang-b.on {
  background: #0EA5E9;
  color: #FFFFFF;
  border-color: #1E2A44;
  box-shadow: 0 2px 0 #1E2A44;
}

.rlang-b:active {
  transform: translateY(1px);
}

.rank-cd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 4px 9px;
  border-radius: 999px;
  border: 2px solid #1E2A44;
  background: #FFF4CC;
  color: #78350F;
  font-family: var(--bm-font-display);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  box-sizing: border-box;
}

.rank-cd img,
.rank-cd .bm-ic {
  width: 14px;
  height: 14px;
  object-fit: contain;
  margin: 0;
}

/* Top 1-2-3 Podium (.rank-podium) */
.rank-podium {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: end;
  gap: 6px;
  width: 100%;
  padding-top: 4px;
  box-sizing: border-box;
}

.pod-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  padding: 9px 6px 10px;
  border: 2.5px solid #1E2A44;
  border-radius: 18px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 4px 0 #1E2A44;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1E2A44;
}

.pod-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #1E2A44;
}

.pod-card.pod-1 {
  background: linear-gradient(180deg, #FFFDF0 0%, #FFF8D6 55%, #FFE799 100%);
  border-width: 3px;
  min-height: 146px;
  padding-top: 11px;
  box-shadow: 0 5px 0 #1E2A44, 0 0 14px rgba(255, 216, 77, 0.45);
}

.pod-card.pod-2 {
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 65%, #E2E8F0 100%);
  min-height: 132px;
}

.pod-card.pod-3 {
  background: linear-gradient(180deg, #FFFBF7 0%, #FFF1E6 65%, #FED7AA 100%);
  min-height: 126px;
}

.pod-card.empty {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.pod-crown {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 0 rgba(30, 42, 68, 0.22));
}

.pod-av {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  border: 2.5px solid #1E2A44;
  background: #FFFFFF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.22);
  box-sizing: border-box;
}

.pod-1 .pod-av {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-color: #D97706;
}

.pod-av:not(img) {
  display: grid;
  place-items: center;
  background: #DCEBFF;
  font-family: var(--bm-font-display);
  font-size: 16px;
  font-weight: 800;
}

.pod-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pod-av.hero-fb img {
  object-fit: contain;
  padding: 3px;
}

.pod-name {
  width: 100%;
  min-width: 0;
  font-family: var(--bm-font-display);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-score {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid rgba(30, 42, 68, 0.24);
  background: rgba(255, 255, 255, 0.85);
  color: #0F172A;
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.pod-1 .pod-score {
  background: #FFD84D;
  border-color: #1E2A44;
  color: #1E2A44;
}

/* Leaderboard Rows (#4..#50), Load More, Empty & Shimmer Skeleton */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.rank-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: 34px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #FFFDF7;
  color: #1E2A44;
  border: 2px solid #CBD5E1;
  border-radius: 14px;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, background-color 0.12s ease, border-color 0.12s ease;
}

.rank-row:hover {
  background: #F4FAFF;
  border-color: #94A3B8;
}

.rank-row:active {
  transform: scale(0.99);
}

.rank-row.is-me {
  background: #FEF9C3;
  border: 2.5px solid #EAB308;
  box-shadow: 0 3px 0 rgba(202, 138, 4, 0.35);
}

.rank-num {
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  text-align: center;
  white-space: nowrap;
}

.rank-row.is-me .rank-num {
  color: #854D0E;
}

.rank-av {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 50%;
  border: 2px solid #1E2A44;
  background: #EAF2FF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  overflow: hidden;
  box-sizing: border-box;
}

.rank-av:not(img) {
  display: grid;
  place-items: center;
  font-family: var(--bm-font-display);
  font-size: 13px;
  font-weight: 800;
}

.rank-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.rank-name {
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-sub {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: #5B6B86;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-val {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-shrink: 0;
  font-family: var(--bm-font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: #1E2A44;
  white-space: nowrap;
}

.rank-val img,
.rank-val .tier-ic {
  width: 22px;
  height: 22px;
  min-width: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.rank-more-btn {
  width: 100%;
  min-height: 42px;
  padding: 9px 14px;
  border: 2.5px solid #1E2A44;
  border-radius: 14px;
  background: #FFFDF7;
  color: #1E2A44;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.14s ease;
}

.rank-more-btn:hover:not(:disabled) {
  background: #EEF8FF;
}

.rank-more-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

.rank-empty {
  padding: 22px 14px;
  background: #FFFDF7;
  color: #5B6B86;
  border: 2px dashed #94A3B8;
  border-radius: 16px;
  text-align: center;
  font-family: var(--bm-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  box-sizing: border-box;
}

.rank-skel {
  height: 50px;
  border-radius: 14px;
  border: 2px solid #E2E8F0;
  background: linear-gradient(90deg, #F1F5F9 25%, #FFFDF7 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: bmRankShimmer 1.2s ease-in-out infinite;
  box-sizing: border-box;
}

@keyframes bmRankShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Sticky "My Rank" Bottom Bar (.rank-my-bar) */
.rank-my-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 8px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #1E3A5F, #1E2A44);
  color: #FFFDF7;
  border: 2.5px solid #FFD84D;
  border-radius: 16px;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  box-sizing: border-box;
}

.rank-my-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.rank-my-num {
  font-family: var(--bm-font-display);
  font-size: 16px;
  font-weight: 800;
  color: #FFD84D;
  white-space: nowrap;
  flex-shrink: 0;
}

.rank-my-name {
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 700;
  color: #FFFDF7;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-my-val {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-family: var(--bm-font-display);
  font-size: 15px;
  font-weight: 800;
  color: #FFD84D;
  white-space: nowrap;
}

.rank-my-val img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.rank-my-bar small {
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 600;
}

/* Public Profile Inspect Modal (.pub-modal) inside #ovbox */
.pub-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  color: #1E2A44;
  background: #FFFDF7;
  min-width: 0;
  box-sizing: border-box;
}

.pub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(155deg, #EEF8FF 0%, #FFF7DC 100%);
  border: 2.5px solid #1E2A44;
  border-radius: 16px;
  min-width: 0;
  box-sizing: border-box;
}

.pub-av {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  border: 2.5px solid #1E2A44;
  background: #EAF2FF;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pub-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pub-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.pub-name {
  font-family: var(--bm-font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-tier-ic {
  width: 26px;
  height: 26px;
  min-width: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.pub-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.pub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 7px 6px;
  background: #F4FAFF;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 13px;
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.pub-stat b {
  font-family: var(--bm-font-display);
  font-size: 16.5px;
  font-weight: 800;
  color: #1E2A44;
}

.pub-stat small {
  font-size: 11px;
  font-weight: 700;
  color: #5B6B86;
}

.pub-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  margin-top: 2px;
}

.pub-acts button,
#ovbox .pub-acts button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  border: 2.5px solid #1E2A44;
  border-radius: 13px;
  background: #FFD84D;
  color: #1E2A44;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.pub-acts .pub-add,
#ovbox .pub-acts button.pub-add {
  background: linear-gradient(180deg, #38BDF8 0%, #0EA5E9 100%);
  color: #FFFFFF;
}

.pub-acts .pub-duel,
#ovbox .pub-acts button.pub-duel {
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #FFFFFF;
}

.pub-acts .pub-close,
#ovbox .pub-acts button.pub-close {
  background: #F1F5F9;
  color: #1E2A44;
}

.pub-acts button:only-child,
.pub-acts button.full {
  grid-column: 1 / -1;
}

/* 18.4 Friends, 1-Tap Private Invites & Online Duel Rematch Bar */
.fr-search-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.fr-search-row input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 7px 11px;
  border: 2.5px solid #1E2A44;
  border-radius: 12px;
  background: #FFFFFF;
  color: #1E2A44;
  font-family: var(--bm-font-ui);
  font-size: 13.5px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
}

.fr-search-row input:focus {
  border-color: #0EA5E9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22);
}

.fr-search-row button,
#ovbox .fr-search-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  width: auto !important;
  min-height: 40px;
  margin: 0 !important;
  padding: 7px 12px !important;
  border: 2.5px solid #1E2A44;
  border-radius: 12px;
  background: linear-gradient(180deg, #FFE15D 0%, #FFC93C 100%) !important;
  color: #1E2A44 !important;
  box-shadow: 0 2.5px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.fr-search-row button img,
.fr-search-row button .bm-ic {
  width: 17px;
  height: 17px;
  object-fit: contain;
  margin: 0;
}

.fr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.fr-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  min-width: 0;
  padding: 7px 9px;
  background: #FFFDF7;
  color: #1E2A44;
  border: 2px solid #1E2A44;
  border-radius: 14px;
  box-shadow: 0 2.5px 0 rgba(30, 42, 68, 0.16);
  box-sizing: border-box;
}

.fr-av-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
}

.fr-av {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: 2px solid #1E2A44;
  background: #EAF2FF;
  color: #1E2A44;
  object-fit: cover;
  display: block;
  box-sizing: border-box;
}

.fr-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  border: 2px solid #FFFDF7;
  box-shadow: 0 0 0 1.5px #1E2A44;
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
}

.fr-av-wrap .fr-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
}

.fr-dot.on {
  background: #22C55E;
}

.fr-dot.off {
  background: #94A3B8;
}

.fr-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fr-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.fr-name {
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-tier {
  width: 18px;
  height: 18px;
  min-width: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.fr-sub {
  font-family: var(--bm-font-ui);
  font-size: 11px;
  font-weight: 700;
  color: #5B6B86;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fr-acts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.fr-inv-btn,
#ovbox .fr-inv-btn,
#ovbox button.fr-inv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto !important;
  min-height: 36px;
  margin: 0 !important;
  padding: 5px 10px !important;
  border: 2px solid #1E2A44;
  border-radius: 11px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(21, 128, 61, 0.45);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.fr-inv-btn:active:not(:disabled),
#ovbox .fr-inv-btn:active:not(:disabled) {
  transform: translateY(1.5px);
  box-shadow: 0 0.5px 0 #1E2A44;
}

.fr-inv-btn:disabled,
#ovbox .fr-inv-btn:disabled {
  background: #E2E8F0 !important;
  color: #64748B !important;
  border-color: #94A3B8;
  box-shadow: none;
  text-shadow: none;
  cursor: not-allowed;
}

.fr-rm-btn,
#ovbox .fr-rm-btn,
#ovbox button.fr-rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 36px;
  width: auto !important;
  margin: 0 !important;
  padding: 5px 8px !important;
  border: 2px solid #FDA4AF;
  border-radius: 11px;
  background: #FFF1F2 !important;
  color: #BE123C !important;
  box-shadow: none;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-sizing: border-box;
}

.fr-rm-btn:hover,
#ovbox .fr-rm-btn:hover {
  background: #FFE4E6 !important;
  border-color: #F43F5E;
}

/* Friend Request Row (.fr-req-card) */
.fr-req-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  min-width: 0;
  padding: 8px 10px;
  background: #EEF8FF;
  color: #1E2A44;
  border: 2px solid #0EA5E9;
  border-radius: 14px;
  box-sizing: border-box;
}

.fr-req-card .fr-acc-btn,
#ovbox .fr-req-card button.fr-acc-btn {
  width: auto !important;
  min-height: 34px;
  margin: 0 !important;
  padding: 5px 10px !important;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.fr-req-card .fr-dec-btn,
.fr-req-card .fr-can-btn,
#ovbox .fr-req-card button.fr-dec-btn,
#ovbox .fr-req-card button.fr-can-btn {
  width: auto !important;
  min-height: 34px;
  margin: 0 !important;
  padding: 5px 9px !important;
  border: 2px solid #1E2A44;
  border-radius: 999px;
  background: #FFFDF7 !important;
  color: #475569 !important;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.16);
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

/* Floating 1-Tap Private Match Invite Toast (.inv-banner) */
.inv-banner {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 9100;
  background: #FFFDF7;
  color: #1E2A44;
  border: 3px solid #1E2A44;
  border-radius: 18px;
  box-shadow: 0 6px 0 #1E2A44, 0 14px 28px rgba(15, 23, 42, 0.3);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  animation: bmInvDrop 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.inv-banner.off {
  display: none;
}

@keyframes bmInvDrop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.inv-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.inv-hero,
.inv-av {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  border: 2px solid #1E2A44;
  background: #EEF8FF;
  object-fit: contain;
  padding: 2px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.inv-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inv-title,
.inv-info b {
  font-family: var(--bm-font-display);
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.2;
  color: #1E2A44;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-sub,
.inv-info small {
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-acts {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 7px;
  width: 100%;
}

.inv-ok {
  min-height: 38px;
  padding: 7px 10px;
  border: 2.5px solid #1E2A44;
  border-radius: 12px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #FFFFFF;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(21, 128, 61, 0.45);
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.inv-no {
  min-height: 38px;
  padding: 7px 10px;
  border: 2.5px solid #1E2A44;
  border-radius: 12px;
  background: #F1F5F9;
  color: #334155;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.inv-ok:active,
.inv-no:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #1E2A44;
}

/* Online Duel Rematch Series (.dn-h2h-bar) & Ready Bar (.dn-ready-row) */
.dn-h2h-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 6px 12px;
  background: linear-gradient(180deg, #1E3A5F 0%, #1E2A44 100%);
  color: #FFFDF7;
  border: 2px solid #FFD84D;
  border-radius: 999px;
  box-shadow: 0 2px 0 rgba(30, 42, 68, 0.28);
  font-family: var(--bm-font-display);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  box-sizing: border-box;
}

.dn-h2h-bar b {
  color: #FFD84D;
  font-size: 15px;
  flex-shrink: 0;
  white-space: nowrap;
}

.dn-h2h-bar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-ready-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
}

.dn-rdy-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  min-width: 0;
  padding: 6px 8px;
  border: 2px solid #CBD5E1;
  border-radius: 12px;
  background: #F8FAFC;
  color: #475569;
  font-family: var(--bm-font-ui);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.dn-rdy-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dn-rdy-chip.ok {
  background: #DCFCE7;
  color: #15803D;
  border-color: #22C55E;
  box-shadow: 0 2px 0 rgba(34, 197, 94, 0.28);
}

.dn-rdy-btn,
#ovbox .dn-rdy-btn,
#ovbox button.dn-rdy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 7px 10px;
  border: 2.5px solid #1E2A44;
  border-radius: 13px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 3px 0 #1E2A44;
  font-family: var(--bm-font-display);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-sizing: border-box;
}

.dn-rdy-btn.on,
#ovbox .dn-rdy-btn.on {
  background: #DCFCE7 !important;
  color: #15803D !important;
  border-color: #22C55E;
  box-shadow: 0 2px 0 #15803D;
}

/* 18.5 Responsive Tightening (<= 390px & <= 360px) */
@media (max-width: 390px) {
  .hm2.hm-online .bigb,
  .hm2.hm-online #goN,
  .hm2.hm-online #goRank,
  #hs[data-scr="home"] .hm2.hm-online .bigb {
    font-size: 14.5px !important;
    padding: 8px 6px !important;
    min-height: 50px !important;
  }

  .hm2.hm-online .bigb .bm-ic,
  .hm2.hm-online .bigb > img {
    width: 20px;
    height: 20px;
    margin-right: 3px;
  }

  .prof-banner {
    padding: 10px;
    gap: 9px;
  }

  .av-ring {
    width: 56px;
    height: 56px;
    min-width: 56px;
  }

  .av-ring > img,
  .av-ring .prof-av {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }

  .prof-name-row b,
  .prof-name-row .prof-name {
    font-size: 15.5px;
  }

  .prof-elo-pill {
    padding: 5px 8px;
    font-size: 14px;
  }

  .prof-tabs {
    gap: 4px;
    padding: 3px;
  }

  .ptab-b {
    font-size: 12px;
    padding: 5px 4px;
  }

  .pvp-grid {
    gap: 5px;
  }

  .pvp-stat-card {
    padding: 7px 4px;
  }

  .pvp-stat-card b {
    font-size: 17px;
  }

  .rank-tabs {
    gap: 3px;
    padding: 3px;
  }

  .rank-tabs .rtab-b {
    font-size: 11px;
    padding: 5px 1px;
  }

  .rlang-b {
    padding: 4px 7px;
    font-size: 11px;
  }

  .rank-cd {
    padding: 4px 7px;
    font-size: 11px;
  }

  .rank-podium {
    gap: 4px;
  }

  .pod-card {
    padding: 7px 4px 8px;
    border-radius: 15px;
  }

  .pod-card.pod-1 {
    min-height: 136px;
  }

  .pod-card.pod-2 {
    min-height: 122px;
  }

  .pod-card.pod-3 {
    min-height: 116px;
  }

  .pod-crown {
    width: 28px;
    height: 28px;
  }

  .pod-av {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .pod-1 .pod-av {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .pod-name {
    font-size: 11.5px;
  }

  .pod-score {
    font-size: 12.5px;
    padding: 2px 6px;
  }

  .rank-row {
    grid-template-columns: 28px 32px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 6px 8px;
  }

  .rank-av {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .rank-name {
    font-size: 13px;
  }

  .rank-val {
    font-size: 13.5px;
    gap: 4px;
  }

  .rank-val img,
  .rank-val .tier-ic {
    width: 19px;
    height: 19px;
    min-width: 19px;
  }

  .fr-card,
  .fr-req-card {
    gap: 6px;
    padding: 6px 7px;
  }

  .fr-inv-btn,
  #ovbox .fr-inv-btn,
  #ovbox button.fr-inv-btn {
    padding: 5px 8px !important;
    font-size: 11.5px;
  }
}

@media (max-width: 360px) {
  .hm2.hm-online,
  #hs[data-scr="home"] .hm2.hm-online {
    gap: 6px;
  }

  .hm2.hm-online .bigb,
  .hm2.hm-online #goN,
  .hm2.hm-online #goRank {
    font-size: 13.5px !important;
    padding: 8px 5px !important;
  }

  .prof-tabs .ptab-b {
    font-size: 11.5px;
  }

  .rank-tabs .rtab-b {
    font-size: 10.5px;
  }

  .pin-shelf {
    gap: 4px;
  }

  .deco-grid {
    gap: 5px;
    padding: 5px;
  }

  .inv-banner {
    left: 8px;
    right: 8px;
    padding: 9px 10px;
  }

  .rank-my-bar {
    padding: 8px 10px;
    gap: 6px;
  }
}

/* 18.6 Respect Reduced Motion Preference for Section 18 */
@media (prefers-reduced-motion: reduce) {
  .rank-skel,
  .rank-ref.spin,
  .inv-banner {
    animation: none;
  }

  .hm2.hm-online .bigb,
  #goRank,
  .dn-bxh-btn,
  #ovbox .dn-bxh-btn,
  .prof-back,
  .prof-set-btn,
  .ptab-b,
  .pin-slot,
  .m-fill,
  .m-weak-cta,
  .diag-fill,
  .tool-btn,
  .btn-danger-solid,
  .rank-back,
  .rank-ref,
  .rtab-b,
  .rlang-b,
  .pod-card,
  .rank-row,
  .rank-more-btn,
  .fr-inv-btn,
  .inv-ok,
  .inv-no {
    transition: none;
  }
}
