:root {
  --bg: #03101f;
  --panel: rgba(7, 22, 39, 0.92);
  --panel-soft: rgba(9, 27, 48, 0.72);
  --line: rgba(52, 81, 116, 0.5);
  --line-soft: rgba(39, 65, 98, 0.36);
  --text: #f8fbff;
  --muted: #6f7f96;
  --soft: #9fb2cf;
  --blue: #0d80ff;
  --gold: #ffc12f;
  --danger: #ff6b82;
  --success: #65e39a;
  --sheet: url("art/ui-main.png?v=20260611-3");
  --circle-frame: url("art/UI/Base/circle_frame.png");
  --coin-img: url("Img/UI/Base/coin-icon.png");
  --coin-pile-img: url("Img/UI/Boxes/GoldCoins.png");
  --promo-flag-img: url("Img/UI/Base/Flag.png");
  --common-box-img: url("Img/UI/Boxes/_CommonBox.png");
  --rare-box-img: url("Img/UI/Boxes/_RareBox.png");
  --epic-box-img: url("Img/UI/Boxes/_EpicBox.png");
  --common-box-open-img: url("Img/UI/Boxes/_CommonBox_open.png");
  --fragment-common-img: url("Img/UI/Store/fragment_common.png");
  --fragment-rare-img: url("Img/UI/Store/fragment_rare.png");
  --fragment-epic-img: url("Img/UI/Store/fragment_epic.png");
  --fragment-legend-img: url("Img/UI/Store/fragment_legendary.png");
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #020914;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020914;
  overscroll-behavior: none;
}

