:root {
  color-scheme: dark;
  --screen-w: min(100vw, 420px);
  --gold: #ffd167;
  --gold-strong: #f6b947;
  --gold-deep: #b86913;
  --text: #f7f3e9;
  --muted: #bbb7ad;
  --panel: rgba(12, 20, 23, .86);
  --stroke: rgba(151, 176, 178, .32);
  --nav-h: 61px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(56, 69, 68, .24), transparent 36%),
    #030607;
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
}

body:not(.is-app-ready) .app-shell {
  opacity: 0;
  transform: scale(.985);
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.inline-gram {
  width: .9em;
  height: .9em;
  display: inline-block;
  flex: 0 0 .9em;
  object-fit: contain;
  vertical-align: -.08em;
  filter: drop-shadow(0 0 5px rgba(60, 174, 255, .34));
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255, 209, 103, .09), transparent 12%, transparent 88%, rgba(255, 209, 103, .09));
  opacity: 1;
  transform: none;
  transition: opacity .45s ease, transform .45s ease;
}

.launch-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(1, 5, 7, .98) 0%, rgba(1, 5, 7, .62) 44%, rgba(4, 8, 9, .28) 100%),
    linear-gradient(180deg, rgba(3, 7, 8, .2), rgba(2, 5, 6, .98)),
    url("assets/oil-field-hero.png") center / cover no-repeat,
    #030607;
  overflow: hidden;
  transition: opacity .42s ease, visibility .42s ease;
}

.launch-screen::before,
.launch-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.launch-screen::before {
  inset: 0;
  background:
    radial-gradient(circle at 74% 48%, rgba(255, 180, 57, .28), transparent 25%),
    radial-gradient(circle at 50% 88%, rgba(43, 174, 255, .08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 15%, transparent 82%, rgba(0, 0, 0, .55));
}

.launch-screen::after {
  inset: auto -10% -8%;
  height: 30%;
  background: radial-gradient(ellipse at center, rgba(255, 188, 71, .13), transparent 58%);
  filter: blur(10px);
}

.launch-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.launch-scene {
  position: relative;
  z-index: 1;
  width: min(calc(100vw - 36px), 360px);
  min-height: 540px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 18px 26px;
  border-radius: 28px;
  border: 1px solid rgba(255, 202, 91, .28);
  background:
    linear-gradient(180deg, rgba(2, 8, 10, .22), rgba(2, 7, 8, .62) 52%, rgba(2, 5, 6, .92)),
    radial-gradient(circle at 72% 32%, rgba(255, 182, 66, .18), transparent 34%);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, .52),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px rgba(255, 255, 255, .02);
  overflow: hidden;
}

.launch-scene::before {
  content: "";
  position: absolute;
  inset: 74px -42px 178px 72px;
  background: url("assets/shop-items-sprite.png") center / contain no-repeat;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, .72));
  opacity: .98;
}

.launch-scene::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 118px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 205, 98, .52), transparent);
}

.launch-brand {
  position: absolute;
  top: 20px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}

.launch-brand-drop {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.launch-brand-drop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 196, 72, .4));
}

.launch-barrel {
  position: absolute;
  left: 24px;
  bottom: 150px;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  border: 1px solid rgba(255, 206, 103, .36);
  background:
    linear-gradient(180deg, rgba(255, 222, 146, .1), rgba(3, 8, 10, .08)),
    url("assets/shop-item-1.png") center / 82% auto no-repeat,
    rgba(5, 11, 12, .58);
  box-shadow: 0 20px 35px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.launch-status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.launch-status p {
  margin: 0;
  color: rgba(247, 243, 233, .78);
  font-size: 12px;
  line-height: 1.3;
}

.launch-status strong {
  color: #ffe39a;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 0 18px rgba(248, 184, 63, .3);
}

.launch-progress {
  position: relative;
  z-index: 2;
  height: 13px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 103, .24);
  background: rgba(0, 0, 0, .34);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  overflow: hidden;
}

.launch-progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4a72d, #ffe59b 52%, #f3aa31);
  box-shadow: 0 0 18px rgba(255, 194, 77, .42);
  transition: width .26s ease;
}

.launch-progress::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
  transform: translateX(-120%);
  animation: launchShine 1.45s linear infinite;
}

@keyframes launchShine {
  to {
    transform: translateX(120%);
  }
}

@media (max-height: 650px) {
  .launch-scene {
    min-height: calc(100dvh - 36px);
  }

  .launch-scene::before {
    top: 58px;
    bottom: 148px;
  }
}

@media (max-width: 330px) {
  .launch-scene {
    width: min(calc(100vw - 24px), 330px);
    padding-inline: 14px;
  }

  .launch-brand {
    font-size: 21px;
  }

  .launch-status strong {
    font-size: 22px;
  }
}

.game-screen {
  position: relative;
  width: var(--screen-w);
  height: 100dvh;
  min-height: 0;
  max-height: 920px;
  overflow: hidden;
  isolation: isolate;
  background: #061012 url("assets/oil-field-hero.png") center -82px / auto calc(100% - 10px) no-repeat;
}

.game-screen::before,
.game-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.game-screen::before {
  background:
    linear-gradient(180deg, rgba(1, 5, 7, .55) 0%, rgba(2, 7, 8, .1) 28%, rgba(4, 8, 10, .04) 53%, rgba(3, 7, 8, .82) 83%, rgba(2, 4, 5, .98) 100%),
    radial-gradient(ellipse at 50% 60%, transparent 0%, rgba(3, 7, 8, .26) 68%, rgba(2, 3, 4, .76) 100%);
}

.game-screen::after {
  inset: auto 0 0;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(2, 5, 6, .95) 56%, #020405 100%);
}

.game-screen.shop-mode {
  background:
    radial-gradient(circle at 12% 5%, rgba(255, 197, 78, .08), transparent 19%),
    radial-gradient(circle at 80% 18%, rgba(44, 161, 245, .08), transparent 23%),
    linear-gradient(180deg, #050b0d 0%, #071013 48%, #030607 100%);
}

.game-screen.shop-mode::before {
  background:
    linear-gradient(180deg, rgba(3, 8, 10, .18), rgba(2, 5, 6, .92)),
    radial-gradient(ellipse at 50% 50%, rgba(244, 166, 52, .08), transparent 62%);
}

.game-screen.shop-mode::after {
  height: 24%;
}

.hud {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 10px 0;
}

.game-screen > .hud {
  z-index: 8;
}

.screen {
  position: relative;
  z-index: 2;
}

.screen:not(.is-active) {
  display: none;
}

.profile-chip,
.balance-chip,
.admin-chip {
  display: inline-flex;
  align-items: center;
  height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(120, 145, 143, .22);
  background: linear-gradient(180deg, rgba(13, 20, 23, .82), rgba(6, 12, 15, .7));
  box-shadow: 0 11px 24px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .06);
  cursor: pointer;
}

