:root {
  --bg: #0b1118;
  --panel: #17212b;
  --surface: #1e2a36;
  --accent: #0098ea;
  --accent-2: #2acfff;
  --red: #0098ea;
  --red-dim: #0a5c8a;
  --text: #e8f4fc;
  --muted: #7f91a4;
  --line: rgba(148, 180, 210, 0.12);
  --phone: 390px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(0, 152, 234, 0.18), transparent 55%),
    radial-gradient(700px 420px at 90% 80%, rgba(42, 171, 238, 0.08), transparent 50%),
    var(--bg);
}

.screen * {
  scrollbar-width: none;
}

.screen *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.studio {
  display: grid;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 32px;
}

.phone-bezel {
  width: var(--phone);
  height: 844px;
  padding: 12px;
  border-radius: 54px;
  background: linear-gradient(180deg, #2a3542, #141c26 30%, #0e1621);
  box-shadow:
    0 0 0 1px #2a3a4a,
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(0, 152, 234, 0.12);
  position: relative;
}

.island {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 36px;
  background: #000;
  border-radius: 24px;
  z-index: 5;
}

.screen {
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background:
    radial-gradient(320px 220px at 50% -10%, rgba(0, 152, 234, 0.22), transparent 60%),
    linear-gradient(180deg, #121c28 0%, #0e1621 28%, #0b141c 100%);
  display: flex;
  flex-direction: column;
}

.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px 0;
  height: 54px;
  font-weight: 700;
  font-size: 15px;
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bars,
.wifi,
.battery {
  display: block;
  background: #fff;
}

.bars {
  width: 18px;
  height: 10px;
  clip-path: polygon(0 70%, 22% 70%, 22% 40%, 48% 40%, 48% 15%, 74% 15%, 74% 0, 100% 0, 100% 100%, 0 100%);
}

.wifi {
  width: 14px;
  height: 10px;
  border-radius: 0 0 12px 12px;
  clip-path: polygon(50% 100%, 0 30%, 20% 10%, 50% 55%, 80% 10%, 100% 30%);
}

.battery {
  width: 22px;
  height: 10px;
  border-radius: 3px;
  opacity: 0.9;
}

.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  padding: 0;
  gap: 0;
}

.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px 16px 10px;
  gap: 12px;
  overflow: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin: -8px -16px 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 22, 33, 0.96);
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.head-gear {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.head-gear svg {
  width: 20px;
  height: 20px;
}

.head-gear.active {
  background: rgba(0, 152, 234, 0.16);
  border-color: rgba(0, 152, 234, 0.4);
  color: #fff;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: Orbitron, sans-serif;
  font-size: 14px;
  background: linear-gradient(145deg, #0098ea, #003056);
  box-shadow: 0 8px 20px rgba(0, 152, 234, 0.35);
  object-fit: cover;
  overflow: hidden;
  flex-shrink: 0;
}

img.brand-mark {
  display: block;
}

.brand > div {
  min-width: 0;
  flex: 1;
}

.head-top {
  --head-angle: 0deg;
  --head-fill: #143044;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--head-fill), var(--head-fill)) padding-box,
    conic-gradient(from var(--head-angle), rgba(42, 207, 255, 0.15) 0deg, #7ad7ff 70deg, #fff 108deg, #2acfff 150deg, rgba(42, 207, 255, 0.12) 220deg, rgba(42, 207, 255, 0.15) 360deg) border-box;
  color: inherit;
  font-family: Orbitron, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible;
  text-align: left;
  cursor: pointer;
  animation: head-top-angle 3.2s linear infinite, head-top-glow 2.4s ease-in-out infinite;
}

@property --head-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.head-top.active {
  --head-fill: #0c5c8c;
}

.head-top-chevron {
  animation: head-top-nudge 1.6s ease-in-out infinite;
}

@keyframes head-top-angle {
  to { --head-angle: 360deg; }
}

@keyframes head-top-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(42, 207, 255, 0); }
  50% { box-shadow: 0 0 12px rgba(42, 207, 255, 0.55); }
}

@keyframes head-top-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .head-top,
  .head-top-chevron,
  .gen-actions .gen-upgrade-side {
    animation: none;
  }
}

.head-top-chevron {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #9ad8ff;
}

#head-top {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transform: translateY(2px);
}

.brand-moves {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-moves svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: #7ee0ff;
}

.coins {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 152, 234, 0.35);
  background: rgba(0, 152, 234, 0.12);
  color: #fff;
  border-radius: 12px;
  height: 38px;
  padding: 0 6px;
  font: inherit;
  font-weight: 700;
}

.coins img,
.coins-mark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.coins-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: Orbitron, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, #0098ea, #003056);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.coins #coins-value {
  min-width: 5ch;
  max-width: 11ch;
  text-align: right;
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.stat strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.stat.accent {
  border-color: rgba(0, 152, 234, 0.35);
  background: rgba(0, 152, 234, 0.1);
}

.board-wrap {
  position: relative;
  touch-action: none;
  overflow: visible;
  user-select: none;
  cursor: grab;
}

.screen.is-swiping,
.screen.is-swiping .board-wrap {
  cursor: grabbing;
  user-select: none;
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  border-radius: 22px;
  background: #121c28;
  border: 1px solid rgba(255, 255, 255, 0.06);
  aspect-ratio: 1;
  touch-action: none;
}

#tiles,
#fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#fx {
  overflow: visible;
  z-index: 5;
  contain: layout;
  transform: translateZ(0);
}