button {
  padding: 0;
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

.app-shell {
  display: grid;
  min-height: 100dvh;
  place-items: start center;
  background:
    radial-gradient(circle at 50% 30%, rgba(21, 89, 167, 0.18), transparent 48%),
    #020914;
}

.phone {
  position: relative;
  display: flex;
  width: min(100vw, 440px);
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  padding: calc(env(safe-area-inset-top) + 29px) 12px calc(env(safe-area-inset-bottom) + 30px);
  background:
    linear-gradient(rgba(31, 68, 104, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 68, 104, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 50% 62%, rgba(10, 58, 112, 0.32), transparent 34%),
    linear-gradient(180deg, #03101f 0%, #041226 100%);
  background-size: 16px 16px, 16px 16px, auto, auto;
}

.topbar {
  order: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.profile-copy {
  min-width: 0;
}

.profile strong {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: #f6f9ff;
  font-size: 16px;
  font-weight: 750;
  line-height: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile small {
  display: block;
  margin-top: 4px;
  color: #78869a;
  font-size: 11px;
  font-weight: 500;
  line-height: 12px;
}

.avatar {
  position: relative;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: transparent;
}

.avatar::before,
.avatar::after {
  content: "";
  position: absolute;
  background: #cbd3df;
}

.avatar::before {
  top: 0;
  left: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.avatar::after {
  right: 1px;
  bottom: 0;
  left: 1px;
  height: 13px;
  border-radius: 18px 18px 4px 4px;
}

.avatar.has-photo {
  background-position: center;
  background-size: cover;
}

.avatar.has-photo::before,
.avatar.has-photo::after {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: #c7d2df;
  background: rgba(10, 28, 52, 0.88);
  border: 1px solid rgba(66, 102, 148, 0.58);
  border-radius: 4px;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 21px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

.screen-clicker {
  order: 1;
}

.balance {
  order: 2;
}

.screen-boxes {
  order: 3;
}

.phone[data-active-screen="boxes"] .balance {
  order: 1;
}

.phone[data-active-screen="boxes"] .screen-boxes {
  order: 2;
}

.phone[data-active-screen="boxes"] .energy-row {
  visibility: hidden;
}

.stat-card {
  display: grid;
  min-height: 101px;
  align-content: start;
  justify-items: center;
  padding: 9px 4px 8px;
  text-align: center;
  background: rgba(5, 19, 35, 0.62);
  border: 1px solid rgba(60, 91, 128, 0.5);
  border-radius: 3px;
  color: inherit;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 160ms ease, filter 160ms ease, transform 160ms ease;
}

.stat-card:active {
  transform: translateY(1px);
}

.stat-card:focus-visible {
  outline: 2px solid rgba(82, 167, 255, 0.9);
  outline-offset: 2px;
}

.stat-card:hover {
  border-color: rgba(86, 158, 236, 0.84);
  filter: brightness(1.12);
}

.sprite {
  display: block;
  width: 50px;
  height: 50px;
  margin-bottom: 7px;
  background-image: var(--sheet);
  background-repeat: no-repeat;
  background-size: 440px 800px;
  filter: drop-shadow(0 0 10px rgba(255, 189, 44, 0.18));
}

.stat-income .sprite {
  background-position: -31px -108px;
}

.stat-energy .sprite {
  background-position: -139px -108px;
}

.stat-passive .sprite {
  background-position: -251px -108px;
}

.stat-max .sprite {
  background-position: -361px -108px;
}

.stat-card b {
  display: block;
  width: 100%;
  overflow: hidden;
  color: #eef5ff;
  font-size: 10px;
  font-weight: 500;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card small {
  display: block;
  width: 100%;
  min-height: 13px;
  margin-top: 2px;
  overflow: hidden;
  color: #697890;
  font-size: 10px;
  font-weight: 500;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 29px;
}

.section-heading {
  margin-top: 27px;
}

.section-heading h1 {
  margin: 0;
  color: #f8fbff;
  font-size: 24px;
  font-weight: 850;
  line-height: 29px;
}

.section-heading p {
  margin: 8px 0 0;
  color: #6f7f96;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.promo-card,
.box-card {
  width: 100%;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background:
    linear-gradient(135deg, rgba(12, 38, 70, 0.94) 0%, rgba(8, 24, 45, 0.95) 100%);
  border: 1px solid rgba(27, 53, 86, 0.64);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 160ms ease, filter 160ms ease, transform 160ms ease;
}

.promo-card:hover,
.box-card:hover {
  border-color: rgba(67, 120, 180, 0.76);
  filter: brightness(1.08);
}

.promo-card:active,
.box-card:active {
  transform: translateY(1px);
}

.promo-card:focus-visible,
.box-card:focus-visible {
  outline: 2px solid rgba(82, 167, 255, 0.9);
  outline-offset: 2px;
}

.promo-card {
  position: relative;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  min-height: 178px;
  margin-top: 22px;
  overflow: hidden;
  padding: 21px 14px 15px;
}

.promo-card::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 21px;
  width: 112px;
  height: 112px;
  background: radial-gradient(circle, rgba(255, 196, 38, 0.34), transparent 62%);
  filter: blur(4px);
}

.promo-coins,
.promo-ribbon,
.box-art,
.box-sheet-art,
.fragment i {
  display: block;
  flex: 0 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.promo-coins {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 102px;
  margin-top: 3px;
  background-image: var(--coin-pile-img);
  filter: drop-shadow(0 0 20px rgba(255, 188, 36, 0.36));
}

.promo-ribbon {
  position: absolute;
  top: -1px;
  right: 24px;
  width: 64px;
  height: 86px;
  background-image: var(--promo-flag-img);
  filter: drop-shadow(0 5px 11px rgba(0, 0, 0, 0.45));
}

.promo-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 40px 0 0 2px;
}

.promo-copy b,
.box-copy b {
  color: #f6f9ff;
  font-size: 16px;
  font-weight: 850;
  line-height: 20px;
}

.promo-copy small,
.box-copy small {
  color: #6f7f96;
  font-size: 12px;
  font-weight: 500;
  line-height: 17px;
}

.promo-copy small {
  max-width: 265px;
  margin-top: 7px;
}

.promo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 17px;
  color: #7d8ca3;
  border-top: 1px solid rgba(72, 98, 132, 0.34);
  font-size: 12px;
  line-height: 15px;
}

.promo-footer em {
  font-style: normal;
}

.promo-footer strong {
  color: #dbe7f7;
  font-weight: 650;
}

.box-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-bottom: 10px;
}

.box-card {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  min-height: 112px;
  align-items: center;
  padding: 12px 17px 12px 11px;
}

.box-art {
  width: 112px;
  height: 100px;
  background-size: 122%;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.36));
}

.box-common {
  background-image: var(--common-box-img);
}

.box-rare {
  background-image: var(--rare-box-img);
}

.box-epic {
  background-image: var(--epic-box-img);
}

.box-copy {
  display: grid;
  min-width: 0;
  align-content: center;
}

.box-copy small {
  margin-top: 3px;
}

.box-copy span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
  line-height: 22px;
}

.coin.mini {
  width: 25px;
  height: 25px;
}

.balance strong {
  max-width: 320px;
  overflow: hidden;
  color: #fbfcff;
  font-size: clamp(29px, 9vw, 40px);
  font-weight: 850;
  line-height: 44px;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(255, 255, 255, 0.38);
  white-space: nowrap;
}

.coin,
.energy-icon {
  display: inline-block;
  flex: 0 0 auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.coin {
  width: 34px;
  height: 34px;
  background-image: var(--coin-img);
}

.coin.small {
  width: 22px;
  height: 22px;
}

.tap-rate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
  color: #b8c5d9;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.tap-orb {
  position: relative;
  display: grid;
  width: min(72vw, 319px);
  aspect-ratio: 1;
  place-items: center;
  margin: 18px auto 0;
  color: #a7c9ff;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  background-image: var(--sheet);
  background-repeat: no-repeat;
  background-size: 137.93% 250.78%;
  background-position: 50.5% 65.1%;
  border: 0;
  border-radius: 50%;
  filter: drop-shadow(0 0 26px rgba(0, 93, 255, 0.42));
  transition: filter 120ms ease, transform 120ms ease;
}

.tap-orb:disabled {
  cursor: not-allowed;
  filter: grayscale(0.34) brightness(0.78) drop-shadow(0 0 18px rgba(0, 93, 255, 0.28));
}

.tap-orb.is-pressed {
  transform: scale(0.975);
  filter: brightness(1.14) drop-shadow(0 0 34px rgba(0, 114, 255, 0.62));
}

.orb-glass {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    var(--circle-frame) center / 118% 118% no-repeat,
    radial-gradient(circle at 50% 55%, rgba(1, 85, 236, 0.92) 0 38%, rgba(1, 33, 92, 0.95) 58%, transparent 61%);
}

.orb-glass::before {
  content: "";
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 72%, rgba(3, 89, 203, 0.38), transparent 34%),
    radial-gradient(circle at 50% 50%, #072d72 0 57%, #031943 100%);
  box-shadow:
    inset 0 0 0 3px rgba(39, 166, 255, 0.78),
    inset 0 0 32px rgba(15, 106, 255, 0.92),
    0 0 22px rgba(26, 116, 255, 0.82);
}

.orb-glass::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 2px solid rgba(103, 191, 255, 0.54);
  border-radius: 50%;
  box-shadow:
    inset 0 0 17px rgba(5, 134, 255, 0.58),
    0 0 9px rgba(17, 93, 255, 0.72);
}

.bolt {
  display: none;
  position: relative;
  z-index: 1;
  width: 97px;
  height: 125px;
  margin-top: -28px;
  background-image: var(--sheet);
  background-repeat: no-repeat;
  background-size: 440px 800px;
  background-position: -170px -384px;
  filter: drop-shadow(0 0 12px #ff8b00);
}

.tap-orb strong,
.tap-orb small {
  opacity: 0;
  position: absolute;
  z-index: 1;
  display: block;
  width: 100%;
  text-align: center;
}

.tap-orb strong {
  bottom: 28.5%;
  color: #8fb9f6;
  font-size: 23px;
  font-weight: 800;
  line-height: 24px;
}

.tap-orb small {
  bottom: 24%;
  color: #7e9dcc;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
}

.energy-row {
  order: 4;
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 2px;
  margin-top: auto;
  margin-bottom: 12px;
  color: #6e7d92;
  font-size: 18px;
  font-weight: 750;
  line-height: 24px;
}

.energy-icon {
  background-image: var(--sheet);
  background-size: 440px 800px;
  width: 42px;
  height: 42px;
  margin-right: 4px;
  background-position: -14px -658px;
}

.energy-row b {
  color: #f5f8ff;
  font-size: 18px;
}

.status-text,
.sync-dot {
  display: none;
}

.tabbar {
  order: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 70px;
  overflow: hidden;
  background: rgba(8, 25, 45, 0.88);
  border: 1px solid rgba(30, 54, 83, 0.56);
  border-radius: 8px;
}

.tab {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  color: #5f6e82;
  text-decoration: none;
}

.tab svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.tab span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: #f7fbff;
}

.tab.active svg {
  color: var(--text);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.18));
}

