:root{
  --bg:#0a0d12; --panel:#12161e; --panel2:#1a1f2a;
  --text:#f2f4f7; --muted:#a9b1c4;
  --primary:#49b4ff; --accent:#ffbf47; --purple:#8b7bff;
  --radius:14px; --border:#222a3a;
  --header-h:56px;
}


html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ -webkit-font-smoothing:antialiased; padding-top:var(--header-h); }
button{ -webkit-appearance:none; appearance:none; cursor:pointer; }

/* ===== Header layout (grid areas) ===== */
.topbar{
  position:fixed; inset:0 0 auto 0;
  background:#0b0e13d1; border-bottom:1px solid var(--border);
  z-index:1500; 
  display:grid;
  grid-template-columns:auto auto 1fr auto;
  grid-template-areas:"menu brand balance actions";
  align-items:center; gap:14px;
  padding:10px 16px; min-height:56px;
  backdrop-filter: blur(3px);
}


.icon-btn{
  display:grid; place-items:center;
  width:40px; height:40px; border-radius:10px;
  background:var(--panel2); border:1px solid #2a3140; color:#e7eaf3;
  line-height:0; font:700 18px/1 system-ui;
}
.icon-btn.left{ grid-area:menu; position:relative; z-index:10; }
.icon-btn span{ display:inline-block; line-height:1; } /* на всякий для текстовых иконок */


.brand{ grid-area:brand; display:flex; align-items:center; height:40px; }
.brand img{ display:block; height:28px; width:auto; }


.balance-center{
  grid-area:balance;
  position:static !important; transform:none !important;
  justify-self:center;
  display:flex; align-items:center; gap:10px; padding:6px 10px;
  background:#12161e; border:1px solid #2a3140; border-radius:12px;
  white-space:nowrap; max-width:min(720px,90vw); z-index:40;
}
.wallet-btn{
  width:36px; height:36px; border-radius:50%;
  background:var(--panel2); border:1px solid #2a3140; color:#fff;
  display:grid; place-items:center; line-height:0; font-size:16px;
}

.wallet-btn i[class^="fa"], .wallet-btn svg{
  display:inline-grid; place-items:center;
  width:20px; height:20px; line-height:0; vertical-align:middle;
  pointer-events:none;
}

.balance-amount{
  font-weight:800; letter-spacing:.02em; font-variant-numeric:tabular-nums;
  max-width:180px; overflow:hidden; text-overflow:ellipsis;
}


.actions{
  grid-area:actions; justify-self:end; z-index:60;
  display:flex; align-items:center; gap:10px;
}
.btn{ border:0; border-radius:20px; padding:8px 12px; font-weight:700; white-space:nowrap; }
.btn--ghost{ background:var(--panel2); color:#fff; border:1px solid var(--border); }
.btn--primary{ background:var(--accent); color:#111; }


.user-chip{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid #2a3140; background:#12161e; color:#e7eaf3;
  border-radius:999px; padding:6px 10px; margin-left:8px;
}
.user-chip img{
  width:24px; height:24px; border-radius:50%; object-fit:cover;
  background:#0f141d; border:1px solid #2a3140;
}


#site-header .user-chip[hidden],
#site-header .auth[hidden]{ display:none !important; }

/* ===== Drawer ===== */
.drawer{
  position:fixed; left:0; top:0; bottom:0; width:min(320px,100vw);
  background:var(--panel); border-right:1px solid var(--border);
  transform:translateX(-100%); transition:transform .25s ease;
  z-index:2000; overflow-y:auto;
}
.drawer.open{ transform:none !important; }
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.55);
  opacity:0; pointer-events:none; transition:opacity .2s; z-index:1990;
}
.backdrop.open{ opacity:1; pointer-events:auto; }

.drawer__header{
  position:sticky; top:0; display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:14px; background:var(--panel); border-bottom:1px solid var(--border); z-index:1;
}
.drawer__title{ font-weight:800; }
.drawer__content{ padding:14px; display:grid; gap:14px; overflow-x:hidden; }
.drawer__list{ list-style:none; display:grid; gap:8px; margin:0; padding:0; }
.drawer__list li{
  display:flex; align-items:center; gap:10px;
  background:#1f2430; border:1px solid #2a3140; border-radius:12px;
  padding:10px 12px; min-width:0;
}
.li-left{ flex:1; display:flex; align-items:center; gap:10px; }