.payout {
  position: absolute;
  width: calc((100% - 20px - 24px) / 4 + 56px);
  margin-left: -28px;
  left: calc(10px + (var(--c) - 1) * ((100% - 20px - 24px) / 4 + 8px));
  top: calc(10px + (var(--r) - 1) * ((100% - 20px - 24px) / 4 + 8px) - 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-family: Orbitron, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #0098ea;
  -webkit-text-stroke: 0.4px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  will-change: transform, opacity;
  backface-visibility: hidden;
  animation: fly-up 1.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.payout-ton {
  font-size: 18px;
}

.payout-ton img {
  width: 20px;
  height: 20px;
}

@keyframes fly-up {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  12% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(0, -86px, 0);
  }
}

.slot {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.tile {
  position: absolute;
  width: var(--cell, calc((100% - 20px - 24px) / 4));
  height: var(--cell, calc((100% - 20px - 24px) / 4));
  left: 10px;
  top: 10px;
  border-radius: 14px;
  transform: translate3d(
    calc((var(--c) - 1) * (var(--cell, 0px) + var(--gap, 8px))),
    calc((var(--r) - 1) * (var(--cell, 0px) + var(--gap, 8px))),
    0
  );
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.tile-face {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--cell) * 13 / 130) calc(var(--cell) * 8 / 130)
    calc(var(--cell) * 8 / 130);
  box-sizing: border-box;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.tile img {
  width: 72%;
  height: auto;
  max-height: calc(100% - 1em);
  flex: 0 0 auto;
  object-fit: contain;
}

.tile span {
  margin-top: auto;
  width: 100%;
  text-align: center;
  font-size: calc(var(--cell) * 18 / 130);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.92;
}

.trx {
  background: linear-gradient(160deg, #c41838, #4e0014);
}
.btt {
  background: linear-gradient(160deg, #3a3a3a, #111);
}
.usdt {
  background: linear-gradient(160deg, #1a9a6e, #0a3d30);
}
.xrp {
  background: linear-gradient(160deg, #5a6d82, #1a2433);
}
.doge {
  background: linear-gradient(160deg, #e0a82a, #7a4a08);
  color: #fff8e8;
}
.ada {
  background: linear-gradient(160deg, #4d7cff, #12308a);
}
.sol {
  background: linear-gradient(160deg, #c084fc, #22d3a6);
  color: #08110e;
}
.bnb {
  background: linear-gradient(160deg, #f6d365, #c58a12);
  color: #2a2108;
}
.eth {
  background: linear-gradient(160deg, #8ea2ff, #3b4ea0);
}
.btc {
  background: linear-gradient(160deg, #e09018, #7a3d00);
  color: #fff8e8;
}
.ton-tile,
.ton {
  background: linear-gradient(160deg, #1a8ed4, #003056);
}

.tile.match .tile-face {
  outline: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(0, 152, 234, 0.55), 0 8px 16px rgba(0, 152, 234, 0.3);
}

.tile.legendary .tile-face {
  box-shadow: 0 0 16px rgba(255, 193, 74, 0.45);
}

.tile.spawn .tile-face {
  animation: spawn 0.16s ease-out;
}

.tile.pop .tile-face {
  animation: pop 0.16s ease-out;
}

@keyframes spawn {
  from {
    transform: scale(0);
  }
}

@keyframes pop {
  50% {
    transform: scale(1.12);
  }
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 8, 12, 0.72);
  border-radius: 22px;
  z-index: 4;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(80%, 240px);
  text-align: center;
  padding: 18px 16px;
  border-radius: 18px;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-card h3 {
  font-family: Orbitron, sans-serif;
  margin-bottom: 8px;
}

.overlay-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.splash-body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(120% 90% at 50% 0%, #17324a 0%, #0e1621 60%);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
}

.splash {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.splash-logo {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: rgba(0, 152, 234, 0.12);
  border: 1px solid rgba(0, 152, 234, 0.3);
  animation: splash-pulse 2.2s ease-in-out infinite;
}

.splash-logo img {
  width: 58px;
  height: 58px;
}

@keyframes splash-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 152, 234, 0.25);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 18px rgba(0, 152, 234, 0);
  }
}

.splash-title {
  margin: 0;
  font-family: Orbitron, sans-serif;
  font-size: 30px;
  letter-spacing: 0.02em;
}

.splash-chain {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.splash-chain img {
  width: 30px;
  height: 30px;
  opacity: 0.35;
  animation: splash-coin 1.6s ease-in-out infinite;
}

.splash-chain img:nth-child(2) { animation-delay: 0.12s; }
.splash-chain img:nth-child(3) { animation-delay: 0.24s; }
.splash-chain img:nth-child(4) { animation-delay: 0.36s; }
.splash-chain img:nth-child(5) { animation-delay: 0.48s; }

@keyframes splash-coin {
  0%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-6px);
  }
}

.splash-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.splash-bar {
  width: min(220px, 70vw);
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.splash-bar[hidden] {
  display: none;
}

.splash-bar i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: splash-run 1.1s ease-in-out infinite;
}

@keyframes splash-run {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

.splash-retry[hidden] {
  display: none;
}

.settings-lang-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-lang-value img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.settings-lang-value strong {
  font-size: 13px;
  font-weight: 700;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  flex-shrink: 0;
  padding: 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.offer .seg button {
  min-width: 54px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.offer .seg button.active {
  background: var(--accent);
  color: #fff;
}

.ref-tabs.top-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.row-ava {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.friend-card .row-ava {
  width: 48px;
  height: 48px;
}

.top-note {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 2px 0 4px;
}

.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.top-row.me {
  border-color: rgba(0, 152, 234, 0.45);
  background: rgba(0, 152, 234, 0.12);
}

.top-place {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-family: Orbitron, sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.top-row:nth-child(1) .top-place {
  color: #ffd166;
}

.top-row:nth-child(2) .top-place {
  color: #d8e2ec;
}

.top-row:nth-child(3) .top-place {
  color: #e0a878;
}

.top-ava {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

/* Без фото на месте аватарки показываем инициалы. */
span.top-ava {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.top-row > div {
  flex: 1;
  min-width: 0;
}

.top-row strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-row p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.top-xp {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #9ad8ff;
  font-variant-numeric: tabular-nums;
}

.top-row.place-1,
.top-row.place-2,
.top-row.place-3 {
  position: relative;
  overflow: hidden;
  border-color: transparent;
  background: transparent;
}

.top-row.place-1 > *,
.top-row.place-2 > *,
.top-row.place-3 > * {
  position: relative;
  z-index: 1;
}

.top-row.place-1::before,
.top-row.place-2::before,
.top-row.place-3::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 170%;
  aspect-ratio: 1;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    var(--podium) 46deg,
    #fff8e8 78deg,
    var(--podium) 112deg,
    transparent 160deg,
    transparent 360deg
  );
  animation: top-ring 3.4s linear infinite;
  z-index: 0;
}

.top-row.place-1::after,
.top-row.place-2::after,
.top-row.place-3::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 14px;
  z-index: 0;
}

.top-row.place-1::after {
  background: linear-gradient(180deg, #2a2416, #121a24 58%);
}

.top-row.place-2::after {
  background: linear-gradient(180deg, #1c242e, #121a24 52%);
}

.top-row.place-3::after {
  background: linear-gradient(180deg, #2a2018, #121a24 52%);
}

#top-list {
  padding: 18px 16px 10px;
}

.top-podium {
  border-radius: 16px;
}

.top-row.place-1,
.top-podium.place-1 {
  --podium: #ffd166;
}

.top-podium.place-1 {
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.55);
}

.top-row.place-2,
.top-podium.place-2 {
  --podium: #d5e2ee;
}

.top-podium.place-2 {
  box-shadow: 0 0 14px rgba(213, 226, 238, 0.42);
}

.top-row.place-2::before {
  animation-duration: 4.6s;
  animation-delay: -1.4s;
}

.top-row.place-3,
.top-podium.place-3 {
  --podium: #e0a878;
}

.top-podium.place-3 {
  box-shadow: 0 0 14px rgba(224, 168, 120, 0.42);
}

.top-row.place-2 .top-place {
  color: #d8e2ec;
}

.top-row.place-3 .top-place {
  color: #e0a878;
}

.top-row.place-3::before {
  animation-duration: 5.4s;
  animation-delay: -2.6s;
}

@keyframes top-ring {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .top-row.place-1::before,
  .top-row.place-2::before,
  .top-row.place-3::before {
    animation: none;
    background: var(--podium);
  }
}

.lang-list {
  display: grid;
  gap: 6px;
  padding: 4px 0 2px;
  max-height: 60vh;
  overflow: auto;
  scrollbar-width: none;
}

.lang-list::-webkit-scrollbar {
  display: none;
}

.lang-list button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.lang-list button.active {
  border-color: rgba(0, 152, 234, 0.55);
  background: rgba(0, 152, 234, 0.14);
}

.lang-list img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.overlay-stats {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.overlay-stats[hidden] {
  display: none;
}

.overlay-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.overlay-stats span {
  color: var(--muted);
  font-size: 12px;
}

.overlay-stats strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.overlay-card button {
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  background: rgba(20, 22, 30, 0.94);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 12;
}

.toast[hidden] {
  display: none;
}

.spawn-ping {
  position: absolute;
  left: 12px;
  bottom: 72px;
  z-index: 20;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  pointer-events: none;
}

.spawn-ping.ok {
  color: #6ee7a8;
}

.spawn-ping.bad {
  color: #ff8aa0;
}

html.is-miniapp .spawn-ping {
  bottom: calc(var(--tabbar-h) + 10px);
}

.dock button {
  cursor: pointer;
}

.ladder {
  overflow: hidden;
}

.ladder-track {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding-bottom: 2px;
}

.ladder-coin {
  min-width: 0;
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  opacity: 0.55;
  font-size: 8px;
  color: var(--muted);
}

.ladder-coin img {
  width: 28px;
  height: 28px;
}

.ladder-coin.current {
  opacity: 1;
}

.dock {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.dock button {
  border: 0;
  border-radius: 16px;
  padding: 12px 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.dock svg {
  width: 22px;
  height: 22px;
}

.dock-mult {
  font-family: Orbitron, sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 22px;
  height: 22px;
  letter-spacing: -0.04em;
}

#btn-mult {
  position: relative;
}

#btn-mult .mult-new {
  display: none;
}

html.is-mult-new #btn-mult .mult-new {
  display: block;
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: #0098ea;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  pointer-events: none;
  animation: mult-new-pulse 1.8s ease-in-out infinite;
}

@keyframes mult-new-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(42, 207, 255, 0);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 10px rgba(42, 207, 255, 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.is-mult-new #btn-mult .mult-new,
  html.is-contest-new #tab-more .contest-new,
  html.is-contest-new .more-sheet button[data-go="contests"] .contest-new {
    animation: none;
  }
}

#mult-modal .ref-modal-top {
  margin-bottom: 0;
}

.mult-rule {
  border: 0;
  height: 1px;
  margin: 14px -16px;
  background: rgba(148, 180, 210, 0.2);
}

.mult-picks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mult-note {
  margin: 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.mult-pick {
  flex: 0 0 calc((100% - 24px) / 4);
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: Orbitron, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.04em;
  cursor: pointer;
}

.mult-pick[data-mult="500"],
.mult-pick[data-mult="1000"] {
  font-size: 11px;
  letter-spacing: -0.06em;
}

.mult-pick.on {
  color: #fff;
  background: rgba(0, 152, 234, 0.22);
  border-color: rgba(0, 152, 234, 0.45);
  box-shadow: 0 8px 20px rgba(0, 152, 234, 0.25);
}

#mult-save {
  width: 100%;
}

.mult-paid-modal {
  z-index: 26;
  padding: 48px 28px;
}

.mult-paid-card {
  width: min(100%, 280px);
  padding: 16px 14px 14px;
}

.mult-paid-card p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.mult-paid-card .mock-cta {
  width: 100%;
}

.mult-paid-card .mock-cta + .mock-cta {
  margin-top: 8px;
}

.finish-cancel {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.dock button.on {
  color: #fff;
  background: rgba(0, 152, 234, 0.22);
  border: 1px solid rgba(0, 152, 234, 0.4);
}

.tab-panel[hidden] {
  display: none !important;
}

#tab-game:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

.game-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.offer-text h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 4px;
}

.offer-gift {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #f0c36a;
}

.offer-text p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.offer-text strong {
  display: block;
  margin-top: 6px;
  color: #9ad8ff;
  font-size: 12px;
}

.offer button {
  flex-shrink: 0;
  border: 0;
  border-radius: 14px;
  padding: 12px 12px;
  min-width: 88px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.mock-avatar.tone-4 {
  background: linear-gradient(145deg, #f6d365, #c58a12);
  color: #2a2108;
}

.mock-avatar.tone-5 {
  background: linear-gradient(145deg, #ffc14a, #e08a00);
  color: #2a2108;
}

.ladder-coin.off {
  opacity: 0.22;
  filter: grayscale(1);
}

.friends-panel:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.friends-panel:not([hidden])::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.friends-head {
  display: grid;
  gap: 10px;
}

.friends-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.friends-invite {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 12px;
  flex-shrink: 0;
}

.friends-intro {
  padding: 14px;
  border-radius: 18px;
  background: rgba(0, 152, 234, 0.08);
  border: 1px solid rgba(0, 152, 234, 0.18);
}

.friends-intro p {
  color: #c5d6e6;
  font-size: 13px;
  line-height: 1.5;
}

.friends-rule {
  border: 0;
  height: 1px;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(154, 216, 255, 0.18) 18%,
    rgba(0, 152, 234, 0.7) 50%,
    rgba(154, 216, 255, 0.18) 82%,
    transparent
  );
}

.friends-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.friends-history {
  flex: 1;
  border: 1px solid rgba(0, 152, 234, 0.35);
  background: rgba(0, 152, 234, 0.12);
  color: #d6f1ff;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.friends-info {
  width: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 152, 234, 0.35);
  background: rgba(0, 152, 234, 0.12);
  color: #d6f1ff;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.friends-info svg {
  width: 20px;
  height: 20px;
}

.friends-history:hover,
.friends-history:focus-visible,
.friends-info:hover,
.friends-info:focus-visible {
  border-color: rgba(0, 152, 234, 0.55);
  background: rgba(0, 152, 234, 0.2);
  color: #fff;
}

.friends-head .stat span {
  font-size: 13px;
}

.friends-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 0;
}

.friends-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.friends-more {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  padding: 8px 0 4px;
}

.ref-levels {
  flex-shrink: 0;
}

.ref-levels-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
}

.ref-levels-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.ref-tabs {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.hist-tabs {
  flex: none;
  width: 100%;
  grid-template-columns: repeat(4, 1fr);
}

.ref-info {
  width: 42px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ref-info svg {
  width: 20px;
  height: 20px;
}

.ref-info:hover,
.ref-info:focus-visible {
  color: #fff;
  border-color: rgba(0, 152, 234, 0.4);
  background: rgba(0, 152, 234, 0.12);
}

.ref-modal[hidden] {
  display: none;
}

.ref-modal {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 20px 18px;
}

.ref-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(6, 8, 12, 0.72);
  cursor: pointer;
}

.ref-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  padding: 18px 16px 16px;
  border-radius: 18px;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.ref-modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ref-modal-top h3 {
  font-size: 18px;
  font-weight: 800;
}

.ref-modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ref-modal-block {
  padding: 14px 0;
}

.ref-modal-block + .ref-modal-block {
  border-top: 1px solid var(--line);
}

.ref-modal-block h4 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
  text-align: center;
}

.ref-modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.friend-row {
  cursor: pointer;
}

.friend-bonus {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
  min-width: 0;
}

.friend-bonus-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.friend-bonus-reward {
  min-width: 0;
  color: #9ad8ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.friend-bonus-label {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  white-space: nowrap;
}

.friend-bonus-track {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.friend-bonus-track[hidden] {
  display: none;
}

.friend-bonus-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0077c8, #4ec4ff);
}

.friend-bonus.is-done {
  gap: 0;
  margin-top: 3px;
}

.friend-bonus.is-done .friend-bonus-reward,
.friend-bonus.is-done .friend-bonus-label {
  color: #8ee8bc;
}

.friend-bonus-card {
  margin: 2px 0 14px;
}

.friend-bonus-card[hidden] {
  display: none;
}

.friend-bonus-card > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.friend-bonus-card .friend-bonus {
  margin-top: 0;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 152, 234, 0.08);
  border: 1px solid rgba(0, 152, 234, 0.18);
}

.friend-bonus-card .friend-bonus.is-done {
  background: rgba(62, 207, 154, 0.1);
  border-color: rgba(62, 207, 154, 0.24);
}

.friend-card {
  position: relative;
  padding: 16px 16px 20px;
}

.friend-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.friend-card-nick {
  display: block;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  padding: 2px 40px 12px;
}

.friend-card-rule {
  border: 0;
  height: 1px;
  margin: 0 -16px 14px;
  background: rgba(148, 180, 210, 0.2);
}

.friend-card-heading {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

.friend-card-stats {
  margin-bottom: 14px;
}

.friend-card-stats .stat {
  text-align: center;
}

.friend-card-stats .stat span {
  line-height: 1.25;
}

.friend-card-stats .stat strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.friend-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
}

.friend-card .mock-avatar {
  width: 72px;
  height: 72px;
  font-size: 20px;
  border-radius: 14px;
  flex-shrink: 0;
}

.friend-card-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.friend-card > .friend-card-lines {
  margin-bottom: 14px;
}

.friend-card-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.friend-card-line span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.friend-card-line strong {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.friend-card-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 14px;
}

.friend-card-table th,
.friend-card-table td {
  padding: 8px 4px;
  text-align: center;
  font-size: 13px;
}

.friend-card-table th {
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 10px;
}

.friend-card-table td {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.friend-card-table td:first-child {
  color: #7ee0a8;
  letter-spacing: 0.04em;
}

.friend-card-table tbody tr + tr td {
  border-top: 1px solid rgba(148, 180, 210, 0.16);
  padding-top: 10px;
}

.friend-card-earned {
  text-align: center;
  padding: 12px 14px;
}

.friend-card-earned span {
  font-size: 13px;
  line-height: 1.25;
}

.friend-card-earned strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.ref-tabs button {
  border: 0;
  border-radius: 10px;
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.ref-tabs button.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0, 152, 234, 0.28);
}

.mock-avatar.tone-1 {
  background: linear-gradient(145deg, #3a7cff, #12308a);
}

.mock-avatar.tone-2 {
  background: linear-gradient(145deg, #2ecf9a, #14785a);
}

.mock-avatar.tone-3 {
  background: linear-gradient(145deg, #c084fc, #5b21b6);
}

.page-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 0 4px;
}

.bots-panel {
  overflow: auto;
}

.gen-pay-tabs {
  flex: none;
  align-self: stretch;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gen-pay-pane[hidden] {
  display: none;
}

.gen-pay-pane:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 10px;
}

.bots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bots-head .friends-info {
  width: 38px;
  height: 38px;
}

.bots-earn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px 12px 14px;
  background: rgba(8, 18, 28, 0.85);
  border: 3px solid rgba(200, 224, 240, 0.55);
  border-radius: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

.gen-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}

.is-preview #tab-bots.page-panel {
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.is-preview .gen-actions {
  margin-top: 6px;
  margin-bottom: 6px;
}

.gen-actions .mock-cta {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.bots-claim-cta {
  width: 100%;
  flex-shrink: 0;
}

.bots-tabs {
  flex: none;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.bots-pane[hidden] {
  display: none;
}

#bots-pane-upgrade:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.bots-bonus-note {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 152, 234, 0.08);
  border: 1px solid rgba(0, 152, 234, 0.18);
  color: #c5d6e6;
  font-size: 13px;
  line-height: 1.45;
}

.bots-upgrade-cta {
  width: 100%;
  margin-top: auto;
}

.gen-ready {
  padding: 16px 16px 14px;
  border-radius: 18px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(42, 207, 255, 0.16), transparent 55%),
    rgba(8, 18, 28, 0.85);
  border: 1px solid rgba(0, 152, 234, 0.4);
  box-shadow: 0 0 28px rgba(0, 152, 234, 0.12);
}

.gen-kicker {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gen-ready-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.gen-ready-value strong {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gen-ready-value span,
.gen-next-hint {
  color: #9ad8ff;
  font-size: 14px;
  font-weight: 700;
}

.gen-progress {
  height: 8px;
  margin-top: 14px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.gen-progress i {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #0a6eab, #2acfff);
  box-shadow: 0 0 12px rgba(42, 207, 255, 0.45);
}

.gen-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gen-next {
  margin-top: 8px;
  color: #9ad8ff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gen-section {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.gen-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gen-stats .stat:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.gen-stats .stat {
  position: relative;
  padding-right: 34px;
}

.gen-stats .stat strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 18px;
}

.gen-stats .stat strong small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.gen-stat-info {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.gen-stat-info svg {
  width: 14px;
  height: 14px;
}

.gen-upgrade-card[hidden] {
  display: none;
}

.gen-upgrade-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(0, 152, 234, 0.35);
  background: rgba(0, 152, 234, 0.08);
}

.gen-upgrade-card h4 {
  font-size: 16px;
  font-weight: 800;
}

.gen-upgrade-card .gen-stats .stat {
  padding-right: 10px;
  background: rgba(8, 18, 28, 0.45);
}

.gen-upgrade-card .mock-cta,
.gen-pay-pane .mock-cta {
  width: 100%;
}

.bots-claim-cta:disabled {
  opacity: 0.45;
  cursor: default;
}

#gen-pay-tabs button {
  min-height: 40px;
  font-size: 14px;
}

#gen-pay-tabs button.active {
  box-shadow: 0 0 16px rgba(42, 207, 255, 0.35);
}

#tab-calc .gen-amount {
  margin-top: 4px;
  margin-bottom: 8px;
}

#tab-calc .gen-amount span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#tab-calc .gen-amount input {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  padding: 8px 12px;
  border-color: rgba(42, 207, 255, 0.55);
  background: rgba(0, 152, 234, 0.1);
  box-shadow: 0 0 24px rgba(0, 152, 234, 0.12);
}

.gen-quick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.gen-quick button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  min-height: 36px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.gen-quick button.active {
  border-color: rgba(42, 207, 255, 0.75);
  background: rgba(0, 152, 234, 0.28);
  color: #fff;
  box-shadow: 0 0 12px rgba(42, 207, 255, 0.25);
}

.gen-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.gen-result .offer {
  background: rgba(8, 18, 28, 0.55);
}

.gen-pay-pane .friends-intro {
  margin: 0;
}

#tab-calc.page-panel {
  gap: 6px;
}

#tab-calc .friends-intro {
  padding: 8px 10px;
}

#tab-calc .friends-intro p {
  font-size: 12px;
  line-height: 1.35;
}

#tab-calc .gen-result {
  gap: 6px;
  padding: 8px;
}

#tab-calc .gen-result .offer {
  padding: 8px 10px;
  border-radius: 14px;
}

#tab-calc .gen-result .offer-text h3 {
  margin-bottom: 0;
  font-size: 14px;
}

#tab-calc .gen-pay-pane:not([hidden]) {
  gap: 6px;
}

#tab-calc #gen-pay-tabs button {
  min-height: 34px;
}

#bots-pane-stats:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bots-stats-title {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  padding: 6px 0 2px;
}

.bots-stats-title:not(:first-child) {
  margin-top: 10px;
  padding-top: 14px;
}

.bots-next-game {
  justify-content: center;
  min-height: 52px;
}

.bots-next-game strong {
  width: 100%;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

#bots-pane-stats .offer-text h3 {
  margin-bottom: 0;
}

.bots-param-ava {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bots-param-ava svg {
  width: 34px;
  height: 34px;
}

.bots-param-info {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.bots-param-info svg {
  width: 18px;
  height: 18px;
}

.bots-params .friend-name {
  display: block;
  line-height: 1.25;
  white-space: normal;
}

.bots-param-bar {
  position: relative;
  height: 18px;
  margin-top: 6px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(62, 207, 154, 0.1);
  --min: 1;
  --max: 86400;
  --val: 1;
}

.bots-param-bar i {
  display: block;
  width: calc((var(--val) - var(--min)) / (var(--max) - var(--min)) * 100%);
  max-width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #157f6c, #3ecf9a);
}

.bots-param-bar span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #e8f4fc;
  text-shadow: 0 1px 4px rgba(8, 14, 22, 0.7);
}

.bot-info-text {
  color: #c5d6e6;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.page-kicker {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.page-head .page-title {
  min-width: 0;
  line-height: 1.15;
}

.friends-title-row .page-head,
.bots-head .page-head {
  flex: 1;
}

.page-back {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.page-back svg {
  width: 20px;
  height: 20px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.mock-cta {
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.gen-actions .gen-upgrade-side {
  --head-angle: 0deg;
  border: 1px solid transparent;
  background:
    linear-gradient(#122033, #122033) padding-box,
    conic-gradient(from var(--head-angle), rgba(42, 207, 255, 0.2) 0deg, #7ad7ff 70deg, #fff 108deg, #2acfff 150deg, rgba(42, 207, 255, 0.15) 220deg, rgba(42, 207, 255, 0.2) 360deg) border-box;
  color: #d7f3ff;
  animation: head-top-angle 3.2s linear infinite, head-top-glow 2.4s ease-in-out infinite;
}

button.offer {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.offer-nav strong {
  font-size: 18px;
  font-weight: 400;
  color: var(--muted);
}

.tasks-label {
  margin: 8px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.task-row .task-cta {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.task-row .task-cta:disabled {
  opacity: 0.55;
  cursor: default;
}

.task-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(0, 152, 234, 0.16);
  color: #d6f1ff;
}

.task-icon svg,
.task-icon img {
  width: 22px;
  height: 22px;
}

#tab-tasks .page-head {
  align-items: flex-start;
}

#tab-tasks .tasks-heading {
  min-width: 0;
}

#tab-tasks .tasks-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

#tab-tasks .tasks-clock {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

#tab-tasks.page-panel {
  overflow-x: hidden;
}

#tasks-tabs {
  flex: none;
  width: 100%;
  align-self: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#tasks-tabs button {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0;
  padding: 8px 2px;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

#tasks-body {
  display: grid;
  gap: 10px;
  flex: none;
  min-width: 0;
  overflow: hidden;
}

#tasks-body.is-leave {
  animation: tasks-leave 0.18s ease forwards;
}

#tasks-body.is-enter {
  animation: tasks-enter 0.24s ease;
}

@keyframes tasks-leave {
  to {
    opacity: 0;
    transform: translateX(calc(var(--tasks-from, 16px) * -1));
  }
}

@keyframes tasks-enter {
  from {
    opacity: 0;
    transform: translateX(var(--tasks-from, 16px));
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tasks-tabs button,
  #tasks-body.is-leave,
  #tasks-body.is-enter,
  #tab-tasks .tasks-bonus {
    animation: none;
    transition: none;
  }
}

#tab-tasks .tasks-list {
  display: grid;
  gap: 8px;
}

#tab-tasks .tasks-section {
  margin: 8px 2px 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#tab-tasks .tasks-section:first-child {
  margin-top: 0;
}

#tab-tasks .task-card,
#tab-tasks .tasks-bonus {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

#tab-tasks .task-card.is-claim {
  border-color: rgba(0, 152, 234, 0.5);
  background: rgba(0, 152, 234, 0.1);
  box-shadow: inset 0 0 18px rgba(0, 152, 234, 0.14);
}

#tab-tasks .task-card.is-claimed {
  opacity: 0.72;
}

