/* ============================================================
   NEONBET · Account Center — css/components/account-center.css
   ------------------------------------------------------------
   Presentation for #nb-center, the one Wallet / Account surface that replaces
   the right-hand drawer and the full-screen Account view. Two forms of the
   SAME markup: a centred dialog ≥1024px, and a full-screen slide-up sheet
   below it (the mobile block at the end of this file). Built on the site's
   existing .modal / .modal-overlay primitives and design tokens; the buttons
   are the shipped .btn classes. account-center.js no longer gates by width.
   ============================================================ */

#nb-center { z-index: 1200; padding: clamp(16px, 4vh, 56px) clamp(16px, 4vw, 48px); }

/* Page-scroll lock compensation: account-center.js measures the width the
   scrollbar gives up when the body is locked and publishes it as --nbc-gutter,
   so the page and the fixed top bar keep their geometry while the dialog is up
   (no sideways jump, and never a second scrollbar). */
body.nbc-open { padding-right: var(--nbc-gutter, 0px); }
body.nbc-open .topnav { right: var(--nbc-gutter, 0px); }
#nb-center .modal-overlay {
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#nb-center .nbc-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  max-height: min(86vh, 880px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated), 0 40px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
  transform: translateY(12px) scale(.985);
  transition: transform var(--dur-slow) var(--ease-out);
}
#nb-center.open .nbc-box { transform: none; }
@media (prefers-reduced-motion: reduce) {
  #nb-center .nbc-box { transition: none; transform: none; }
}

/* ---- Header: tabs left, close right ---- */
#nb-center .nbc-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
}
#nb-center .nbc-tabs {
  display: flex;
  gap: var(--space-1);
  padding: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .04);
}
#nb-center .nbc-tab {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: .02em;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
#nb-center .nbc-tab:hover { color: var(--text-primary); }
#nb-center .nbc-tab[aria-selected="true"] {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
#nb-center .nbc-close {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
#nb-center .nbc-close:hover { color: var(--text-primary); border-color: var(--border-strong); }
#nb-center :focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ---- Body: one scroller, never the page ---- */
#nb-center .nbc-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}
#nb-center .nbc-panel[hidden] { display: none; }
/* The site's global scrollbar paints a dark track, which the box's corner
   radius then clips into a notch. Inside the dialog show the thumb only. */
#nb-center .nbc-body::-webkit-scrollbar { width: 8px; }
#nb-center .nbc-body::-webkit-scrollbar-track { background: transparent; }
#nb-center .nbc-body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#nb-center .nbc-body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---- Wallet ---- */
#nb-center .nbc-who {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
#nb-center .nbc-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: var(--text-inverse);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}
#nb-center .nbc-who-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
#nb-center .nbc-who-txt b { font-size: var(--text-base); color: var(--text-primary); }
#nb-center .nbc-who-txt span {
  font-size: var(--text-sm);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nb-center .nbc-bal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
#nb-center .nbc-bal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  overflow: hidden;
}
/* The colour identity lives in the card's own wash and ring. A hairline on the
   top edge was tried first; the corner radius clipped its ends, so it read as a
   stray line floating above the card rather than part of it. */
#nb-center .nbc-bal-card.is-real {
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(0, 229, 255, .13) 0%, rgba(0, 229, 255, 0) 60%),
    var(--bg-surface);
  border-color: rgba(0, 229, 255, .22);
}
#nb-center .nbc-bal-card.is-bonus {
  background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 196, 40, .12) 0%, rgba(255, 196, 40, 0) 60%),
    var(--bg-surface);
  border-color: rgba(255, 196, 40, .22);
}
#nb-center .nbc-bal-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#nb-center .nbc-bal-val {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
#nb-center .nbc-bal-card.is-real .nbc-bal-val { color: var(--neon-cyan); }
#nb-center .nbc-bal-card.is-bonus .nbc-bal-val { color: var(--casino-gold); }
#nb-center .nbc-bal-note { font-size: var(--text-xs); color: var(--text-muted); }

#nb-center .nbc-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}
#nb-center .nbc-actions .btn { width: 100%; justify-content: center; height: 48px; font-size: var(--text-sm); }
/* Deposit is the primary commercial action and wears the site's primary CTA.
   Withdraw is deliberate but secondary: the same elevated + bordered treatment
   the withdraw form itself uses, not a ghost that reads as unstyled. */
#nb-center .nbc-actions .btn-primary::after { opacity: .3; filter: blur(16px); }
#nb-center .nbc-actions .btn-secondary { border-color: var(--border-strong); }
#nb-center .nbc-actions .btn-secondary:hover { border-color: var(--text-primary); background: rgba(255, 255, 255, .05); }