.error-panel {
  position: absolute;
  right: 12px;
  bottom: 112px;
  left: 12px;
  padding: 12px 14px;
  color: #ffc5ce;
  background: rgba(68, 16, 31, 0.88);
  border: 1px solid rgba(255, 107, 130, 0.44);
  border-radius: 8px;
}

.error-panel b,
.error-panel span {
  display: block;
}

.error-panel b {
  color: #fff1f4;
  font-size: 13px;
}

.error-panel span {
  margin-top: 5px;
  font-size: 12px;
  line-height: 17px;
}

.upgrade-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(1, 7, 15, 0.42);
  opacity: 0;
  transition: opacity 240ms ease;
}

.box-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(1, 7, 15, 0.68);
  opacity: 0;
  transition: opacity 240ms ease;
}

.box-backdrop.is-open {
  opacity: 1;
}

.upgrade-backdrop.is-open {
  opacity: 1;
}

.upgrade-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  display: grid;
  justify-items: center;
  padding: 33px 30px calc(env(safe-area-inset-bottom) + 29px);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(12, 45, 82, 0.95) 0%, rgba(8, 24, 45, 0.98) 100%);
  border: 2px solid #52a3ff;
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow:
    0 -8px 36px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(105%);
  transition: transform 280ms cubic-bezier(0.2, 0.85, 0.25, 1);
}