#tab-tasks .task-card.is-locked {
  opacity: 0.5;
}

#tab-tasks .task-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

#tab-tasks .task-card-copy {
  flex: 1;
  min-width: 0;
}

#tab-tasks .task-card-copy strong {
  display: block;
  font-size: 14px;
}

#tab-tasks .task-card-copy p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#tab-tasks .task-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

#tab-tasks .task-cta {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

#tab-tasks .task-badge {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

#tab-tasks .task-badge.is-done {
  color: #8ee8bc;
  background: rgba(62, 207, 142, 0.12);
}

#tab-tasks .task-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

#tab-tasks .task-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#tab-tasks .task-prize {
  color: #9ad8ff;
}

#tab-tasks .task-bar {
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

#tab-tasks .task-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0077c8, #4ec4ff);
  box-shadow: 0 0 8px rgba(78, 196, 255, 0.35);
}

#tab-tasks .task-card.is-claimed .task-bar span,
#tab-tasks .tasks-bonus.is-done .task-bar span {
  background: #3dcaa0;
  box-shadow: none;
}

#tab-tasks .tasks-bonus {
  --head-angle: 0deg;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #3a220f 0%, #140e0a 100%) padding-box,
    conic-gradient(from var(--head-angle), #ff9a3c 0deg, #ffe7a3 48deg, #ff4d1a 110deg, #ffb020 180deg, #ff7a18 240deg, #ffe7a3 300deg, #ff9a3c 360deg) border-box;
  box-shadow: inset 0 0 18px rgba(255, 120, 30, 0.22);
  animation: head-top-angle 3.6s linear infinite, tasks-bonus-burn 2.2s ease-in-out infinite;
}

