:root {
  --ink: #05070b;
  --panel: #0d1119;
  --panel-2: #121824;
  --line: rgba(159, 194, 235, .13);
  --muted: #7f8da0;
  --lime: #3da4ff;
  --purple: #268dff;
  --purple-soft: #1465bd;
  --ice: #91d9ff;
  --star: #ffd45a;
  --star-deep: #f5a800;
}

html, body { background: var(--ink); }
body {
  color: #f5f9ff;
  background:
    radial-gradient(760px 460px at 50% -8%, rgba(34, 139, 255, .13), transparent 68%),
    radial-gradient(560px 380px at 100% 45%, rgba(39, 155, 255, .055), transparent 72%),
    linear-gradient(180deg, #05070a 0%, #070b11 52%, #05070a 100%);
}

.app-header {
  min-height: 64px;
  padding: 7px max(18px, calc((100% - 1320px) / 2));
  border-bottom-color: rgba(185, 219, 255, .1);
  background: linear-gradient(180deg, rgba(12, 18, 27, .82), rgba(6, 9, 14, .76));
  box-shadow: 0 16px 42px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .045);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
}
.brand-banner-link {
  display: flex;
  width: 174px;
  height: 44px;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-banner-link img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(27, 142, 255, .18));
  transform: none;
  transition: transform .2s ease, filter .2s ease;
}
.brand-banner-link:hover img { filter: drop-shadow(0 9px 22px rgba(43, 158, 255, .27)); transform: translateY(-1px) scale(1.018); }
.brand-banner-link:focus-visible { outline-color: var(--ice); }
.header-actions { gap: 8px; }
.user-pill, .balance-pill {
  min-height: 40px;
  border-color: rgba(105, 173, 239, .14);
  background: rgba(17, 25, 37, .86);
}
.balance-pill { color: #f7fbff; }
.star-icon, .star-symbol { color: var(--star); }
.ghost-button { border-color: rgba(113, 179, 243, .16); background: #111824; }

.upgrade-feed {
  width: 100%;
  margin: 0;
  overflow: hidden;
}
.feed-track { display: flex; gap: 10px; scroll-snap-type: x proximity; }
.feed-card {
  --rarity: #9ba8b7;
  --rarity-soft: rgba(155, 168, 183, .12);
  --rarity-border: rgba(155, 168, 183, .24);
  --rarity-glow: rgba(155, 168, 183, .42);
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: repeat(3, auto);
  min-width: 218px;
  min-height: 72px;
  padding: 9px 12px 9px 9px;
  column-gap: 11px;
  row-gap: 1px;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--rarity-border);
  border-radius: 16px;
  background: linear-gradient(125deg, var(--rarity-soft), rgba(12, 17, 25, .88) 68%);
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 12px 28px rgba(0,0,0,.18);
  -webkit-backdrop-filter: blur(17px) saturate(120%);
  backdrop-filter: blur(17px) saturate(120%);
}
.feed-card:before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  background: var(--rarity);
  box-shadow: 0 0 12px var(--rarity-glow);
  content: "";
}
.feed-preview {
  grid-row: 1 / 4;
  width: 54px;
  height: 54px;
  align-self: center;
  border: 1px solid rgba(183, 222, 255, .1);
  border-radius: 13px;
  background: rgba(52, 101, 149, .15);
  box-shadow: inset 0 1px rgba(255,255,255,.07);
}
.feed-preview .preview-model svg { width: 94%; height: 94%; }
.feed-preview .preview-symbols { display: none; }
.feed-card b { align-self: end; padding-right: 35px; overflow: hidden; color: #f1f8ff; font-size: 12px; font-weight: 750; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.feed-card small { align-self: center; color: #c0dcf4; font-size: 10px; font-variant-numeric: tabular-nums; }
.feed-card-hot { border-color: var(--rarity-border); }
.feed-card.rarity-neutral, .feed-card.feed-rarity-neutral { --rarity: #a6b0bc; --rarity-soft: rgba(132, 145, 160, .13); --rarity-border: rgba(166, 176, 188, .28); --rarity-glow: rgba(166, 176, 188, .38); }
.feed-card.rarity-blue, .feed-card.feed-rarity-blue { --rarity: #3b9cff; --rarity-soft: rgba(35, 128, 226, .17); --rarity-border: rgba(59, 156, 255, .3); --rarity-glow: rgba(59, 156, 255, .48); }
.feed-card.rarity-purple, .feed-card.feed-rarity-purple { --rarity: #a86cff; --rarity-soft: rgba(128, 67, 211, .18); --rarity-border: rgba(168, 108, 255, .3); --rarity-glow: rgba(168, 108, 255, .45); }
.feed-card.rarity-red, .feed-card.feed-rarity-red { --rarity: #ff5f6d; --rarity-soft: rgba(213, 55, 75, .18); --rarity-border: rgba(255, 95, 109, .3); --rarity-glow: rgba(255, 95, 109, .45); }
.feed-card.rarity-gold, .feed-card.feed-rarity-gold { --rarity: #ffca45; --rarity-soft: rgba(217, 155, 25, .19); --rarity-border: rgba(255, 202, 69, .33); --rarity-glow: rgba(255, 202, 69, .48); }
.feed-card-new { animation: feed-card-enter .48s cubic-bezier(.2,.8,.2,1) both; }
.feed-skeleton .feed-preview, .feed-skeleton b, .feed-skeleton small {
  color: transparent;
  background: linear-gradient(100deg, rgba(255,255,255,.025) 20%, rgba(141,203,255,.08) 40%, rgba(255,255,255,.025) 60%);
  background-size: 220% 100%;
  animation: feed-skeleton 1.6s linear infinite;
}
@keyframes feed-card-enter {
  from { opacity: 0; transform: translate3d(-16px, 6px, 0) scale(.975); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes feed-skeleton { to { background-position: -220% 0; } }

.upgrader-shell { width: min(1320px, calc(100% - 36px)); margin: 18px auto 56px; gap: 14px; }
.upgrade-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
}
.upgrade-heading span { color: var(--ice); font-size: 18px; font-weight: 900; letter-spacing: -8px; }
.upgrade-heading h1 { margin: 0; color: #f6f9ff; font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.arena {
  min-height: 410px;
  grid-template-columns: minmax(230px, 1fr) minmax(300px, .94fr) minmax(230px, 1fr);
  gap: 20px;
  padding: 22px;
  border-color: rgba(114, 171, 232, .1);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(22, 34, 49, .58), rgba(7, 11, 17, .72));
  box-shadow: 0 28px 70px rgba(0, 0, 0, .34), inset 0 1px rgba(226, 242, 255, .055);
  -webkit-backdrop-filter: blur(24px) saturate(118%);
  backdrop-filter: blur(24px) saturate(118%);
}
.arena:after { border-color: rgba(123, 184, 247, .045); }
.selected-panel, .wheel-panel, .panel {
  border-color: rgba(171, 211, 250, .12);
  background: linear-gradient(145deg, rgba(27, 40, 57, .64), rgba(10, 15, 23, .76));
  box-shadow: inset 0 1px rgba(238, 247, 255, .055), 0 18px 38px rgba(0,0,0,.12);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  backdrop-filter: blur(20px) saturate(120%);
}
.selected-panel { border-radius: 17px; }
.wheel-panel {
  border-radius: 19px;
  background: radial-gradient(circle at 50% 45%, rgba(33, 132, 245, .13), transparent 52%), #0c1119;
}
.panel-label { color: #91a3b8; }
.slot-value, .wheel-center span { color: var(--ice); }
.gift-card { border-color: rgba(156, 204, 251, .13); background: linear-gradient(145deg, rgba(19,29,42,.78), rgba(6,10,16,.84)); }
.gift-card:before { border-color: rgba(53, 154, 255, .12); }
.background:not([src]), img[data-preview="background"]:not([src]) { display: none !important; }
.wheel-wrap { width: min(100%, 265px); }
.wheel {
  background: conic-gradient(from 0deg, #238bff 0deg var(--chance-deg, 0deg), #1a2431 var(--chance-deg, 0deg) 1turn);
  box-shadow: 0 0 0 1px rgba(170, 214, 255, .13), 0 0 0 9px #101722, 0 22px 35px rgba(0, 0, 0, .5), 0 0 34px rgba(42, 142, 255, .1);
}
.wheel:after { background: #0d131d; }
.wheel-center { background: #111a26; border-color: rgba(162, 207, 255, .14); }
.wheel-pointer span { border-top-color: #c8ecff; }
.wheel-pointer:before { border-color: #c8ecff; background: #167ee8; }
.wheel-pointer { transition-duration: var(--spin-duration, 3250ms) !important; }
.upgrade-button {
  width: 100%;
  border-color: #248ff9;
  background: linear-gradient(135deg, #1578db, #219fef);
  color: #fff;
  box-shadow: 0 11px 25px rgba(20, 126, 232, .24), inset 0 1px rgba(255,255,255,.27);
}
.upgrade-button:after {
  display: block;
  margin-top: 2px;
  content: "Шанс выигрыша " attr(data-chance);
  color: rgba(224, 242, 255, .62);
  font-size: 9px;
  font-weight: 600;
}
.upgrade-button:hover:not(:disabled) { border-color: #a7e1ff; background: #278eea; }
.upgrade-button:disabled { border-color: rgba(72, 136, 197, .2); background: #182334; color: #6f89a5; }
.upgrade-action-row {
  display: grid;
  grid-template-columns: 42px 42px minmax(0, 1fr);
  width: min(100%, 290px);
  gap: 7px;
}
.quick-action {
  display: grid;
  min-width: 0;
  place-items: center;
  border: 1px solid rgba(119, 179, 239, .1);
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(30, 45, 64, .74), rgba(13, 19, 28, .82));
  color: #f4f8fd;
  font-size: 22px;
  font-weight: 800;
}
.quick-action:hover { border-color: rgba(92, 178, 255, .38); background: #172436; }
.quick-action:focus-visible { outline: 2px solid rgba(125, 205, 255, .92); outline-offset: 3px; }
.quick-action:disabled { cursor: default; opacity: .5; }
.quick-spin-toggle { position: relative; isolation: isolate; }
.lightning-icon {
  display: block;
  width: 18px;
  height: 25px;
  background: currentColor;
  clip-path: polygon(54% 0, 14% 53%, 44% 53%, 31% 100%, 87% 39%, 57% 39%);
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.32));
  transition: transform .2s ease, filter .2s ease;
}
.quick-spin-toggle:after {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #526477;
  box-shadow: 0 0 0 3px rgba(82,100,119,.1);
  content: "";
  transition: background .2s ease, box-shadow .2s ease;
}
.quick-spin-toggle.is-active {
  border-color: rgba(137, 215, 255, .72);
  background: linear-gradient(145deg, rgba(36, 155, 255, .9), rgba(13, 91, 188, .88));
  color: white;
  box-shadow: inset 0 1px rgba(255,255,255,.3), 0 0 0 3px rgba(36,147,255,.14), 0 10px 24px rgba(17,112,219,.24);
}
.quick-spin-toggle.is-active .lightning-icon { transform: scale(1.08); filter: drop-shadow(0 0 7px rgba(255,255,255,.55)); }
.quick-spin-toggle.is-active:after { background: #bff4ff; box-shadow: 0 0 10px #71d9ff; }
.result-banner, .fairness-box { border-color: rgba(124, 186, 246, .09); background: #0a0f16; color: #91a5ba; }
.empty-gift-art { filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .4)) hue-rotate(168deg) saturate(.7); }
.empty-gift-state strong { color: #e8f5ff; }
.empty-gift-state small, .selection-copy { color: #8193a8; }

.panel { border-radius: 18px; background: linear-gradient(145deg, rgba(21, 32, 46, .72), rgba(8, 13, 20, .82)); }
.panel-head { border-bottom-color: rgba(119, 181, 243, .1); }
.future-strip, .stars-input-card { border-color: rgba(117, 180, 246, .12); background: #111a27; }
.stars-input-card { background: linear-gradient(135deg, rgba(25, 116, 212, .18), rgba(13, 26, 42, .9)); }
.stars-input-card label, .market-card .price-chip { color: #a9dcff; }
.stars-input-card button { background: #197fdf; color: white; }
.filters input, .filters select, .stars-input-card input { border-color: rgba(111, 174, 237, .14); background: #0d141e; }
.market-card { border-color: rgba(113, 174, 236, .1); background: #101721; }
.market-card:hover:not(:disabled) { border-color: rgba(82, 163, 246, .54); background: #142131; }
.market-card.selected { border-color: #54b6ff; background: linear-gradient(150deg, rgba(38, 137, 244, .22), #112235); box-shadow: 0 0 0 1px rgba(83, 182, 255, .15); }
.market-card .price-chip, .target-item .price-chip { background: rgba(34, 127, 222, .16); }
.scope-badge { background: rgba(8, 15, 24, .86); }
.card-buy-action { border-color: rgba(99, 186, 255, .25); background: rgba(34, 135, 235, .16); color: #a4dcff; }

.mobile-nav, .mobile-presets, .mobile-sort { display: none; }

@media (max-width: 900px) {
  .upgrader-shell { width: min(100% - 22px, 680px); }
  .feed-track { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .feed-track::-webkit-scrollbar { display: none; }
  .arena { grid-template-columns: 1fr; }
  .wheel-panel { order: -1; }
  .content-grid { grid-template-columns: 1fr; }
}

@media (min-width: 641px) and (max-width: 900px) {
  .arena { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wheel-panel { grid-column: 1 / -1; }
  .selected-panel { min-height: 280px; }
}

@media (max-width: 640px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); background: radial-gradient(380px 250px at 50% 0%, rgba(23, 107, 206, .1), transparent 72%), #05070b; }
  .app-header { position: relative; min-height: 64px; padding: 8px 12px; background: linear-gradient(180deg, rgba(10,15,23,.88), rgba(5,8,12,.76)); box-shadow: inset 0 -1px rgba(184,220,255,.07); }
  .brand-banner-link { width: 139px; height: 40px; }
  .brand-banner-link img { transform: none; }
  .brand-banner-link:hover img { transform: translateY(-1px) scale(1.018); }
  .header-actions { margin-left: auto; }
  .user-pill { order: 2; display: flex; min-height: 38px; padding: 0; border: 0; background: transparent; }
  .user-copy { display: none; }
  .user-avatar { width: 38px; height: 38px; border: 2px solid rgba(117, 196, 255, .5); border-radius: 50%; }
  .balance-pill { order: 1; min-width: 52px; min-height: 38px; padding: 0 10px; border-radius: 12px; }
  .upgrade-feed { width: calc(100% + 24px); margin-left: -12px; padding-left: 12px; }
  .feed-track { overflow-x: auto; padding: 0 12px 4px 0; scrollbar-width: none; }
  .feed-track::-webkit-scrollbar { display: none; }
  .feed-card { min-width: 204px; min-height: 70px; padding: 8px 10px 8px 8px; }
  .feed-preview { width: 52px; height: 52px; }
  .upgrader-shell { width: min(100% - 24px, 560px); margin: 8px auto 20px; }
  .upgrade-heading { padding: 2px 0 5px; }
  .upgrade-heading h1 { font-size: 19px; }
  .arena {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .arena:after { display: none; }
  .wheel-panel { display: contents; }
  .wheel-wrap { grid-column: 1 / -1; grid-row: 1; width: min(100%, 306px); margin: 6px auto 8px; padding: 14px; }
  .wheel { box-shadow: 0 0 0 1px rgba(194, 226, 255, .18), 0 0 0 10px #10151d, 0 25px 42px rgba(0,0,0,.55); }
  .wheel-center span { font-size: 23px; }
  .wheel[data-empty="true"] .wheel-center { inset: 24%; }
  .wheel[data-empty="true"] .wheel-center span { max-width: 150px; font-size: 17px; line-height: 1.15; letter-spacing: -.025em; }
  .wheel[data-empty="true"] .wheel-center small { display: none; }
  .input-panel { grid-column: 1; grid-row: 2; }
  .target-panel { grid-column: 2; grid-row: 2; }
  .selected-panel { min-height: 178px; padding: 10px; gap: 8px; border-radius: 18px; background: linear-gradient(145deg, rgba(24,36,51,.66), rgba(7,12,18,.84)); }
  .target-panel { border-color: rgba(160, 211, 255, .35); }
  .slot-head { min-height: 29px; justify-content: center; border: 1px solid rgba(164, 206, 248, .23); border-radius: 999px; }
  .slot-head .panel-label { color: #b9dcf9; font-size: 9px; letter-spacing: 0; }
  .slot-value, .selection-copy { display: none; }
  .gift-card.hero-card { width: 100%; height: 120px; min-height: 120px; aspect-ratio: auto; border-radius: 14px; }
  .empty-gift-art { width: min(72%, 116px); height: 82px; }
  .target-gift-art { width: min(80%, 128px); height: 92px; }
  .empty-gift-state { gap: 4px; padding: 7px; }
  .empty-gift-state strong { font-size: 11px; }
  .empty-gift-state small { display: none; }
  .upgrade-action-row { grid-column: 1 / -1; grid-row: 3; width: 100%; margin-top: 4px; grid-template-columns: 50px 50px minmax(0, 1fr); }
  .quick-action, .upgrade-button { min-height: 56px; border-radius: 15px; }
  .upgrade-button { font-size: 15px; }
  .result-banner { grid-column: 1 / -1; grid-row: 4; width: 100%; min-height: 31px; border-radius: 10px; font-size: 10px; }
  .result-banner[data-result=""], .result-banner[data-result="ready"] { display: none; }
  .fairness-box { display: none; }
  .content-grid { gap: 14px; margin-top: 10px; }
  .catalog-panel { order: -1; }
  .panel { padding: 13px; border-radius: 18px; }
  .panel-head { padding-bottom: 10px; }
  .panel-head h2 { font-size: 16px; }
  .mobile-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .mobile-presets button { min-width: 0; min-height: 42px; border: 1px solid rgba(114, 172, 229, .08); border-radius: 11px; background: #10151e; color: #68788c; font-size: 11px; font-weight: 800; }
  .mobile-presets button:disabled { opacity: .38; }
  .mobile-presets button.active { border-color: rgba(74, 168, 255, .48); background: rgba(30, 128, 224, .17); color: #b9e3ff; }
  .catalog-head { display: block; }
  .catalog-head > div:first-child { display: none; }
  .filters { display: grid; grid-template-columns: 46px 1fr 1fr; gap: 7px; margin-top: 0; }
  .mobile-sort { display: grid; min-height: 42px; place-items: center; border: 1px solid rgba(114, 172, 229, .12); border-radius: 11px; background: #101722; color: #c0ddf5; font-size: 17px; }
  .filters input[type="search"], .filters #chancePreset, .filters #sortSelect { display: none; }
  .filters input, .filters select { min-width: 0; width: 100%; }
  .market-grid, .target-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .market-card { min-height: 0; padding: 7px; border-radius: 12px; }
  .market-preview { height: auto; aspect-ratio: 1; border-radius: 9px; }
  .gift-name, .market-card strong { margin-top: 6px; font-size: 10px; }
  .gift-number { min-height: 12px; font-size: 8px; }
  .market-card .price-chip { min-height: 25px; margin-top: 6px; padding: 0 8px; font-size: 10px; }
  .scope-badge { top: 7px; left: 7px; font-size: 7px; }
  .selected-dot { top: 7px; right: 7px; }
  .card-buy-action { right: 7px; bottom: 7px; width: 27px; height: 27px; }
  .card-buy-action svg { width: 13px; }
  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 62px;
    padding: 5px;
    border: 1px solid rgba(172, 210, 248, .16);
    border-radius: 18px;
    background: rgba(13, 18, 26, .94);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .42);
    backdrop-filter: blur(18px);
  }
  .mobile-nav a { display: grid; place-content: center; gap: 2px; border-radius: 13px; color: #718297; text-align: center; }
  .mobile-nav a span { font-size: 18px; line-height: 17px; font-weight: 900; }
  .mobile-nav a small { font-size: 8px; font-weight: 700; }
  .mobile-nav a.active { color: #f2f9ff; background: linear-gradient(180deg, #1d79cd, #155ca0); box-shadow: inset 0 1px rgba(255,255,255,.25); }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; }
  .wheel-pointer { transition-duration: 1ms !important; }
  .feed-card-new, .feed-skeleton .feed-preview, .feed-skeleton b, .feed-skeleton small { animation: none !important; }
  .brand-banner-link img, .lightning-icon { transition: none !important; }
}

/* 2026-08 refinement: native navigation, currency and restrained liquid glass. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.upgrade-heading { min-height: 38px; padding: 1px 0 3px; }
.feed-wordmark,
.feed-brand-logo {
  width: auto;
  height: 31px;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(45, 157, 255, .16));
}
.feed-brand-logo { height: 38px; max-width: min(184px, 56vw); }

.user-pill { border: 1px solid rgba(167, 210, 255, .12); color: inherit; }
.balance-pill {
  min-width: 106px;
  min-height: 43px;
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 11px 5px 6px;
  border: 1px solid rgba(162, 211, 255, .18);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(35, 62, 89, .64), rgba(12, 19, 29, .8));
  color: #f2f8ff;
  box-shadow: inset 0 1px rgba(255, 255, 255, .09), 0 10px 22px rgba(0, 0, 0, .2);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}
.currency-star {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border: 1px solid rgba(255, 224, 122, .7);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #fff6bf 0 10%, #ffd85f 34%, #f9b51a 69%, #b66b00 100%);
  color: #fff9d8;
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(102, 57, 0, .5);
  box-shadow: inset 0 1px 3px rgba(255,255,255,.62), 0 4px 13px rgba(244, 168, 0, .28);
}
.balance-stack { display: grid; min-width: 0; justify-items: start; line-height: 1; }
.balance-stack strong { color: #f6fbff; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.balance-stack small { margin-top: 3px; color: #d4a943; font-size: 7px; font-weight: 800; letter-spacing: .13em; }

.feed-card b { padding-right: 0; }
.feed-card {
  grid-template-rows: auto auto;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 218px 72px;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.feed-preview { grid-row: 1 / 3; }
.feed-card-new { animation-duration: .34s; }

.upgrade-button {
  display: grid;
  align-content: center;
  justify-items: center;
  overflow: hidden;
}
.upgrade-button-main { display: flex; align-items: center; justify-content: center; gap: 9px; }
.upgrade-button-icon,
.upgrade-button-main svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  stroke-width: 2.3;
  filter: drop-shadow(0 3px 7px rgba(202, 241, 255, .24));
}
.upgrade-button-main > span { font-weight: 800; letter-spacing: -.02em; }
.upgrade-button:disabled {
  opacity: 1;
  border-color: rgba(108, 169, 225, .14);
  background: linear-gradient(145deg, rgba(27, 42, 59, .72), rgba(12, 19, 28, .82));
  color: #6f87a0;
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.upgrade-button:disabled .upgrade-button-icon,
.upgrade-button:disabled .upgrade-button-main svg { opacity: .42; filter: saturate(.38) brightness(.75); }

.quick-action > svg { width: 21px; height: 21px; stroke-width: 2.15; }
.quick-spin-toggle > svg { fill: rgba(255,255,255,.08); }
.quick-spin-toggle.is-active > svg { fill: rgba(255,255,255,.18); filter: drop-shadow(0 0 6px rgba(255,255,255,.42)); }

.load-more-targets {
  display: flex;
  width: min(260px, 100%);
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px auto 2px;
  border: 1px solid rgba(127, 191, 250, .2);
  border-radius: 14px;
  background: rgba(25, 78, 128, .18);
  color: #c6e9ff;
  font-size: 11px;
  font-weight: 750;
}
.load-more-targets[hidden] { display: none !important; }
.load-more-targets:hover { border-color: rgba(120, 200, 255, .45); background: rgba(34, 115, 190, .25); }
.load-more-targets svg { width: 17px; height: 17px; }

.wheel-pointer:not(.wheel-pointer-reset) {
  transition-property: transform !important;
  transition-duration: var(--spin-duration, 3250ms) !important;
  transition-timing-function: cubic-bezier(.13, .78, .12, 1) !important;
}
.wheel-pointer-reset { transition: none !important; }

.scope-badge[hidden] { display: none !important; }
.scope-badge:not([hidden]) {
  border: 1px solid rgba(179, 219, 255, .16);
  background: rgba(10, 17, 25, .72);
  color: #cae9ff;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
.market-card .price-chip {
  border: 1px solid rgba(142, 205, 255, .13);
  background: linear-gradient(145deg, rgba(34, 113, 188, .28), rgba(13, 49, 83, .55));
  color: #e8f7ff;
  box-shadow: inset 0 1px rgba(255,255,255,.07);
  font-variant-numeric: tabular-nums;
}
.card-buy-action {
  width: 40px;
  height: 40px;
  padding: 0;
  border-color: rgba(135, 205, 255, .28);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(35, 133, 225, .28), rgba(13, 46, 78, .72));
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 8px 18px rgba(0,0,0,.18);
}
.card-buy-action svg { width: 18px; height: 18px; }

.profile-sheet {
  width: min(420px, calc(100% - 24px));
  max-height: min(680px, calc(100dvh - 28px));
  margin: auto;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(181, 220, 255, .18);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(25, 39, 56, .94), rgba(7, 12, 19, .97));
  color: #f4f9ff;
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 28px 80px rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  backdrop-filter: blur(28px) saturate(145%);
}
.profile-sheet::backdrop { background: rgba(2, 5, 9, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.profile-sheet[open] { display: grid; gap: 15px; }
body.profile-sheet-open { overflow: hidden; }
.profile-sheet-handle { display: none; width: 46px; height: 4px; margin: -5px auto 1px; border-radius: 99px; background: rgba(205, 231, 255, .26); }
.profile-sheet-head { display: grid; grid-template-columns: 52px 1fr 38px; align-items: center; gap: 12px; }
.profile-sheet-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(164, 217, 255, .36);
  border-radius: 17px;
  background: linear-gradient(145deg, #228de9, #174b92);
  color: white;
  font-size: 15px;
  font-weight: 850;
  box-shadow: inset 0 1px rgba(255,255,255,.22), 0 10px 25px rgba(20,103,192,.24);
}
.profile-sheet-identity { display: grid; min-width: 0; gap: 2px; }
.profile-sheet-identity p { color: #7f99b4; font-size: 9px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.profile-sheet-identity strong, .profile-sheet-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-sheet-identity strong { color: #f5faff; font-size: 16px; letter-spacing: -.025em; }
.profile-sheet-identity small { color: #8397ac; font-size: 10px; }
.profile-close-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(172,211,249,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #9db0c4;
  font-size: 22px;
}
.profile-mode-row { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-badge { padding: 5px 9px; border: 1px solid rgba(156,206,255,.17); border-radius: 999px; background: rgba(43,130,214,.12); color: #a7d9ff; font-size: 8px; font-weight: 850; letter-spacing: .09em; }
.profile-test-badge { border-color: rgba(86, 221, 177, .22); background: rgba(35, 161, 121, .1); color: #8ee6c6; }
.profile-balance-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(153, 210, 255, .16);
  border-radius: 18px;
  background: linear-gradient(125deg, rgba(35, 128, 218, .18), rgba(255,255,255,.025));
  box-shadow: inset 0 1px rgba(255,255,255,.07);
}
.currency-star-large { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }
.profile-balance-card > div { display: grid; gap: 4px; }
.profile-balance-card small, .profile-stats small { color: #7f94aa; font-size: 9px; }
.profile-balance-card strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.profile-stats > div { display: grid; gap: 4px; padding: 12px; border: 1px solid rgba(171,214,255,.1); border-radius: 15px; background: rgba(255,255,255,.025); }
.profile-stats strong { font-size: 13px; }
.profile-exit-button { min-height: 44px; border: 1px solid rgba(255,137,155,.18); border-radius: 14px; background: rgba(212,62,87,.09); color: #ffc0ca; font-size: 11px; font-weight: 750; }

@media (max-width: 640px) {
  .upgrade-heading { min-height: 34px; padding-top: 0; }
  .feed-wordmark { height: 27px; }
  .feed-brand-logo { height: 34px; max-width: 158px; }
  .balance-pill { min-width: 88px; min-height: 40px; gap: 6px; padding: 4px 8px 4px 5px; }
  .currency-star { width: 27px; height: 27px; flex-basis: 27px; }
  .balance-stack strong { font-size: 11px; }
  .balance-stack small { font-size: 6px; }

  .mobile-nav {
    isolation: isolate;
    min-height: 68px;
    padding: 6px;
    border-color: rgba(188, 225, 255, .17);
    border-radius: 21px;
    background: linear-gradient(180deg, rgba(22, 32, 45, .94), rgba(8, 13, 20, .97));
    box-shadow: inset 0 1px rgba(255,255,255,.08), 0 18px 40px rgba(0,0,0,.43);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    backdrop-filter: blur(14px) saturate(120%);
  }
  .mobile-nav:before {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(180px 54px at 50% 0%, rgba(94, 186, 255, .09), transparent 72%);
    pointer-events: none;
    content: "";
  }
  .mobile-nav-item {
    display: grid;
    min-width: 0;
    min-height: 54px;
    place-content: center;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #71859a;
    text-align: center;
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  }
  .mobile-nav-item small { font-size: 8px; font-weight: 750; line-height: 1; }
  .mobile-nav-item.active {
    border-color: rgba(150, 211, 255, .2);
    background: linear-gradient(145deg, rgba(50, 151, 242, .25), rgba(22, 82, 143, .16));
    color: #eff9ff;
    box-shadow: inset 0 1px rgba(255,255,255,.12), 0 7px 17px rgba(0,0,0,.14);
  }
  .mobile-nav-item:focus-visible { outline: 2px solid rgba(126, 205, 255, .9); outline-offset: -2px; }
  .nav-icon { position: relative; display: block; width: 20px; height: 20px; margin: 0 auto; color: currentColor; }
  .nav-icon svg { display: block; width: 20px; height: 20px; stroke-width: 2; }
  .mobile-nav-item.active .nav-icon svg { filter: drop-shadow(0 3px 7px rgba(104, 196, 255, .3)); }

  .card-buy-action { right: 7px; bottom: 7px; width: 38px; height: 38px; }
  .card-buy-action svg { width: 17px; height: 17px; }
  .target-item .price-chip { max-width: calc(100% - 43px); padding-right: 8px; }

  .arena, .selected-panel, .wheel-panel, .panel, .feed-card {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .profile-sheet {
    width: 100%;
    max-width: none;
    max-height: 78dvh;
    margin: auto 0 0;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 26px 26px 0 0;
  }
  .profile-sheet-handle { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-pointer:not(.wheel-pointer-reset) { transition-duration: min(var(--spin-duration, 420ms), 420ms) !important; }
  .mobile-nav-item { transition: none; }
}

/* Keep the gift artwork unobstructed: its name belongs below the preview. */
.hero-card:not(.empty-card) {
  overflow: visible;
  margin-bottom: 46px;
}
.hero-card:not(.empty-card) .card-title {
  top: calc(100% + 9px);
  right: 0;
  bottom: auto;
  left: 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  column-gap: 5px;
  row-gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #f5f9ff;
  text-align: center;
  text-shadow: none;
}
.hero-card:not(.empty-card) .card-title strong,
.hero-card:not(.empty-card) .card-title [data-role="serial"] {
  align-self: baseline;
  min-width: 0;
  margin: 0;
  color: #f5f9ff;
  font-size: 13px;
  line-height: 1.2;
}
.hero-card:not(.empty-card) .card-title strong { font-weight: 750; }
.hero-card:not(.empty-card) .card-title [data-role="serial"] { color: #91a7bd; font-size: 11px; font-weight: 650; }
.hero-card:not(.empty-card) .card-title [data-role="model-name"] {
  grid-column: 1 / -1;
  margin: 0;
  color: #7f94aa;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 640px) {
  .selected-panel { min-height: 216px; }
  .hero-card:not(.empty-card) { margin-bottom: 42px; }
  .hero-card:not(.empty-card) .card-title strong { font-size: 12px; }
}

/* Telegram viewport-aware shell: retain mobile layout, give desktop the available canvas. */
html { min-height: 100%; }
body {
  min-height: max(100svh, var(--tg-viewport-stable-height, 0px));
  padding-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  overflow-x: clip;
}
@media (min-width: 901px) {
  .app-header,
  .upgrader-shell { width: min(1400px, calc(100% - 40px)); }
  .upgrader-shell { margin-top: 18px; margin-bottom: 56px; gap: 14px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .app-header,
  .upgrader-shell { width: calc(100% - 32px); max-width: none; }
  .upgrader-shell { margin-top: 14px; }
}
@media (max-width: 640px) {
  body {
    min-height: max(100svh, var(--tg-viewport-height, 0px), var(--tg-viewport-stable-height, 0px));
    padding-bottom: calc(88px + max(env(safe-area-inset-bottom, 0px), var(--tg-content-safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)));
  }
  .mobile-nav { bottom: max(10px, env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)); }
}
/* Application shell tokens and Telegram-native chrome. */
:root {
  --glass-bg: rgba(12, 27, 45, .78);
  --glass-bg-strong: rgba(10, 22, 37, .92);
  --glass-border: rgba(177, 222, 255, .18);
  --glass-highlight: rgba(255, 255, 255, .09);
  --glass-shadow: 0 18px 44px rgba(0, 8, 18, .28);
  --accent-blue: #2aabee;
  --accent-cyan: #72d9ff;
  --surface-navy: #071522;
}
html, body { width: 100%; min-height: 100%; }
body { min-height: max(var(--tg-viewport-stable-height, 0px), 100dvh, 100svh); padding-inline: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px)) max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px)); }
.app-header {
  border-color: var(--glass-border);
  background: var(--glass-bg);
  box-shadow: inset 0 1px var(--glass-highlight), var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  backdrop-filter: blur(22px) saturate(125%);
}
.header-actions { margin-left: auto; }
@media (min-width: 901px) {
  .app-header { width: min(1440px, calc(100% - 40px)); min-height: 68px; padding-inline: 18px; }
}
@media (max-width: 640px) {
  .app-header { width: calc(100% - 24px); }
  .mobile-nav {
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: inset 0 1px var(--glass-highlight), var(--glass-shadow);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    backdrop-filter: blur(24px) saturate(135%);
  }
  .mobile-nav:before { background: radial-gradient(220px 70px at 50% 0%, rgba(114, 217, 255, .12), transparent 75%); }
  .mobile-nav-item { border-color: transparent; border-radius: 24px; background: transparent; }
  .mobile-nav-item.active { border-color: rgba(114, 217, 255, .22); background: rgba(42, 171, 238, .18); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 8px 20px rgba(12, 117, 181, .16); }
  .nav-profile-avatar { display: block; width: 28px; height: 28px; margin: 0 auto; border-radius: 50%; object-fit: cover; }
  .nav-profile-initials { display: grid; place-items: center; border: 1px solid rgba(114, 217, 255, .46); background: rgba(42, 171, 238, .2); color: #e9f8ff; font-size: 10px; font-weight: 800; }
  .profile-nav-item.active .nav-profile-avatar { box-shadow: 0 0 0 2px rgba(114, 217, 255, .36); }
}
@media (prefers-reduced-motion: reduce) {
  .app-splash, .mobile-nav-item, .app-header { transition: none !important; }
}