.box-sheet {
  position: fixed;
  right: auto;
  bottom: 0;
  left: 50%;
  z-index: 11;
  display: grid;
  width: min(100vw, 440px);
  justify-items: center;
  height: 523px;
  padding: 30px 32px calc(env(safe-area-inset-bottom) + 29px);
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 43, 82, 0.98) 0%, rgba(5, 16, 32, 0.99) 100%);
  border: 2px solid rgba(64, 126, 206, 0.9);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow:
    0 -8px 36px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translate(-50%, 105%);
  transition: transform 280ms cubic-bezier(0.2, 0.85, 0.25, 1);
}

.box-sheet.is-open {
  transform: translate(-50%, 0);
}

.box-sheet-art {
  width: 164px;
  height: 130px;
  margin-bottom: 7px;
  background-image: var(--common-box-open-img);
  background-size: 124%;
  filter: drop-shadow(0 13px 18px rgba(0, 0, 0, 0.36));
}

.box-sheet-art.is-rare,
.box-sheet-art.is-epic {
  width: 172px;
  height: 145px;
  margin: 3px 0 15px;
}

.box-sheet-art.is-rare {
  background-image: var(--rare-box-img);
}

.box-sheet-art.is-epic {
  background-image: var(--epic-box-img);
}

.box-sheet h2 {
  margin: 0;
  color: #ffffff;
  font-size: 27px;
  font-weight: 650;
  line-height: 33px;
}

.box-sheet p {
  margin: 20px 0 10px;
  color: #71819a;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.fragment-row {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.fragment {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 8px;
}