#tab-tasks .tasks-bonus .task-icon {
  background: rgba(255, 150, 40, 0.22);
  color: #ffd27a;
}

#tab-tasks .tasks-bonus .task-card-copy strong {
  color: #fff1d2;
}

#tab-tasks .tasks-bonus .task-card-copy p,
#tab-tasks .tasks-bonus .task-count {
  color: #e7c9a4;
}

#tab-tasks .tasks-bonus .task-prize {
  color: #ffd56a;
  font-size: 14px;
  text-shadow: 0 0 10px rgba(255, 160, 40, 0.7);
}

#tab-tasks .tasks-bonus .task-bar {
  background: rgba(255, 170, 70, 0.16);
}

#tab-tasks .tasks-bonus .task-bar span {
  background: linear-gradient(90deg, #ff5a1f, #ffd56a);
  box-shadow: 0 0 8px rgba(255, 150, 40, 0.55);
}

@keyframes tasks-bonus-burn {
  0%, 100% { box-shadow: inset 0 0 14px rgba(255, 110, 20, 0.2); }
  50% { box-shadow: inset 0 0 28px rgba(255, 176, 50, 0.48); }
}

#tab-tasks .tasks-bonus[hidden] {
  display: none;
}

#tab-withdraw .mock-cta {
  margin-top: 10px;
}

