:root {
  color-scheme: dark;
  --bg: #04070f;
  --bg-soft: #0a0f1f;
  --surface: rgba(11, 16, 28, 0.88);
  --surface-2: rgba(16, 22, 39, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f7ff;
  --muted: #8e9ab6;
  --green: #7dff5f;
  --green-strong: #21da68;
  --gold: #ffcf52;
  --pink: #ff53c5;
  --cyan: #2ad8ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  --frame-width: min(430px, calc(100vw - 20px));
  --wheel-size: min(302px, calc(100vw - 132px), calc(100svh - 442px));
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(64, 128, 255, 0.14), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(125, 255, 95, 0.12), transparent 20%),
    linear-gradient(180deg, #050811 0%, #04070f 100%);
  color: var(--text);
  font-family: "Outfit", sans-serif;
}

body {
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

.tg-host body {
  position: relative;
  min-height: 100svh;
}

button,
input {
  font: inherit;
}

button {
  outline: none;
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.28) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px);
  background-size: 34px 34px, 46px 46px;
}

.glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

.glow-a {
  width: 240px;
  height: 240px;
  top: -40px;
  right: -50px;
  background: rgba(32, 166, 255, 0.24);
}

.glow-b {
  width: 200px;
  height: 200px;
  left: -40px;
  bottom: 80px;
  background: rgba(111, 255, 89, 0.18);
}

.app-shell {
  width: 100%;
  height: 100svh;
  padding: 10px;
  display: flex;
  justify-content: center;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at 50% 38%, rgba(57, 114, 255, 0.18), transparent 20%),
    radial-gradient(circle at 50% 62%, rgba(109, 255, 85, 0.12), transparent 24%),
    rgba(4, 7, 15, 0.94);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.app-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loader strong {
  position: relative;
  z-index: 1;
  font: 700 0.98rem/1 "Space Grotesk", sans-serif;
  letter-spacing: 0.02em;
  color: #f5f8ff;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.app-loader__orb,
.app-loader__ring {
  grid-area: 1 / 1;
}

.app-loader__orb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff7b6 0%, #7dff5f 42%, #27c96d 100%);
  box-shadow:
    0 0 24px rgba(125, 255, 95, 0.4),
    0 0 40px rgba(42, 216, 255, 0.18);
}

.app-loader__ring {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 245, 170, 0.95);
  border-right-color: rgba(125, 255, 95, 0.9);
  box-shadow: 0 0 30px rgba(125, 255, 95, 0.12);
  animation: loader-spin 1s linear infinite;
}

.app-loader__ring--alt {
  width: 104px;
  height: 104px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(42, 216, 255, 0.7);
  border-left-color: rgba(255, 83, 197, 0.6);
  animation-duration: 1.35s;
  animation-direction: reverse;
}

