:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-quart: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --bg: #0a1411;
  --surface: #11211c;
  --surface-2: #18302a;
  --surface-3: #1f3d35;
  --line: rgba(244, 239, 226, 0.09);
  --ink: #f4efe2;
  --muted: #8ea39a;
  --gold: #e8b84a;
  --gold-deep: #c4922a;
  --gold-ink: #1c1503;
  --red: #d8463f;
  --green: #2fb26d;
  --pocket-black: #1a2320;
  --radius: 18px;
  --radius-sm: 12px;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: var(--tg-viewport-stable-height, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.35;
}

input, textarea {
  user-select: text;
  font-size: 16px;
  font-family: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.num { font-variant-numeric: tabular-nums; }

#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  transition: transform 280ms var(--ease-quart), filter 280ms var(--ease-quart);
}

body.has-subscreen #app {
  transform: translate3d(-22%, 0, 0);
  filter: brightness(0.9);
  pointer-events: none;
}

/* --- шапка --- */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: linear-gradient(180deg, #0d1b17 0%, var(--bg) 100%);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--gold);
}

.brand__mark { width: 26px; height: 26px; }

.brand__name {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--gold);
}

.icon-btn svg { width: 21px; height: 21px; }

.balance {
  height: 40px;
  padding: 0 13px 0 9px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid rgba(232, 184, 74, 0.32);
  font-weight: 800;
  font-size: 15px;
}

.balance__chip { width: 21px; height: 21px; color: var(--gold); flex-shrink: 0; }