.withdraw-payouts {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.withdraw-payouts h4 {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.payout-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.payout-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.payout-id {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.payout-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.payout-status.wait {
  color: #9ad8ff;
  background: rgba(0, 152, 234, 0.16);
}

.payout-status.ok {
  color: #7ee0a8;
  background: rgba(46, 180, 110, 0.16);
}

.payout-status.cancel {
  color: #ff9b9b;
  background: rgba(220, 80, 80, 0.16);
}

.payout-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.payout-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Иконку монеты держим маленькой в любом месте карточки: у SVG своих размеров нет. */
.payout-card img,
.payout-amount img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.payout-wallet {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-tx {
  justify-self: start;
  margin-top: -4px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.payout-tx::before {
  content: "↗ ";
}

.mock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.rates-table-wrap {
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.rates-table th,
.rates-table td {
  padding: 11px 8px;
  text-align: center;
}

.rates-table th:first-child,
.rates-table td:first-child {
  width: 46%;
  text-align: left;
  padding-left: 14px;
}

.rates-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: rgba(0, 152, 234, 0.08);
}

.rates-table th:not(:first-child) {
  color: #7ee0a8;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.rates-table td {
  font-size: 13px;
}

.rates-table td:not(:first-child) {
  color: #9ad8ff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rates-table tbody tr + tr td {
  border-top: 1px solid var(--line);
}

#tab-rates .friends-actions {
  margin-top: 8px;
}

.mock-row .hist-login {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hist-row {
  padding-top: 9px;
  padding-bottom: 9px;
}

.hist-row .mock-avatar {
  width: 42px;
  height: 42px;
  font-size: 12px;
}

.mock-row strong.friend-name {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.friend-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  transform: translateY(1px);
}

.friend-status.on {
  background: #7ee0a8;
}

.friend-status.off {
  background: #ff6b6b;
}

.hist-lvl {
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  color: #7ee0a8;
  background: rgba(0, 152, 234, 0.08);
  border: 1px solid rgba(0, 152, 234, 0.18);
}

.mock-row > div {
  flex: 1;
  min-width: 0;
}

.mock-row strong {
  display: block;
  font-size: 14px;
}

.mock-row p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.mock-row p.ref-online {
  color: #7ee0a8;
}

.mock-row p.ref-offline {
  color: #ff9b9b;
}

.friend-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.friend-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.friend-meta svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.hist-row > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 42px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.friend-row > div {
  height: auto;
  justify-content: center;
  gap: 2px;
  padding-top: 0;
  padding-bottom: 0;
}

.hist-row p {
  margin-top: 0;
}

.mock-row em {
  font-style: normal;
  color: #9ad8ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mock-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(145deg, #0098ea, #003056);
  flex-shrink: 0;
}

.mock-avatar.alt {
  background: linear-gradient(145deg, #3a7cff, #12308a);
}

.rank {
  width: 24px;
  text-align: center;
  font-family: Orbitron, sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.promo-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.promo-card > span {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: Orbitron, sans-serif;
  font-size: 14px;
  background: rgba(0, 152, 234, 0.16);
  color: #d6f1ff;
}

.promo-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.promo-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mock-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.mock-field input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

#tab-calc .mock-field,
#tab-pay-ton .mock-field,
#tab-pay-bot .mock-field {
  margin-top: 16px;
  margin-bottom: 14px;
}

#tab-calc .mock-field.gen-amount {
  margin-top: 4px;
  margin-bottom: 8px;
}

.pay-ton-send {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(62, 207, 154, 0.16);
  border: 1px solid rgba(62, 207, 154, 0.38);
  color: #7ee0a8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.pay-ton-send:empty {
  display: none;
}

#pay-ton-wallet,
#pay-ton-memo,
#pay-bot-wallet,
#pay-bot-memo {
  word-break: break-all;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#tab-pay-ton .mock-cta.is-copied,
#tab-pay-bot .mock-cta.is-copied {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay-ton-check {
  width: 18px;
  height: 18px;
  color: #3ecf9a;
}

#tab-pay-ton.page-panel {
  gap: 8px;
}

#tab-pay-ton .pay-hero {
  padding: 14px 12px 12px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(42, 207, 255, 0.18), transparent 60%),
    rgba(8, 18, 28, 0.85);
  border: 1px solid rgba(0, 152, 234, 0.4);
}

#tab-pay-ton .pay-hero strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
}

