:root{
  --bg: #0B0F10;
  --panel: #101617;
  --panel2: #0F1415;
  --text: #E7F2F1;
  --muted: rgba(231,242,241,.65);
  --muted2: rgba(231,242,241,.45);
  --mint: #00C7B1;
  --danger: #FF5A5F;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 18px;
  --radius2: 22px;
  --border: rgba(255,255,255,.06);
}

*{ box-sizing:border-box; }
html, body{
  height: 100%;
  background: var(--bg);
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation; /* helps reduce double-tap zoom */
}
button, input{ font: inherit; color: inherit; }
.hidden{ display:none !important; }

/* SPLASH */
.splash{
  position: fixed;
  inset: 0;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(0,199,177,.14), transparent 55%),
              radial-gradient(900px 600px at 100% 25%, rgba(0,199,177,.10), transparent 55%),
              var(--bg);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 22px;
}
.splash__stage{
  width: min(520px, 92vw);
}
.splash__track{
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.splash__fill{
  position:absolute;
  left:0; top:0; bottom:0;
  width: 0%;
  background: linear-gradient(90deg, rgba(0,199,177,.20), rgba(0,199,177,.55));
  /* ключевое: без transition, чтобы не лагало */
  transition: none;
}

.splash__head{
  position:absolute;
  left:0;
  top:50%;
  width: 58px;
  height: 58px;
  transform: translate3d(8px,-50%,0);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  will-change: transform;
  z-index: 3;
}

/* заливка прогресса внутри трека (вместо второй полосы) */
.splash__track::before{
  content:"";
  position:absolute;
  inset:0;
  width: var(--p);
  background: linear-gradient(90deg, rgba(0,199,177,.10), rgba(0,199,177,.30));
  transition: width 120ms ease;
}

.pudge-head{
  width: 76px;
  height: 76px;
  border-radius: 999px;
  position:absolute;
  top: 8px;
  left: 8px;

  /* ВАЖНО: чтобы не “терялась” на фоне */
  z-index: 3;

  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.22), transparent 38%),
    radial-gradient(circle at 65% 62%, rgba(0,0,0,.35), transparent 48%),
    linear-gradient(180deg, #00E5D0, #00C7B1 60%, #008A7C);

  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 18px 32px rgba(0,0,0,.55);
  transform: translateX(0) rotate(0deg);
  transition: transform 60ms linear;
}
.splash__meta{
  margin-top: 14px;
  text-align: center;
}
.splash__title{
  font-size: 20px;
  font-weight: 760;
  letter-spacing: .2px;
}
.splash__subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.splash__progress{
  margin: 12px auto 0;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  overflow: hidden;
}
.splash__bar{
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,199,177,.25), rgba(0,199,177,.95));
  border-radius: 999px;
  transition: width 120ms ease;
}
.splash__pct{
  margin-top: 10px;
  font-weight: 720;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}