.admin-chip {
  justify-content: center;
  min-width: 58px;
  padding: 0 10px;
  color: #160f05;
  border-color: rgba(255, 213, 111, .58);
  background: linear-gradient(180deg, #ffe39c, #f7b344);
  box-shadow: 0 9px 18px rgba(244, 174, 58, .2), inset 0 1px 0 rgba(255, 255, 255, .55);
  font-size: 11px;
  font-weight: 500;
}

.profile-chip {
  gap: 7px;
  min-width: 128px;
  padding: 5px 10px 5px 5px;
}

.avatar {
  position: relative;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 218, 122, .92);
  background:
    radial-gradient(circle at 50% 38%, #f1c69d 0 16%, transparent 17%),
    radial-gradient(circle at 50% 69%, #283a42 0 21%, transparent 22%),
    linear-gradient(150deg, #273138, #060b0d 62%);
  box-shadow: 0 0 14px rgba(255, 208, 93, .3);
  overflow: hidden;
}

.avatar-photo {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.avatar.has-photo .avatar-photo {
  display: block;
}

.avatar.has-photo .avatar-face {
  display: none;
}

.avatar-face {
  width: 18px;
  height: 25px;
  display: block;
  position: relative;
  margin-top: 2px;
  border-radius: 44% 44% 48% 48%;
  background: linear-gradient(#f0c498 0 42%, #d9a577 43% 100%);
}

.avatar-face::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -4px;
  width: 22px;
  height: 11px;
  border-radius: 9px 9px 5px 5px;
  background: #2b211b;
}

.avatar-face::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: -9px;
  height: 13px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(90deg, #1b2930, #324b53, #18262d);
}

.profile-text {
  display: flex;
  align-items: center;
  min-height: 100%;
  text-align: left;
  line-height: 1.05;
}

.profile-text span:first-child {
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
}

.balance-chip {
  min-width: 120px;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 9px;
}

.gram-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 8px rgba(48, 161, 245, .42));
}

.gram-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.balance-value {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.balance-divider {
  width: 1px;
  height: 23px;
  margin-left: auto;
  background: rgba(126, 144, 145, .2);
}

.balance-plus {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  opacity: .72;
}

.balance-plus::before,
.balance-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: rgba(206, 218, 218, .7);
  transform: translate(-50%, -50%);
}

.balance-plus::after {
  width: 2px;
  height: 14px;
}

.hero-spacer {
  height: clamp(230px, 45dvh, 420px);
}

.empty-state {
  position: relative;
  z-index: 2;
  padding: 0 13px;
  text-align: center;
  transform: translateY(-2px);
}

.empty-state h1 {
  margin: 0 0 9px;
  color: #fffaf0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, .74);
  font-size: clamp(22px, 6vw, 26px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: 0;
}

.empty-state p {
  margin: 0 0 18px;
  color: rgba(238, 234, 221, .86);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .7);
  font-size: clamp(14px, 3.9vw, 16px);
  line-height: 1.18;
  font-weight: 400;
}

.buy-button {
  width: 100%;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: 8px;
  color: #171006;
  background: linear-gradient(180deg, #ffe29a 0%, #ffc25b 43%, #f2a83a 100%);
  box-shadow: 0 9px 22px rgba(246, 174, 56, .22), inset 0 1px 0 rgba(255, 255, 255, .58), inset 0 -2px 0 rgba(145, 76, 4, .14);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.buy-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.buy-button:active {
  transform: translateY(1px);
  filter: brightness(.96);
}

.profit-card {
  position: relative;
  z-index: 2;
  min-height: 86px;
  margin: 18px 13px 0;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 14px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(13, 25, 30, .91), rgba(9, 17, 21, .84));
  box-shadow: 0 16px 28px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.clock-badge {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  color: var(--gold);
  border-radius: 50%;
  background: rgba(255, 200, 83, .08);
  box-shadow: 0 0 0 1px rgba(255, 207, 94, .24);
}

.clock-badge svg {
  width: 36px;
  height: 36px;
}

.profit-card p {
  margin: 0;
  color: #fff7e7;
  font-size: 12px;
  line-height: 1.3;
}

.profit-card strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 500;
}

.profit-card span:last-child {
  color: rgba(226, 226, 219, .68);
  font-weight: 400;
}

.shop-screen {
  position: absolute;
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 2;
  padding: calc(max(14px, env(safe-area-inset-top)) + 58px) 8px 10px;
  overflow: auto;
  scrollbar-width: none;
}

.shop-screen::-webkit-scrollbar {
  display: none;
}

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

.shop-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 13px;
}

.shop-cart {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(255, 202, 90, .32));
}

.shop-cart svg {
  width: 33px;
  height: 33px;
  fill: currentColor;
}

.shop-header h1 {
  margin: 0 0 4px;
  color: #fff8e9;
  font-size: 23px;
  line-height: 1;
  font-weight: 600;
}

.shop-header p {
  margin: 0;
  color: rgba(226, 229, 224, .72);
  font-size: 11px;
  line-height: 1.38;
}

.shop-list {
  display: grid;
  gap: 8px;
}

.shop-card {
  min-height: 89px;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 8px;
  border: 1px solid rgba(179, 149, 82, .42);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 186, 66, .11), transparent 36%),
    linear-gradient(180deg, rgba(21, 31, 32, .9), rgba(9, 17, 20, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 13px 24px rgba(0, 0, 0, .24);
}

.shop-thumb {
  width: 78px;
  height: 74px;
  display: block;
  border-radius: 6px;
  background-image: url("assets/shop-items-sprite.png");
  background-size: 200% 200%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 104, .16), 0 8px 15px rgba(0, 0, 0, .28);
}

.shop-thumb.item-one {
  background-position: 0 0;
}

.shop-thumb.item-five {
  background-position: 100% 0;
}

.shop-thumb.item-ten {
  background-position: 0 100%;
}

.shop-thumb.item-tower {
  background-position: 100% 100%;
}

.shop-info {
  min-width: 0;
  color: #fff8e7;
  line-height: 1.1;
}

.shop-info h2 {
  margin: 0 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.shop-info p {
  margin: 0 0 2px;
  color: rgba(235, 231, 218, .74);
  font-size: 9px;
}

.shop-income {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 5px;
  color: #ffbc48;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(255, 170, 40, .3);
}

.shop-income img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.shop-info strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff4df;
  font-size: 13px;
  font-weight: 600;
}

