/* =========================================================
   AXIOME Mini App — стили
   ========================================================= */
:root {
  --bg: #EDF0F7;
  --card: #FFFFFF;
  --text: #0F1426;
  --text-2: #353C52;
  --muted: #747B90;
  --line: #E8EBF3;
  --blue: #2361FF;
  --blue-2: #1A4BE6;
  --blue-soft: #E6EDFF;
  --grad-blue: linear-gradient(180deg, #3B7AFF 0%, #1D4FEA 100%);
  --shadow: 0 5px 19px rgba(30, 52, 120, .07);
  --r: 19px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-num: 'Unbounded', 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; }
img { display: block; -webkit-user-drag: none; }

.app {
  position: relative;
  max-width: 440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 12px calc(88px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
.app.no-tabbar { padding-bottom: calc(19px + env(safe-area-inset-bottom)); }

.screen { isolation: isolate; display: flex; flex-direction: column; gap: 10px; animation: screen-in .28s ease both; }
.no-anim .screen { animation: none; }
@keyframes screen-in { from { opacity: 0; transform: translateY(7px); } }

/* ---------- базовые блоки ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

.logo { height: 22px; width: auto; margin: 5px 5px 2px; align-self: flex-start; }
.logo-text {
  display: inline-block;
  font-family: var(--font-num); font-weight: 900; font-size: 21px; line-height: 1;
  letter-spacing: -.01em;
  transform: skewX(-12deg);
  background: linear-gradient(90deg, #1846E0, #3B7BFF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.num {
  display: inline-block;
  font-family: var(--font-num); font-weight: 900; line-height: .92;
  letter-spacing: -.045em;
  transform: skewX(-9deg);
  padding-right: .1em;
  background: linear-gradient(180deg, #4C89FF 0%, #2058F0 55%, #1440D2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.num--xl { font-size: 78px; }
.num--lg { font-size: 54px; }

.progress { height: 8px; border-radius: 84px; background: #E3E7F1; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1C4FEB, #3F7EFF); transition: width .5s ease; }

.muted { color: var(--muted); }
.hint { text-align: center; color: var(--muted); font-size: 13px; }
.text { color: var(--text-2); font-size: 14px; line-height: 1.4; }

/* ---------- плейсхолдеры картинок ---------- */
.ph {
  display: grid; place-items: center;
  border: 1.5px dashed #9DB4F2; border-radius: 14px;
  background: repeating-linear-gradient(45deg, rgba(35, 97, 255, .05) 0 8px, rgba(35, 97, 255, .1) 8px 17px);
  color: #5A76C8; font: 600 9px/1.2 var(--font);
  text-align: center; padding: 3px; overflow: hidden;
}
.ph span { max-width: 100%; overflow-wrap: anywhere; }
.fb { display: grid; place-items: center; }
.fb svg { width: 100%; height: 100%; }

/* ---------- бейджи редкости ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 17px; padding: 0 7px; border-radius: 6px;
  font-size: 9px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap;
  color: #fff;
}
.badge--legendary { background: linear-gradient(180deg, #FFE35C, #FFC414); color: #2A2000; }
.badge--epic { background: linear-gradient(180deg, #A276FF, #7B48F5); }
.badge--rare { background: linear-gradient(180deg, #3E7CFF, #2058F2); }
.badge--common { background: #9DA3B2; }
.badge--lg { height: 26px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 700; }

/* ---------- кнопки ---------- */
.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 48px; padding: 0 53px; border-radius: 15px;
  font-size: clamp(15px, 4.4vw, 17px); white-space: nowrap; font-weight: 700; letter-spacing: -.01em;
  transition: transform .12s ease, filter .12s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn--primary {
  background: var(--grad-blue); color: #fff;
  box-shadow: 0 8px 20px rgba(35, 97, 255, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn--outline { background: #fff; color: var(--blue); border: 1.5px solid #CFD7EA; }
.btn--disabled, .btn:disabled { background: #D8DCE5; color: #868C9C; box-shadow: none; cursor: default; }
.btn--disabled:active, .btn:disabled:active { transform: none; }
.btn--sm { width: auto; height: 31px; padding: 0 17px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 3px 10px rgba(35, 97, 255, .3); }
.btn__arrow { position: absolute; right: 4px; top: 50%; width: 58px; height: 58px; pointer-events: none; transform: translateY(-50%); object-fit: contain; }
.btn.is-busy { opacity: .7; pointer-events: none; }

/* ---------- верхняя панель спинов ---------- */
.spins {
  display: flex; align-items: center; justify-content: space-between;
  height: 42px; padding: 0 7px 0 17px;
  background: #fff; border-radius: 15px; box-shadow: var(--shadow);
}
.spins__count b { color: var(--blue); font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.spins__count span { margin-left: 5px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 29px; padding: 0 12px;
  border: 1.5px solid var(--blue); border-radius: 84px;
  color: var(--blue); font-size: 12px; font-weight: 700; background: #fff;
}
.pill--on { background: var(--blue-soft); }

/* ---------- шапка экрана ---------- */
.head { display: flex; align-items: center; gap: 14px; min-height: 37px; margin-top: 2px; }
.back {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 12px;
  background: #fff; box-shadow: var(--shadow); color: var(--text);
}
.head__title { font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.head__aside { margin-left: auto; color: var(--muted); font-size: 13px; }

.h2 { margin: 7px 5px 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.h2--sm { font-size: 17px; margin-top: 3px; }

/* ---------- таб-бар ---------- */
.tabbar {
  position: fixed; z-index: 30;
  left: 50%; bottom: calc(8px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 412px; height: 61px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 20px; box-shadow: 0 7px 26px rgba(30, 52, 120, .12);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #868C9E; font-size: 11px; font-weight: 600; text-align: center; }
.tab.is-active { color: var(--blue); font-weight: 700; }

/* ---------- декоративная диагональ ---------- */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage::before {
  content: ''; position: absolute; z-index: -1;
  left: -60%; right: -60%; top: 26%; height: 238px;
  background: linear-gradient(180deg, rgba(222, 232, 255, 0), rgba(205, 220, 255, .85) 60%, rgba(222, 232, 255, 0));
  transform: rotate(-16deg);
}

/* пьедестал под 3D-призом */
.podium { position: relative; display: flex; flex-direction: column; align-items: center; }
.podium__img { position: relative; z-index: 2; width: 196px; height: 178px; object-fit: contain; }
.pedestal { position: relative; z-index: 1; width: 212px; height: 63px; margin-top: -34px; }
.pedestal::before {
  content: ''; position: absolute; left: 0; right: 0; top: 19px; height: 41px;
  border-radius: 0 0 50% 50% / 0 0 20px 20px;
  background: linear-gradient(90deg, #2A5BEA 0%, #86AEFF 42%, #5E8DFF 60%, #2A5BEA 100%);
  box-shadow: 0 19px 34px rgba(37, 90, 240, .32);
}
.pedestal::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 39px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, #F4F7FF 0%, #C4D6FF 45%, #7AA1FF 80%, #4E7FF8 100%);
  border: 1px solid rgba(255, 255, 255, .8);
}

/* ============ ГЛАВНАЯ ============ */
.hero { position: relative; overflow: hidden; padding: 22px 15px 15px; }
.hero__img { position: absolute; right: -4px; top: -2px; width: 172px; height: 154px; object-fit: contain; }
.hero__title { position: relative; margin-top: 10px; font-size: 20px; font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.hero__foot { display: flex; justify-content: space-between; margin: 24px 2px 8px; font-size: 13px; color: var(--text-2); }
.hero__foot b { color: var(--blue); font-weight: 700; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rcard {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 12px 12px; border-radius: 17px;
  background: #fff; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.rcard:active { transform: scale(.97); }
.rcard__img { width: 100%; height: 82px; object-fit: contain; }
.rcard .badge { margin-top: -5px; position: relative; }
.rcard__name { margin-top: 4px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.rcard__sub { margin-top: 2px; font-size: 11px; color: var(--muted); }

/* ============ РУЛЕТКА ============ */
.main-prize {
  position: relative; min-height: 126px; padding: 26px 17px 20px;
  border-radius: var(--r); box-shadow: var(--shadow);
  background: linear-gradient(105deg, #fff 45%, #DCE6FF 100%);
}
.main-prize__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.main-prize__name { margin-top: 3px; max-width: 64%; color: var(--blue); font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.main-prize__img { position: absolute; right: 2px; bottom: 0; width: 119px; height: 158px; object-fit: contain; }

.reel {
  position: relative; overflow: hidden;
  padding: 24px 7px 15px; border-radius: 20px;
  background: radial-gradient(120% 95% at 50% 0%, #1E3EA6 0%, #0D215F 48%, #071344 100%);
  box-shadow: 0 12px 29px rgba(10, 30, 110, .32), inset 0 0 0 1px rgba(120, 160, 255, .16);
}
.reel__pointer {
  position: absolute; z-index: 3; top: 5px; left: 50%;
  width: 29px; height: 26px; transform: translateX(-50%);
  background: linear-gradient(180deg, #FFFFFF, #AEB8D0);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.reel__window { overflow: hidden; padding: 8px 0; }
.reel__track { display: flex; gap: 8px; will-change: transform; }
.ritem {
  flex: 0 0 var(--iw, 92px); height: 126px;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 5px 10px; border-radius: 15px;
  background: linear-gradient(180deg, rgba(64, 96, 200, .42), rgba(22, 42, 124, .55));
  border: 1px solid rgba(130, 160, 255, .22);
  color: #fff; font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.ritem__img { width: 80%; height: 75px; margin-bottom: auto; object-fit: contain; }
.ritem .ph { border-color: rgba(150, 180, 255, .45); color: #A9BEFF; background: rgba(120, 150, 255, .08); font-size: 8px; }
.ritem.is-center {
  transform: scale(1.07);
  border: 2px solid #4D86FF;
  background: linear-gradient(180deg, #2C58DC, #1838A6);
  box-shadow: 0 0 0 3px rgba(77, 134, 255, .22), 0 0 22px rgba(77, 134, 255, .55);
}

.list { padding: 3px 0; }
.lrow { display: grid; grid-template-columns: 34px 95px auto 1fr; align-items: center; gap: 10px; padding: 7px 15px 7px 12px; }
.lrow + .lrow { border-top: 1px solid var(--line); }
.lrow__img { width: 34px; height: 34px; object-fit: contain; }
.lrow__img.ph { border-radius: 8px; font-size: 6px; }
.lrow__name { font-size: 13px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow__pct { text-align: right; color: var(--muted); font-size: 13px; }

.spins-card { padding: 14px 15px 15px; }
.spins-card__t { margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.spins-card__t b { color: var(--blue); font-weight: 700; }

/* ============ РЕЗУЛЬТАТ ============ */
.result { padding-top: 2px; }
.result .badge--lg { margin: 5px 0 3px; }
.result__name { margin-top: 8px; font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1.05; }
.result__sub { margin-top: 5px; color: var(--muted); font-size: 14px; }

.goal { padding: 15px 17px 17px; }
.goal__label { color: var(--text-2); font-size: 14px; font-weight: 600; }
.goal .num { margin-top: 8px; }
.goal__sub { margin: 8px 0 10px; font-size: 13px; font-weight: 500; }

/* ============ КОПИЛКА ============ */
.piggy-hero { position: relative; overflow: hidden; min-height: 167px; padding: 27px 15px 22px; }
.piggy-hero__label { margin-top: 10px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.piggy-hero .progress { width: 55%; margin-top: 22px; }
.piggy-hero__img { position: absolute; right: -10px; top: -2px; width: 170px; height: 166px; object-fit: contain; }

.prow { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.prow__img { flex: none; width: 63px; height: 63px; border-radius: 15px; background: #EEF2FB; object-fit: contain; }
.prow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.prow__name { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.prow__date { align-self: flex-start; margin-top: 14px; color: var(--muted); font-size: 12px; }

.empty { padding: 22px 17px; text-align: center; }
.empty b { display: block; margin-bottom: 5px; font-size: 15px; }

/* ============ ПОДПИСКА (шаг до спина) ============ */
.gate__top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
.gate__step { color: var(--muted); font-size: 14px; margin-top: 5px; }
.gate__img { width: 153px; height: 144px; margin: -31px auto 0; object-fit: contain; }
.gate__title { margin-top: 7px; font-size: 26px; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
.gate .text { margin-top: -3px; }

.partner { padding: 12px 14px 15px; }
.partner__row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.partner__img { flex: none; width: 54px; height: 54px; border-radius: 14px; object-fit: contain; }
.partner__name { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.partner__handle { margin-top: 3px; color: var(--muted); font-size: 14px; }

.step-card { padding: 14px 17px 15px; }
.step-card__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.step-card__row b { color: var(--blue); }

.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 15px; border-radius: 15px;
  background: #FCE9EC; color: #E1253A;
  font-size: 13px; font-weight: 600; line-height: 1.3;
  animation: shake .35s ease;
}
.alert svg { flex: none; }
@keyframes shake { 20%, 60% { transform: translateX(-3px); } 40%, 80% { transform: translateX(3px); } }

/* ============ ВЫВОД ============ */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 12px; }
.trio__img { width: 100%; height: 95px; object-fit: contain; }
.trio--many { grid-template-columns: repeat(4, 1fr); }
.trio--many .trio__img { height: 66px; }

.subs-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3px 20px; padding: 15px 17px 17px; }
.subs-card__label { font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.subs-card .progress { grid-column: 1 / -1; margin-top: 12px; }

.partners { padding: 7px; }
.prt { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 5px 8px 5px 10px; border: 1.5px solid transparent; border-radius: 14px; }
.prt + .prt { margin-top: 2px; }
.prt.is-active { border-color: #4C80FF; background: #F4F7FF; }
.prt__img { flex: none; width: 42px; height: 42px; border-radius: 12px; object-fit: contain; }
.prt__img.ph { font-size: 6px; }
.prt.is-locked .prt__img { filter: grayscale(1); opacity: .55; }
.prt__name { flex: 1; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.prt__done { display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 12px; border-radius: 8px; background: #E5F5E9; color: #1E9A45; font-size: 13px; font-weight: 600; }
.prt__done svg { width: 15px; height: 15px; }
.prt__lock { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding-right: 5px; }

/* ============ БЕЗ РЕКЛАМЫ ============ */
.noads__img { width: 280px; height: 187px; object-fit: contain; margin-top: 4px; }
.noads__title { margin-top: 15px; align-self: flex-start; font-size: 29px; font-weight: 900; letter-spacing: -.03em; }
.noads__text { align-self: flex-start; margin-top: 3px; text-align: left; }
.price { padding: 14px 17px 15px; }
.price__top { display: flex; align-items: center; gap: 8px; }
.price__top svg { width: 24px; height: 24px; }
.price__stars { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.price__sub { margin-top: 7px; color: var(--text-2); font-size: 14px; }
.price ul { list-style: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.price li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.price li svg { color: var(--blue); }

/* ============ ДРУЗЬЯ ============ */
.friends { padding: 20px 17px 17px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.friends .num { font-size: 48px; }
.friends p { color: var(--text-2); font-size: 14px; line-height: 1.4; }

/* ---------- тост ---------- */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(12px + env(safe-area-inset-top));
  transform: translate(-50%, calc(-100% - 40px - env(safe-area-inset-top)));
  opacity: 0; visibility: hidden;
  max-width: calc(100% - 27px); padding: 10px 15px; border-radius: 12px;
  background: #121A33; color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .2);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .2s, visibility 0s .3s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition-delay: 0s; }

/* загрузка при старте */
.boot { min-height: 70vh; justify-content: flex-start; }
.boot .empty { margin-top: 30vh; display: flex; flex-direction: column; }
.boot__spin {
  width: 34px; height: 34px; margin: 32vh auto 0; border-radius: 50%;
  border: 3px solid rgba(35, 97, 255, .18); border-top-color: var(--blue);
  animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* выбор призов для вывода */
.wpick__bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 6px; }
.wpick__bar .text { margin: 0; }
.wpick__all { flex: none; border: 0; background: none; color: var(--blue); font: 700 13px var(--font); padding: 4px 0; cursor: pointer; }
.wpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.wpick__it {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 9px; border-radius: 15px; border: 2px solid transparent; background: var(--bg);
  font: 600 11px/1.2 var(--font); color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.wpick__it:active { transform: scale(.97); }
.wpick__it.is-sel { border-color: var(--blue); background: var(--blue-soft); color: var(--text); }
.wpick__img { width: 100%; height: 62px; object-fit: contain; }
.wpick__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpick__chk {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 2px solid #CDD5EA; color: #fff; z-index: 1;
}
.wpick__chk svg { width: 12px; height: 12px; opacity: 0; }
.wpick__it.is-sel .wpick__chk { background: var(--blue); border-color: var(--blue); }
.wpick__it.is-sel .wpick__chk svg { opacity: 1; }

/* платные рулетки и буст шансов */
.rcard { position: relative; }
.rcard__price {
  position: absolute; top: 8px; right: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 7px 3px 8px; border-radius: 99px; background: #FFF4D6; color: #A86A00; font-size: 12px; font-weight: 800;
}
.rcard__price svg { width: 12px; height: 12px; }
.boost {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border-radius: 15px;
  border: 1.5px dashed #F5B400; background: #FFFAEB; color: #7A5200; font: 700 14px var(--font); cursor: pointer;
}
.boost span { flex: 1; text-align: left; }
.boost b { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 99px; background: #FFC93C; color: #5A3B00; font-size: 13px; }
.boost svg { width: 16px; height: 16px; flex: none; }
.boost b svg { width: 12px; height: 12px; }
.boost.is-on { border-style: solid; background: linear-gradient(180deg, #FFF3C9, #FFE69A); cursor: default; }
.lrow__pct.is-boost s { color: #B7BDCC; margin-right: 2px; }
.lrow__pct.is-boost b { color: #C27C0E; }