#nb-center .nbc-more {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}
#nb-center .nbc-tile {
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-1);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
#nb-center .nbc-tile:hover { border-color: var(--border-strong); background: var(--bg-surface-2); }
#nb-center .nbc-tile-t { font-size: var(--text-sm); font-weight: 600; }
#nb-center .nbc-tile-s { font-size: var(--text-xs); color: var(--text-muted); }

/* ---- Account: the real #nb-account view, borrowed into the dialog ----
   account.js keeps rendering it; NOTHING here changes what it renders or what
   it does. These rules re-tune the PAGE design for a dialog: a page can spend
   vertical space on a hero header and generous cards, a 700px-tall dialog
   cannot. Everything below is spacing, type scale and layout — no state, no
   fields, no actions added or removed. */
#nb-center #nb-account { display: block !important; }
#nb-center #nb-account .container { max-width: none; padding: 0; }
#nb-center #nb-account .acct-shell { padding-bottom: 0; gap: var(--space-5); }
@media (min-width: 1024px) {
  #nb-center #nb-account .acct-shell { grid-template-columns: 190px 1fr; gap: var(--space-5); }
}
#nb-center #nb-account .acct-side { position: static; top: auto; align-self: start; }

/* Identity strip. The page's hero card (84px avatar, display-size name, two
   radial washes, 24px padding) is a banner; in the dialog it is a label for
   two facts, so it gets a strip instead. */
#nb-center #nb-account .acct-header {
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(420px 120px at 8% 0%, rgba(139, 92, 255, .14), transparent 70%),
    var(--bg-surface);
  gap: var(--space-3);
}
@media (min-width: 760px) {
  #nb-center #nb-account .acct-header { gap: var(--space-4); }
}
#nb-center #nb-account .acct-avatar {
  width: 44px; height: 44px;
  font-size: var(--text-base);
  box-shadow: 0 0 14px rgba(255, 46, 147, .28);
}
#nb-center #nb-account .acct-id { min-width: 0; }
#nb-center #nb-account .acct-id .name {
  font-size: var(--text-lg);
  letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#nb-center #nb-account .acct-id .email {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  max-width: 100%;
}

/* Section chrome: the dialog header already says Account, so the section
   title is a label, not a page heading. */
#nb-center #nb-account .acct-section h2 { font-size: var(--text-lg); letter-spacing: .01em; }
#nb-center #nb-account .acct-section .section-lead {
  font-size: var(--text-sm);
  margin: 2px 0 var(--space-4);
}
#nb-center #nb-account .panel { padding: var(--space-4) var(--space-5) var(--space-5); margin-bottom: var(--space-3); }
#nb-center #nb-account .panel:last-child { margin-bottom: 0; }
#nb-center #nb-account .panel h3 { font-size: var(--text-base); }
#nb-center #nb-account .panel .panel-lead { margin: 2px 0 var(--space-3); font-size: var(--text-xs); }

/* Sidebar rail */
#nb-center #nb-account .acct-nav { padding: var(--space-2); }
#nb-center #nb-account .acct-nav-link { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
#nb-center #nb-account .acct-nav-link svg { width: 16px; height: 16px; }

/* Profile fields */
#nb-center #nb-account .acct-note {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  gap: var(--space-2);
  align-items: center;
}
#nb-center #nb-account .acct-note svg { width: 15px; height: 15px; margin-top: 0; }
#nb-center #nb-account .form-grid { gap: var(--space-3); }
#nb-center #nb-account .field { gap: 4px; }
#nb-center #nb-account .input { height: 38px; font-size: var(--text-sm); padding: 0 var(--space-3); }

/* ---- Verification ----
   Same content, same controls, same KYC state — read as a status list rather
   than a wall of cards. */
/* Order inside Verification: what needs action first, the explainer last.
   "Why verify?" is reassurance, not a task — it earns its space below the
   documents, where it is read once rather than pushing every status row down. */
#nb-center #nb-account #kyc-root { display: flex; flex-direction: column; }
#nb-center #nb-account #kyc-root > * { order: 1; }
#nb-center #nb-account #kyc-root .pv-kyc-card { order: 0; }
#nb-center #nb-account #kyc-root .kyc-banner { order: 2; margin: var(--space-3) 0 0; }