#tab-pay-ton .pay-hero span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#tab-pay-ton .pay-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 176, 46, 0.14);
  border: 1px solid rgba(255, 176, 46, 0.7);
}

#tab-pay-ton .pay-warn-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #ffb02e;
  color: #1a1204;
  font-size: 18px;
  font-weight: 800;
}

#tab-pay-ton .pay-warn strong {
  display: block;
  color: #ffd27a;
  font-size: 14px;
  letter-spacing: 0.03em;
  line-height: 1.25;
}

#tab-pay-ton .pay-warn p {
  margin-top: 4px;
  color: #ffe7bf;
  font-size: 13px;
  line-height: 1.35;
}

#tab-pay-ton .pay-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

#tab-pay-ton .pay-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#tab-pay-ton .pay-card-memo {
  border-color: rgba(255, 176, 46, 0.55);
  background: rgba(255, 176, 46, 0.08);
}

#tab-pay-ton .pay-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

#tab-pay-ton .pay-value input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0;
}

#tab-pay-ton #pay-ton-memo {
  font-size: 32px;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.04em;
}

#tab-pay-ton #pay-ton-wallet {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 700;
  word-break: break-all;
}

#tab-pay-ton .pay-copy-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 152, 234, 0.45);
  border-radius: 12px;
  background: rgba(0, 152, 234, 0.12);
  color: #d6f1ff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

#tab-pay-ton .pay-copy-icon svg {
  width: 18px;
  height: 18px;
}

#tab-pay-ton .pay-card .mock-cta {
  width: 100%;
}

#tab-pay-ton .pay-cta-secondary {
  background: transparent;
  border: 1px solid rgba(0, 152, 234, 0.55);
  color: #9ad8ff;
}

#tab-pay-ton .pay-steps {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

#tab-pay-ton .pay-steps h4 {
  margin-bottom: 8px;
  font-size: 14px;
}

#tab-pay-ton .pay-steps ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #d5e6f2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#tab-pay-ton .pay-note p {
  font-size: 13px;
}

#calc-ton,
#calc-stars,
#calc-f-amount {
  padding: 18px 14px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.buy-bot-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 2px auto 12px;
  border-radius: 18px;
  background: rgba(0, 152, 234, 0.14);
  border: 1px solid rgba(0, 152, 234, 0.3);
  color: #7ee0ff;
}

.buy-bot-icon svg {
  width: 34px;
  height: 34px;
}

#buy-bot-cta,
#buy-bot-ton {
  width: 100%;
  margin-top: 14px;
}

#buy-bot-ton {
  margin-top: 8px;
}

/* Заглушка забаненного: перекрывает всё, включая нижнее меню. */
.banned-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 28px;
  text-align: center;
  background: #0e1621;
}

.banned-screen strong {
  font-size: 22px;
  color: #ff9b9b;
}

.banned-screen p {
  margin: 0;
  max-width: 320px;
  color: var(--muted);
  line-height: 1.45;
}

/* Ответ на заявку показываем прямо над полями, а не тостом внизу экрана. */
.form-note {
  margin: 0 0 4px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.form-note[hidden] {
  display: none;
}

.form-note.error {
  color: #ff9b9b;
  background: rgba(220, 80, 80, 0.16);
  border: 1px solid rgba(220, 80, 80, 0.35);
}

.form-note.ok {
  color: #7ee0a8;
  background: rgba(46, 180, 110, 0.16);
  border: 1px solid rgba(46, 180, 110, 0.35);
}

.withdraw-receive {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  min-height: 46px;
  pointer-events: none;
}

.withdraw-receive img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.withdraw-receive span {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  flex-shrink: 0;
  padding: 6px 4px 10px;
  border-top: 1px solid var(--line);
  background: rgba(14, 22, 33, 0.96);
}

.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 4px 2px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.tabbar svg {
  width: 22px;
  height: 22px;
}

.tabbar button.active,
.tabbar button.open {
  color: #fff;
}

.tabbar button.active svg,
.tabbar button.open svg {
  color: var(--red);
}

.tabbar [data-tab="top"] {
  display: none;
}

.tabbar .tab-more {
  display: grid;
  position: relative;
}

#tab-more .contest-new,
.more-sheet button[data-go="contests"] .contest-new {
  display: none;
}

html.is-contest-new #tab-more .contest-new {
  display: block;
  position: absolute;
  top: 0;
  right: 2px;
  z-index: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background: #0098ea;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  animation: mult-new-pulse 1.8s ease-in-out infinite;
}

html.is-contest-new .more-sheet button[data-go="contests"] .contest-new {
  display: inline-block;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #0098ea;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  animation: mult-new-pulse 1.8s ease-in-out infinite;
}

.more-backdrop {
  position: absolute;
  inset: 0 0 62px;
  border: 0;
  padding: 0;
  background: rgba(4, 6, 10, 0.62);
  z-index: 8;
  cursor: pointer;
}

.more-backdrop[hidden],
.more-sheet[hidden] {
  display: none !important;
}

.more-sheet {
  position: absolute;
  left: auto;
  right: 10px;
  width: min(240px, calc(100% - 20px));
  bottom: 70px;
  z-index: 9;
  display: grid;
  gap: 4px;
  padding: 10px 10px 12px;
  border-radius: 22px;
  background: #17212b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  animation: sheet-up 0.18s ease-out;
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.more-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin: 2px auto 6px;
}

.more-caption {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 8px 4px;
}

.more-sheet button {
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}

.more-sheet button:hover,
.more-sheet button.active {
  background: rgba(255, 255, 255, 0.06);
}

.more-sheet svg {
  width: 20px;
  height: 20px;
  color: var(--red);
}

.more-sheet button[hidden],
.more-sheet .more-later {
  display: none;
}