.shop-buy {
  justify-self: end;
  width: 64px;
  height: 34px;
  border-radius: 7px;
  color: #1f1305;
  background: linear-gradient(180deg, #ffe08d 0%, #ffc04f 46%, #f2a034 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .52), 0 7px 15px rgba(243, 168, 46, .2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.shop-buy:active {
  transform: translateY(1px);
  filter: brightness(.96);
}

.shop-buy:disabled,
.shop-buy.is-owned {
  color: rgba(238, 238, 232, .56);
  background: linear-gradient(180deg, rgba(47, 59, 66, .9), rgba(25, 35, 41, .9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  cursor: default;
}

.shop-buy:disabled:active {
  transform: none;
  filter: none;
}

.bottom-nav {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 1px 4px max(5px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  border-top: 1px solid rgba(111, 134, 135, .21);
  background:
    linear-gradient(180deg, rgba(14, 24, 27, .96), rgba(5, 10, 12, .98)),
    rgba(7, 13, 15, .98);
  box-shadow: 0 -13px 24px rgba(0, 0, 0, .44);
}

.nav-item {
  min-width: 0;
  height: 52px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 1px;
  padding-top: 2px;
  border-radius: 7px;
  background: transparent;
  color: rgba(190, 200, 199, .74);
  font-size: 9px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.nav-icon {
  width: 30px;
  height: 28px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 27px;
  height: 27px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}

.nav-icon svg path:not(.icon-fill):not(.icon-dot),
.nav-icon svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon .icon-fill {
  fill: currentColor;
  stroke: none;
}

.nav-icon .icon-dot {
  stroke-width: 3.2;
}

.nav-item.active {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 206, 91, .45);
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 8px rgba(255, 207, 93, .42));
}

.nav-item:active {
  background: rgba(255, 255, 255, .03);
}

@media (min-width: 421px) {
  body {
    background: #020405;
  }

  .game-screen {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 32px 80px rgba(0, 0, 0, .62);
  }
}

@media (max-height: 700px) {
  .game-screen {
    min-height: 100dvh;
  }

  .hero-spacer {
    height: clamp(166px, 41dvh, 292px);
  }

  .empty-state h1 {
    font-size: clamp(20px, 5.7vw, 24px);
  }

  .empty-state p {
    margin-bottom: 14px;
  }

  .buy-button {
    height: 50px;
  }

  .profit-card {
    min-height: 78px;
    margin-top: 14px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .shop-screen {
    padding-top: calc(max(10px, env(safe-area-inset-top)) + 40px);
    padding-bottom: 6px;
  }

  .shop-header {
    gap: 7px;
    margin-bottom: 23px;
  }

  .shop-cart {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .shop-cart svg {
    width: 26px;
    height: 26px;
  }

  .shop-header h1 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .shop-header p {
    font-size: 7.5px;
    line-height: 1.35;
  }

  .shop-list {
    gap: 8px;
  }

  .shop-card {
    min-height: 82px;
    grid-template-columns: 72px minmax(0, 1fr) 58px;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
  }

  .shop-thumb {
    width: 68px;
    height: 68px;
    border-radius: 5px;
    background-size: 220% 220%;
  }

  .shop-thumb.item-one {
    background-position: 3% 1%;
  }

  .shop-thumb.item-five {
    background-position: 100% 2%;
  }

  .shop-thumb.item-ten {
    background-position: 4% 100%;
  }

  .shop-thumb.item-tower {
    background-position: 100% 100%;
  }

  .shop-info {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .shop-info h2 {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .shop-info p {
    margin-bottom: 2px;
    font-size: 7px;
  }

  .shop-income {
    gap: 2px;
    margin-bottom: 4px;
    font-size: 12px;
  }

  .shop-income img {
    width: 10px;
    height: 10px;
  }

  .shop-info strong {
    font-size: 10px;
  }

  .shop-buy {
    align-self: end;
    margin-bottom: 8px;
    width: 58px;
    height: 28px;
    border-radius: 5px;
    font-size: 8px;
  }
}

@media (max-width: 330px) {
  .hud {
    padding-left: 8px;
    padding-right: 8px;
  }

  .profile-chip {
    min-width: 116px;
  }

  .balance-chip {
    min-width: 106px;
  }

  .nav-item {
    font-size: 8px;
  }
}

@media (max-width: 240px) {
  :root {
    --nav-h: 43px;
  }

  .game-screen {
    background-position: center -86px;
    background-size: auto calc(100% + 42px);
  }

  .game-screen::before {
    background:
      linear-gradient(180deg, rgba(1, 5, 7, .52) 0%, rgba(2, 7, 8, .06) 31%, rgba(4, 8, 10, .05) 54%, rgba(3, 7, 8, .79) 81%, rgba(2, 4, 5, .98) 100%),
      radial-gradient(ellipse at 50% 58%, transparent 0%, rgba(3, 7, 8, .18) 66%, rgba(2, 3, 4, .74) 100%);
  }

  .hud {
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 6px 0;
  }

  .profile-chip,
  .balance-chip {
    height: 34px;
    border-radius: 8px;
  }

  .profile-chip {
    min-width: 74px;
    gap: 4px;
    padding: 4px 6px 4px 4px;
  }

  .avatar {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
    border-width: 1px;
  }

  .avatar-face {
    width: 12px;
    height: 17px;
    margin-top: 1px;
  }

  .avatar-face::before {
    left: -2px;
    top: -3px;
    width: 16px;
    height: 8px;
  }

  .avatar-face::after {
    left: -3px;
    right: -3px;
    bottom: -7px;
    height: 9px;
  }

  .profile-text {
    min-height: 100%;
  }

  .profile-text span:first-child {
    max-width: 42px;
    font-size: 7px;
  }

  .balance-chip {
    min-width: 67px;
    gap: 4px;
    padding: 4px 6px;
  }

  .gram-icon {
    width: 23px;
    height: 23px;
  }

  .balance-value {
    font-size: 11px;
  }

  .balance-divider {
    height: 19px;
  }

  .balance-plus {
    width: 11px;
    height: 11px;
    flex-basis: 11px;
  }

  .balance-plus::before {
    width: 10px;
    height: 1.5px;
  }

  .balance-plus::after {
    width: 1.5px;
    height: 10px;
  }

  .hero-spacer {
    height: clamp(125px, 38dvh, 151px);
  }

  .empty-state {
    padding: 0 7px;
    transform: none;
  }

  .empty-state h1 {
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.08;
  }

  .empty-state p {
    margin-bottom: 10px;
    font-size: 10px;
    line-height: 1.15;
  }

  .buy-button {
    height: 28px;
    gap: 6px;
    border-radius: 6px;
    font-size: 9px;
  }

  .buy-button svg {
    width: 14px;
    height: 14px;
  }

  .profit-card {
    min-height: 43px;
    margin: 10px 6px 0;
    gap: 7px;
    padding: 6px 8px;
    border-radius: 6px;
  }

  .clock-badge {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }

  .clock-badge svg {
    width: 23px;
    height: 23px;
  }

  .profit-card p {
    font-size: 8px;
    line-height: 1.25;
  }

  .bottom-nav {
    padding-left: 2px;
    padding-right: 2px;
    padding-top: 0;
  }

  .nav-item {
    height: 37px;
    gap: 0;
    padding-top: 1px;
    font-size: 6px;
  }

  .nav-icon {
    width: 24px;
    height: 23px;
  }

  .nav-icon svg {
    width: 22px;
    height: 22px;
  }
}

/* Shop screen rebuilt from the phone reference. */
.game-screen.shop-mode {
  background:
    radial-gradient(circle at 10% 4%, rgba(255, 197, 78, .08), transparent 20%),
    linear-gradient(180deg, #071014 0%, #071114 50%, #030708 100%);
}

.shop-screen {
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  padding: calc(max(14px, env(safe-area-inset-top)) + 46px + clamp(19px, 5vw, 26px)) clamp(20px, 8.6vw, 34px) 8px;
}

.shop-header {
  gap: clamp(8px, 2.6vw, 12px);
  margin-bottom: clamp(13px, 3.5vw, 18px);
}

.shop-cart {
  width: clamp(30px, 9.5vw, 42px);
  height: clamp(30px, 9.5vw, 42px);
  flex-basis: clamp(30px, 9.5vw, 42px);
  align-self: flex-start;
}

.shop-cart svg {
  width: 88%;
  height: 88%;
}

.shop-header h1 {
  margin: 0 0 clamp(4px, 1.1vw, 7px);
  font-size: clamp(20px, 7.2vw, 29px);
  line-height: 1;
  font-weight: 500;
}

.shop-header p {
  font-size: clamp(7.5px, 2.55vw, 11px);
  line-height: 1.3;
}

.shop-list {
  gap: clamp(7px, 2.2vw, 10px);
}

.shop-card {
  height: clamp(78px, 20.5vw, 88px);
  min-height: 0;
  grid-template-columns: clamp(58px, 19.5vw, 78px) minmax(0, 1fr) clamp(52px, 15.8vw, 64px);
  gap: clamp(7px, 2vw, 10px);
  padding: clamp(5px, 1.5vw, 7px);
  border-radius: 8px;
  border-color: rgba(176, 151, 89, .45);
  background:
    linear-gradient(90deg, rgba(226, 157, 45, .08), transparent 34%),
    linear-gradient(180deg, rgba(18, 29, 31, .94), rgba(9, 17, 20, .93));
}

.shop-thumb {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  background-image: url("assets/shop-items-sharp.png");
  background-repeat: no-repeat;
  background-size: 230% 230%;
  box-shadow: none;
}

.shop-thumb-one {
  background-position: 6% 9%;
}

.shop-thumb-five {
  background-position: 96% 9%;
}

.shop-thumb-ten {
  background-position: 6% 96%;
}

.shop-thumb-tower {
  background-position: 94% 94%;
}

.shop-info {
  align-self: stretch;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: clamp(2px, .7vw, 4px);
}

.shop-info h2 {
  margin: 0;
  font-size: clamp(10px, 3.45vw, 14px);
  line-height: 1.15;
  font-weight: 500;
}

.shop-info p {
  margin: 0;
  font-size: clamp(7px, 2.3vw, 9px);
  line-height: 1.25;
}

.shop-meta {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.8vw, 9px);
  min-width: 0;
}

.shop-income {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0;
  font-size: clamp(13px, 4.45vw, 17px);
  line-height: 1.05;
  font-weight: 600;
}

.shop-income img {
  width: .78em;
  height: .78em;
}

.shop-divider {
  width: 1px;
  height: clamp(19px, 5.4vw, 25px);
  flex: 0 0 1px;
  background: rgba(255, 200, 91, .32);
}

.shop-price-line {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: clamp(4px, 1.2vw, 6px);
  color: rgba(226, 226, 215, .68);
  font-size: clamp(8px, 2.4vw, 10px);
  line-height: 1;
  white-space: nowrap;
}

.shop-purchase {
  align-self: stretch;
  justify-self: end;
  display: grid;
  place-items: center end;
  justify-content: center;
}

.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff4df;
  font-size: clamp(12px, 3.85vw, 15px);
  line-height: 1;
  font-weight: 600;
}

.shop-price .inline-gram {
  width: .92em;
  height: .92em;
}

.shop-buy {
  align-self: auto;
  justify-self: end;
  width: clamp(54px, 18vw, 72px);
  height: clamp(28px, 8.8vw, 35px);
  margin-bottom: 0;
  border-radius: 7px;
  font-size: clamp(8px, 2.75vw, 11px);
  font-weight: 600;
}

@media (max-width: 330px) {
  :root {
    --nav-h: 48px;
  }

  .shop-list {
    gap: 6px;
  }

  .shop-card {
    height: 76px;
  }

  .nav-item {
    height: 42px;
    font-size: 7px;
  }

  .nav-icon {
    width: 25px;
    height: 24px;
  }

  .nav-icon svg {
    width: 23px;
    height: 23px;
  }
}

@media (max-width: 240px) {
  .shop-screen {
    padding: calc(max(8px, env(safe-area-inset-top)) + 47px) 7px 6px;
  }

  .shop-header {
    margin-bottom: 13px;
  }

  .shop-card {
    height: 68px;
    grid-template-columns: 58px minmax(0, 1fr) 49px;
    gap: 6px;
    padding: 4px;
  }

  .shop-info h2 {
    font-size: 8.5px;
  }

  .shop-info p {
    font-size: 6px;
  }

  .shop-income {
    margin-bottom: 3px;
    font-size: 10.5px;
  }

  .shop-price {
    font-size: 8.5px;
  }

  .shop-purchase {
    gap: 5px;
  }

  .shop-buy {
    width: 48px;
    height: 24px;
    margin-bottom: 0;
    font-size: 6.6px;
  }
}

/* Shop spacing refinement: wider and thicker cards, closer to the reference. */
.shop-screen {
  padding-left: clamp(8px, 3.4vw, 14px);
  padding-right: clamp(8px, 3.4vw, 14px);
}

.shop-card {
  height: clamp(92px, 26vw, 112px);
  grid-template-columns: clamp(72px, 24vw, 96px) minmax(0, 1fr) clamp(58px, 16vw, 72px);
}

.shop-list {
  gap: clamp(8px, 2.4vw, 11px);
}

@media (max-width: 330px) {
  .shop-screen {
    padding-left: 10px;
    padding-right: 10px;
  }

  .shop-card {
    height: 88px;
    grid-template-columns: 72px minmax(0, 1fr) 54px;
  }

  .shop-thumb {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 240px) {
  .shop-screen {
    padding-left: 7px;
    padding-right: 7px;
  }

  .shop-card {
    height: 78px;
    grid-template-columns: 64px minmax(0, 1fr) 48px;
  }

  .shop-meta {
    gap: 4px;
  }

  .shop-divider {
    height: 16px;
  }

  .shop-price-line {
    gap: 3px;
    font-size: 6px;
  }
}

/* Tasks screen. */
.game-screen.tasks-mode {
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 197, 78, .07), transparent 21%),
    radial-gradient(circle at 82% 14%, rgba(62, 171, 245, .06), transparent 24%),
    linear-gradient(180deg, #071014 0%, #071114 48%, #030708 100%);
}

.game-screen.tasks-mode::before {
  background:
    linear-gradient(180deg, rgba(4, 10, 12, .12), rgba(3, 7, 8, .92)),
    radial-gradient(ellipse at 50% 48%, rgba(42, 132, 190, .06), transparent 62%);
}

.game-screen.tasks-mode::after {
  height: 22%;
}

.tasks-screen {
  position: absolute;
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 2;
  padding: calc(max(14px, env(safe-area-inset-top)) + 46px + clamp(19px, 5vw, 26px)) clamp(8px, 3.4vw, 14px) 8px;
  overflow: auto;
  scrollbar-width: none;
}

.tasks-screen::-webkit-scrollbar {
  display: none;
}

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

.tasks-header {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2.6vw, 12px);
  margin-bottom: clamp(14px, 3.8vw, 18px);
}

.tasks-title-icon {
  width: clamp(30px, 9.5vw, 42px);
  height: clamp(30px, 9.5vw, 42px);
  flex: 0 0 clamp(30px, 9.5vw, 42px);
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(255, 202, 90, .28));
}

.tasks-title-icon svg {
  width: 88%;
  height: 88%;
  fill: currentColor;
}

.tasks-title-icon svg path:not(:first-child) {
  fill: none;
  stroke: #5e3b0b;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tasks-header h1 {
  margin: 0 0 clamp(4px, 1.1vw, 7px);
  color: #fff8e9;
  font-size: clamp(20px, 7.2vw, 29px);
  line-height: 1;
  font-weight: 500;
}

.tasks-header p {
  margin: 0;
  color: rgba(226, 229, 224, .72);
  font-size: clamp(8px, 2.7vw, 11px);
  line-height: 1.3;
}

.tasks-list {
  display: grid;
  gap: clamp(7px, 2.3vw, 10px);
}

.task-card {
  min-height: clamp(64px, 19vw, 78px);
  display: grid;
  grid-template-columns: clamp(46px, 14.5vw, 58px) minmax(0, 1fr) clamp(56px, 16.5vw, 68px);
  align-items: center;
  gap: clamp(8px, 2.5vw, 11px);
  padding: clamp(6px, 1.8vw, 8px);
  border: 1px solid rgba(105, 131, 134, .32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 30, 34, .92), rgba(8, 17, 21, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 22px rgba(0, 0, 0, .22);
}

.task-icon {
  width: clamp(42px, 13.2vw, 52px);
  height: clamp(42px, 13.2vw, 52px);
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 8px 15px rgba(0, 0, 0, .25);
}

.task-icon svg {
  width: 68%;
  height: 68%;
}

.task-icon-telegram {
  background: linear-gradient(145deg, #42b9ff, #1d7dec);
}

.task-icon-telegram svg path:first-child {
  fill: #fff;
}

.task-icon-telegram svg path:last-child {
  fill: #c9ecff;
  opacity: .9;
}

.task-icon-megaphone,
.task-icon-users,
.task-icon-official {
  color: var(--gold);
  background: linear-gradient(145deg, #263a39, #132023);
}

.task-icon-news {
  color: #91bde0;
  background: linear-gradient(145deg, #243d50, #14212d);
}

.task-icon-megaphone svg,
.task-icon-users svg,
.task-icon-news svg,
.task-icon-official svg {
  fill: currentColor;
}

.task-icon-megaphone svg path:last-child,
.task-icon-news svg path:not(:first-child),
.task-icon-official svg path:last-child {
  fill: none;
  stroke: #f8f1db;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-info {
  min-width: 0;
}

.task-info h2 {
  margin: 0 0 4px;
  overflow: hidden;
  color: #fff8e9;
  font-size: clamp(11px, 3.4vw, 14px);
  line-height: 1.08;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-info p {
  margin: 0 0 4px;
  color: rgba(230, 228, 219, .7);
  font-size: clamp(8px, 2.45vw, 10px);
  line-height: 1.1;
}

.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ffc65f;
  font-size: clamp(12px, 3.7vw, 15px);
  line-height: 1;
  font-weight: 600;
}

.reward-coin {
  width: .88em;
  height: .88em;
  display: inline-block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff4a8 0 15%, transparent 16%),
    linear-gradient(145deg, #ffe17e, #f3b33c 48%, #a86616);
  box-shadow: inset 0 0 0 1px rgba(94, 52, 6, .45), 0 0 7px rgba(255, 196, 75, .3);
}

.task-reward .inline-gram {
  width: .85em;
  height: .85em;
}

.task-action {
  justify-self: end;
  width: clamp(54px, 17vw, 68px);
  height: clamp(28px, 8.8vw, 34px);
  border-radius: 6px;
  border: 1px solid rgba(255, 196, 84, .43);
  color: #ffd37a;
  background: linear-gradient(180deg, rgba(255, 186, 66, .12), rgba(255, 169, 41, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  font-size: clamp(8px, 2.65vw, 10px);
  font-weight: 500;
  cursor: pointer;
}

.task-action:active {
  transform: translateY(1px);
  filter: brightness(.96);
}

.task-card.is-complete {
  border-color: rgba(65, 222, 143, .38);
}

.task-card.is-complete .task-action {
  color: rgba(224, 236, 229, .72);
  border-color: rgba(92, 122, 120, .26);
  background: linear-gradient(180deg, rgba(38, 55, 55, .72), rgba(18, 31, 33, .72));
  cursor: default;
}

@media (max-width: 330px) {
  .tasks-screen {
    padding: calc(max(14px, env(safe-area-inset-top)) + 46px + clamp(19px, 5vw, 26px)) 7px 6px;
  }

  .tasks-header {
    margin-bottom: 11px;
  }

  .task-card {
    min-height: 57px;
    grid-template-columns: 41px minmax(0, 1fr) 49px;
    gap: 6px;
    padding: 5px;
    border-radius: 6px;
  }

  .task-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }

  .task-info h2 {
    margin-bottom: 2px;
    font-size: 8.5px;
  }

  .task-info p {
    margin-bottom: 2px;
    font-size: 6.4px;
  }

  .task-reward {
    font-size: 10px;
  }

  .task-action {
    width: 46px;
    height: 24px;
    border-radius: 5px;
    font-size: 6.8px;
  }
}

@media (max-width: 240px) {
  .tasks-screen {
    padding: calc(max(8px, env(safe-area-inset-top)) + 47px) 6px 12px;
  }

  .tasks-header {
    gap: 7px;
    margin-bottom: 9px;
  }

  .tasks-title-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .tasks-title-icon svg {
    width: 26px;
    height: 26px;
  }

  .tasks-header h1 {
    margin-bottom: 4px;
    font-size: 17px;
  }

  .tasks-header p {
    font-size: 7.4px;
    line-height: 1.22;
  }

  .tasks-list {
    gap: 5px;
  }

  .task-card {
    min-height: 48px;
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    gap: 5px;
    padding: 4px;
  }

  .task-icon {
    width: 34px;
    height: 34px;
  }

  .task-info h2 {
    margin-bottom: 2px;
    font-size: 7.8px;
  }

  .task-info p {
    margin-bottom: 2px;
    font-size: 5.7px;
  }

  .task-reward {
    font-size: 9px;
  }

  .task-action {
    width: 42px;
    height: 21px;
    font-size: 6px;
  }
}

/* Friends screen. */
.game-screen.friends-mode {
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 197, 78, .08), transparent 20%),
    linear-gradient(180deg, #071014 0%, #071114 48%, #030708 100%);
}

.game-screen.friends-mode::before {
  background:
    linear-gradient(180deg, rgba(4, 10, 12, .12), rgba(3, 7, 8, .92)),
    radial-gradient(ellipse at 50% 48%, rgba(255, 183, 63, .06), transparent 62%);
}

.game-screen.friends-mode::after {
  height: 22%;
}

.game-screen.friends-mode > .hud {
  display: none;
}

.game-screen.friends-mode .friends-screen {
  padding-top: max(14px, env(safe-area-inset-top));
}

.friends-screen {
  position: absolute;
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 2;
  padding: max(14px, env(safe-area-inset-top)) clamp(7px, 3.2vw, 13px) 8px;
  overflow: auto;
  scrollbar-width: none;
}

.friends-screen::-webkit-scrollbar {
  display: none;
}

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

.friends-local-hud {
  padding: 0 0 clamp(19px, 5vw, 26px);
}

.friends-header {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2.6vw, 12px);
  margin-bottom: clamp(11px, 3.2vw, 16px);
}

.friends-title-icon {
  width: clamp(30px, 9.5vw, 42px);
  height: clamp(30px, 9.5vw, 42px);
  flex: 0 0 clamp(30px, 9.5vw, 42px);
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(255, 202, 90, .28));
}

.friends-title-icon svg {
  width: 88%;
  height: 88%;
  fill: currentColor;
}

.friends-header h1 {
  margin: 0 0 clamp(4px, 1.1vw, 7px);
  color: #fff8e9;
  font-size: clamp(20px, 7vw, 28px);
  line-height: 1;
  font-weight: 500;
}

.friends-header p {
  margin: 0;
  color: rgba(226, 229, 224, .72);
  font-size: clamp(8px, 2.55vw, 10.5px);
  line-height: 1.32;
}

.friend-bonus-card {
  position: relative;
  min-height: clamp(94px, 26.5vw, 118px);
  display: grid;
  grid-template-columns: clamp(74px, 21vw, 94px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 4.7vw, 22px);
  overflow: hidden;
  margin: 0 0 clamp(10px, 3vw, 14px);
  padding: clamp(13px, 3.8vw, 17px) clamp(16px, 4.5vw, 20px);
  border: 2px solid rgba(255, 183, 69, .92);
  border-radius: clamp(15px, 4.2vw, 20px);
  background:
    linear-gradient(90deg, rgba(5, 13, 16, .96) 0%, rgba(5, 13, 16, .9) 34%, rgba(6, 12, 13, .52) 52%, rgba(8, 11, 10, .18) 73%, rgba(5, 10, 12, .72) 100%),
    url("assets/friends-bonus-bg.png") right 49% / auto 132% no-repeat;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, .34),
    0 0 28px rgba(255, 172, 53, .08),
    inset 0 1px 0 rgba(255, 234, 180, .16);
}

.friend-bonus-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 77% 54%, rgba(255, 187, 73, .2), transparent 18%),
    radial-gradient(ellipse at 17% 53%, rgba(255, 204, 89, .16), transparent 28%),
    linear-gradient(90deg, rgba(1, 7, 10, .08) 0%, transparent 45%, rgba(255, 159, 37, .08) 100%);
  pointer-events: none;
}

.bonus-gift {
  position: relative;
  z-index: 1;
  width: clamp(68px, 19.5vw, 86px);
  height: clamp(68px, 19.5vw, 86px);
  display: grid;
  place-items: center;
  border: 2px solid rgba(226, 151, 48, .72);
  border-radius: clamp(17px, 5vw, 24px);
  background: radial-gradient(circle at 50% 48%, rgba(255, 204, 89, .16), rgba(8, 15, 16, .74) 60%, rgba(6, 12, 14, .86) 100%);
  box-shadow:
    0 0 22px rgba(255, 182, 54, .1),
    inset 0 1px 0 rgba(255, 229, 160, .08);
}

.bonus-gift img {
  width: 63%;
  height: 63%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 202, 70, .54));
}

.friend-bonus-card > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: clamp(168px, 48vw, 210px);
}