#nb-center #nb-account .kyc-banner {
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
}
#nb-center #nb-account .kyc-banner svg { width: 16px; height: 16px; }
#nb-center #nb-account .kyc-banner { align-items: flex-start; }
#nb-center #nb-account .kyc-banner svg { margin-top: 2px; }
#nb-center #nb-account .kyc-banner h4 { font-size: var(--text-xs); margin: 0 0 1px; letter-spacing: .02em; }
#nb-center #nb-account .kyc-banner p { font-size: var(--text-xs); line-height: 1.35; }
/* Every row carries its own instruction line, so the panel's lead was saying
   the same thing a third time. The heading stays. */
#nb-center #nb-account #kyc-root .panel .panel-lead { display: none; }

/* Phone verification: one row — who/what on the left, the action on the right. */
#nb-center .pv-kyc-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-3);
  border-radius: var(--radius-md);
}
#nb-center .pv-kyc-head { margin-bottom: 0; gap: var(--space-2); align-items: center; }
#nb-center .pv-kyc-icon { font-size: 16px; }
#nb-center .pv-kyc-head > div { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
#nb-center .pv-kyc-title { margin: 0; font-size: var(--text-sm); }
#nb-center .pv-kyc-sub { grid-column: 1; font-size: var(--text-xs); margin-top: 2px; }
#nb-center .pv-kyc-cta {
  grid-column: 2; grid-row: 1 / span 2;
  margin-top: 0; align-self: center;
  height: 34px; padding: 0 var(--space-4); font-size: var(--text-xs);
}

/* Documents: the page shows three 200px-tall dashed drop-zones side by side,
   which in a dialog wastes a row on the fourth document and answers "what is
   verified?" only after reading four cards. Same cards, same children, same
   controls — re-laid as one status row each: icon · name + what it is ·
   status · action. `order` does the arranging, so account.js's markup and the
   upload wiring are untouched. */
#nb-center #nb-account .kyc-grid { grid-template-columns: 1fr; gap: var(--space-2); }
#nb-center #nb-account .kyc-zone {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 0 var(--space-3);
  min-height: 0;
  padding: var(--space-2) var(--space-3);
  border-width: 1px;
  border-style: solid;
  background: rgba(255, 255, 255, .02);
}
#nb-center #nb-account .kyc-zone > * { order: 5; }
/* Grid item default min-width:auto lets a long unbreakable token in any child
   grow the 1fr track and widen the card; pin it to 0 so content wraps instead. */
#nb-center #nb-account .kyc-zone { min-width: 0; }
#nb-center #nb-account .kyc-zone .icon-wrap {
  order: 0; width: 32px; height: 32px; flex: 0 0 auto;
}
#nb-center #nb-account .kyc-zone .icon-wrap svg { width: 16px; height: 16px; }
#nb-center #nb-account .kyc-zone h4 {
  order: 1; flex: 1 1 auto; min-width: 0;
  font-size: var(--text-sm); display: flex; align-items: center; gap: var(--space-2);
}
#nb-center #nb-account .kyc-zone .kyc-status { order: 2; flex: 0 0 auto; margin-left: auto; }
#nb-center #nb-account .kyc-zone .kyc-upload-btn { order: 3; flex: 0 0 auto; margin: 0; }
/* Second line: what the document is, then anything the reviewer said. Indented
   under the title, never pushing the row's controls around. */
#nb-center #nb-account .kyc-zone p,
#nb-center #nb-account .kyc-zone .kyc-todo {
  flex: 1 0 100%;
  min-width: 0;
  /* Indent under the title with PADDING, not margin. This row is flex-basis:100%
     (its own full-width line); a left MARGIN sits OUTSIDE that width, so the row's
     right edge ran 44px past the card border and the text overflowed. With
     box-sizing:border-box the same indent as padding stays INSIDE the card. */
  padding-left: calc(32px + var(--space-3));
  line-height: 1.35;
  /* `anywhere`, not `break-word`: it lets an over-long token (a URL, a long
     filename) break AND counts that break when the browser sizes min-content, so
     the token can never grow the card. Normal words still wrap at spaces. */
  overflow-wrap: anywhere;
}
#nb-center #nb-account .kyc-zone p { margin-top: 1px; }
#nb-center #nb-account .kyc-zone .kyc-file { margin-top: 0; color: var(--text-muted); font-size: var(--text-xs); }
#nb-center #nb-account .kyc-zone .kyc-reason-h,
#nb-center #nb-account .kyc-zone .kyc-todo-h { font-weight: 700; }
#nb-center #nb-account .kyc-zone .kyc-err[hidden] { display: none; }

/* Short screens (1366x768 and every 900-tall laptop) are the case where the
   Account content actually threatens to scroll, so the dialog takes more of
   the height it has instead of holding a fixed 14% margin. */