.more-sheet .more-soon {
  display: none;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(192, 132, 252, 0.16);
  color: #e9d5ff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.more-sheet button.is-soon,
.more-sheet button[data-more-soon] {
  color: rgba(255, 255, 255, 0.46);
  cursor: default;
  opacity: 1;
  pointer-events: none;
}

.more-sheet button.is-soon svg,
.more-sheet button[data-more-soon] svg {
  color: rgba(255, 255, 255, 0.32);
}

.more-sheet button.is-soon:hover,
.more-sheet button.is-soon:active,
.more-sheet button[data-more-soon]:hover,
.more-sheet button[data-more-soon]:active {
  background: transparent;
}

.more-sheet button.is-soon .more-soon,
.more-sheet button[data-more-soon] .more-soon {
  display: inline-block;
}

html.is-preview .more-sheet button[data-go="contests"] {
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
}

html.is-preview .more-sheet button[data-go="contests"] svg {
  color: var(--red);
}

html.is-preview .more-sheet button[data-go="contests"]:hover,
html.is-preview .more-sheet button[data-go="contests"]:active {
  background: rgba(255, 255, 255, 0.06);
}

html.is-preview .more-sheet button[data-go="contests"] .more-soon {
  display: none;
}

html.is-miniapp,
html.is-miniapp body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-miniapp body {
  background: #0e1621;
}

html.is-miniapp {
  /* Telegram пишет свою вставку даже когда она 0px, и тогда env() раньше не читался. */
  --tg-bottom: calc(
    var(--tg-safe-area-inset-bottom, 0px) +
    var(--tg-content-safe-area-inset-bottom, 0px)
  );
  --safe-bottom: max(var(--tg-bottom), env(safe-area-inset-bottom, 0px));
  --tabbar-h: calc(58px + var(--safe-bottom));
}

html.is-miniapp .studio {
  display: block;
  min-height: 100%;
  height: 100%;
  padding: 0;
}

html.is-miniapp .phone-bezel {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

html.is-miniapp .island,
html.is-miniapp .status {
  display: none;
}

html.is-miniapp .screen {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border-radius: 0;
}

html.is-miniapp .phone {
  height: 100%;
}

/*
 * В фуллскрине Telegram отдаёт две вставки сверху: safe-area — вырез и островок
 * устройства, content-safe-area — собственная шапка с крестиком. Их складываем,
 * иначе шапка игры уезжает под них. Вне фуллскрина обе равны нулю.
 */
html.is-miniapp .app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding-top: calc(
    var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) +
    var(--tg-content-safe-area-inset-top, 0px)
  );
}

html.is-miniapp .board-wrap {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.is-miniapp .board {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1;
  flex: 0 0 auto;
}

html.is-miniapp .tabbar {
  padding: 6px 4px calc(10px + var(--safe-bottom));
}

html.is-miniapp .more-sheet {
  bottom: calc(var(--tabbar-h) + 8px);
}

html.is-miniapp .more-backdrop {
  inset: 0 0 var(--tabbar-h);
}

html.is-miniapp .toast {
  bottom: calc(var(--tabbar-h) + 24px);
}

@media (max-width: 900px) {
  .studio {
    padding: 24px 16px 48px;
  }

  html.is-miniapp .studio {
    padding: 0;
  }
}

body.land {
  min-height: 100vh;
  padding: 0;
}

.land-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 24px;
}

.land-brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.land-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
}

.land-brand strong {
  font-family: Orbitron, sans-serif;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.land-brand p {
  color: var(--muted);
  font-size: 14px;
}

.land-lang {
  position: relative;
}

.land-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.land-lang-btn:hover,
.land-lang-btn[aria-expanded="true"] {
  border-color: rgba(0, 152, 234, 0.45);
  background: rgba(0, 152, 234, 0.1);
}

.land-lang-caret {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.land-lang-btn[aria-expanded="true"] .land-lang-caret {
  transform: rotate(180deg);
}

.land-flag {
  width: 26px;
  height: 19px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  flex: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}

.land-flag[data-flag="en"] { background-image: url("/assets/img/flags/en.png"); }
.land-flag[data-flag="ru"] { background-image: url("/assets/img/flags/ru.png"); }
.land-flag[data-flag="es"] { background-image: url("/assets/img/flags/es.png"); }
.land-flag[data-flag="it"] { background-image: url("/assets/img/flags/it.png"); }
.land-flag[data-flag="de"] { background-image: url("/assets/img/flags/de.png"); }
.land-flag[data-flag="fr"] { background-image: url("/assets/img/flags/fr.png"); }
.land-flag[data-flag="nl"] { background-image: url("/assets/img/flags/nl.png"); }
.land-flag[data-flag="pl"] { background-image: url("/assets/img/flags/pl.png"); }
.land-flag[data-flag="tr"] { background-image: url("/assets/img/flags/tr.png"); }
.land-flag[data-flag="id"] { background-image: url("/assets/img/flags/id.png"); }
.land-flag[data-flag="uz"] { background-image: url("/assets/img/flags/uz.png"); }

.land-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 188px;
  max-height: min(70vh, 420px);
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #17212b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.land-lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.land-lang-menu button:hover,
.land-lang-menu button[aria-selected="true"] {
  background: rgba(0, 152, 234, 0.12);
}

.land-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.land-kicker {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.land-hero h1 {
  font-family: Orbitron, sans-serif;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.land-lead {
  color: #c5d6e6;
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 520px;
}

.land-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  margin-top: 10px;
}

.land-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 22px;
  border-radius: 16px;
  padding: 18px 56px;
  min-width: 280px;
}

.land-cta-note {
  width: 0;
  min-width: 100%;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.land-mini-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: #121c28;
  border: 1px solid var(--line);
}

.land-mini-board .tile {
  position: relative;
  width: auto;
  height: auto;
  left: auto;
  top: auto;
  transform: none;
  will-change: auto;
  transition: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio: 1;
  min-height: 104px;
  padding: 13px 8px 8px;
  box-sizing: border-box;
}

.land-mini-board .tile img {
  position: static;
  width: 72%;
  height: auto;
  max-height: calc(100% - 18px);
  flex: 0 0 auto;
  transform: none;
  object-fit: contain;
}

.land-mini-board .tile span {
  position: static;
  margin-top: auto;
  display: block;
  width: 100%;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.land-divider {
  max-width: 1080px;
  height: 1px;
  margin: 48px auto;
  padding: 0 24px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 152, 234, 0.5), transparent);
  background-clip: content-box;
}

.land-stats {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.land-stats article {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
}

.land-stat-paid {
  padding-right: 52px;
}

.stat-info {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 152, 234, 0.14);
  color: var(--accent);
  text-decoration: none;
  transform: translateY(-50%);
}

.stat-info:hover {
  background: rgba(0, 152, 234, 0.28);
}

.stat-info svg {
  width: 18px;
  height: 18px;
}

.land-stats span {
  display: block;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

.land-stats strong {
  font-size: 26px;
  font-weight: 800;
  white-space: nowrap;
}

.land-how {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.land-how h2,
.land-bottom h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

.land-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.land-steps article {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.land-steps b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(0, 152, 234, 0.18);
  color: var(--accent);
  margin-bottom: 10px;
}

.land-steps h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.land-steps p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.land-bottom {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 140px;
  text-align: center;
}

.land-bottom p {
  color: var(--muted);
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .land-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 8px;
  }

  .land-hero h1 {
    font-size: 32px;
  }

  .land-stats,
  .land-steps {
    grid-template-columns: 1fr;
  }

}

#tab-contests.page-panel {
  min-width: 0;
  overflow-x: hidden;
}

#tab-contests.page-panel > * {
  flex: none;
}

#contests-body,
#tab-contests .contest-stack,
#tab-contests .contest-top {
  min-width: 0;
  max-width: 100%;
}

#tab-contests .top-row {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#tab-contests .top-row > div,
#tab-contests .top-row strong,
#tab-contests .top-row p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#contest-tabs {
  flex: none;
  width: 100%;
  align-self: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#contest-tabs button {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  letter-spacing: 0;
  padding: 8px 2px;
}

#tab-contests .page-head {
  align-items: center;
  flex-wrap: wrap;
}

#tab-contests .contest-lead {
  margin: -2px 0 0 46px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
}

#tab-contests .tasks-heading {
  flex: 1;
  min-width: 0;
}

#tab-contests .contest-help-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}

#tab-contests .contest-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#tab-contests .contest-actions.is-single {
  grid-template-columns: 1fr;
}

#tab-contests .contest-actions .mock-cta,
#tab-contests .contest-actions .contest-about {
  width: 100%;
  margin: 0;
  border-radius: 12px;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

#tab-contests .contest-actions .contest-about {
  border: 1px solid rgba(0, 152, 234, 0.55);
  background: transparent;
  color: #9ad8ff;
}

#contest-modal {
  overflow: hidden;
  grid-template-rows: minmax(0, 1fr);
}