.friend-bonus-card p,
.friend-bonus-card span {
  margin: 0;
  color: rgba(225, 228, 225, .8);
  font-size: clamp(15px, 4vw, 20px);
  line-height: 1.08;
}

.friend-bonus-card p {
  color: rgba(235, 238, 236, .88);
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 500;
  letter-spacing: 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, .56);
}

.friend-bonus-card strong {
  display: block;
  margin: clamp(7px, 1.9vw, 9px) 0 clamp(7px, 1.9vw, 9px);
  color: #ffc24f;
  font-size: clamp(46px, 13vw, 64px);
  line-height: 1;
  font-weight: 600;
  text-shadow: 0 0 18px rgba(255, 189, 47, .34), 0 4px 11px rgba(0, 0, 0, .5);
}

.friend-bonus-card span {
  color: rgba(221, 225, 224, .78);
}

.ref-section {
  margin-bottom: clamp(8px, 2.7vw, 12px);
}

.ref-section p {
  margin: 0 0 4px;
  color: rgba(232, 230, 219, .72);
  font-size: clamp(8px, 2.45vw, 10px);
}

.ref-link-row {
  height: clamp(32px, 9.6vw, 40px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: clamp(8px, 2.8vw, 11px);
  border: 1px solid rgba(95, 122, 127, .28);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(13, 24, 29, .9), rgba(7, 15, 19, .86));
}