.fragment i {
  width: 65px;
  height: 65px;
  border: 1px solid rgba(54, 91, 132, 0.72);
  border-radius: 5px;
}

.fragment-common i {
  background-image: var(--fragment-common-img);
}

.fragment-rare i {
  background-image: var(--fragment-rare-img);
}

.fragment-epic i {
  background-image: var(--fragment-epic-img);
}

.fragment-legend i {
  background-image: var(--fragment-legend-img);
}

.fragment small {
  color: #8d9bb1;
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
}

.box-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 19px;
}

.box-cost .coin {
  width: 42px;
  height: 42px;
}

.box-cost span {
  display: grid;
  justify-items: start;
}

.box-cost small {
  color: #7989a1;
  font-size: 12px;
  font-weight: 600;
  line-height: 14px;
}

.box-cost b {
  color: #ffffff;
  font-size: 26px;
  font-weight: 850;
  line-height: 28px;
}

.box-sheet .buy-button {
  margin-top: 24px;
}

.upgrade-sheet.is-open {
  transform: translateY(0);
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  color: #8fa7c7;
  background: rgba(4, 15, 30, 0.52);
  border: 1px solid rgba(82, 163, 255, 0.28);
  border-radius: 5px;
  font-size: 24px;
  line-height: 26px;
}

.sheet-sprite {
  width: 91px;
  height: 91px;
  margin: -4px 0 6px;
  background-size: 801px 1456px;
}

.sheet-sprite.stat-income {
  background-position: -56px -197px;
}

.sheet-sprite.stat-energy {
  background-position: -253px -197px;
}

.sheet-sprite.stat-passive {
  background-position: -457px -197px;
}

.sheet-sprite.stat-max {
  background-position: -657px -197px;
}

.upgrade-sheet h2 {
  margin: 0;
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
  line-height: 24px;
}

.upgrade-sheet p {
  max-width: 285px;
  margin: 4px 0 22px;
  color: #71819a;
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
}

.upgrade-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: #ffffff;
  font-size: 27px;
  font-weight: 850;
  line-height: 34px;
}

.upgrade-change strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 55px;
}

.upgrade-change strong::after {
  content: "";
  width: 24px;
  height: 24px;
  background-image: var(--sheet);
  background-repeat: no-repeat;
  background-size: 311px 565px;
  background-position: -92px -164px;
}

.upgrade-change.is-energy strong::after {
  width: 28px;
  height: 28px;
  background-size: 289px 525px;
  background-position: -9px -431px;
}

.upgrade-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 23px;
}

.upgrade-cost .coin {
  width: 36px;
  height: 36px;
}

.upgrade-cost span {
  display: grid;
  justify-items: start;
}

.upgrade-cost small {
  color: #7989a1;
  font-size: 11px;
  font-weight: 600;
  line-height: 13px;
}

.upgrade-cost b {
  color: #ffffff;
  font-size: 22px;
  font-weight: 850;
  line-height: 24px;
}