/* APP LAYOUT */
.app{
  height: 100%;
  display:flex;
  flex-direction: column;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.topbar{
  height: 56px;
  padding: 10px 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
}
.topbar__left{ display:flex; gap:10px; align-items:center; }
.brand-dot{
  width: 10px; height:10px; border-radius:999px;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(0,199,177,.10);
}
.brand-title{ font-weight: 760; letter-spacing: .2px; }
.icon-btn{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.icon-btn:active{ transform: translateY(1px); }

.content{
  flex:1;
  overflow:auto;
  padding: 0 14px 14px;
}
.tab{ display:none; }
.tab--active{ display:block; animation: tabIn 180ms ease; }
@keyframes tabIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-top: 12px;
}
.card--mini{ padding: 12px; }
.card__title{
  font-size: 13px;
  letter-spacing: .3px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* PROFILE */
.card--profile{ padding: 12px 14px; }
.profile{ display:flex; align-items:center; gap:12px; }
.avatar{
  width: 46px; height: 46px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  position: relative;
  overflow:hidden;
}
.avatar img{
  width: 100%; height: 100%;
  object-fit: cover;
  display:block;
}
.avatar__ring{
  position:absolute; inset:-2px;
  border-radius:999px;
  border: 2px solid rgba(0,199,177,.55);
  box-shadow: 0 0 0 8px rgba(0,199,177,.08);
  pointer-events:none;
}
.profile__name{ font-weight: 820; font-size: 16px; }
.profile__sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

/* BALANCE */
.balance-row{ display:flex; align-items: baseline; gap:8px; }
.balance{
  font-size: 38px;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}
.balance__unit{ color: var(--muted); font-weight: 650; }
.hint{ color: var(--muted); font-size: 12px; line-height: 1.35; }

.tiles{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.tile{
  width: 100%;
  text-align:left;
  background: rgba(15,20,21,.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display:flex;
  gap:12px;
  align-items:center;
  transition: transform 160ms ease, border-color 160ms ease;
}
.tile:hover{ border-color: rgba(0,199,177,.25); }
.tile:active{ transform: translateY(1px); }
.tile__icon{
  width: 40px; height:40px;
  border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,199,177,.12);
  border: 1px solid rgba(0,199,177,.22);
  color: var(--mint);
  font-weight: 900;
}
.tile__title{ font-weight: 780; }
.tile__sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

/* STATS */
.stats-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat{
  padding: 10px;
  border-radius: 16px;
  background: rgba(15,20,21,.55);
  border: 1px solid var(--border);
}
.stat__label{ color: var(--muted); font-size: 12px; }
.stat__value{ margin-top: 6px; font-weight: 860; color: var(--mint); font-variant-numeric: tabular-nums; }

/* KPI */
.kpi-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.kpi{
  background: rgba(15,20,21,.65);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 12px;
  text-align:left;
  box-shadow: var(--shadow);
}
.kpi:active{ transform: translateY(1px); }
.kpi__label{ color: var(--muted); font-size: 12px; }
.kpi__value{ margin-top: 6px; font-weight: 900; color: var(--mint); font-size: 20px; }

/* TX LIST */
.txlist{ display:flex; flex-direction: column; gap: 8px; }
.tx{
  padding: 12px;
  border-radius: 16px;
  background: rgba(15,20,21,.55);
  border: 1px solid var(--border);
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease;
}
.tx:hover{ border-color: rgba(0,199,177,.22); }
.tx:active{ transform: translateY(1px); }
.tx__left{ min-width: 0; }
.tx__reason{ font-weight: 760; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; max-width: 62vw; }
.tx__date{ margin-top: 3px; color: var(--muted); font-size: 12px; }
.tx__delta{ font-weight: 900; font-variant-numeric: tabular-nums; }
.tx__delta--pos{ color: var(--mint); }
.tx__delta--neg{ color: var(--danger); }

.txlist--mini .tx{ padding: 10px; }
.ghost-btn{
  width: 100%;
  margin-top: 10px;
  background: transparent;
  border: 1px solid rgba(0,199,177,.25);
  color: var(--mint);
  border-radius: 16px;
  padding: 12px;
}
.ghost-btn:active{ transform: translateY(1px); }

/* SHOP */
.shop{ display:flex; flex-direction: column; gap: 10px; }
.item{
  background: rgba(15,20,21,.55);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  display:flex;
  justify-content: space-between;
  gap: 12px;
}
.item__left{ min-width: 0; }
.item__title{ font-weight: 820; }
.item__desc{ margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.item__right{ display:flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.price{ color: var(--mint); font-weight: 900; font-variant-numeric: tabular-nums; }
.buy{
  background: rgba(0,199,177,.14);
  border: 1px solid rgba(0,199,177,.30);
  color: var(--mint);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
}
.buy:active{ transform: translateY(1px); }

.purchases{ display:flex; flex-direction: column; gap: 8px; }
.purchase{
  padding: 10px;
  border-radius: 16px;
  background: rgba(15,20,21,.55);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* CHAT */
.card--chat{ padding-bottom: 12px; }
.chat{
  height: calc(100vh - 320px);
  min-height: 260px;
  overflow:auto;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(15,20,21,.40);
  padding: 10px;
}
.msg{
  display:flex;
  margin: 8px 0;
}
.msg--in{ justify-content:flex-end; }
.msg--out{ justify-content:flex-start; }
.bubble{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.msg--in .bubble{
  background: rgba(0,199,177,.14);
  border-color: rgba(0,199,177,.30);
}
.bubble__time{
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted2);
}

.chatbox{
  margin-top: 10px;
  display:flex;
  gap: 10px;
}
.chatbox__input{
  flex:1;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
  padding: 12px 12px;
  outline:none;
}
.chatbox__send{
  border-radius: 16px;
  background: var(--mint);
  border: 0;
  color: #00110E;
  font-weight: 900;
  padding: 12px 14px;
}
.chatbox__send:active{ transform: translateY(1px); }

/* BOTTOM TABS */
.tabs{
  position: fixed;
  left: 0; right:0; bottom:0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11,15,16,.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tabs__item{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 8px;
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 4px;
}
.tabs__item--active{
  border-color: rgba(0,199,177,.35);
  background: rgba(0,199,177,.10);
}
.tabs__icon{ font-weight: 900; color: var(--mint); }
.tabs__label{ font-size: 11px; color: var(--muted); }
.tabs__item--active .tabs__label{ color: var(--text); }

/* MODAL */
.modal{
  position: fixed;
  inset: 0;
  z-index: 5000;               /* ВАЖНО: поверх всего */
  background: rgba(0,0,0,.80);  /* плотнее, не “прозрачно” */
  display:flex;
  align-items: flex-end;
  justify-content:center;
  padding: 14px;
}

.modal__sheet{
  width: min(560px, 100%);
  border-radius: 22px;
  background: #0F1415;          /* НЕ прозрачная */
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 22px 60px rgba(0,0,0,.65);
  padding: 14px;
  animation: sheetIn 180ms ease;
}
body.modal-open{ overflow: hidden; }

@keyframes sheetIn{
  from{ transform: translateY(18px); opacity: 0; }
  to{ transform: translateY(0); opacity: 1; }
}
.modal__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.modal__title{ font-weight: 860; }
.pie{ width: 100%; height: auto; border-radius: 18px; background: rgba(0,0,0,.15); border: 1px solid var(--border); }
.legend{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.modal__actions{
  margin-top: 12px;
  display:flex;
  gap: 10px;
}
.btn{
  flex: 1;
  border-radius: 16px;
  background: var(--mint);
  color: #00110E;
  font-weight: 900;
  border: 0;
  padding: 12px;
}
.btn--ghost{
  background: transparent;
  color: var(--mint);
  border: 1px solid rgba(0,199,177,.28);
}
.btn:active, .btn--ghost:active{ transform: translateY(1px); }

.txdetails{
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(15,20,21,.45);
  padding: 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}
.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  max-width: 92vw;
  text-align:center;
}

.brand-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}

.brand-chip__logo{
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.22), transparent 45%),
    linear-gradient(180deg, rgba(0,199,177,.95), rgba(0,199,177,.40));
  border: 1px solid rgba(0,199,177,.35);
  box-shadow: 0 0 0 6px rgba(0,199,177,.10);
}

.brand-chip__text{
  font-weight: 820;
  letter-spacing: .2px;
}

.item__titleRow{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  color: var(--mint);
  background: rgba(0,199,177,12);
  border: 1px solid rgba(0,199,177,28);
}

/* --- SHOP: titleRow + pill --- */
.item__titleRow{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill{
  display:inline-flex;
  align-items:center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  color: var(--mint);
  background: rgba(0,199,177,.12);
  border: 1px solid rgba(0,199,177,.28);
}

/* --- SHOP: price centered --- */
.item__right{
  align-items: center;  /* было flex-end */
  text-align: center;
}
.price{
  width: 100%;
  text-align: center;
}

/* --- PARI modal: prevent overflow --- */
.chatbox__input{ min-width: 0; }
#pariModal .chatbox__send{ white-space: nowrap; }

/* DUEL PROMO */
.card--duel{
  background: linear-gradient(180deg, rgba(255,215,0,.08), rgba(255,215,0,.02));
  border-color: rgba(255,215,0,.15);
}
.duel-promo{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.duel-promo__icon{
  font-size: 40px;
  animation: coinPulse 2s ease-in-out infinite;
}
@keyframes coinPulse{
  0%, 100%{ transform: scale(1) rotateY(0); }
  50%{ transform: scale(1.1) rotateY(180deg); }
}
.duel-promo__title{
  font-weight: 820;
  font-size: 16px;
}
.duel-promo__sub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.btn--duel{
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a00;
}