.app-frame {
  width: var(--frame-width);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.topbar,
.tabbar,
.control-card,
.mini-card,
.feature-card,
.modal-card {
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(16, 22, 39, 0.92), rgba(8, 12, 24, 0.92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.tg-host .noise-layer,
.tg-host .glow,
.tg-host .wheel-blur {
  display: none;
}

.tg-host .topbar,
.tg-host .tabbar,
.tg-host .control-card,
.tg-host .mini-card,
.tg-host .feature-card,
.tg-host .modal-card {
  backdrop-filter: none;
  background: linear-gradient(180deg, rgba(14, 19, 34, 0.98), rgba(8, 12, 22, 0.98));
}

.tg-host .wheel-glow {
  filter: blur(3px);
  opacity: 0.88;
}

.tg-host .wheel-shell {
  box-shadow:
    0 0 0 2px rgba(255, 235, 170, 0.28),
    0 16px 32px rgba(0, 0, 0, 0.34),
    0 0 42px rgba(255, 189, 75, 0.22);
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 24px;
}

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

.brand-text {
  min-width: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  padding: 6px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), rgba(10, 14, 26, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.brand h1 {
  margin: 0;
  font: 700 1.12rem/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

.brand-text p {
  margin: 4px 0 0;
  max-width: 130px;
  color: rgba(190, 198, 219, 0.72);
  font-size: 0.74rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #d5deef;
  cursor: pointer;
}

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

.icon-button--sound {
  position: relative;
}

.sound-slash {
  position: absolute;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5c78, #ff2f52);
  transform: rotate(-40deg);
  box-shadow: 0 0 12px rgba(255, 70, 106, 0.45);
}

.icon-button--sound.is-muted {
  color: #ffd7dd;
}

.profile-trigger {
  min-width: 132px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  color: #eef3ff;
  text-align: left;
}

.profile-trigger__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(125, 255, 95, 0.42), rgba(15, 24, 10, 0.3));
  color: #f4f7ff;
}

.profile-trigger__icon svg {
  width: 18px;
  height: 18px;
}

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

.profile-trigger strong {
  display: block;
  font: 700 0.92rem/1.05 "Space Grotesk", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-trigger span {
  display: block;
  margin-top: 4px;
  color: rgba(214, 223, 244, 0.76);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.66rem;
}

.balance-button {
  min-width: 128px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 9px;
  border: 1px solid rgba(125, 255, 95, 0.24);
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(96, 255, 100, 0.16), rgba(13, 23, 16, 0.8));
  color: #e9ffd8;
}

.balance-button__icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(125, 255, 95, 0.42), rgba(15, 24, 10, 0.3));
  color: var(--green);
}

.balance-button__icon svg {
  width: 18px;
  height: 18px;
}

.balance-button span {
  display: block;
  color: rgba(233, 255, 216, 0.72);
  font-size: 0.68rem;
}

.balance-button strong {
  display: block;
  margin-top: 3px;
  font: 700 1.02rem/1 "Space Grotesk", sans-serif;
}

.screen {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.panel {
  display: none;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

.roulette-layout,
.compact-layout {
  height: 100%;
  min-height: 0;
  flex: 1 1 0;
}

.roulette-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.wheel-glow,
.wheel-blur {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.wheel-glow {
  width: calc(var(--wheel-size) + 34px);
  aspect-ratio: 1;
  background:
    radial-gradient(circle, rgba(255, 214, 82, 0.4) 0%, rgba(255, 78, 194, 0.2) 36%, rgba(48, 215, 255, 0.1) 58%, rgba(4, 7, 15, 0) 72%);
  filter: blur(8px);
  animation: pulse 2.6s ease-in-out infinite;
}

.wheel-blur {
  bottom: 10px;
  width: 280px;
  height: 70px;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0));
  filter: blur(20px);
}

.pointer-wrap {
  position: absolute;
  top: 4px;
  z-index: 5;
  width: 38px;
}

.pointer-wrap svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.wheel-shell {
  width: var(--wheel-size);
  aspect-ratio: 1;
  padding: 9px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, #ffed98 0%, #ffca3a 28%, #ff9d2b 52%, #ffcf63 100%);
  box-shadow:
    0 0 0 2px rgba(255, 235, 170, 0.34),
    0 0 0 8px rgba(255, 205, 90, 0.08),
    0 20px 44px rgba(0, 0, 0, 0.42),
    0 0 60px rgba(255, 189, 75, 0.26);
}

.wheel-face {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #10162c;
  transform: translateZ(0) rotate(0deg);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 4.8s cubic-bezier(0.08, 0.82, 0, 1);
}

.wheel-face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05), transparent 52%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.wheel-labels {
  position: absolute;
  inset: 0;
}

.wheel-label {
  position: absolute;
  width: 52px;
  display: grid;
  place-items: center;
  text-align: center;
  transform:
    translate(-50%, -50%)
    rotate(var(--sector-angle))
    translateY(calc(var(--sector-radius) * -1))
    rotate(calc(var(--sector-angle) * -1));
  pointer-events: none;
  text-shadow: 0 5px 14px rgba(0, 0, 0, 0.55);
}

.wheel-label strong {
  display: block;
  font: 800 0.78rem/1 "Space Grotesk", sans-serif;
  color: #fff;
}

.wheel-label span {
  display: block;
  margin-top: 2px;
  font-size: 0.44rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.88);
}