/* --- вкладки --- */
.app-viewport {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.view[hidden] { display: none; }

.view__pad {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@keyframes paneFromRight {
  from { opacity: 0; transform: translate3d(16px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes paneFromLeft {
  from { opacity: 0; transform: translate3d(-16px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.view.enter-right > .view__pad { animation: paneFromRight 220ms var(--ease-out) both; }
.view.enter-left  > .view__pad { animation: paneFromLeft  220ms var(--ease-out) both; }

/* --- нижний бар --- */
.tabbar {
  flex-shrink: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tabs, 5), 1fr);
  padding: 6px 8px calc(8px + var(--safe-bottom));
  background: #0d1b17;
  border-top: 1px solid var(--line);
  z-index: 20;
}

.tabbar__pill {
  position: absolute;
  top: 6px;
  left: 8px;
  width: calc((100% - 16px) / var(--tabs, 5));
  height: 48px;
  border-radius: 14px;
  background: rgba(232, 184, 74, 0.13);
  transform: translate3d(calc(var(--active, 0) * 100%), 0, 0);
  transition: transform 240ms var(--ease-out);
  pointer-events: none;
}

.tab {
  position: relative;
  z-index: 1;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  transition: color 180ms var(--ease-out);
}

.tab svg { width: 21px; height: 21px; transition: transform 200ms var(--ease-out); }
.tab.is-active { color: var(--gold); }
.tab.is-active svg { transform: translate3d(0, -1px, 0); }

body.kb-open .tabbar { display: none; }

/* --- общие блоки --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin: 4px 2px 0;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.section-title--tight { margin: 0 0 8px; }

.empty {
  padding: 14px 4px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn--gold {
  background: linear-gradient(180deg, #f1c864 0%, var(--gold-deep) 100%);
  border-color: transparent;
  color: var(--gold-ink);
}

.btn:disabled { opacity: 0.42; pointer-events: none; }

.pressable {
  transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  will-change: transform;
}
.pressable:active:not(:disabled) {
  transform: scale(0.972);
  transition-duration: 80ms;
}
@media (hover: hover) {
  .pressable:hover:not(:disabled) { opacity: 0.92; }
}

.pbar {
  height: 8px;
  border-radius: 99px;
  background: rgba(244, 239, 226, 0.09);
  overflow: hidden;
}

.pbar__fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
  transition: transform 420ms var(--ease-out);
}

@keyframes cardRise {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.stagger-list > * {
  animation: cardRise 240ms var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * 32ms);
}

/* --- главная --- */
.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(232, 184, 74, 0.16) 0%, rgba(232, 184, 74, 0) 55%),
    var(--surface);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.hero__balance {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 4px;
}

.hero__level {
  text-align: right;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(232, 184, 74, 0.12);
  border: 1px solid rgba(232, 184, 74, 0.25);
}

.hero__level-num {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.hero__level-name { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 4px; }

.hero__xp { font-size: 12px; color: var(--muted); font-weight: 600; }

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

.games {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--gold);
}

.game-card svg { width: 40px; height: 40px; }
.game-card__name { font-weight: 800; font-size: 14px; color: var(--ink); }
.game-card__desc { font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.25; }

/* --- история --- */
.hist { display: flex; flex-direction: column; }

.hist__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.hist__row:last-child { border-bottom: 0; }
.hist__title { font-weight: 700; font-size: 13.5px; }
.hist__sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.hist__sum { grid-row: 1 / span 2; grid-column: 2; align-self: center; text-align: right; font-weight: 800; font-size: 14px; }
.hist__mult { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.plus { color: var(--green); }
.minus { color: #ef7a72; }

/* --- фишки и ставки --- */
.bet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bet-total { font-size: 13px; color: var(--muted); font-weight: 700; }
.bet-total b { color: var(--ink); font-size: 15px; }

.link-btn {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--gold);
}

.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 12px; }

.chip {
  position: relative;
  height: 44px;
  border-radius: 50%;
  aspect-ratio: 1;
  max-width: 56px;
  width: 100%;
  justify-self: center;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface-2);
  border: 2px dashed rgba(244, 239, 226, 0.28);
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out), background-color 180ms var(--ease-out);
}

.chip.is-active {
  background: linear-gradient(180deg, #f1c864 0%, var(--gold-deep) 100%);
  border: 2px solid #fbe3a1;
  color: var(--gold-ink);
  transform: scale(1.06);
}

.bet-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

/* --- рулетка --- */
.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  padding: 4px 0 2px;
}

.wheel {
  width: min(100%, 340px);
  aspect-ratio: 1;
  display: block;
}

.wheel-result {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  min-width: 96px;
  padding: 9px 14px;
  border-radius: 18px;
  text-align: center;
  background: rgba(10, 20, 17, 0.9);
  border: 1px solid rgba(232, 184, 74, 0.5);
  pointer-events: none;
  animation: popIn 240ms var(--ease-out) both;
}

.wheel-result__num {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.wheel-result__txt { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.wheel-result__gold { font-size: 11.5px; font-weight: 800; color: var(--gold); margin-top: 3px; }

@keyframes popIn {
  from { opacity: 0; transform: translate3d(-50%, -50%, 0) scale(0.86); }
  to   { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); }
}

.history-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: none;
  min-height: 34px;
}
.history-strip::-webkit-scrollbar { display: none; }

.pill {
  flex: 0 0 auto;
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.pill--red { background: var(--red); border-color: transparent; color: #fff; }
.pill--black { background: var(--pocket-black); color: var(--ink); }
.pill--green { background: var(--green); border-color: transparent; color: #06210f; }
.pill--gold { background: var(--gold); border-color: transparent; color: var(--gold-ink); }
.pill--muted { color: var(--muted); }

.r-table { display: flex; flex-direction: column; gap: 6px; }

.r-zero {
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #06210f;
  font-weight: 800;
}

.r-nums {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.r-cell {
  position: relative;
  height: 42px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  background: var(--pocket-black);
  border: 1px solid var(--line);
  transition: transform 160ms var(--ease-out);
}

.r-cell--red { background: var(--red); color: #fff; border-color: transparent; }
.r-cell--out { background: var(--surface-2); font-size: 12.5px; }
.r-cell.is-hit { box-shadow: inset 0 0 0 2px var(--gold); }

.r-cell__amt {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 22px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--gold-ink);
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  animation: chipIn 160ms var(--ease-out) both;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.r-outside { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.r-dozens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }

/* --- блэкджек --- */
.felt {
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(47, 178, 109, 0.2) 0%, rgba(47, 178, 109, 0) 60%),
    var(--surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
}

.bj-side { display: flex; flex-direction: column; gap: 8px; align-items: center; }

.bj-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bj-score {
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 99px;
  display: inline-grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink);
  font-size: 13px;
}

.bj-score.is-bust { background: var(--red); color: #fff; }
.bj-score.is-best { background: var(--gold); color: var(--gold-ink); }

.bj-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
}

.bj-vs {
  text-align: center;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-height: 20px;
}

.bj-vs.is-win { color: var(--gold); }
.bj-vs.is-lose { color: #ef7a72; }

.card {
  width: 62px;
  height: 90px;
  border-radius: 10px;
  background: #f6f1e4;
  color: #15201c;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 7px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform-origin: center;
}

.card--red { color: #c62f29; }
.card__rank { font-size: 16px; line-height: 1; }
.card__suit { width: 20px; height: 20px; align-self: center; }
.card__suit--big { width: 30px; height: 30px; opacity: 0.9; }
.card__foot { align-self: flex-end; font-size: 12px; line-height: 1; opacity: 0.75; }

.card--back {
  background:
    repeating-linear-gradient(45deg, #1f3d35 0 6px, #18302a 6px 12px);
  border: 2px solid #f6f1e4;
  align-items: center;
  justify-content: center;
}

.card--back::after {
  content: "";
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(246, 241, 228, 0.7);
}

@keyframes dealIn {
  from { opacity: 0; transform: translate3d(0, -34px, 0) rotate(-8deg) scale(0.9); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}

@keyframes flipIn {
  from { opacity: 0.2; transform: scaleX(0.08); }
  to   { opacity: 1; transform: scaleX(1); }
}

.card--in { animation: dealIn 260ms var(--ease-out) both; }
.card--flip { animation: flipIn 260ms var(--ease-out) both; }

/* --- краш --- */
.crash {
  position: relative;
  padding: 14px 14px 10px;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% 0%, rgba(232, 184, 74, 0.12) 0%, rgba(232, 184, 74, 0) 60%),
    var(--surface);
}

.crash__mult {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  transition: color 160ms var(--ease-out);
}

.crash.is-lost .crash__mult { color: #ef7a72; }
.crash.is-won .crash__mult { color: var(--green); }

.crash__sub {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  min-height: 18px;
  margin-top: 2px;
}

.crash__canvas { width: 100%; height: 210px; display: block; margin-top: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field__label { font-size: 12px; font-weight: 700; color: var(--muted); }

.field__input {
  height: 46px;
  padding: 0 13px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  outline: none;
  width: 100%;
}

.field__input:focus { border-color: rgba(232, 184, 74, 0.6); }

#c-go, #c-cashout { width: 100%; }

/* --- профиль --- */
.profile-head { display: flex; align-items: center; gap: 14px; }

.avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold-ink);
  background: linear-gradient(180deg, #f1c864 0%, var(--gold-deep) 100%);
}

.profile-head__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.profile-head__name { font-size: 18px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-head__meta { font-size: 12.5px; font-weight: 700; color: var(--muted); }

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

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.stat__v { font-family: "Unbounded", "Manrope", sans-serif; font-size: 17px; font-weight: 600; margin-top: 3px; }

.ref-text { font-size: 13px; color: var(--muted); font-weight: 600; }

.ref-link {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px dashed rgba(232, 184, 74, 0.4);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold);
  word-break: break-all;
  user-select: text;
}

.top__row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.top__row:last-child { border-bottom: 0; }
.top__row.is-me .top__name { color: var(--gold); }
.top__place { font-weight: 800; color: var(--muted); font-size: 13px; }
.top__name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__lvl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.top__bal { font-weight: 800; font-size: 14px; }

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

.ach {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  opacity: 0.55;
}

.ach.is-done { opacity: 1; border-color: rgba(232, 184, 74, 0.4); background: rgba(232, 184, 74, 0.07); }
.ach__name { font-weight: 800; font-size: 13.5px; }
.ach__desc { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.ach__reward { font-size: 11.5px; font-weight: 800; color: var(--gold); margin-top: 6px; }

/* --- экран заработка --- */
.subscreen {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  transform: translate3d(100%, 0, 0);
  transition: transform 280ms var(--ease-quart);
  will-change: transform;
}

.subscreen[hidden] { display: none; }
.subscreen.is-open { transform: translate3d(0, 0, 0); }

.subscreen__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: rgba(10, 20, 17, 0.92);
  backdrop-filter: blur(10px);
}

.subscreen__title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.subscreen__body {
  padding: 12px 16px calc(28px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.earn-card { display: flex; flex-direction: column; gap: 8px; }
.earn-card__title { font-weight: 800; font-size: 15px; }
.earn-card__desc { font-size: 12px; color: var(--muted); font-weight: 600; flex: 1; }
.earn-card .btn { width: 100%; padding: 0 8px; }

.tapper {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
}

.tapper__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.tap-coin {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  color: var(--gold);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.tap-coin svg { width: 100%; height: 100%; display: block; }

.tap-coin.is-hit { animation: coinHit 160ms var(--ease-out); }

@keyframes coinHit {
  from { transform: scale(0.93); }
  to   { transform: scale(1); }
}

.tap-float {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate3d(-50%, 0, 0);
  font-weight: 800;
  font-size: 17px;
  color: var(--gold);
  pointer-events: none;
  animation: floatUp 620ms var(--ease-out) both;
}

@keyframes floatUp {
  from { opacity: 0; transform: translate3d(-50%, 6px, 0); }
  25%  { opacity: 1; }
  to   { opacity: 0; transform: translate3d(-50%, -44px, 0); }
}

.jobs { display: flex; flex-direction: column; gap: 8px; }

.job {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  text-align: left;
  width: 100%;
}

.job__name { font-weight: 800; font-size: 14.5px; }
.job__desc { grid-column: 1; font-size: 12px; color: var(--muted); font-weight: 600; }
.job__reward { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-weight: 800; color: var(--gold); font-size: 14px; }
.job__wait { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.job.is-waiting { opacity: 0.6; }

.promo { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.promo .field__input { text-transform: uppercase; }

/* --- шторка задания --- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease-out);
}

.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 51;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 8px 16px calc(20px + var(--safe-bottom));
  transform: translate3d(0, 100%, 0);
  transition: transform 300ms var(--ease-quart);
}

.sheet.is-open { transform: translate3d(0, 0, 0); }
.sheet.is-dragging { transition: none; }

.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(142, 163, 154, 0.4);
  margin: 4px auto 12px;
  flex-shrink: 0;
}

.sheet__body { overflow-y: auto; overscroll-behavior: contain; }
.sheet__title { font-family: "Unbounded", "Manrope", sans-serif; font-size: 15px; font-weight: 600; }
.sheet__question { margin: 10px 0 14px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.sheet__options { display: flex; flex-direction: column; gap: 8px; }

.opt {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  text-align: left;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.opt.is-right { background: rgba(47, 178, 109, 0.22); border-color: var(--green); }
.opt.is-wrong { background: rgba(216, 70, 63, 0.22); border-color: var(--red); }
.opt:disabled { pointer-events: none; }

/* --- подсказка --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(74px + var(--safe-bottom));
  z-index: 60;
  max-width: min(90vw, 380px);
  padding: 10px 15px;
  border-radius: 14px;
  background: #1b332c;
  border: 1px solid rgba(232, 184, 74, 0.35);
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  transform: translate3d(-50%, 14px, 0);
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-out);
}

.toast.is-open { opacity: 1; transform: translate3d(-50%, 0, 0); }
.toast.is-err { border-color: rgba(216, 70, 63, 0.7); }
.toast.is-gold { background: linear-gradient(180deg, #f1c864 0%, var(--gold-deep) 100%); color: var(--gold-ink); border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