.ref-link-row span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: rgba(211, 218, 216, .68);
  font-size: clamp(8px, 2.45vw, 10px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button {
  width: clamp(31px, 9.5vw, 39px);
  height: 100%;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(118, 141, 144, .22);
  background: rgba(255, 255, 255, .02);
  color: rgba(217, 226, 225, .72);
  cursor: pointer;
}

.copy-button svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invite-button {
  width: 100%;
  height: clamp(34px, 10.5vw, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: clamp(9px, 2.8vw, 12px);
  border-radius: 7px;
  color: #171006;
  background: linear-gradient(180deg, #ffe29a 0%, #ffc25b 43%, #f2a83a 100%);
  box-shadow: 0 9px 20px rgba(246, 174, 56, .2), inset 0 1px 0 rgba(255, 255, 255, .56);
  font-size: clamp(10px, 3.2vw, 13px);
  font-weight: 600;
  cursor: pointer;
}

.invite-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.friend-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(7px, 2.4vw, 10px);
  margin-bottom: clamp(12px, 3.6vw, 16px);
}

.friend-stat {
  min-height: clamp(50px, 15vw, 64px);
  display: grid;
  grid-template-columns: clamp(27px, 8.8vw, 36px) minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  padding: clamp(7px, 2.4vw, 10px);
  border: 1px solid rgba(103, 128, 130, .3);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 29, 33, .92), rgba(8, 17, 21, .86));
}

.stat-icon {
  grid-row: span 2;
  width: clamp(27px, 8.8vw, 36px);
  height: clamp(27px, 8.8vw, 36px);
  display: grid;
  place-items: center;
  color: var(--gold);
}

.stat-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coin-stat,
.mini-coin {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff4a8 0 15%, transparent 16%),
    linear-gradient(145deg, #ffe17e, #f3b33c 48%, #a86616);
  box-shadow: inset 0 0 0 1px rgba(94, 52, 6, .45), 0 0 7px rgba(255, 196, 75, .3);
}

.coin-stat {
  background: transparent;
  box-shadow: none;
}

.coin-stat img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(58, 174, 255, .35));
}

.friend-stat p {
  margin: 0 0 3px;
  color: rgba(226, 229, 224, .68);
  font-size: clamp(7px, 2.25vw, 9px);
  line-height: 1.12;
}

.friend-stat strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff8e9;
  font-size: clamp(12px, 3.8vw, 16px);
  line-height: 1;
  font-weight: 500;
}

.friend-stat strong .inline-gram {
  width: .78em;
  height: .78em;
}

.friends-list-section {
  color: #fff8e9;
}

.friends-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(7px, 2.2vw, 10px);
}

.friends-list-head h2 {
  margin: 0;
  font-size: clamp(11px, 3.4vw, 14px);
  font-weight: 500;
}

.friends-list-head button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  color: rgba(213, 218, 215, .62);
  font-size: clamp(7px, 2.25vw, 9px);
  cursor: pointer;
}

.friends-list-head button::after {
  content: "›";
  color: rgba(213, 218, 215, .7);
  font-size: 1.25em;
}

.friends-list {
  display: grid;
  gap: clamp(7px, 2.1vw, 9px);
}

.friend-row {
  display: grid;
  grid-template-columns: clamp(30px, 9.5vw, 38px) minmax(0, 1fr) max-content;
  align-items: center;
  gap: clamp(7px, 2.3vw, 10px);
}