@media (max-height: 820px) {
  #nb-center { padding: clamp(12px, 2.5vh, 32px) clamp(16px, 4vw, 48px); }
  #nb-center .nbc-box { max-height: 92vh; }
  #nb-center .nbc-body { padding: var(--space-5); }
}

/* ---- Laptop widths ---- */
@media (max-width: 1280px) {
  #nb-center .nbc-box { max-width: 880px; }
}
@media (max-width: 1100px) {
  #nb-center { padding: clamp(12px, 3vh, 32px) clamp(12px, 3vw, 24px); }
  /* Keep a real gutter and a dialog-sized box at 1024–1100: stretching to the
     viewport made the balance cards read as page sections, not a dialog. The
     three tiles stay on one row so none of them is orphaned. */
  #nb-center .nbc-box { max-width: 820px; max-height: min(90vh, 820px); }
  #nb-center .nbc-body { padding: var(--space-5); }
  #nb-center .nbc-tile { padding: var(--space-3) var(--space-4); }
}


/* ---- Nested modals that the wallet hands off to ----
   .modal is z500 site-wide and only #deposit-modal.open is lifted (3100), so
   Withdraw and Rewards would open *behind* this dialog. Lift them for as long
   as the dialog is up; when it is closed these rules do not apply and the
   site's own stacking is untouched. */
body.nbc-open #withdraw-modal.open,
body.nbc-open #rewards-modal.open { z-index: 3100; }

/* ============================================================
   MOBILE — full-screen sheet (< 1024px)
   ------------------------------------------------------------
   The same #nb-center becomes a slide-up sheet that fills the viewport,
   intentionally laid out for ~320–430px rather than a shrunk dialog. One
   scroller (.nbc-body), safe-area insets top and bottom, touch-sized controls,
   and the balance → actions → more hierarchy the desktop dialog established.
   account-center.js opens/closes it exactly as it does the dialog.
   ============================================================ */
@media (max-width: 1023.98px) {
  /* No reserved scrollbar on a phone, so no gutter compensation. */
  body.nbc-open { padding-right: 0; }
  body.nbc-open .topnav { right: 0; }

  /* The modal container fills the screen; ONLY .nbc-body scrolls — never the
     container, never the page underneath. */
  #nb-center { padding: 0; overflow: hidden; }
  #nb-center .modal-overlay { display: none; }          /* the sheet covers it whole */

  #nb-center .nbc-box {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateY(100%);                        /* slide up from the bottom */
  }
  #nb-center.open .nbc-box { transform: none; }

  /* Header — safe-area top; the Wallet/Account tabs become a full-width
     segmented control, close at the trailing edge. Targets ≥44px. */
  #nb-center .nbc-head {
    gap: var(--space-3);
    padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3);
  }
  #nb-center .nbc-tabs { flex: 1 1 auto; }
  #nb-center .nbc-tab { flex: 1 1 0; text-align: center; padding: 12px 10px; }
  #nb-center .nbc-close { width: 40px; height: 40px; flex: 0 0 auto; }

  /* Body — the single scroller. Comfortable padding; safe-area bottom keeps
     content clear of the home indicator and the browser's bottom chrome. */
  #nb-center .nbc-body {
    padding: var(--space-5) var(--space-4);
    padding-bottom: max(var(--space-6), calc(env(safe-area-inset-bottom) + var(--space-5)));
    -webkit-overflow-scrolling: touch;
  }

  /* Wallet */
  #nb-center .nbc-bal { gap: var(--space-3); }
  #nb-center .nbc-bal-card { padding: var(--space-4); }
  #nb-center .nbc-bal-val { font-size: var(--text-xl); }
  #nb-center .nbc-actions { margin-top: var(--space-5); gap: var(--space-3); }
  #nb-center .nbc-actions .btn { height: 50px; font-size: var(--text-base); }
  /* The three tiles read as a stacked list on a phone, not a squeezed 3-up row. */
  #nb-center .nbc-more {
    grid-template-columns: 1fr;
    gap: var(--space-2);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
  }
  #nb-center .nbc-tile { padding: var(--space-4); }

  /* Account — the borrowed #nb-account keeps account.css's own < 1024px layout
     (its side rail is already a horizontal section strip there). The dialog's
     compacting rules above still apply; this only gives the shell room. */
  #nb-center #nb-account .acct-shell { gap: var(--space-4); }
}

/* Narrow phones (≤ 360px): stack the two balance cards so neither is squeezed. */
@media (max-width: 360px) {
  #nb-center .nbc-bal { grid-template-columns: 1fr; }
}