.wheel-core {
  position: absolute;
  inset: 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-align: center;
  background: radial-gradient(circle at 35% 35%, rgba(40, 53, 93, 0.96), rgba(9, 12, 23, 0.98) 76%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.05), 0 12px 28px rgba(0, 0, 0, 0.45);
}

.wheel-core strong {
  display: block;
  margin: 0;
  font: 800 1.18rem/1 "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
}

.control-card {
  border-radius: 24px;
  padding: 8px 10px 9px;
}

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

.stake-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.stake-head strong {
  font: 800 1.06rem/1 "Space Grotesk", sans-serif;
}

.stake-input-wrap {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 6px;
  margin-top: 7px;
}

.stake-input,
.step-button {
  min-height: 40px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.stake-input {
  width: 100%;
  padding: 0 10px;
  text-align: center;
  font: 700 0.94rem/1 "Space Grotesk", sans-serif;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stake-input::-webkit-outer-spin-button,
.stake-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.step-button {
  display: grid;
  place-items: center;
  cursor: pointer;
}

.step-button svg {
  width: 20px;
  height: 20px;
}

.quick-stakes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.quick-stake {
  min-height: 30px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #d9e2f6;
  font-weight: 700;
  cursor: pointer;
}

.quick-stake.active {
  background: linear-gradient(180deg, rgba(125, 255, 95, 0.18), rgba(18, 33, 16, 0.9));
  border-color: rgba(125, 255, 95, 0.28);
  color: #eaffdf;
}

.spin-button,
.primary-small {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  color: #071108;
  background: linear-gradient(135deg, #fdf58e 0%, #7dff5f 48%, #1dd268 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 18px 32px rgba(23, 208, 82, 0.24);
}

.spin-button {
  margin-top: 7px;
}

.spin-button strong,
.primary-small {
  display: block;
  font: 800 0.93rem/1 "Space Grotesk", sans-serif;
}

.spin-button small {
  display: block;
  margin-top: 2px;
  color: rgba(7, 17, 8, 0.72);
  font-weight: 600;
  font-size: 0.66rem;
}

.spin-button__shine {
  position: absolute;
  inset: -120% auto -120% -40%;
  width: 44%;
  transform: rotate(18deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0));
  animation: sweep 3s linear infinite;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 8px;
}

.task-list::-webkit-scrollbar {
  width: 4px;
}

.task-list::-webkit-scrollbar-thumb {
  background: rgba(125, 255, 95, 0.22);
  border-radius: 999px;
}

.tasks-layout {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
  min-width: 0;
}

.task-summary-card {
  padding: 12px 14px;
}

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

.task-summary-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.task-summary-grid strong {
  display: block;
  margin-top: 5px;
  font: 800 0.95rem/1.05 "Space Grotesk", sans-serif;
  color: #eff6ff;
}

.topup-field {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.topup-field__label {
  color: var(--muted);
  font-size: 0.72rem;
}

.topup-field__input {
  width: 100%;
}

.task-card {
  border-radius: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(125, 255, 95, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(15, 22, 37, 0.98), rgba(7, 11, 22, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 28px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  flex-shrink: 0;
}

.task-card > strong {
  display: block;
  text-align: center;
  font: 700 0.95rem/1.15 "Space Grotesk", sans-serif;
}

.task-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.task-card__top > div {
  min-width: 0;
  overflow: hidden;
}

.task-card__top strong {
  display: block;
  font: 700 0.95rem/1.1 "Space Grotesk", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card__top span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.task-pill {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(125, 255, 95, 0.2);
  background: rgba(125, 255, 95, 0.08);
  color: #cbffbc;
  font-size: 0.64rem;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}

.task-meta--simple span {
  max-width: 52%;
  text-align: right;
  color: var(--muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-status-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.task-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 188, 61, 0.24);
  background: rgba(255, 188, 61, 0.12);
  color: #ffd98c;
  font-size: 0.68rem;
  font-weight: 700;
}

.task-meta strong {
  font: 800 0.9rem/1 "Space Grotesk", sans-serif;
  color: #c7ff8e;
}

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

.task-actions--single {
  grid-template-columns: 1fr;
}

.ghost-button {
  min-height: 36px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #dce6ff;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button--wide {
  width: 100%;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.inline-form__input {
  min-width: 0;
}

.panel-status {
  margin: 0;
  color: rgba(222, 233, 255, 0.72);
  font-size: 0.72rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-detail-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.modal-card--task {
  padding-bottom: 14px;
}

.modal-note--task {
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 34svh;
  overflow: auto;
}

.modal-card--profile {
  padding-bottom: 14px;
}

.spin-button--compact {
  margin-top: 8px;
}

.spin-button:disabled {
  cursor: wait;
  filter: saturate(0.92) brightness(0.96);
}

.mini-card span,
.feature-card span,
.modal-card__head span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
}

.mini-card strong,
.feature-card strong,
.modal-card__head strong {
  display: block;
  margin-top: 5px;
  font: 700 0.9rem/1 "Space Grotesk", sans-serif;
}

.compact-layout {
  height: 100%;
  display: grid;
  gap: 10px;
  align-content: start;
  overflow-x: hidden;
  min-width: 0;
}

.compact-layout.tasks-layout {
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.compact-grid {
  display: grid;
  gap: 8px;
}

.compact-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-card,
.feature-card {
  border-radius: 20px;
  padding: 14px;
}

.feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feature-card p,
.modal-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.82rem;
}

.feature-card--wide {
  align-items: flex-start;
}

.feature-card--wide strong {
  word-break: break-word;
}

.ghost-button {
  min-width: 88px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.primary-small {
  width: auto;
  min-width: 112px;
  padding: 0 16px;
}

.tabbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
}

.tab-button {
  border: 0;
  background: transparent;
  color: #8792af;
  border-radius: 16px;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 5px;
  cursor: pointer;
}

.tab-button svg {
  width: 20px;
  height: 20px;
}

.tab-button span {
  font-size: 0.7rem;
}

.tab-button.active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(125, 255, 95, 0.14), rgba(255, 255, 255, 0.02));
}

.tab-button.active svg {
  color: var(--green);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 5, 12, 0.74);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(390px, calc(100vw - 28px));
  border-radius: 26px;
  padding: 16px;
}

.modal-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.topup-chip {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.topup-chip.active {
  background: linear-gradient(180deg, rgba(125, 255, 95, 0.18), rgba(17, 30, 15, 0.92));
  border-color: rgba(125, 255, 95, 0.28);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(30px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(10, 14, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf4ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-spinning .wheel-glow {
  animation-duration: 0.7s;
}

.is-spinning .pointer-wrap {
  animation: pointer-bounce 0.12s linear infinite;
}

.is-spinning .wheel-face {
  filter: saturate(1.15) brightness(1.08);
}

.is-spinning .wheel-shell {
  box-shadow:
    0 0 0 2px rgba(255, 235, 170, 0.4),
    0 0 0 8px rgba(255, 205, 90, 0.1),
    0 22px 46px rgba(0, 0, 0, 0.44),
    0 0 74px rgba(255, 196, 70, 0.34);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.84;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes sweep {
  from {
    transform: translateX(0) rotate(18deg);
  }
  to {
    transform: translateX(390%) rotate(18deg);
  }
}

@keyframes pointer-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes loader-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 390px) {
  :root {
    --wheel-size: min(260px, calc(100vw - 100px), calc(100svh - 440px));
  }

  .compact-grid--three {
    grid-template-columns: 1fr;
  }

  .feature-card {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    gap: 6px;
  }

  .balance-button {
    min-width: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