.friend-avatar {
  width: clamp(30px, 9.5vw, 38px);
  height: clamp(30px, 9.5vw, 38px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: clamp(12px, 3.8vw, 16px);
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 12px rgba(0, 0, 0, .22);
}

.friend-avatar-blue {
  background: linear-gradient(145deg, #9ccbe2, #476a79);
}

.friend-avatar-red {
  background: linear-gradient(145deg, #f0a394, #91433d);
}

.friend-avatar-gray {
  background: linear-gradient(145deg, #a2adb0, #4c585b);
}

.friend-row h3 {
  margin: 0 0 2px;
  color: #f6f1e8;
  font-size: clamp(10px, 3.2vw, 13px);
  font-weight: 500;
}

.friend-row p {
  margin: 0;
  color: rgba(216, 220, 216, .56);
  font-size: clamp(7px, 2.25vw, 9px);
}

.friend-row strong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ffc65f;
  font-size: clamp(10px, 3.15vw, 13px);
  font-weight: 600;
}

.friend-row .inline-gram {
  width: .78em;
  height: .78em;
}

/* Wallet screen. */
.game-screen.wallet-mode {
  background:
    radial-gradient(circle at 14% 5%, rgba(255, 197, 78, .08), transparent 20%),
    radial-gradient(circle at 82% 13%, rgba(62, 171, 245, .05), transparent 24%),
    linear-gradient(180deg, #071014 0%, #071114 48%, #030708 100%);
}

.game-screen.wallet-mode::before {
  background:
    linear-gradient(180deg, rgba(4, 10, 12, .12), rgba(3, 7, 8, .92)),
    radial-gradient(ellipse at 50% 48%, rgba(255, 183, 63, .06), transparent 62%);
}

.game-screen.wallet-mode::after {
  height: 22%;
}

.game-screen.admin-mode {
  background:
    radial-gradient(circle at 11% 4%, rgba(255, 197, 78, .08), transparent 21%),
    radial-gradient(circle at 82% 13%, rgba(62, 171, 245, .06), transparent 24%),
    linear-gradient(180deg, #071014 0%, #071114 48%, #030708 100%);
}

.game-screen.admin-mode::before {
  background:
    linear-gradient(180deg, rgba(4, 10, 12, .12), rgba(3, 7, 8, .92)),
    radial-gradient(ellipse at 50% 48%, rgba(244, 166, 52, .06), transparent 62%);
}

.game-screen.admin-mode::after {
  height: 22%;
}

.game-screen.wallet-mode > .hud {
  display: none;
}

.wallet-screen {
  position: absolute;
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 2;
  padding: calc(max(14px, env(safe-area-inset-top)) + 12px) clamp(8px, 3vw, 12px) 8px;
  overflow: auto;
  scrollbar-width: none;
}

.wallet-screen::-webkit-scrollbar {
  display: none;
}

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

.wallet-header {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2.4vw, 10px);
  margin-bottom: clamp(10px, 2.8vw, 13px);
}

.wallet-title-icon {
  width: clamp(30px, 9.5vw, 42px);
  height: clamp(30px, 9.5vw, 42px);
  flex: 0 0 clamp(30px, 9.5vw, 42px);
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(255, 202, 90, .28));
}

.wallet-title-icon svg {
  width: 88%;
  height: 88%;
  fill: currentColor;
}

.wallet-title-icon svg path:not(:first-child) {
  fill: none;
  stroke: #4d3210;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-header h1 {
  margin: 0 0 clamp(4px, 1.1vw, 7px);
  color: #fff8e9;
  font-size: clamp(20px, 7vw, 28px);
  line-height: 1;
  font-weight: 500;
}

.wallet-header p {
  margin: 0;
  color: rgba(226, 229, 224, .72);
  font-size: clamp(8px, 2.55vw, 10.5px);
  line-height: 1.32;
}

.wallet-balance-card {
  position: relative;
  min-height: clamp(116px, 31vw, 134px);
  display: grid;
  grid-template-columns: clamp(92px, 24.5vw, 108px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 3.6vw, 17px);
  overflow: hidden;
  margin-bottom: clamp(9px, 2.8vw, 12px);
  padding: clamp(11px, 3.1vw, 14px) clamp(15px, 4.2vw, 18px);
  border: 2px solid rgba(255, 184, 63, .9);
  border-radius: clamp(16px, 4.5vw, 21px);
  background:
    radial-gradient(ellipse at 13% 51%, rgba(255, 180, 45, .16), transparent 28%),
    linear-gradient(90deg, rgba(4, 11, 13, .98) 0%, rgba(6, 13, 15, .97) 38%, rgba(6, 13, 15, .82) 59%, rgba(18, 13, 9, .32) 78%, rgba(250, 148, 35, .16) 100%),
    url("assets/friends-bonus-bg.png") right 50% / auto 150% no-repeat;
  box-shadow:
    0 13px 26px rgba(0, 0, 0, .28),
    0 0 18px rgba(255, 166, 46, .08),
    inset 0 1px 0 rgba(255, 241, 180, .22),
    inset 0 -1px 0 rgba(255, 185, 57, .35);
}

.wallet-balance-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(255, 205, 87, .18), transparent 19%),
    linear-gradient(90deg, rgba(0, 7, 10, .06), rgba(0, 7, 10, .76) 43%, rgba(0, 7, 10, .28) 67%, rgba(255, 172, 47, .04));
  pointer-events: none;
}

.wallet-balance-card::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: calc(clamp(16px, 4.5vw, 21px) - 2px);
  border: 1px solid rgba(255, 231, 152, .17);
  pointer-events: none;
}

.wallet-oil-mark {
  position: relative;
  z-index: 1;
  width: clamp(84px, 22.5vw, 98px);
  height: clamp(84px, 22.5vw, 98px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 42%, rgba(255, 198, 64, .18), transparent 42%),
    radial-gradient(circle, rgba(13, 10, 6, .48), rgba(4, 8, 9, .3) 58%, transparent 70%);
  box-shadow:
    0 0 24px rgba(255, 178, 39, .16),
    inset 0 0 0 2px rgba(255, 211, 102, .72),
    inset 0 0 0 6px rgba(115, 70, 23, .24);
}

.wallet-oil-mark::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px solid rgba(255, 214, 111, .66);
  box-shadow: inset 0 0 24px rgba(255, 168, 43, .14);
}

.wallet-oil-mark img {
  position: relative;
  z-index: 1;
  width: 58%;
  height: 72%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 185, 45, .46));
}

.wallet-balance-info {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.wallet-balance-info p {
  margin: 0 0 clamp(9px, 2.5vw, 12px);
  color: rgba(255, 235, 199, .82);
  font-size: clamp(18px, 4.8vw, 24px);
  line-height: 1;
  font-weight: 500;
  text-shadow: 0 3px 10px rgba(0, 0, 0, .55);
}

.wallet-balance-info strong {
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.9vw, 10px);
  margin-bottom: clamp(10px, 2.8vw, 13px);
  color: #fff7e7;
  font-size: clamp(34px, 9.2vw, 48px);
  line-height: .9;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .58), 0 0 18px rgba(255, 236, 188, .14);
}

.wallet-balance-gram {
  width: .68em;
  height: .68em;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 12px rgba(59, 174, 255, .5));
}

.wallet-balance-info > span {
  display: block;
  color: rgba(230, 226, 210, .68);
  font-size: clamp(20px, 5.6vw, 28px);
  line-height: 1;
  font-weight: 500;
  text-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2.5vw, 10px);
  margin-bottom: clamp(7px, 2.3vw, 9px);
}

.wallet-action,
.wallet-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  font-size: clamp(9px, 2.9vw, 12px);
  font-weight: 600;
  cursor: pointer;
}

.wallet-action {
  height: clamp(34px, 9.8vw, 40px);
}

