:root {
  color-scheme: dark;
  --brand-gold: #ffd694;
  --ink: #f6f7ed;
  --muted: #b6b8a8;
  --accent: #dbfa38;
  --panel: #191a17;
  --line: #33362c;
  --glow: #dafa3955;
}
* { box-sizing: border-box; }
body { margin: 0; background: #090a09; color: var(--ink); font: 600 16px/1.4 Inter, system-ui, sans-serif; }
.shell {
  max-width: 540px; min-height: 100dvh; margin: auto; display: flex; flex-direction: column;
  background-color: #111210;
  background-image: radial-gradient(ellipse at 50% 25%, #2a302131, transparent 65%), repeating-linear-gradient(135deg, #ffffff04 0 1px, transparent 1px 20px);
  box-shadow: 0 0 60px #000b;
}
header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
header strong { letter-spacing: .08em; }
header i { color: var(--accent); font-style: normal; }
#energy, .pill {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid #426b83;
  border-radius: 24px; background: #142632; color: #99dcff; padding: 5px 11px; font-weight: 800;
}
.energy-can {
  display: inline-grid; place-items: center; width: 16px; height: 23px; border: 2px solid #9adaff;
  border-top: 3px solid #e1f4ff; border-radius: 5px; background: #216a99; color: #fff38a;
  transform: rotate(10deg); font-size: 13px; font-style: normal; line-height: 1;
}
main { flex: 1; padding: 21px 18px 25px; }
h1, h2, p { margin: 0 0 12px; }
h1 { font-size: clamp(27px, 7vw, 36px); letter-spacing: -.035em; font-weight: 900; }
h2 { font-size: 19px; font-weight: 800; }
small { color: var(--muted); }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: default; }
button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.card, .hero { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); padding: 16px; margin-bottom: 12px; }
.hero { text-align: center; padding: 19px 8px; background: radial-gradient(ellipse at 50% 45%, #252a15, #141612 72%); }
.coin {
  display: grid; place-items: center; width: min(49vw, 205px); aspect-ratio: 1; margin: 20px auto 17px; border-radius: 50%;
  border: 8px double #d7f646; background: radial-gradient(circle at 35% 25%, #f3ff83, #c4e32e 67%, #82951b);
  color: #283109; font-size: clamp(45px, 16vw, 88px); box-shadow: 0 8px 0 #74831c, 0 12px 28px #b5d92e45;
  touch-action: manipulation; user-select: none;
}
.coin:active:not(:disabled) { transform: translateY(4px); }
.coin:disabled { filter: saturate(.55); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row + .row { margin-top: 12px; }
.btn { padding: 9px 14px; background: var(--accent); color: #1a2105; border-radius: 11px; font-weight: 850; }
.btn:disabled { opacity: .5; }
.alt, select { background: #282b23; color: var(--ink); border: 1px solid #3e4333; border-radius: 11px; }
select { padding: 8px; }
.farm-progress { border-color: #606e26; background: linear-gradient(115deg, #262c14, #181b14 68%); }
#count { color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
progress { appearance: none; display: block; width: 100%; height: 11px; margin-top: 10px; border: 0; border-radius: 10px; overflow: hidden; background: #303527; }
progress::-webkit-progress-bar { background: #303527; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }
nav {
  position: sticky; z-index: 4; bottom: 0; background: #10110ff5; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 7px 4px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
}
nav button { padding: 6px 0; background: transparent; border-radius: 12px; color: var(--muted); font-size: 12px; }
nav button span { display: block; font-size: 21px; }
nav [aria-current=true] { background: #282f15; color: var(--accent); font-weight: 850; }
.spin-hero { padding: 8px 0 18px; text-align: center; }
.spin-hero h1 { margin: 13px 0; text-shadow: 0 0 20px var(--glow); }
.lights { display: flex; justify-content: center; gap: 12px; }
.lights b { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 2px var(--glow); }
.lights b:nth-child(odd) { opacity: .4; }
.wheel-wrap { position: relative; width: min(100%, 390px); margin: 32px auto 3px; aspect-ratio: 1; }
.wheel {
  position: absolute; inset: 0; border: 4px solid #393b34; border-radius: 50%;
  background: radial-gradient(circle, #252c1230, transparent 63%),
    conic-gradient(from -36deg, #414c1b 0 19.8%, #424638 0 20%, #382542 0 39.8%, #424638 0 40%, #232421 0 59.8%, #424638 0 60%, #181b18 0 79.8%, #424638 0 80%, #272822 0 99.8%, #424638 0);
  box-shadow: 0 0 0 3px #10110e, 0 12px 40px #0008, inset 0 0 0 6px #11120f;
  transition: transform 850ms cubic-bezier(.15,.65,.3,1);
}
.wheel span { position: absolute; inset: 9% 0; text-align: center; font-size: clamp(24px, 7vw, 43px); transform: rotate(var(--angle)); }
.wheel span b { display: inline-block; transform: rotate(calc(-1 * var(--angle))); filter: drop-shadow(0 4px 4px #0009); }
.pointer {
  position: absolute; left: 50%; top: -10px; z-index: 2; transform: translateX(-50%); width: 0; height: 0;
  border: 13px solid transparent; border-top: 21px solid var(--accent); filter: drop-shadow(0 0 7px var(--glow));
}
.spin-hub {
  display: grid; place-content: center; position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 35%; aspect-ratio: 1; border-radius: 50%; border: 5px solid #12140b;
  background: var(--accent); color: #171d07; box-shadow: 0 0 0 3px #2c311f, 0 0 33px var(--glow);
  font-size: clamp(18px, 5vw, 28px); font-weight: 900; letter-spacing: .035em;
}
.spin-hub:disabled { color: #424b19; background: #c4dd45; }
.spin-hub small { color: inherit; font-size: 13px; line-height: 1; }
.spin-status { border-color: #596724; background: linear-gradient(110deg, #2b3215, #171914 78%); }
.spin-status strong { color: var(--accent); }
.prizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.prizes li { text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 8px 2px; background: var(--panel); }
.prizes small { display: block; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.notice { min-height: 1.5em; color: var(--accent); }
.list { padding-left: 20px; }
.shop { display: flex; flex-wrap: wrap; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .wheel { transition: none; } }

#view:has(.farm-landscape) { padding: clamp(12px,4vw,20px); }
#view:has(.farm-landscape) > h1 { margin: 0 0 12px; }
.farm-landscape {
  display: grid; justify-items: center; gap: 16px;
  min-height: 0; padding: 0 0 15px; border: 0; background: transparent;
}
.farm-landscape .farm-meter { width: 100%; flex-wrap: wrap; }
.farm-landscape .pill { font-size: 13px; }
.farm-landscape .wooden-coin { width: min(57vw, 220px); margin: 0; }
.farm-landscape .wooden-coin:focus-visible { outline-color: #ffe2b4; }
.farm-landscape #farmHint {
  padding: 6px 12px; border-radius: 999px; background: #16252ce8;
  color: #f0eee7; font-size: 14px; font-weight: 700;
}
#view .farm-progress {
  border-color: #52605a; padding: 14px; background: #192422f2;
}
.farm-progress h2 { font-size: clamp(15px,4.6vw,19px); margin-bottom: 12px; }
.farm-progress .row { flex-wrap: wrap; font-size: 13px; }
.farm-progress #count { color: #ffd59b; }
.farm-progress progress, .farm-progress progress::-webkit-progress-bar { background: #364743; }
.farm-progress progress::-webkit-progress-value { background: #ffd59b; }
.farm-progress progress::-moz-progress-bar { background: #ffd59b; }
#view:has(.farm-landscape) > small {
  display: block; padding: 0 6px; background: transparent; color: #fff;
  text-align: center; line-height: 1.4; text-shadow: 0 1px 3px #101f18;
}
.wooden-coin {
  position: relative;
  margin: 20px auto 23px;
  border: 7px double #a05b2d;
  color: #4e2618;
  background:
    repeating-radial-gradient(ellipse at 30% 0%, #66301525 0 1px, transparent 2px 7px),
    repeating-linear-gradient(8deg, #70371722 0 1px, transparent 2px 6px),
    radial-gradient(circle at 31% 25%, #f6ce92, #c9864d 73%, #a05e35);
  box-shadow: 5px 8px 0 #754324, 7px 12px 0 #552d1c, 13px 20px 20px #16382d8c, inset 0 2px 5px #fff2cb;
}
.wooden-coin::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 2px solid #74412385;
  box-shadow: 0 1px 1px #ffd99c;
}
.dote-mark {
  position: relative;
  width: 41%;
  height: 33%;
  filter: drop-shadow(0 2px 0 #f4ca91);
}
.dote-mark::before {
  content: "";
  position: absolute;
  inset: 4% 0 4% 20%;
  border: .14em solid currentColor;
  border-left: 0;
  border-radius: 18% 55% 55% 18%;
}
.dote-mark::after {
  content: "";
  position: absolute;
  width: 20%;
  aspect-ratio: 1;
  background: currentColor;
  bottom: 7%;
  left: 0;
  border-radius: 50%;
}
.wheel {
  background: radial-gradient(circle, #202b2260, transparent 70%),
    conic-gradient(from -30deg, #414c1b 0 16.4%, #56613d 0 16.667%, #382542 0 33%, #54415d 0 33.333%, #283828 0 49.7%, #3e5240 0 50%, #182b38 0 66.4%, #345269 0 66.667%, #203e45 0 83%, #3b5761 0 83.333%, #252b49 0 99.7%, #3e4764 0);
}
.wheel span small { display: block; color: var(--ink); font-size: clamp(10px, 2.9vw, 14px); }
.prizes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
a.btn { text-decoration: none; }

.shell {
  isolation: isolate;
  background: #1a2930;
}
.shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  width: min(100%, 540px);
  margin-inline: auto;
  background: url("app-landscape.png") center bottom / cover no-repeat;
  filter: saturate(.43) brightness(.66);
  pointer-events: none;
}
header { background: #141c20e8; }
.card { background-color: #191a17ed; }
main > h1, .spin-hero h1 { text-shadow: 0 2px 5px #0a171e; }
.shell:has(.tasks-screen) { background: #000; }
.shell:has(.tasks-screen)::before { display: none; }
.shell:has(.tasks-screen) header { background: #0c0c0c; }
.task-feature {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: linear-gradient(120deg, #12151d, #171621) padding-box, linear-gradient(115deg, #29d9e6, #a899ff 67%, #e97bac) border-box;
}
.task-feature h2 { display: flex; align-items: center; gap: 9px; margin: 0; }
.task-feature h2 span { color: #8eeaf3; }
.task-feature p { margin: 6px 0 12px; }
.can-reward { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #aee4ff; }
.task-actions { margin-top: 10px; }
.task-sticker {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-inline-end: 8px;
  flex: 0 0 40px;
  border: 2px solid #ffffff66;
  border-radius: 13px;
  background: #245c76;
  color: #fff;
  font-size: 21px;
  line-height: 1;
  vertical-align: middle;
  box-shadow: inset 0 3px 4px #ffffff38, 0 3px 8px #0006;
}
.task-feature h2 .task-sticker { color: #fff; margin-inline-end: 0; }
.sticker-video { background: #101725; text-shadow: -2px 0 #28e6e1, 2px 0 #ff5880; }
.sticker-comment { background: #a53171; }
.sticker-boost { background: #7545b9; }
.sticker-friend, .sticker-referral { background: #345a3b; }
.task-detail { margin-top: 14px; padding-block: 25px; }
.task-detail h1 { margin: 0; }
.task-steps { padding-inline-start: 24px; }
.task-steps li + li { margin-top: 9px; }
main > small, .notice:not(:empty) {
  padding: 3px 8px;
  border-radius: 6px;
  background: #141c20ed;
}

.shell > header {
  position: relative;
  background: #10111b;
  justify-content: flex-start;
  padding-inline: 8px 14px;
  column-gap: 6px;
}
.shell > header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand-gold) 0%, #ffe1af 33%, #dce5ff 66%, #819af1 100%);
  box-shadow: -2px 1px 9px #edac6860, 3px 1px 9px #829bf468;
  pointer-events: none;
}
.shell > header .brand-logo { margin-inline-start: -4px; }
.shell > header #energy {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  white-space: nowrap;
  font-size: clamp(12px, 3.8vw, 15px);
  line-height: 1;
  background: #1b2032;
  color: #e0e8ff;
  border-color: #667bb0;
}
.shell > header #energy .energy-can {
  flex: 0 0 15px;
  width: 15px;
  height: 21px;
  transform: none;
  border-color: #c7d7ff;
  border-top-color: #e8efff;
  background: #354c94;
  color: #ffd298;
}
.brand-logo { display: block; width: min(216px, 54vw); min-width: 0; height: auto; aspect-ratio: 216 / 45; object-fit: cover; image-rendering: auto; }
.shell > header #energy { flex-shrink: 0; }
.tasks-screen .quest-card { width: 100%; color: var(--ink); }
.tasks-screen .quest-card button:disabled { opacity: .48; }
.tasks-screen .quest-art { flex-shrink: 0; }
.tasks-screen .quest-art svg { width: 30px; height: 30px; }
.tasks-screen .comment-mark svg { width: 44px; height: 44px; }
.tasks-screen .quest-reward .energy-can { vertical-align: middle; }

#invite-toast:not(:empty) {
  position: fixed;
  z-index: 20;
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  inset-inline: 12px;
  max-width: 500px;
  margin-inline: auto;
  padding: 9px 13px;
  border: 1px solid #6c6588;
  border-radius: 12px;
  background: #1b2032;
  color: #ffd694;
  box-shadow: 0 6px 20px #08080b80;
  overflow-wrap: anywhere;
}

.coin-ranking {
  padding: clamp(12px,4vw,20px);
  border: 1px solid #6e6f99;
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 12%,#34345a,#141927 64%);
  color: #f3f5ff;
}
.coin-ranking h1 { font-size: clamp(24px,7vw,34px); text-align: center; }
.rank-kicker { margin: 0 0 5px; text-align: center; color: var(--brand-gold); font-size: 13px; font-weight: 750; }
.ranking-podium, .ranking-list { margin: 0; padding: 0; list-style: none; }
.ranking-podium { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; align-items: end; margin: 24px 0 13px; }
.rank-place { position: relative; display: grid; justify-items: center; align-content: end; gap: 6px; min-height: 123px; padding: 9px 5px; border: 1px solid #666e91; border-radius: 16px 16px 9px 9px; background: linear-gradient(#354575,#21283d); text-align: center; font-size: 12px; }
.rank-place-1 { min-height: 154px; border-color: #efbd87; background: linear-gradient(#825f52,#372a3e); }
.rank-place-3 { min-height: 107px; background: linear-gradient(#504065,#22263f); }
.rank-avatar { display: grid; place-items: center; width: 36px; aspect-ratio: 1; overflow: hidden; border-radius: 50%; border: 1px solid #8a9cc6; background: #222945; }
.rank-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank-medal { display: grid; place-items: center; width: 21px; aspect-ratio: 1; border-radius: 50%; background: #d3ddff; color: #263248; }
.rank-place-1 .rank-medal { background: var(--brand-gold); color: #3e2715; }
.rank-name { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-line { display: grid; grid-template-columns: minmax(22px,auto) 36px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid #535a7e; }
.rank-own { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px; border-radius: 12px; background: #2a324f; }
.rank-empty { font-size: 13px; color: #cad3ee; }
.rank-count { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-gold); font-weight: 750; white-space: nowrap; }
.rank-coin { display: grid; place-items: center; flex: 0 0 18px; width: 18px; aspect-ratio: 1; border-radius: 50%; border: 2px solid #e8ad66; background: radial-gradient(circle at 30% 20%,#fff0b6,#c9864d); color: #6b3b20; font-size: 8px; box-shadow: 0 1px #704326; }
.rank-coin .dote-mark { width: 68%; height: 53%; filter: none; }

#nav {
  display: grid;
  grid-template-columns: minmax(0,2fr) minmax(52px,1fr) minmax(0,2fr);
  gap: clamp(4px,1.9vw,10px);
  align-items: end;
  padding: 6px clamp(6px,2.4vw,14px) max(7px,env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
}
#nav .nav-island {
  display: flex;
  padding: 3px;
  min-width: 0;
  border: 1px solid #62566b;
  border-radius: 22px;
  background: #101320f6;
  box-shadow: 0 4px 14px #06071070;
}
#nav .nav-island-farm { border-color: #9c7956; }
#nav button {
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 2px 0;
  border-radius: 17px;
  color: #b7c3df;
  font-size: clamp(9px,2.7vw,12px);
  line-height: 1.15;
  white-space: nowrap;
}
#nav button svg { display: block; width: 22px; height: 22px; }
#nav button span { font-size: inherit; }
#nav button[aria-current="page"] { color: #ffd694; background: #3c2c39; font-weight: 750; }

#nav { grid-template-columns: minmax(0,1fr) clamp(54px,17vw,63px) minmax(0,1fr); align-items: center; }
#nav .nav-island-farm {
  width: 100%;
  aspect-ratio: 1;
  padding: 3px;
  border-radius: 50%;
  overflow: hidden;
}
#nav .nav-island-farm button { min-height: 0; align-self: stretch; border-radius: 50%; padding: 0; }
#nav .nav-island-farm button svg { width: 21px; height: 21px; }

.shell > header:has(#deposit-launch) { padding: 8px 9px 8px 2px; border: 0; background: transparent; }
.shell > header:has(#deposit-launch)::after { display: none; }
.shell > header:has(#deposit-launch) .brand-logo { width: min(158px,42vw); margin: 0; aspect-ratio: 158 / 34; object-position: center 45%; }
.header-balances { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; padding: 4px 5px 4px 7px; border: 1px solid #524256; border-radius: 18px; background: #20192b; color: #f3e7ed; font-size: 11px; white-space: nowrap; }
.header-balances > span { display: inline-flex; align-items: center; gap: 2px; }
.header-balances img { width: 15px; height: 15px; object-fit: contain; }
.header-balances .rank-coin { width: 15px; flex-basis: 15px; }
.header-balances .header-plus { display: grid; place-items: center; width: 19px; height: 19px; color: #2e1b14; background: #ffd694; border-radius: 50%; font-size: 15px; }
.farm-meter { display: flex; justify-content: space-between; gap: 6px; }
.profile-screen .card { background: #20212deb; border-color: #65566b; color: #f2ecf6; backdrop-filter: blur(7px); }
.profile-screen h1 { text-shadow: 0 2px 6px #000; }
.profile-currency { width: 19px; height: 19px; object-fit: contain; }
.profile-withdraw-cost { display: flex; align-items: center; gap: 5px; margin: 11px 0 4px; }
.profile-screen .card small { color: #c8bad0; }
.profile-screen progress::-webkit-progress-value { background: #ffd694; }

.header-balances .header-plus { flex: 0 0 19px; line-height: 1; padding-bottom: 1px; align-self: center; }

#nav {
  width: 100%;
  min-width: 0;
  padding-inline: clamp(12px,4vw,21px);
  padding-bottom: calc(15px + env(safe-area-inset-bottom,0px));
}
#nav .nav-island { overflow: hidden; }
#nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.shell:has(.spin-screen,.profile-screen) { background: #000; }
.shell:has(.spin-screen,.profile-screen)::before { display: none; }
.shell:has(.spin-screen,.profile-screen) > header:has(#deposit-launch) { background: transparent; }

#nav .nav-island:not(.nav-island-farm), #nav .nav-island:not(.nav-island-farm) button { border-radius: 999px; }
.shell:has(.tasks-screen,.ranking-screen) #nav { padding-bottom: calc(34px + env(safe-area-inset-bottom,0px)); }

#nav .nav-island,#nav .nav-island-farm,.header-balances { border-color: #56545e; }
#nav button[aria-current="page"] { background: #393941; color: #fafafa; }
.shell:has(.profile-screen) { background: #111114; }
.profile-screen .card { background: #232327eb; border-color: #3e3e45; color: #f3f3f6; }
.profile-screen .card small { color: #babac4; }
.profile-identity { display: grid; justify-items: center; gap: 7px; }
.profile-identity .rank-avatar { width: 60px; padding: 2px; background: #32323a; border-color: #65656e; }
.profile-identity .rank-avatar img { object-fit: contain; border-radius: 50%; }
.profile-balance-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.profile-balance-grid > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; background: #2b2b30; border: 1px solid #45454d; border-radius: 13px; padding: 10px; }
.profile-balance-grid strong { font-size: 19px; }
.profile-balance-grid small { width: 100%; }
.profile-section summary { cursor: pointer; font-weight: 700; }
.profile-section-body { margin-top: 12px; }
.profile-empty { margin-top: 13px; text-align: center; }
.profile-empty .btn { background: #eeeef2; color: #25252c; }

#nav button[aria-current="page"] { color:#f1f1f4; background:#3a3a40; }
.shell > header:has(#deposit-launch) .header-balances { background:#242428; color:#dedee4; border-color:#4b4b50; }
.header-balances .header-plus { color:#f1f1f3; background:#4d4d55; }
.shell { --muted:#a9a9b3; color:#dedee5; }
.spin-modes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
.spin-modes .btn { min-width:0; background:#222226; border-color:#4f4f56; color:#c7c7cf; }
.spin-modes .btn[aria-pressed="true"] { background:#45454d; border-color:#85858e; color:#f4f4f6; }
#social-dialog {
  box-sizing:border-box; width:min(100%,480px); max-width:100%;
  position:fixed; inset:auto 0 0; margin:0 auto;
  border:1px solid #52525a; border-radius:24px 24px 0 0;
  background:#26262b; color:#efeff2; text-align:center;
  padding:22px 18px calc(18px + env(safe-area-inset-bottom,0px));
}
#social-dialog::backdrop { background:#08080bb1; backdrop-filter:blur(5px); }
#social-dialog .task-sticker { display:block; margin:0 auto 8px; width:52px; height:52px; background:#333952; box-shadow:none; }
#social-dialog p { color:#bdbdc6; }
#social-dialog .btn { display:block; width:100%; margin-top:8px; min-height:40px; }
#social-dialog .social-start { background:#375fae; color:white; }
#social-dialog .social-close { position:absolute; top:10px; right:12px; background:#38383f; border-radius:50%; width:29px; height:29px; }

#social-dialog .task-sticker { background: url("assets/task-stickers.png") center / 300% 200% no-repeat; }
#social-dialog .sticker-channel { background-position: left bottom; }
#social-dialog .sticker-boost { background-position: center bottom; }
#social-dialog .sticker-name { background-position: right top; }

.sheet-grip { width: 40px; height: 4px; background: #85858d; border-radius: 999px; margin: 0 auto 15px; }
#social-dialog .social-start { display: grid; place-items: center; border: 0; border-radius: 12px; background: #385fae; font-weight: 750; }
#social-dialog .btn.alt { border-radius: 12px; background: #37373e; }
#social-dialog .sticker-friend { background-position: right bottom; }
.social-invite-link { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid #52525d; border-radius: 10px; background: #202026; color: #e5e5ee; font: inherit; }
.social-copy-status { margin: 8px 0 0; overflow-wrap: anywhere; }
.social-copy-status:empty { display: none; }

.profile-screen .profile-identity {
  position: relative; gap: 5px; padding: 22px 14px 14px;
  isolation: isolate;
  overflow: hidden;
  background: #202125;
}
.profile-identity::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #74757d;
  opacity: .30;
  mask: url("assets/profile-telegram-pattern.svg") center 42% / 370px auto repeat;
  pointer-events: none;
}
.profile-identity .rank-avatar { width: 82px; height: 82px; background: #16161b; border: 2px solid #dadade; box-shadow: 0 0 12px #ededfa38; }
.profile-identity .rank-avatar img { object-fit: cover; }
.profile-identity #profile-name { font-size: 19px; text-align: center; overflow-wrap: anywhere; }
.profile-settings-open { position: absolute; inset: 12px 12px auto auto; width: 37px; height: 37px; border: 1px solid #57575f; border-radius: 50%; background: #34343b; color: #f0f0f3; font-size: 19px; }
.profile-gift-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #414149; }

.profile-gift-link { display: grid; width: 100%; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; margin-top: 10px; border-radius: 16px; border: 1px solid #494950; background: #2f2f35; color: #f0f0f4; font-weight: 750; }
.profile-back { width: 40px; height: 40px; margin-bottom: 10px; border-radius: 12px; background: #333339; color: #eee; font-size: 25px; }
#social-dialog .btn { display: grid; place-items: center; min-height: 48px; padding: 10px 14px; border-radius: 14px; font-size: 15px; font-weight: 700; }
#social-dialog .social-start { background: #2868ee; }
#social-dialog .btn.alt { background: #43444b; color: #f1f1f5; }
#social-dialog .btn.alt:disabled { opacity: 1; color: #c3c4cd; }

#view.profile-screen { padding-inline: clamp(12px,4vw,20px); }
.profile-screen .profile-balance-card { background: #222226; border-color: #3e3e44; }
.profile-balance-card .profile-balance-grid > div { background: #2c2c31; padding: 11px 10px; }
.profile-balance-card .profile-balance-grid .rank-coin { width: 19px; flex-basis: 19px; }
.profile-balance-card .profile-balance-grid strong { font-size: clamp(17px,5vw,24px); overflow-wrap: anywhere; min-width: 0; }
.profile-balance-card .profile-balance-grid small { font-size: 13px; }
.profile-activity { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 0 0 12px; padding: 8px; }
.profile-activity > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; padding: 9px 10px; background: #2b2b30; border: 1px solid #3c3c44; border-radius: 13px; }
.profile-activity dd { margin: 0; font-size: 19px; font-weight: 800; }
.profile-activity dt { color: #bdbdc6; font-size: 12px; line-height: 1.3; }
.profile-shortcuts { padding: 0; }
.profile-shortcuts :is(summary,button) {
  display: grid; width: 100%; min-height: 54px; grid-template-columns: 31px minmax(0,1fr) 22px;
  align-items: center; gap: 10px; padding: 8px 12px; background: transparent; color: inherit;
  text-align: left; font-weight: 750; list-style: none;
}
.profile-shortcuts summary::-webkit-details-marker { display: none; }
.profile-shortcuts button { border-top: 1px solid #3b3b40; }
.profile-shortcuts .profile-section-body { margin: 0; padding: 0 12px 12px; }
.profile-shortcut-icon,.profile-chevron { display: grid; place-items: center; aspect-ratio: 1; background: #36363d; border-radius: 50%; }
.profile-shortcuts details[open] .profile-chevron { transform: rotate(180deg); }

.profile-screen .profile-balance-card { padding: 12px; }
.profile-balance-card h2 { margin-bottom: 8px; }
.profile-balance-card .profile-balance-grid { margin-bottom: 0; gap: 7px; }
.profile-balance-card .profile-balance-grid > div { gap: 4px 6px; padding: 7px 9px; }
.profile-balance-card .profile-balance-grid strong { font-size: clamp(16px,4.6vw,20px); }
.profile-balance-card .profile-balance-grid small { font-size: 12px; }

.inventory-cover {
  display: grid; grid-template-columns: minmax(0,1fr) clamp(68px,23vw,100px);
  align-items: center; gap: 8px; padding: 13px 15px;
}
.profile-screen .inventory-cover { background: radial-gradient(ellipse at 86% 44%, #494157, transparent 62%), #23232a; }
.inventory-cover h1 { margin: 0 0 5px; font-size: clamp(20px,6vw,27px); }
.inventory-cover p { margin: 0; color: #d3d0db; font-size: 13px; }
.inventory-cover img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.inventory-stars { display: flex; align-items: center; gap: 7px; padding: 10px 13px; }
.inventory-stars span { margin-right: auto; font-size: 13px; color: #d3d3de; }
.inventory-stars img { width: 19px; height: 19px; }
.inventory-items .row { padding-block: 4px; }
.inventory-items .row + .row { margin-top: 5px; border-top: 1px solid #44444c; padding-top: 9px; }

.energy-shop-pack {
  display: grid; justify-items: center; gap: 7px; margin-bottom: 8px; padding: 11px; border: 1px solid #55536a;
  border-radius: 17px; background: radial-gradient(ellipse at 50% 35%, #4c4765, transparent 68%), #282833;
}
.energy-shop-pack > strong { color: #f3eefe; font-size: 28px; line-height: 1; font-weight: 850; }
.profile-gift-link > span:last-child::before, .history-arrow::before {
  content: ""; display: block; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.profile-gift-link > span:last-child, .profile-back { font-size: 0; }
.profile-gift-link > span:last-child::before, .history-arrow[data-action="history-next"]::before { transform: rotate(-45deg); }
.profile-back { display: grid; place-items: center; }
.history-arrow[data-action="history-prev"]::before { transform: rotate(135deg); }
.history-pages { display: flex; justify-content: center; align-items: center; gap: 11px; margin-top: 12px; font-size: 12px; }
.profile-shortcuts .history-arrow {
  display: grid; place-items: center; min-height: 34px; width: 34px; padding: 0; border: 1px solid #53535e;
  border-radius: 10px; background: #33333b; color: #f1f1f5;
}
.profile-shortcuts .history-arrow:disabled { opacity: .43; }

.profile-screen .profile-energy-launch { margin: 0 0 12px; }
.profile-energy-launch .profile-gift-icon img { width: 23px; height: 23px; object-fit: contain; }
#energy-dialog, #gift-dialog {
  position: fixed; inset: auto 0 0; width: min(100%,480px); max-width: 100%; max-height: 88dvh;
  padding: 0; margin: 0 auto; overflow: auto; background: #232329; color: #f0f0f5;
  border: 1px solid #494950; border-radius: 24px 24px 0 0;
}
#energy-dialog::backdrop, #gift-dialog::backdrop { background: #08080bb1; backdrop-filter: blur(5px); }
.energy-shop-inner { padding: 13px 15px calc(17px + env(safe-area-inset-bottom,0px)); }
.energy-shop-inner h2 { margin: 0 38px 4px 0; }
.energy-shop-inner p { margin: 0 0 13px; color: #bdbdc6; font-size: 13px; }
.energy-shop-close {
  position: absolute; inset: 12px 12px auto auto; width: 32px; height: 32px;
  display: grid; place-items: center; padding: 0; border-radius: 50%;
  background: #38383f; color: #f0f0f5; font-size: 0;
}
.energy-shop-close::before, .energy-shop-close::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 2px; border-radius: 2px; background: currentColor;
}
.energy-shop-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.energy-shop-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.energy-shop-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.energy-shop-pack { margin: 0; }
.energy-pack-can { width: min(72px,100%); height: 72px; object-fit: contain; filter: drop-shadow(0 3px 7px #14141c70); }
.energy-pack-price { display: flex; width: 100%; min-height: 38px; justify-content: center; align-items: center; gap: 5px; background: #444457; border-radius: 10px; color: #fff; font-size: clamp(11px,3.8vw,14px); font-weight: 750; }
.energy-pack-price img { width: 17px; height: 17px; object-fit: contain; }

.energy-shop-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.energy-shop-pack { min-width: 0; padding: 8px 4px; background: radial-gradient(ellipse at 50% 40%, #41384e, #2a2933 80%); }
.energy-shop-pack > strong { font-size: clamp(14px,5vw,24px); }
.energy-shop-pack .energy-pack-can { width: min(58px,100%); height: 54px; }
.energy-pack-price { gap: 3px; white-space: nowrap; font-size: clamp(9px,3.2vw,13px); }
.energy-pack-price img { width: 14px; height: 14px; }

.inventory-gift {
  display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center;
  gap: 8px; padding: 8px; border: 1px solid #474550; border-radius: 14px; background: #2b2a34;
}
.inventory-gift + .inventory-gift { margin-top: 7px; }
.inventory-gift img { width: 58px; height: 58px; padding: 5px; object-fit: contain; }
.inventory-gift h3 { margin: 0 0 2px; font-size: 13px; overflow-wrap: anywhere; }
.inventory-gift .btn { padding: 8px 9px; font-size: 12px; }

html { background: #111114; -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
button, summary, a { touch-action: manipulation; }
input, select, textarea { font-size: max(16px,1em) !important; }
.shell > main { min-width: 0; }
.profile-screen .profile-back {
  width: 36px; height: 36px; border: 1px solid #47474f; border-radius: 50%; background: #28282e;
}
.inventory-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.inventory-grid .inventory-gift {
  width: 100%; min-width: 0; margin: 0; display: grid; grid-template-columns: none;
  justify-items: start; gap: 4px; padding: 7px; color: #f1f0f6; text-align: left;
}
.inventory-grid .inventory-gift img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; padding: 0; }
.inventory-grid .inventory-gift :is(strong,small) { overflow-wrap: anywhere; }
.inventory-grid .inventory-gift strong { font-size: 13px; }
#gift-dialog .energy-shop-inner { padding-top: 13px; }
#gift-dialog .gift-detail-art { display: block; width: min(112px,40vw); aspect-ratio: 1; object-fit: cover; border-radius: 16px; margin: 0 0 10px; }
#gift-dialog .btn { width: 100%; min-height: 44px; margin-top: 5px; }
.spin-gift-art { display: block; width: clamp(24px,8.5vw,41px); aspect-ratio: 1; object-fit: contain; margin-inline: auto; }

.profile-settings-open { display: grid; place-items: center; padding: 0; }
.profile-screen :is(.profile-settings-open,.profile-back) svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.gift-invite-progress { padding: 11px; border: 1px solid #494950; border-radius: 15px; background: #2b2b32; }
.gift-invite-progress .row { font-size: 13px; }
.gift-invite-progress strong { flex: none; color: #e8f4a7; font-variant-numeric: tabular-nums; }
.gift-invite-track { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; margin: 8px 0 10px; }
.gift-invite-track span { height: 7px; border-radius: 999px; background: #42434a; }
.gift-invite-track .filled { background: linear-gradient(90deg,#bdde56,#e1f487); }
.gift-share { display: grid; place-items: center; min-height: 40px; border-radius: 11px; background: #393a43; color: #f0f0f5; font-size: 13px; font-weight: 750; text-decoration: none; }

.profile-shortcuts .profile-section > summary {
  grid-template-columns: 30px minmax(0,1fr) 22px;
  min-height: 52px; gap: 8px; padding: 8px 11px; font-size: clamp(13px,4.2vw,16px);
}
.profile-shortcuts .profile-section > summary > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
#profile-history { min-width: 0; padding: 0 11px 11px; font-size: 13px; }
#profile-history .row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 8px 0; border-top: 1px solid #3b3b44; }
#profile-history .row + .row { margin-top: 0; }
#profile-history .row > span { min-width: 0; overflow-wrap: anywhere; }
#profile-history .row > strong { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#profile-history .energy-can { width: 13px; height: 17px; font-size: 9px; transform: none; }

.profile-gift-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-identity :is(.profile-settings-open,.profile-gift-icon) { background: #37373f; color: #e6e6ef; }

html, body { min-height: 100%; background: #111114; overscroll-behavior-y: none; }
.shell { min-height: max(100dvh,var(--tg-viewport-stable-height,0px)); }
.inventory-cover p { max-width: 24ch; margin-top: 5px; line-height: 1.35; }
.inventory-cover .inventory-count { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #35353e; }
.inventory-sell { width: 100%; margin-bottom: 12px; color: #e7e4f0; background: #464054; }
.inventory-grid .inventory-gift img { width: 80%; max-width: 112px; justify-self: center; object-fit: contain; }
#gift-dialog { inset: 0; width: min(calc(100% - 24px),390px); max-height: 88dvh; margin: auto; border-radius: 21px; }
#gift-dialog .sheet-grip { display: none; }
#gift-dialog .energy-shop-inner { padding: 14px; }
.gift-detail-heading { display: grid; grid-template-columns: 58px minmax(0,1fr); align-items: center; gap: 10px; padding-right: 35px; margin-bottom: 12px; }
#gift-dialog .gift-detail-art { width: 58px; margin: 0; }
.gift-detail-heading h2 { margin: 0 0 3px; overflow-wrap: anywhere; }
.gift-detail-heading p { margin: 0; }
.gift-detail-heading small { display: block; font-size: 11px; }
.gift-deadline { margin-bottom: 8px; }
.gift-invite-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.gift-invite-actions :is(a,button) { padding: 6px; text-align: center; }
.gift-invite-actions .gift-share { background: #eed1a1; color: #242025; }
.gift-copy { background: transparent; color: #e7d6ba; border: 1px solid #6c5a51; border-radius: 11px; font-size: 12px; font-weight: 750; }
.gift-invite-progress .gift-copy-status { margin: 6px 0 0; overflow-wrap: anywhere; }
.gift-copy-status:empty { display: none; }
.energy-shop-inner h2 + .energy-shop-options { margin-top: 11px; }

.profile-shortcuts :is(.profile-shortcut-icon,.profile-chevron) svg { width: 15px; height: 15px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.gift-detail-heading .gift-kicker { margin-bottom: 3px; color: #bdbdc6; }
.gift-invite-progress .gift-invite-description { margin: 11px 0 13px; font-size: 13px; line-height: 1.5; color: #e3e1e9; }
.gift-invite-actions :is(a,button) { min-height: 44px; border-radius: 999px; overflow-wrap: anywhere; }
.gift-invite-actions .gift-share { font-weight: 800; }