.drawer__list .li-left i[class^="fa"], .drawer__list .li-left svg{
  display:inline-grid; place-items:center;
  width:20px; min-width:20px; height:20px; line-height:0; vertical-align:middle; flex:0 0 20px;
}
.chev{ display:inline-grid; place-items:center; width:16px; height:16px; line-height:0; opacity:.7; margin-left:auto; }

/* ===== Wallet / Profile panels ===== */
.wallet-panel{
  position:fixed;
  top:calc(var(--header-h) + 12px);
  left:50%;
  width:min(420px,94vw);
  background:#12161e; border:1px solid #2a3140; border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  opacity:0; transform:translate(-50%,-8px);
  pointer-events:none; transition:opacity .2s, transform .2s;
  z-index:1300; max-height:calc(100dvh - var(--header-h) - 24px);
  overflow:auto; overscroll-behavior:contain;
}
.wallet-panel.open{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.wallet-panel__inner{ padding:14px; display:grid; gap:12px; }
.wallet-panel__head{ display:flex; align-items:center; justify-content:space-between; }
.wallet-panel__label{ color:#cfd6e8; }
.wallet-panel__amount{ font-weight:800; }
.wallet-panel__row{ display:flex; gap:10px; justify-content:center; }
.wallet-panel__row .btn{ min-width:120px; }
.wallet-panel__divider{ border:0; border-top:1px solid #2a3140; }
.link-ghost{ color:#cfd6e8; display:block; text-align:center; margin-top:2px; }
.wallet-panel__foot{ color:#a6afc3; font-size:12px; text-align:center; }

#walletPanelInner section{ display:none; }
#walletPanelInner[data-mode="home"]     #wpHome{ display:grid; gap:12px; }
#walletPanelInner[data-mode="deposit"]  #wpDeposit{ display:grid; gap:12px; }
#walletPanelInner[data-mode="withdraw"] #wpWithdraw{ display:grid; gap:12px; }
.wallet-panel .form{ display:grid; gap:12px; }
.wallet-panel .form-row{ display:grid; gap:6px; }
.wallet-panel .form-label{ font-size:12px; color:var(--muted); }
.wallet-panel .form-input{
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid #2a3140; background:#0f141d; color:#fff;
}
.wallet-panel .form-actions{ display:flex; justify-content:center; padding-top:6px; }
.wallet-panel h3{ margin:0; font-size:16px; font-weight:800; color:#fff; }
#wpDeposit [data-crypto-only]{ display:none; }

/* ===== Responsive ===== */
@media (max-width:640px){
  .topbar{
    grid-template-columns:auto 1fr auto;
    grid-template-rows:auto auto;
    grid-template-areas:
      "menu brand actions"
      "balance balance balance";
    row-gap:8px;
  }
  .brand{ justify-self:center; }
  .actions{ justify-self:end; gap:8px; }
  .balance-center{ justify-self:center; gap:8px; padding:6px 8px; max-width:calc(100vw - 24px); }
}
@media (max-width:390px){
  .actions .btn{ padding:5px 8px; font-size:12px; }
  .balance-amount{ max-width:110px; }
  .wallet-btn{ width:34px; height:34px; }
}


.fas,.far,.fal,.fa{ -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }


.icon-btn,
.wallet-btn{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
}


.icon-btn > svg,
.icon-btn > i[class^="fa"],
.icon-btn > i.fa,
.wallet-btn > svg,
.wallet-btn > i[class^="fa"],
.wallet-btn > i.fa{
  display:block !important;
  width:20px !important;
  height:20px !important;
  line-height:1 !important;
  margin:0 !important;
  padding:0 !important;
  text-align:center !important;
  flex:0 0 20px !important;
}


.icon-btn > i[class^="fa"]::before,
.icon-btn > i.fa::before,
.wallet-btn > i[class^="fa"]::before,
.wallet-btn > i.fa::before{
  display:block !important;
  width:20px !important;
  height:20px !important;
  line-height:20px !important; 
  margin:0 !important;
  text-align:center !important;
}


.icon-btn svg[data-icon],
.wallet-btn svg[data-icon]{
  display:block !important;
  width:20px !important;
  height:20px !important;
}


.icon-btn,
.wallet-btn{
  letter-spacing:0 !important;
  word-spacing:0 !important;
}


.balance-center .wallet-btn{
  min-width:36px; min-height:36px;
}
/* === Notifications (button + panel) === */


.notif-btn{
  position:relative;
}
.notif-btn .notif-badge{
  position:absolute; top:-4px; right:-4px;
  min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#ff4d4f; color:#fff;
  font:700 11px/18px system-ui;
  display:inline-block; text-align:center;
  box-shadow:0 0 0 2px #0b0e13;
}

.notif-panel{
  position:fixed;
  top:calc(var(--header-h) + 12px); right:16px; left:auto;
  width:min(420px, 94vw);
  background:#12161e; border:1px solid #2a3140; border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  opacity:0; transform:translateY(-8px);
  pointer-events:none; transition:opacity .2s, transform .2s;
  z-index:1400; /* выше кошелька, ниже дровера (у дровера 2000) */
  max-height:calc(100dvh - var(--header-h) - 24px);
  overflow:auto; overscroll-behavior:contain;
}
.notif-panel.open{ opacity:1; transform:none; pointer-events:auto; }
.notif-panel__inner{ padding:12px; display:grid; gap:10px; }
.notif-panel__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:4px 2px 8px 2px; border-bottom:1px solid #2a3140;
}
.notif-panel__title{ font-weight:800; }


.notif-list{
  list-style:none; margin:0; padding:0; display:grid; gap:8px;
}
.notif-item{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px;
  background:#1f2430; border:1px solid #2a3140; border-radius:12px;
  padding:10px;
}
.notif-item__icon{
  width:28px; height:28px; border-radius:50%;
  display:grid; place-items:center; background:#0f141d; border:1px solid #2a3140;
  font-size:14px;
}
.notif-item__title{ font-weight:700; padding-bottom: 2px; }
.notif-item__text{ color:#cfd6e8; font-size:13px; line-height:1.3; }
.notif-item__time{ color:#a6afc3; font-size:12px; white-space:nowrap; width: 100%; text-align: right; padding-right: 4px; align-items: flex-end; display: flex; flex-direction: row-reverse; }
.notif-item__meta{ display: flex; flex-wrap: wrap; flex-direction: row-reverse; height: 100%;  }
.notif-item--unread{ border-color:#3a84ff; box-shadow:0 0 0 1px rgba(58,132,255,.15) inset; }


.notif-empty{ text-align:center; padding:18px 6px; color:#a6afc3; }
.notif-empty__icon{ font-size:24px; margin-bottom:6px; }


@media (max-width:640px){
  .notif-panel{
    right:12px; left:12px; width:auto;
  }
}
:root{
  --bg:#0a0d12; --panel:#12161e; --panel2:#1a1f2a;
  --text:#f2f4f7; --muted:#a9b1c4;
  --primary:#49b4ff; --accent:#ffbf47; --purple:#8b7bff;
  --radius:14px; --border:#222a3a;
  --header-h:56px;
}


html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body{ -webkit-font-smoothing:antialiased; padding-top:var(--header-h); }
button{ -webkit-appearance:none; appearance:none; cursor:pointer; }

/* ===== Header layout (grid areas) ===== */
.topbar{
  position:fixed; inset:0 0 auto 0;
  background:#0b0e13d1; border-bottom:1px solid var(--border);
  z-index:1500; /* ниже дровера, выше контента */
  display:grid;
  grid-template-columns:auto auto 1fr auto;
  grid-template-areas:"menu brand balance actions";
  align-items:center; gap:14px;
  padding:10px 16px; min-height:56px;
  backdrop-filter: blur(3px);
}


.icon-btn{
  display:grid; place-items:center;
  width:40px; height:40px; border-radius:10px;
  background:var(--panel2); border:1px solid #2a3140; color:#e7eaf3;
  line-height:0; font:700 18px/1 system-ui;
}
.icon-btn.left{ grid-area:menu; position:relative; z-index:10; }
.icon-btn span{ display:inline-block; line-height:1; } 


.brand{ grid-area:brand; display:flex; align-items:center; height:40px; }
.brand img{ display:block; height:28px; width:auto; }


.balance-center{
  grid-area:balance;
  position:static !important; transform:none !important;
  justify-self:center;
  display:flex; align-items:center; gap:10px; padding:6px 10px;
  background:#12161e; border:1px solid #2a3140; border-radius:12px;
  white-space:nowrap; max-width:min(720px,90vw); z-index:40;
}
.wallet-btn{
  width:36px; height:36px; border-radius:50%;
  background:var(--panel2); border:1px solid #2a3140; color:#fff;
  display:grid; place-items:center; line-height:0; font-size:16px;
}

.wallet-btn i[class^="fa"], .wallet-btn svg{
  display:inline-grid; place-items:center;
  width:20px; height:20px; line-height:0; vertical-align:middle;
  pointer-events:none;
}

.balance-amount{
  font-weight:800; letter-spacing:.02em; font-variant-numeric:tabular-nums;
  max-width:180px; overflow:hidden; text-overflow:ellipsis;
}


.actions{
  grid-area:actions; justify-self:end; z-index:60;
  display:flex; align-items:center; gap:10px;
}
.btn{ border:0; border-radius:20px; padding:8px 12px; font-weight:700; white-space:nowrap; }
.btn--ghost{ background:var(--panel2); color:#fff; border:1px solid var(--border); }
.btn--primary{ background:var(--accent); color:#111; }

/* Чип юзера */
.user-chip{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid #2a3140; background:#12161e; color:#e7eaf3;
  border-radius:999px; padding:6px 10px; margin-left:8px;
}
.user-chip img{
  width:24px; height:24px; border-radius:50%; object-fit:cover;
  background:#0f141d; border:1px solid #2a3140;
}


#site-header .user-chip[hidden],
#site-header .auth[hidden]{ display:none !important; }

/* ===== Drawer ===== */
.drawer{
  position:fixed; left:0; top:0; bottom:0; width:min(320px,100vw);
  background:var(--panel); border-right:1px solid var(--border);
  transform:translateX(-100%); transition:transform .25s ease;
  z-index:2000; overflow-y:auto;
}
.drawer.open{ transform:none !important; }
.backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.55);
  opacity:0; pointer-events:none; transition:opacity .2s; z-index:1990;
}
.backdrop.open{ opacity:1; pointer-events:auto; }

.drawer__header{
  position:sticky; top:0; display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:14px; background:var(--panel); border-bottom:1px solid var(--border); z-index:1;
}
.drawer__title{ font-weight:800; }
.drawer__content{ padding:14px; display:grid; gap:14px; overflow-x:hidden; }
.drawer__list{ list-style:none; display:grid; gap:8px; margin:0; padding:0; }
.drawer__list li{
  display:flex; align-items:center; gap:10px;
  background:#1f2430; border:1px solid #2a3140; border-radius:12px;
  padding:10px 12px; min-width:0;
}
.li-left{ flex:1; display:flex; align-items:center; gap:10px; }
/* одинаковая коробка для svg/FA слева, чтобы ничего не «прыгало» */
.drawer__list .li-left i[class^="fa"], .drawer__list .li-left svg{
  display:inline-grid; place-items:center;
  width:20px; min-width:20px; height:20px; line-height:0; vertical-align:middle; flex:0 0 20px;
}
.chev{ display:inline-grid; place-items:center; width:16px; height:16px; line-height:0; opacity:.7; margin-left:auto; }

/* ===== Wallet / Profile panels ===== */
.wallet-panel{
  position:fixed;
  top:calc(var(--header-h) + 12px);
  left:50%;
  width:min(420px,94vw);
  background:#12161e; border:1px solid #2a3140; border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  opacity:0; transform:translate(-50%,-8px);
  pointer-events:none; transition:opacity .2s, transform .2s;
  z-index:1300; max-height:calc(100dvh - var(--header-h) - 24px);
  overflow:auto; overscroll-behavior:contain;
}
.wallet-panel.open{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.wallet-panel__inner{ padding:14px; display:grid; gap:12px; }
.wallet-panel__head{ display:flex; align-items:center; justify-content:space-between; }
.wallet-panel__label{ color:#cfd6e8; }
.wallet-panel__amount{ font-weight:800; }
.wallet-panel__row{ display:flex; gap:10px; justify-content:center; }
.wallet-panel__row .btn{ min-width:120px; }
.wallet-panel__divider{ border:0; border-top:1px solid #2a3140; }
.link-ghost{ color:#cfd6e8; display:block; text-align:center; margin-top:2px; }
.wallet-panel__foot{ color:#a6afc3; font-size:12px; text-align:center; }

#walletPanelInner section{ display:none; }
#walletPanelInner[data-mode="home"]     #wpHome{ display:grid; gap:12px; }
#walletPanelInner[data-mode="deposit"]  #wpDeposit{ display:grid; gap:12px; }
#walletPanelInner[data-mode="withdraw"] #wpWithdraw{ display:grid; gap:12px; }
.wallet-panel .form{ display:grid; gap:12px; }
.wallet-panel .form-row{ display:grid; gap:6px; }
.wallet-panel .form-label{ font-size:12px; color:var(--muted); }
.wallet-panel .form-input{
  width:100%; padding:10px 12px; border-radius:10px;
  border:1px solid #2a3140; background:#0f141d; color:#fff;
}
.wallet-panel .form-actions{ display:flex; justify-content:center; padding-top:6px; }
.wallet-panel h3{ margin:0; font-size:16px; font-weight:800; color:#fff; }
#wpDeposit [data-crypto-only]{ display:none; }

/* ===== Responsive ===== */
@media (max-width:640px){
  .topbar{
    grid-template-columns:auto 1fr auto;
    grid-template-rows:auto auto;
    grid-template-areas:
      "menu brand actions"
      "balance balance balance";
    row-gap:8px;
  }
  .brand{ justify-self:center; }
  .actions{ justify-self:end; gap:8px; }
  .balance-center{ justify-self:center; gap:8px; padding:6px 8px; max-width:calc(100vw - 24px); }
}
@media (max-width:390px){
  .actions .btn{ padding:5px 8px; font-size:12px; }
  .balance-amount{ max-width:110px; }
  .wallet-btn{ width:34px; height:34px; }
}


.fas,.far,.fal,.fa{ -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }


.icon-btn,
.wallet-btn{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 !important;
}


.icon-btn > svg,
.icon-btn > i[class^="fa"],
.icon-btn > i.fa,
.wallet-btn > svg,
.wallet-btn > i[class^="fa"],
.wallet-btn > i.fa{
  display:block !important;
  width:20px !important;
  height:20px !important;
  line-height:1 !important;
  margin:0 !important;
  padding:0 !important;
  text-align:center !important;
  flex:0 0 20px !important;
}


.icon-btn > i[class^="fa"]::before,
.icon-btn > i.fa::before,
.wallet-btn > i[class^="fa"]::before,
.wallet-btn > i.fa::before{
  display:block !important;
  width:20px !important;
  height:20px !important;
  line-height:20px !important; 
  margin:0 !important;
  text-align:center !important;
}


.icon-btn svg[data-icon],
.wallet-btn svg[data-icon]{
  display:block !important;
  width:20px !important;
  height:20px !important;
}


.icon-btn,
.wallet-btn{
  letter-spacing:0 !important;
  word-spacing:0 !important;
}


.balance-center .wallet-btn{
  min-width:36px; min-height:36px;
}



.notif-btn{
  position:relative;
}
.notif-btn .notif-badge{
  position:absolute; top:-4px; right:-4px;
  min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; background:#ff4d4f; color:#fff;
  font:700 11px/18px system-ui;
  display:inline-block; text-align:center;
  box-shadow:0 0 0 2px #0b0e13;
}


.notif-panel{
  position:fixed;
  top:calc(var(--header-h) + 12px); right:16px; left:auto;
  width:min(420px, 94vw);
  background:#12161e; border:1px solid #2a3140; border-radius:14px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
  opacity:0; transform:translateY(-8px);
  pointer-events:none; transition:opacity .2s, transform .2s;
  z-index:1400; 
  max-height:calc(100dvh - var(--header-h) - 24px);
  overflow:auto; overscroll-behavior:contain;
}
.notif-panel.open{ opacity:1; transform:none; pointer-events:auto; }
.notif-panel__inner{ padding:12px; display:grid; gap:10px; }
.notif-panel__head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; padding:4px 2px 8px 2px; border-bottom:1px solid #2a3140;
}
.notif-panel__title{ font-weight:800; }


.notif-list{
  list-style:none; margin:0; padding:0; display:grid; gap:8px;
}
.notif-item{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px;
  background:#1f2430; border:1px solid #2a3140; border-radius:12px;
  padding:10px;
}
.notif-item__icon{
  width:28px; height:28px; border-radius:50%;
  display:grid; place-items:center; background:#0f141d; border:1px solid #2a3140;
  font-size:14px;
}
.notif-item__title{ font-weight:700; }
.notif-item__text{ color:#cfd6e8; font-size:13px; line-height:1.3; }
.notif-item__time{ color:#a6afc3; font-size:12px; white-space:nowrap; }
.notif-item--unread{ border-color:#3a84ff; box-shadow:0 0 0 1px rgba(58,132,255,.15) inset; }


.notif-empty{ text-align:center; padding:18px 6px; color:#a6afc3; }
.notif-empty__icon{ font-size:24px; margin-bottom:6px; }


@media (max-width:640px){
  .notif-panel{
    right:12px; left:12px; width:auto;
  }
}

@media (max-width: 414px){
  
  .topbar{
    box-sizing: border-box;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left:  max(12px, env(safe-area-inset-left));
  }

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

 
  .actions .btn.auth{
    padding: 6px 10px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  
  .actions .icon-btn{ width: 36px; height: 36px; }


  .brand img{ height: 26px; }
}

@media (max-width: 390px){
  
  .topbar{
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left:  max(10px, env(safe-area-inset-left));
  }
  .actions{ gap: 6px; }

  .actions .btn.auth{
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .actions .icon-btn{ width: 34px; height: 34px; }

  
  .notif-btn{ margin-right: 4px; }          
  .notif-btn .notif-badge{ right: -2px; }   
}
.bonus-select-wrap {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.bonus-info {
  background: var(--panel2);
  border: 1px solid #2a3140;
  border-radius: 10px;
  padding: 6px 10px;
  color: var(--text);
  font-weight: 500;
}
.bonus-modal-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,.55);
  display:grid; place-items:center; z-index:1600;
  animation:bonusFade .15s ease;
}
@keyframes bonusFade { from{ opacity:0 } to{ opacity:1 } }

.bonus-modal{
  width:min(520px,94vw);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
  display:grid; gap:10px;
  padding:12px;
}
.bonus-modal__head{ display:flex; align-items:center; justify-content:space-between;
  padding-bottom:6px; border-bottom:1px solid #2a3140; }
.bonus-modal__title{ font-weight:800; font-size:16px; }
.bonus-close{ width:32px; height:32px; border-radius:8px;
  background:var(--panel2); border:1px solid #2a3140; color:#fff; }

.bonus-modal__list{ display:grid; gap:8px; max-height:50vh; overflow:auto; }

.bonus-item{
  display:grid; grid-template-columns:auto 1fr auto; gap:10px; align-items:center;
  background:#1f2430; border:1px solid #2a3140; border-radius:12px; padding:10px;
}
.bonus-item input[type="radio"]{ accent-color:var(--accent); width:18px; height:18px; }
.bonus-item__title{ font-weight:700; }
.bonus-item__sub{ color:#cfd6e8; font-size:12px; opacity:.85; }

.bonus-modal__foot{ display:flex; gap:10px; justify-content:flex-end; padding-top:6px;
  border-top:1px solid #2a3140; }

.bonus-info{
  background: var(--panel2);
  border: 1px solid #2a3140;
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
  font-weight: 600;
  text-align:center;
  margin: 6px 0 8px;
}
#pInterests {
  display: none !important;
}
.notif-item__deleteButton {
  background: none;
  border: none;
  color: #a6afc3;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 8px;
  transition: background .2s, color .2s;
  /* padding-bottom: 0;
  padding-top: 0; */
  display: flex;
  flex-direction: column;
}

.notif-item__deleteButton:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
/* Спрятать "красную точку" по умолчанию */
#site-header .notif-btn::after {
  display: none !important;
}

/* Показывать точку, только если есть непрочитанные */
#site-header .notif-btn[data-unread="1"]::after {
  display: inline-block !important;
}
/* ——— Notifications dot: full reset ——— */
#site-header .notif-btn::before,
#site-header .notif-btn::after{
  content: none !important;
  display: none !important;
}

/* ——— Show dot only when there are unread ——— */
#site-header .notif-btn[data-unread="1"]::after{
  content: "" !important;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  display: block !important;
}
/* === NOTIF DOT: полный ресет всего, что может прийти из header.css === */

/* 1) вырубаем любые псевдоэлементы у кнопки уведомлений */
header#site-header .actions .icon-btn.notif-btn::before,
header#site-header .actions .icon-btn.notif-btn::after,
header#site-header .icon-btn#notifToggle::before,
header#site-header .icon-btn#notifToggle::after{
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* 2) на самой кнопке глушим возможный красный кружок, который рисуют как background-image */
header#site-header .icon-btn#notifToggle,
header#site-header .actions .icon-btn.notif-btn{
  background-image: none !important; /* на случай radial-gradient(...) */
  background-position: initial !important;
  background-repeat: no-repeat !important;
}

/* 3) наш управляемый индикатор: показывается ТОЛЬКО когда JS ставит data-unread="1" */
header#site-header .icon-btn#notifToggle[data-unread="1"]::after,
header#site-header .actions .icon-btn.notif-btn[data-unread="1"]::after{
  content: "" !important;
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  display: block !important;
  box-shadow: 0 0 0 2px #0b0e13;
}
/* ❶ Полный ресет любых “точек”, которые могут приезжать псевдоэлементами на кнопках справа */
#site-header .actions .icon-btn::before,
#site-header .actions .icon-btn::after{
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

/* ❷ На всякий — глушим вариант, когда точка нарисована фоном (radial-gradient) на самой кнопке */
#site-header .actions .icon-btn{
  background-image: none !important;
  background-repeat: no-repeat !important;
}

/* ❸ Наш единственный индикатор: появляется ТОЛЬКО когда JS ставит data-unread="1" на #notifToggle */
#site-header #notifToggle[data-unread="1"]::after{
  content: "" !important;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4d4f;
  display: block !important;
  box-shadow: 0 0 0 2px #0b0e13;
}

/* сам числовой бейдж — как у тебя, но он скрыт, если нет непрочитанных */
#site-header .notif-badge[hidden] { display: none !important; }

/* Remove default look */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #888;
  border-radius: 50%;
  background-color: #1a1a1a; /* dark inner color when unselected */
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}

/* Hover effect (optional) */
input[type="radio"]:hover {
  border-color: #ccc;
}

/* Checked state — dark background with bright inner dot */
input[type="radio"]:checked {
  border-color: #3b82f6; /* blue border when selected */
}

input[type="radio"]:checked::before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: #3b82f6; /* inner dot color */
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
/* Bonus modal — всегда поверх всего, особенно поверх wallet-panel на iOS */
.bonus-modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 2147483646;            /* выше, чем любые панели/оверлеи */
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.bonus-modal{
  width: 100%;
  max-width: min(520px, 92vw);
  border-radius: 14px;
  background: #171a21;
  border: 1px solid #2a3140;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
/* === отключаем аватар полностью в UI === */
.user-chip img#userChipAva { display: none !important; }

#profileAvaFile,
#profileAvaPreview,
#profileAvaPreview + input[type="file"],
#profileAvaFile + * {
  display: none !important;
}

/* выравниваем чип пользователя без картинки */
.user-chip {
  gap: 8px;
}
#userChipName {
  padding-left: 0; /* не оставляем место под картинку */
}
/* сохранить прежний размер user-chip без аватара */
.user-chip{
  display: inline-flex;           /* как и было */
  align-items: center;
  height: 36px;                   /* фикс высота под хедер (подставь своё, если у тебя 38/40) */
  padding: 0 10px;                /* чтобы кнопка не схлопывалась */
  gap: 8px;                       /* как и раньше */
}

/* заглушка на месте аватара, чтобы не уехала типографика/выровненность */
.user-chip::before{
  content: "";
  display: inline-block;
  width: 28px;                    /* прежний диаметр иконки/аватара */
  height: 28px;
  border-radius: 50%;
  /* фон прозрачный, ничего не рисуем — просто занимаем место */
  margin-right: 0;                /* gap уже даёт отступ */
}

/* текст не должен прилипать и не должен влиять на высоту */
#userChipName{
  line-height: 1;                 /* без лишней высоты строки */
  padding-left: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;       /* центрируем всё по вертикали */
  justify-content: center;   /* добавляем центрирование по горизонтали */
  height: 36px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 8px;        /* чтобы форма не потерялась, если есть фон при hover */
}

/* убираем псевдоэлемент, если он мешает центрированию */
.user-chip::before {
  content: none;
}

/* имя строго по центру */
#userChipName {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  line-height: 1;
  width: 100%;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;   /* центрируем имя внутри кнопки */
  height: 36px;
  min-width: 80px;           /* ширина, чтобы текст не прилипал к краю */
  padding: 0 12px;
  gap: 8px;
  border-radius: 8px;
  text-align: center;
}

/* убираем псевдоэлементы, если были */
.user-chip::before { content: none; }

/* сам текст */
#userChipName {
  flex: 1;                   /* заставляем занять всю ширину кнопки */
  display: flex;
  align-items: center;
  justify-content: center;   /* центр текста по горизонтали */
  text-align: center;
  line-height: 1;
  padding: 0;
}

/* если хедер выравнивает .actions.right вправо, пусть остаётся */
.actions.right {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* это влияет только на блок в целом, не на внутренности кнопки */
}
/* ==== FIX: center username inside user-chip ==== */
#site-header #userChip{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:0 12px !important;
  height:36px !important;
  min-width:88px;               /* чтобы не выглядело узко */
  text-align:center !important; /* на случай наследования */
}

/* отменяем старые ширины/флексы/выравнивания на span */
#site-header #userChipName{
  flex:0 0 auto !important;     /* не растягиваемся на 100% */
  width:auto !important;        /* сброс старого width:100% */
  min-width:0 !important;
  margin:0 auto !important;     /* центр как fallback */
  display:block !important;
  line-height:1 !important;
  text-align:center !important;
  padding:0 !important;
}

/* если где-то осталась заглушка или аватар — убираем, чтоб не сдвигало текст */
#site-header #userChip::before,
#site-header #userChip img#userChipAva{
  display:none !important;
  content:none !important;
}
/* ==== VISUAL TUNE: make username bolder and same height as notif button ==== */
#site-header #userChip {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;        /* как у .icon-btn (40x40) */
  min-width: 96px !important;     /* немного шире, чтобы текст не прилипал */
  padding: 0 14px !important;
  border-radius: 10px !important;
  background: var(--panel2) !important;
  border: 1px solid #2a3140 !important;
}

/* ник — жирный и визуально центрированный */
#site-header #userChipName {
  font-weight: 800 !important;
  font-size: 15px !important;
  color: var(--text) !important;
  text-align: center !important;
  line-height: 1 !important;
  margin: 0 auto !important;
  width: auto !important;
  flex: 0 0 auto !important;
}

/* hover-эффект — лёгкий, как на других кнопках */
#site-header #userChip:hover {
  background: #1f2430 !important;
  border-color: #3a4455 !important;
}
/* Если чип помечен hidden — прячем полностью */
#site-header #userChip[hidden]{
  display:none !important;
}
/* === HEADER AUTH BUTTONS: refined for desktop & mobile === */
#site-header .actions .btn.auth{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;             /* общая высота */
  padding: 0 14px;          /* базовая ширина на десктопе */
  border-radius: 10px;      /* умеренно скруглённые */
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all .15s ease;
}

/* hover / active */
#site-header .actions .btn.auth:hover{ filter: brightness(1.08); }
#site-header .actions .btn.auth:active{ transform: translateY(.5px); }

/* === Mobile refinements === */
@media (max-width: 640px){
  #site-header .actions .btn.auth{
    height: 36px;            /* чуть ниже, чтобы не упирались в верх */
    padding: 0 10px;         /* уже по бокам */
    font-size: 13px;         /* немного меньше текст */
    border-radius: 9px;      /* чуть компактнее скругление */
  }
}
@media (max-width: 420px){
  #site-header .actions .btn.auth{
    height: 34px;
    padding: 0 8px;
    font-size: 12.5px;
    border-radius: 8px;
  }
}