.wallet-action svg,
.wallet-connect svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-action-primary,
.wallet-connect {
  color: #171006;
  background: linear-gradient(180deg, #ffe39c 0%, #ffc35b 44%, #f1a638 100%);
  box-shadow: 0 9px 20px rgba(246, 174, 56, .2), inset 0 1px 0 rgba(255, 255, 255, .56);
}

.wallet-action-secondary {
  color: rgba(238, 244, 244, .88);
  background: linear-gradient(180deg, rgba(38, 51, 60, .96), rgba(24, 34, 42, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 8px 17px rgba(0, 0, 0, .2);
}

.wallet-connect {
  width: 100%;
  height: clamp(34px, 9.8vw, 40px);
  margin-bottom: clamp(11px, 3.1vw, 14px);
}

.wallet-connect.is-connected {
  color: rgba(238, 244, 244, .9);
  background: linear-gradient(180deg, rgba(34, 48, 56, .96), rgba(18, 29, 36, .96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 18px rgba(0, 0, 0, .22);
}

.wallet-connect.is-connected svg {
  color: #4fe29a;
}

.wallet-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: clamp(7px, 2.2vw, 10px);
}

.wallet-history-head h2 {
  margin: 0;
  color: #fff8e9;
  font-size: clamp(11px, 3.4vw, 14px);
  line-height: 1;
  font-weight: 500;
}

.wallet-history-head button {
  height: clamp(24px, 7.2vw, 30px);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid rgba(100, 124, 128, .26);
  border-radius: 7px;
  color: rgba(229, 236, 235, .78);
  background: linear-gradient(180deg, rgba(15, 29, 33, .88), rgba(8, 17, 21, .82));
  font-size: clamp(8px, 2.45vw, 10px);
  cursor: pointer;
}

.wallet-history-head button::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.wallet-history-list {
  display: grid;
  gap: clamp(7px, 2.1vw, 9px);
}

.wallet-operation {
  min-height: clamp(42px, 11.4vw, 48px);
  display: grid;
  grid-template-columns: clamp(32px, 10vw, 40px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(7px, 2.3vw, 10px);
  padding: 0 clamp(2px, .8vw, 4px);
}

.operation-icon {
  width: clamp(32px, 10vw, 40px);
  height: clamp(32px, 10vw, 40px);
  display: grid;
  place-items: center;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 7px 14px rgba(0, 0, 0, .18);
}

.operation-icon svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.operation-buy {
  color: #ff514d;
  background: rgba(109, 29, 29, .42);
}

.operation-income,
.operation-ref,
.operation-topup {
  color: #3fe38e;
  background: rgba(24, 95, 65, .38);
}

.operation-withdraw {
  color: #ff5953;
  background: rgba(103, 32, 34, .42);
}

.wallet-operation h3 {
  margin: 0 0 3px;
  overflow: hidden;
  color: #f5f0e6;
  font-size: clamp(9px, 2.95vw, 12px);
  line-height: 1.08;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wallet-operation p {
  margin: 0;
  color: rgba(216, 220, 216, .56);
  font-size: clamp(7px, 2.2vw, 9px);
  line-height: 1.05;
}

.wallet-operation strong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: clamp(9px, 2.95vw, 12px);
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.wallet-operation strong .inline-gram {
  width: .82em;
  height: .82em;
}

.wallet-empty {
  margin: 8px 2px 0;
  padding: 14px 12px;
  border: 1px solid rgba(100, 124, 128, .24);
  border-radius: 8px;
  color: rgba(226, 230, 226, .68);
  background: linear-gradient(180deg, rgba(12, 23, 27, .78), rgba(7, 15, 18, .72));
  font-size: clamp(10px, 3vw, 12px);
  line-height: 1.2;
  text-align: center;
}

/* Admin screen. */
.admin-screen {
  position: absolute;
  inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  z-index: 2;
  padding: calc(max(14px, env(safe-area-inset-top)) + 46px + clamp(22px, 6vw, 30px)) clamp(8px, 3.4vw, 14px) 10px;
  overflow: auto;
  scrollbar-width: none;
}

.admin-screen::-webkit-scrollbar {
  display: none;
}

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

.admin-header {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2.6vw, 12px);
  margin-bottom: clamp(14px, 3.8vw, 18px);
}

.admin-title-icon {
  width: clamp(30px, 9.5vw, 42px);
  height: clamp(30px, 9.5vw, 42px);
  flex: 0 0 clamp(30px, 9.5vw, 42px);
  display: grid;
  place-items: center;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(255, 202, 90, .28));
}

.admin-title-icon svg {
  width: 88%;
  height: 88%;
  fill: currentColor;
}

.admin-title-icon svg path:last-child {
  fill: none;
  stroke: #5e3b0b;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-header h1,
.admin-task-form h2,
.admin-task-list-section h2 {
  margin: 0;
  color: #fff8e9;
  font-weight: 500;
  line-height: 1.08;
}

.admin-header h1 {
  margin-bottom: 5px;
  font-size: clamp(20px, 7.2vw, 29px);
}

.admin-header p {
  margin: 0;
  color: rgba(226, 229, 224, .72);
  font-size: clamp(8px, 2.7vw, 11px);
  line-height: 1.3;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-stats article,
.admin-task-form,
.admin-task-list article {
  border: 1px solid rgba(105, 131, 134, .32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 30, 34, .92), rgba(8, 17, 21, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 22px rgba(0, 0, 0, .22);
}

.admin-stats article {
  display: grid;
  gap: 6px;
  padding: 11px 10px;
}

.admin-stats span,
.admin-task-form label span,
.admin-task-list article span {
  color: rgba(226, 230, 226, .62);
  font-size: 10px;
  line-height: 1.2;
}

.admin-stats strong {
  color: #fff7e5;
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
}

.admin-task-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  margin-bottom: 12px;
}

.admin-task-form h2,
.admin-task-list-section h2 {
  font-size: 15px;
}

.admin-task-form label {
  display: grid;
  gap: 6px;
}

.admin-task-form button {
  margin-top: 3px;
}

.admin-task-list-section {
  display: grid;
  gap: 8px;
}

.admin-task-list {
  display: grid;
  gap: 8px;
}

.admin-task-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 10px;
}

.admin-task-list strong {
  color: #fff8e9;
  font-size: 13px;
  font-weight: 500;
}

.admin-task-list em {
  color: #ffc65f;
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
}

.operation-positive {
  color: #45e493;
}

.operation-negative {
  color: #ff5350;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 30;
  width: min(calc(100% - 32px), 340px);
  padding: 11px 13px;
  border: 1px solid rgba(255, 196, 84, .42);
  border-radius: 8px;
  color: #fff4dc;
  background: linear-gradient(180deg, rgba(20, 31, 34, .98), rgba(8, 16, 19, .98));
  box-shadow: 0 14px 32px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px 12px calc(env(safe-area-inset-bottom) + 18px);
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  pointer-events: auto;
  transition: opacity .18s ease;
}

.app-modal-backdrop.is-open {
  opacity: 1;
}

.app-modal {
  width: min(100%, 390px);
  overflow: hidden;
  border: 1px solid rgba(255, 201, 83, .5);
  border-radius: 12px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 194, 86, .13), transparent 34%),
    linear-gradient(180deg, rgba(17, 30, 34, .98), rgba(7, 15, 18, .98));
  box-shadow: 0 24px 55px rgba(0, 0, 0, .58), inset 0 1px 0 rgba(255, 255, 255, .08);
  transform: translateY(12px);
  transition: transform .18s ease;
}

.app-modal-backdrop.is-open .app-modal {
  transform: translateY(0);
}

.app-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 15px 8px;
}

.app-modal-header h2 {
  margin: 0 0 4px;
  color: #fff7e5;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 500;
}

.app-modal-header p {
  margin: 0;
  color: rgba(226, 230, 226, .68);
  font-size: 11px;
  line-height: 1.28;
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(240, 245, 241, .8);
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.modal-form {
  display: grid;
  gap: 12px;
  padding: 8px 15px 15px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: rgba(230, 230, 222, .72);
  font-size: 11px;
}

.modal-form input,
.modal-form select,
.admin-task-form input,
.admin-task-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(105, 131, 134, .32);
  border-radius: 8px;
  outline: none;
  color: #fff8e9;
  background: linear-gradient(180deg, rgba(13, 24, 28, .98), rgba(6, 14, 17, .96));
  font: inherit;
  font-size: 13px;
}

.modal-form input:focus,
.modal-form select:focus,
.admin-task-form input:focus,
.admin-task-form select:focus {
  border-color: rgba(255, 203, 92, .72);
  box-shadow: 0 0 0 3px rgba(255, 197, 78, .1);
}

.modal-primary,
.language-options button,
.admin-task-form button {
  min-height: 44px;
  border-radius: 9px;
  color: #170f05;
  background: linear-gradient(180deg, #ffe39e 0%, #ffc55f 44%, #f4a93b 100%);
  box-shadow: 0 11px 23px rgba(246, 174, 56, .23), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(145, 76, 4, .14);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-note {
  margin: 0;
  color: rgba(226, 230, 226, .6);
  font-size: 10px;
  line-height: 1.35;
}

.language-card {
  padding: 16px;
}

.language-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.language-options button {
  min-height: 48px;
}

.task-action.is-claim {
  color: #160f05;
  border-color: rgba(255, 218, 122, .62);
  background: linear-gradient(180deg, #ffe39c, #f6b241);
}

.task-action:disabled {
  opacity: .72;
}

.shop-buy.is-owned {
  color: rgba(238, 238, 231, .68);
}

/* Home state for players who already own barrels. */
.barrels-dashboard {
  display: none;
}

.game-screen.has-barrels:not(.shop-mode):not(.tasks-mode):not(.friends-mode):not(.wallet-mode) {
  background:
    radial-gradient(circle at 12% 5%, rgba(255, 197, 78, .08), transparent 19%),
    linear-gradient(180deg, #071014 0%, #071114 50%, #030708 100%);
}

.game-screen.has-barrels:not(.shop-mode):not(.tasks-mode):not(.friends-mode):not(.wallet-mode)::before {
  background:
    linear-gradient(180deg, rgba(3, 8, 10, .18), rgba(2, 5, 6, .92)),
    radial-gradient(ellipse at 50% 42%, rgba(244, 166, 52, .08), transparent 62%);
}

.game-screen.has-barrels .home-screen {
  position: absolute;
  inset: calc(max(14px, env(safe-area-inset-top)) + 58px) 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0;
  padding: 0 clamp(8px, 3.4vw, 14px) 10px;
  overflow: auto;
  scrollbar-width: none;
}

.game-screen.has-barrels .home-screen::-webkit-scrollbar {
  display: none;
}

.game-screen.has-barrels .hero-spacer,
.game-screen.has-barrels .empty-state,
.game-screen.has-barrels .profit-card {
  display: none;
}

.game-screen.has-barrels .barrels-dashboard {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.4vw, 11px);
  padding-top: clamp(10px, 3vw, 14px);
}

.owned-barrel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 201, 83, .62);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(6, 12, 14, .92), rgba(10, 22, 25, .9) 52%, rgba(5, 13, 16, .94)),
    radial-gradient(circle at 18% 42%, rgba(255, 185, 67, .14), transparent 45%);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.owned-barrel-image {
  position: relative;
  z-index: 1;
  display: block;
  border-radius: 6px;
  background-color: #091013;
  background-image: url("assets/shop-items-sharp.png");
  background-repeat: no-repeat;
  background-position: 6% 9%;
  background-size: 230% 230%;
  box-shadow: inset 0 0 0 1px rgba(255, 220, 137, .07);
}

.owned-barrel-image-five {
  background-position: 96% 9%;
}

.owned-barrel-image-ten {
  background-position: 6% 96%;
}

.owned-barrel-image-tower {
  background-position: 94% 94%;
}

.barrels-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.barrels-list-head h2 {
  margin: 0;
  color: #fff8ed;
  font-size: clamp(16px, 4.2vw, 18px);
  font-weight: 500;
  line-height: 1.1;
}

.barrels-list-head button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: rgba(226, 230, 226, .74);
  background: transparent;
  font-size: clamp(9px, 2.75vw, 11px);
  cursor: pointer;
}

.barrels-list-head svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.owned-barrels-list {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.4vw, 11px);
}

.owned-barrel-card {
  min-height: clamp(103px, 29vw, 118px);
  display: grid;
  grid-template-columns: clamp(82px, 24vw, 96px) minmax(0, 1fr) clamp(82px, 24vw, 95px);
  gap: clamp(8px, 2.3vw, 12px);
  align-items: center;
  padding: clamp(6px, 1.9vw, 8px);
}

.owned-barrel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 179, 56, .08), transparent 34%, rgba(66, 174, 255, .04));
  pointer-events: none;
}