#contest-modal .contest-modal-card {
  width: min(100%, 340px);
  max-height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 16px 18px;
  background:
    linear-gradient(180deg, rgba(0, 152, 234, 0.18), rgba(0, 152, 234, 0) 78px),
    #17212b;
  border-color: rgba(0, 152, 234, 0.38);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), inset 0 0 22px rgba(0, 152, 234, 0.08);
  animation: contest-modal-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#contest-modal .ref-modal-top {
  flex: none;
  align-items: center;
  margin-bottom: 0;
}

#contest-modal .contest-modal-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 152, 234, 0.16);
  color: #d6f1ff;
}

#contest-modal .contest-modal-mark svg {
  width: 20px;
  height: 20px;
}

#contest-modal .ref-modal-top h3 {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
}

#contest-modal .contest-modal-text {
  flex: 1 1 auto;
  min-height: 0;
  margin: 14px 0 0;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #d5e4f0;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

@keyframes contest-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#tab-contests .contest-stack {
  display: grid;
  gap: 10px;
}

#tab-contests .contest-featured,
#tab-contests .contest-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  overflow: hidden;
}

#tab-contests .contest-fold {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#tab-contests .contest-fold .task-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
}

#tab-contests .contest-card {
  gap: 0;
  transition: border-color 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}

#tab-contests .contest-card.is-season {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 196, 72, 0.22), transparent 55%),
    rgba(255, 186, 64, 0.1);
  border-color: rgba(255, 196, 72, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 214, 120, 0.18), 0 10px 28px rgba(120, 72, 0, 0.18);
}

#tab-contests .contest-card.is-season .contest-name,
#tab-contests .contest-card.is-season .contest-kicker {
  color: #ffd56a;
}

#tab-contests .contest-chevron {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: start;
  justify-self: end;
  width: 28px;
  height: 28px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(0, 152, 234, 0.2);
  color: #d6f1ff;
  stroke-width: 2.6;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.45s ease;
}

#tab-contests .contest-card.is-open .contest-chevron {
  transform: rotate(180deg);
  background: rgba(0, 152, 234, 0.38);
}

#tab-contests .contest-fold-body {
  display: grid;
  grid-template-rows: 0fr;
  min-width: 0;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#tab-contests .contest-card.is-open .contest-fold-body {
  grid-template-rows: 1fr;
}

#tab-contests .contest-fold-inner {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding-top: 12px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.28s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#tab-contests .contest-card.is-open .contest-fold-inner {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

#tab-contests .contest-card.is-open:not(.is-upcoming):not(.is-done):not(.is-reward) {
  border-color: rgba(0, 152, 234, 0.55);
  background: rgba(0, 152, 234, 0.1);
  box-shadow: inset 0 0 18px rgba(0, 152, 234, 0.14);
}

#tab-contests .contest-featured {
  border-color: rgba(0, 152, 234, 0.55);
  background: rgba(0, 152, 234, 0.1);
  box-shadow: inset 0 0 18px rgba(0, 152, 234, 0.14);
}

#tab-contests .contest-kicker {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#tab-contests .task-card-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

#tab-contests .task-card-copy {
  display: contents;
}

#tab-contests .contest-name,
#tab-contests .contest-mini strong,
#tab-contests .contest-board-title {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

#tab-contests .contest-name,
#tab-contests .contest-blurb {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#tab-contests .contest-name {
  grid-column: 2;
  grid-row: 1;
  -webkit-line-clamp: 1;
  height: 1.25em;
}

#tab-contests .contest-blurb {
  grid-column: 2;
  grid-row: 2;
  -webkit-line-clamp: 1;
  height: 1.35em;
  margin: 0;
  padding-right: 56px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#tab-contests .contest-mini p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#tab-contests .contest-time,
#tab-contests .contest-meta,
#tab-contests .contest-you {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

#tab-contests .contest-time span,
#tab-contests .contest-meta span {
  flex: none;
  color: var(--muted);
}

#tab-contests .contest-time strong,
#tab-contests .contest-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#tab-contests .contest-prize-block {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 193, 74, 0.08);
  border: 1px solid rgba(255, 193, 74, 0.28);
}

#tab-contests .contest-prize-block p {
  margin: 0;
  color: #ffc14a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#tab-contests .contest-prize-block ul {
  list-style: none;
  display: grid;
  gap: 4px;
}

#tab-contests .contest-prize-block li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

#tab-contests .contest-prize-block li span {
  color: var(--muted);
  font-weight: 600;
}

#tab-contests .contest-progress {
  display: grid;
  gap: 6px;
}

#tab-contests .contest-progress p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

#tab-contests .contest-progress span {
  color: var(--muted);
}

#tab-contests .contest-featured .mock-cta,
#tab-contests .contest-claim {
  width: 100%;
}

#tab-contests .contest-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

#tab-contests .contest-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#tab-contests .contest-section-head h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

#tab-contests .contest-section-head button,
#tab-contests .contest-back-link {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

#tab-contests .contest-top {
  display: grid;
  gap: 8px;
}

#tab-contests .contest-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 2px;
}

#tab-contests .contest-mini {
  position: relative;
  flex: 0 0 78%;
  scroll-snap-align: start;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 28px 12px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#tab-contests .contest-more {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: var(--accent-2);
  font-size: 22px;
  line-height: 1;
}

#tab-contests .contest-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

#tab-contests .contest-fold > .contest-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  margin: 0;
  border-radius: 12px 0 15px 0;
}

#tab-contests .contest-card.is-open .contest-fold > .contest-badge {
  display: none;
}

#tab-contests .contest-badge.is-active {
  color: #b7ebc9;
  background: rgba(46, 160, 96, 0.28);
}

#tab-contests .contest-badge.is-soon {
  color: #e9d5ff;
  background: rgba(192, 132, 252, 0.16);
}

#tab-contests .contest-card.is-upcoming {
  border-color: rgba(192, 132, 252, 0.28);
}

#tab-contests .contest-card.is-done {
  opacity: 0.72;
}

#tab-contests .contest-card.is-reward {
  border-color: rgba(255, 193, 74, 0.45);
  background: rgba(255, 193, 74, 0.06);
}

#tab-contests .contest-badge.is-taken {
  color: #8ee8bc;
  background: rgba(62, 207, 142, 0.12);
}

#tab-contests .contest-badge.is-reward {
  color: #ffc14a;
  background: rgba(255, 193, 74, 0.14);
}

#tab-contests .contest-board-title {
  margin: 2px 0 0;
  font-size: 18px;
}

#tab-contests .contest-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(0, 152, 234, 0.55);
  border-radius: 12px;
  background: rgba(0, 152, 234, 0.16);
  color: #dff2ff;
  font-size: 14px;
  font-weight: 800;
}

#tab-contests .contest-back-link svg {
  width: 16px;
  height: 16px;
  flex: none;
}

#tab-contests .contest-you + .contest-top {
  margin-top: 8px;
}

#tab-contests .contest-you {
  color: var(--muted);
  justify-content: flex-start;
}

#tab-contests span.top-ava {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

#tab-contests .contest-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 8px 0 0;
  padding: 28px 18px 26px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 180, 210, 0.32);
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(0, 152, 234, 0.16), transparent 68%),
    rgba(255, 255, 255, 0.035);
  text-align: center;
}

#tab-contests .contest-empty-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(0, 152, 234, 0.16);
  color: #d6f1ff;
  box-shadow: inset 0 0 0 1px rgba(0, 152, 234, 0.32);
}

#tab-contests .contest-empty-mark svg {
  width: 26px;
  height: 26px;
}

#tab-contests .contest-empty p {
  margin: 0;
  max-width: 220px;
  color: #d5e4f2;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  #tab-contests .contest-card,
  #tab-contests .contest-fold-body,
  #tab-contests .contest-fold-inner,
  #tab-contests .contest-chevron,
  #contest-modal .contest-modal-card {
    transition: none;
    animation: none;
  }
}