.buy-button {
  width: 100%;
  min-height: 51px;
  margin-top: 28px;
  color: #ffffff;
  background: linear-gradient(180deg, #434da4 0%, #283476 100%);
  border: 1px solid rgba(112, 127, 226, 0.7);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 800;
  line-height: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.buy-button:disabled {
  color: rgba(255, 255, 255, 0.48);
  cursor: not-allowed;
  background: linear-gradient(180deg, #2a335e 0%, #1c2549 100%);
  border-color: rgba(88, 103, 160, 0.45);
}

[data-state="ready"] .sync-dot {
  background: var(--success);
}

[data-state="error"] .sync-dot {
  background: var(--danger);
}

@media (min-height: 760px) {
  .phone {
    min-height: min(100dvh, 800px);
  }
}

@media (max-width: 390px) {
  .phone {
    padding-top: calc(env(safe-area-inset-top) + 10px);
    padding-bottom: calc(env(safe-area-inset-bottom) + 14px);
  }

  .topbar {
    min-height: 43px;
    padding-bottom: 10px;
  }

  .profile {
    gap: 7px;
  }

  .avatar {
    width: 21px;
    height: 21px;
  }

  .profile strong {
    max-width: 142px;
    font-size: 10px;
    line-height: 13px;
  }

  .profile small {
    margin-top: 1px;
    font-size: 7px;
    line-height: 9px;
  }

  .top-actions {
    gap: 7px;
  }

  .icon-button {
    width: 29px;
    height: 29px;
  }

  .icon-button svg {
    width: 19px;
    height: 19px;
  }

  .stat-grid {
    gap: 7px;
    margin-top: 13px;
  }

  .section-heading {
    margin-top: 16px;
  }

  .section-heading h1 {
    font-size: 16px;
    line-height: 20px;
  }

  .section-heading p {
    margin-top: 4px;
    font-size: 10px;
    line-height: 13px;
  }

  .promo-card {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 125px;
    margin-top: 10px;
    padding: 12px 10px 9px;
    border-radius: 5px;
  }

  .promo-card::before {
    top: 10px;
    left: 12px;
    width: 78px;
    height: 78px;
  }

  .promo-coins {
    width: 78px;
    height: 70px;
  }

  .promo-ribbon {
    right: 18px;
    width: 45px;
    height: 62px;
  }

  .promo-copy {
    padding-top: 24px;
  }

  .promo-copy b,
  .box-copy b {
    font-size: 11px;
    line-height: 14px;
  }

  .promo-copy small,
  .box-copy small {
    font-size: 8px;
    line-height: 11px;
  }

  .promo-copy small {
    margin-top: 4px;
  }

  .promo-footer {
    padding-top: 9px;
    font-size: 8px;
    line-height: 10px;
  }

  .box-list {
    gap: 8px;
    margin-top: 8px;
  }

  .box-card {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 77px;
    padding: 8px 11px 8px 8px;
    border-radius: 5px;
  }

  .box-art {
    width: 78px;
    height: 70px;
    background-size: 122%;
  }

  .box-copy span {
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    line-height: 14px;
  }

  .coin.mini {
    width: 18px;
    height: 18px;
  }

  .stat-card {
    min-height: 67px;
    padding-top: 6px;
  }

  .sprite {
    width: 34px;
    height: 34px;
    margin-bottom: 3px;
    background-size: 299px 544px;
  }

  .stat-income .sprite {
    background-position: -21px -73px;
  }

  .stat-energy .sprite {
    background-position: -94px -73px;
  }

  .stat-passive .sprite {
    background-position: -170px -73px;
  }

  .stat-max .sprite {
    background-position: -245px -73px;
  }

  .stat-card b,
  .stat-card small {
    font-size: 6px;
    line-height: 8px;
  }

  .stat-card small {
    margin-top: 1px;
  }

  .balance {
    gap: 5px;
    margin-top: 17px;
  }

  .balance strong {
    font-size: 25px;
    line-height: 30px;
  }

  .coin {
    width: 23px;
    height: 23px;
  }

  .coin.small {
    width: 16px;
    height: 16px;
  }

  .tap-rate {
    margin-top: 0;
    font-size: 11px;
    line-height: 15px;
  }

  .tap-orb {
    width: min(75vw, 252px);
    margin-top: 14px;
  }

  .orb-glass::before {
    inset: 27px;
  }

  .orb-glass::after {
    inset: 16px;
  }

  .bolt {
    width: 76px;
    height: 98px;
    margin-top: -22px;
    background-size: 345px 627px;
    background-position: -133px -301px;
  }

  .tap-orb strong {
    bottom: 28%;
    font-size: 14px;
    line-height: 17px;
  }

  .tap-orb small {
    bottom: 23.5%;
    font-size: 8px;
    line-height: 10px;
  }

  .energy-row {
    min-height: 25px;
    margin-bottom: 9px;
    font-size: 13px;
    line-height: 17px;
  }

  .energy-row b {
    font-size: 13px;
  }

  .energy-icon {
    width: 29px;
    height: 29px;
    margin-right: 2px;
    background-size: 299px 544px;
    background-position: -9px -447px;
  }

  .tabbar {
    min-height: 54px;
    border-radius: 5px;
  }

  .tab {
    gap: 2px;
  }

  .tab svg {
    width: 17px;
    height: 17px;
  }

  .tab span {
    font-size: 8px;
    line-height: 10px;
  }

  .upgrade-sheet {
    padding: 24px 22px calc(env(safe-area-inset-bottom) + 20px);
    border-radius: 20px 20px 0 0;
  }

  .box-sheet {
    height: 354px;
    padding: 19px 24px calc(env(safe-area-inset-bottom) + 18px);
    border-radius: 20px 20px 0 0;
  }

  .sheet-close {
    top: 9px;
    right: 10px;
    width: 26px;
    height: 26px;
    font-size: 21px;
    line-height: 22px;
  }

  .sheet-sprite {
    width: 73px;
    height: 73px;
    margin-bottom: 4px;
    background-size: 641px 1165px;
  }

  .sheet-sprite.stat-income {
    background-position: -45px -158px;
  }

  .sheet-sprite.stat-energy {
    background-position: -202px -158px;
  }

  .sheet-sprite.stat-passive {
    background-position: -366px -158px;
  }

  .sheet-sprite.stat-max {
    background-position: -526px -158px;
  }

  .upgrade-sheet h2 {
    font-size: 14px;
    line-height: 18px;
  }

  .box-sheet-art {
    width: 88px;
    height: 70px;
    margin-bottom: 5px;
  }

  .box-sheet-art.is-rare,
  .box-sheet-art.is-epic {
    width: 135px;
    height: 114px;
    margin: 3px 0 10px;
  }

  .box-sheet h2 {
    font-size: 20px;
    line-height: 25px;
  }

  .box-sheet p {
    margin: 12px 0 7px;
    font-size: 10px;
    line-height: 13px;
  }

  .fragment-row {
    gap: 6px;
  }

  .fragment i {
    width: 46px;
    height: 46px;
  }

  .fragment small {
    font-size: 8px;
    line-height: 10px;
  }

  .box-cost {
    margin-top: 12px;
  }

  .box-cost .coin {
    width: 28px;
    height: 28px;
  }

  .box-cost small {
    font-size: 10px;
    line-height: 12px;
  }

  .box-cost b {
    font-size: 18px;
    line-height: 20px;
  }

  .box-sheet .buy-button {
    margin-top: 14px;
  }

  .upgrade-sheet p {
    max-width: 235px;
    margin-bottom: 16px;
    font-size: 9px;
    line-height: 11px;
  }

  .upgrade-change {
    gap: 9px;
    font-size: 21px;
    line-height: 26px;
  }

  .upgrade-change strong {
    min-width: 45px;
  }

  .upgrade-change strong::after {
    width: 18px;
    height: 18px;
    background-size: 238px 433px;
    background-position: -70px -126px;
  }

  .upgrade-change.is-energy strong::after {
    width: 21px;
    height: 21px;
    background-size: 216px 393px;
    background-position: -7px -322px;
  }

  .upgrade-cost {
    margin-top: 17px;
  }

  .upgrade-cost .coin {
    width: 28px;
    height: 28px;
  }

  .upgrade-cost small {
    font-size: 8px;
    line-height: 10px;
  }

  .upgrade-cost b {
    font-size: 17px;
    line-height: 19px;
  }

  .buy-button {
    min-height: 38px;
    margin-top: 21px;
    font-size: 12px;
    line-height: 15px;
  }
}

@media (max-height: 680px) {
  .stat-grid {
    margin-top: 10px;
  }

  .balance {
    margin-top: 12px;
  }

  .tap-orb {
    width: min(64vw, 238px);
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tap-orb,
  .stat-card,
  .upgrade-backdrop,
  .upgrade-sheet {
    transition: none;
  }
}