.owned-barrel-image {
  z-index: 1;
  width: 100%;
  aspect-ratio: 1;
}

.owned-barrel-info,
.owned-barrel-side {
  position: relative;
  z-index: 1;
}

.owned-barrel-info {
  min-width: 0;
}

.owned-barrel-info h2 {
  margin: 0 0 5px;
  color: #fffaf0;
  font-size: clamp(15px, 4.1vw, 18px);
  font-weight: 500;
  line-height: 1.08;
}

.barrel-timer,
.next-income {
  margin: 0;
  display: flex;
  align-items: center;
  min-width: 0;
  color: rgba(225, 229, 225, .76);
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 1.2;
  white-space: nowrap;
}

.barrel-timer {
  gap: 5px;
  margin-bottom: 7px;
}

.barrel-timer svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: #ffd166;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.next-income {
  gap: 4px;
  margin-bottom: 7px;
}

.next-income strong {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #ffd76b;
  font-weight: 600;
}

.barrel-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(130, 151, 151, .25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}

.barrel-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd975, #f5a83d);
  box-shadow: 0 0 9px rgba(255, 188, 64, .3);
}

.owned-barrel-side {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.owned-barrel-side button {
  min-height: 38px;
  padding: 5px 7px;
  border-radius: 8px;
  color: rgba(245, 247, 244, .82);
  background: linear-gradient(180deg, rgba(42, 55, 65, .94), rgba(22, 34, 42, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 17px rgba(0, 0, 0, .26);
  font-size: clamp(8px, 2.35vw, 10px);
  line-height: 1.25;
  cursor: pointer;
}

.owned-barrel-side span {
  align-self: flex-end;
  color: rgba(226, 230, 226, .72);
  font-size: clamp(10px, 2.8vw, 12px);
}

.buy-more-barrels {
  height: clamp(49px, 13vw, 58px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
  border-radius: 9px;
  color: #170f05;
  background: linear-gradient(180deg, #ffe39e 0%, #ffc55f 44%, #f4a93b 100%);
  box-shadow: 0 11px 23px rgba(246, 174, 56, .23), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(145, 76, 4, .14);
  font-size: clamp(16px, 4.4vw, 20px);
  font-weight: 600;
  cursor: pointer;
}

.buy-more-barrels svg {
  width: clamp(24px, 6.4vw, 30px);
  height: clamp(24px, 6.4vw, 30px);
  fill: currentColor;
}

@media (max-height: 700px) {
  .game-screen.has-barrels .home-screen {
    top: calc(max(10px, env(safe-area-inset-top)) + 50px);
  }

  .owned-barrel-card {
    min-height: 100px;
  }
}

@media (max-width: 240px) {
  .game-screen.has-barrels .home-screen {
    top: calc(max(10px, env(safe-area-inset-top)) + 42px);
    padding: 0 5px 10px;
  }

  .game-screen.has-barrels .barrels-dashboard,
  .owned-barrels-list {
    gap: 6px;
  }

  .barrels-list-head h2 {
    font-size: 10px;
  }

  .barrels-list-head button {
    gap: 2px;
    font-size: 6px;
  }

  .barrels-list-head svg {
    width: 11px;
    height: 11px;
  }

  .owned-barrel-card {
    min-height: 74px;
    grid-template-columns: 56px minmax(0, 1fr) 54px;
    gap: 5px;
    padding: 5px;
    border-radius: 6px;
  }

  .owned-barrel-info h2 {
    margin-bottom: 3px;
    font-size: 9px;
  }

  .barrel-timer,
  .next-income {
    font-size: 6px;
  }

  .barrel-timer {
    gap: 3px;
    margin-bottom: 4px;
  }

  .barrel-timer svg {
    width: 8px;
    height: 8px;
    flex-basis: 8px;
  }

  .next-income {
    margin-bottom: 4px;
  }

  .barrel-progress {
    height: 4px;
  }

  .owned-barrel-side {
    gap: 4px;
  }

  .owned-barrel-side button {
    min-height: 24px;
    padding: 3px 4px;
    border-radius: 5px;
    font-size: 5.5px;
  }

  .owned-barrel-side span {
    font-size: 6px;
  }

  .buy-more-barrels {
    height: 30px;
    gap: 6px;
    border-radius: 6px;
    font-size: 10px;
  }

  .buy-more-barrels svg {
    width: 16px;
    height: 16px;
  }

  .wallet-screen {
    padding: calc(max(8px, env(safe-area-inset-top)) + 7px) 5px 10px;
  }

  .wallet-header {
    gap: 7px;
    margin-bottom: 7px;
  }

  .wallet-title-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .wallet-title-icon svg {
    width: 26px;
    height: 26px;
  }

  .wallet-header h1 {
    margin-bottom: 4px;
    font-size: 17px;
  }

  .wallet-header p {
    font-size: 7.2px;
  }

  .wallet-balance-card {
    min-height: 82px;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 6px;
    padding: 7px 8px;
    border-radius: 12px;
    background-size: auto 148%;
  }

  .wallet-oil-mark {
    width: 62px;
    height: 62px;
    flex-basis: 62px;
  }

  .wallet-balance-info p {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .wallet-balance-info strong {
    gap: 5px;
    margin-bottom: 6px;
    font-size: 25px;
  }

  .wallet-balance-info > span {
    font-size: 12px;
  }

  .wallet-actions {
    gap: 6px;
    margin-bottom: 6px;
  }

  .wallet-action,
  .wallet-connect {
    height: 28px;
    gap: 5px;
    font-size: 7.5px;
  }

  .wallet-action svg,
  .wallet-connect svg {
    width: 13px;
    height: 13px;
  }

  .wallet-connect {
    margin-bottom: 8px;
  }

  .wallet-history-head {
    margin-bottom: 5px;
  }

  .wallet-history-head h2 {
    font-size: 9px;
  }

  .wallet-history-head button {
    height: 22px;
    font-size: 7px;
  }

  .wallet-history-list {
    gap: 5px;
  }

  .wallet-operation {
    min-height: 34px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 6px;
  }

  .operation-icon {
    width: 28px;
    height: 28px;
  }

  .wallet-operation h3 {
    margin-bottom: 2px;
    font-size: 7.4px;
  }

  .wallet-operation p,
  .wallet-operation strong {
    font-size: 6.5px;
  }

  .friends-screen {
    padding: calc(max(10px, env(safe-area-inset-top)) + 40px) 5px 10px;
  }

  .game-screen.friends-mode .friends-screen {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .friends-local-hud {
    padding-bottom: 13px;
  }

  .friends-header {
    margin-bottom: 6px;
  }

  .friend-bonus-card {
    min-height: 72px;
    margin-bottom: 6px;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-radius: 11px;
    background-size: auto 132%;
    background-position: right 49%;
  }

  .bonus-gift {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 12px;
  }

  .friend-bonus-card strong {
    margin: 3px 0;
    font-size: 29px;
  }

  .friend-bonus-card p,
  .friend-bonus-card span {
    font-size: 10px;
  }

  .friend-bonus-card p {
    font-size: 12px;
  }

  .ref-section {
    margin-bottom: 6px;
  }

  .ref-section p {
    margin-bottom: 3px;
    font-size: 7px;
  }

  .ref-link-row {
    height: 27px;
  }

  .ref-link-row span {
    font-size: 7px;
  }

  .copy-button {
    width: 28px;
  }

  .invite-button {
    height: 29px;
    margin-bottom: 7px;
    font-size: 8px;
  }

  .invite-button svg {
    width: 14px;
    height: 14px;
  }

  .friend-stats {
    gap: 6px;
    margin-bottom: 8px;
  }

  .friend-stat {
    min-height: 43px;
    grid-template-columns: 25px minmax(0, 1fr);
    column-gap: 6px;
    padding: 6px;
  }

  .stat-icon {
    width: 25px;
    height: 25px;
  }

  .friend-stat p {
    font-size: 5.8px;
  }

  .friend-stat strong {
    font-size: 10px;
  }

  .friends-list-head {
    margin-bottom: 5px;
  }

  .friends-list-head h2 {
    font-size: 9px;
  }

  .friends-list-head button {
    font-size: 6px;
  }

  .friends-list {
    gap: 5px;
  }

  .friend-row {
    grid-template-columns: 25px minmax(0, 1fr) max-content;
    gap: 6px;
  }

  .friend-avatar {
    width: 25px;
    height: 25px;
    font-size: 10px;
  }

  .friend-row h3 {
    margin-bottom: 1px;
    font-size: 8px;
  }

  .friend-row p {
    font-size: 5.8px;
  }

  .friend-row strong {
    font-size: 8px;
  }
}
