/* ============================================================
   DOUBLE GAME — Coinflip Telegram Mini App
   Палитра из референса: золото #FFE5AE→#FFD171, коричневые
   #644B2B/#312618, зелёный #95E564, красный #E56C64
   ============================================================ */

:root {
  --gold-1: #FFE5AE;
  --gold-2: #FFD171;
  --brown-1: #644B2B;
  --brown-2: #312618;
  --bg: #17120D;
  --bg-card: #241C13;
  --bg-card-2: #2E2418;
  --text: #F5EFE6;
  --text-dim: #9C8E7A;
  --green: #95E564;
  --red: #E56C64;
  --gold-grad: linear-gradient(135deg, #FFE5AE 0%, #FFD171 100%);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Golos Text', -apple-system, sans-serif;
  overscroll-behavior: none;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 76px;
}

button { font-family: inherit; border: none; cursor: pointer; }
[hidden] { display: none !important; }

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.header__logo {
  height: 62px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(255, 209, 113, .25));
}

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

.online-pill {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-dim);
  background: var(--bg-card);
  border-radius: 20px; padding: 7px 12px;
}
.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: .5; } }

.balance-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--gold-grad);
  color: #241C13;
  font-weight: 800; font-size: 15px;
  border-radius: 20px; padding: 6px 14px 6px 8px;
  box-shadow: 0 4px 18px rgba(255, 209, 113, .3);
}
.balance-pill__coin { width: 22px; height: 22px; border-radius: 50%; }

/* ===== SCREENS / NAV ===== */
.screen { display: none; flex-direction: column; padding: 0 16px; flex: 1; }
.screen.is-active { display: flex; }

.screen__title {
  font-family: 'Bokor', serif;
  font-size: 28px;
  text-align: center;
  margin: 14px 0 16px;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: flex;
  background: rgba(23, 18, 13, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 209, 113, .12);
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 50;
}
.nav__btn {
  flex: 1; background: none; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; transition: .2s;
}
.nav__btn span { font-size: 11px; font-weight: 600; }
.nav__btn img {
  width: 26px; height: 26px; object-fit: contain;
  filter: grayscale(1) brightness(.75);
  transition: .2s;
}
.nav__btn.is-active { color: var(--gold-2); }
.nav__btn.is-active img {
  filter: none;
  transform: scale(1.12);
  -webkit-filter: drop-shadow(0 0 8px rgba(255, 209, 113, .5));
  filter: drop-shadow(0 0 8px rgba(255, 209, 113, .5));
}

/* ===== ARENA (игровое поле со случайными фонами) ===== */
.arena {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 209, 113, .14);
  transition: background 1s ease;
  isolation: isolate;
}

/* --- 6 случайных фонов (сгенерированные обложки) ---
   Лёгкое затемнение сверху — чтобы текст и монета читались. */
.arena.bg-0 { background: linear-gradient(rgba(10,6,2,.25), rgba(10,6,2,.3)), #120c05 url(../images/bg/bg-embers.webp) center/cover no-repeat; }   /* ночной лес с углями */
.arena.bg-1 { background: linear-gradient(rgba(4,5,12,.2), rgba(4,5,12,.25)), #090b16 url(../images/bg/bg-stars.webp) center/cover no-repeat; }     /* звёздная ночь */
.arena.bg-2 { background: linear-gradient(rgba(8,3,12,.25), rgba(8,3,12,.3)), #0f0618 url(../images/bg/bg-magic.webp) center/cover no-repeat; }     /* магия */
.arena.bg-3 { background: linear-gradient(rgba(2,9,6,.25), rgba(2,9,6,.3)), #04120c url(../images/bg/bg-emerald.webp) center/cover no-repeat; }     /* изумрудная пещера */
.arena.bg-4 { background: linear-gradient(rgba(10,3,3,.25), rgba(10,3,3,.3)), #140505 url(../images/bg/bg-crimson.webp) center/cover no-repeat; }   /* вулкан */
.arena.bg-5 { background: linear-gradient(rgba(2,8,12,.2), rgba(2,8,12,.25)), #041018 url(../images/bg/bg-ocean.webp) center/cover no-repeat; }     /* океан */

.arena__particles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

.particle {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: .7; }
  100% { transform: translateY(-360px) translateX(var(--drift, 20px)); opacity: 0; }
}

.arena__status {
  position: relative; z-index: 2;
  margin-top: 18px;
  font-size: 14px; font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  min-height: 20px;
  padding: 0 20px;
}
.arena__status--gold { color: var(--gold-2); }
.arena__status--win { color: var(--green); }
.arena__status--lose { color: var(--red); }

/* --- Панель VS --- */
.versus {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: 22px;
  margin-bottom: 8px;
  width: 100%;
  padding: 14px 20px 0;
}
.versus__player { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 96px; }
.versus__avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-card-2);
  border: 2px solid rgba(255, 209, 113, .4);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--gold-2);
  overflow: hidden;
  background-size: cover; background-position: center;
}
.versus__avatar--waiting { animation: waitingPulse 1.2s ease infinite; }
@keyframes waitingPulse { 50% { border-color: var(--gold-2); box-shadow: 0 0 16px rgba(255,209,113,.4); } }
.versus__name {
  font-size: 12px; font-weight: 700; max-width: 96px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.versus__side { font-size: 10px; color: var(--text-dim); font-weight: 600; text-transform: uppercase; min-height: 13px; }
.versus__vs {
  font-family: 'Bokor', serif; font-size: 22px;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --- Стрик --- */
.streak {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255, 209, 113, .35);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px; font-weight: 800; color: var(--gold-2);
  display: flex; align-items: center; gap: 4px;
}

/* когда бейдж стрика виден — опускаем панель соперников, чтобы не накладывалось */
.arena.has-streak .versus { padding-top: 46px; }

/* ============================================================
   МОНЕТА — механика/анимация из архива coinflip_game
   ============================================================ */
.coinflip__game {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding-top: 6px;
}

/* ВАЖНО: на обёртке нельзя использовать filter — он схлопывает
   preserve-3d, и вторая сторона монеты перестаёт показываться */
.coinflip__wrapper {
  perspective: 2000px;
  -webkit-perspective: 2000px;
  width: 154px;
  height: 154px;
  transition: -webkit-transform 1s ease-in;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.coinflip__wrapper div {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* свечение на сторонах, а не на обёртке — не ломает 3D */
  box-shadow: 0 14px 30px rgba(0, 0, 0, .45), 0 0 34px rgba(255, 209, 113, .18);
}

.side-a {
  background-size: cover;
  background-image: url(../images/coin/coin--orel.png);
  background-position: center;
}

.side-b {
  transform: rotateZ(180deg) rotateY(-180deg);
  -webkit-transform: rotateZ(180deg) rotateY(-180deg);
  background-size: cover;
  background-image: url(../images/coin/coin--reshka.png);
  background-position: center;
}

/* лёгкое покачивание в ожидании */
.coinflip__wrapper.idle { animation: idleFloat 3s ease-in-out infinite; }
@keyframes idleFloat {
  0%, 100% { transform: translateY(0) rotateZ(-2deg); }
  50% { transform: translateY(-9px) rotateZ(2deg); }
}

.animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
.animated.flip_1 {
  -webkit-backface-visibility: visible; backface-visibility: visible;
  -webkit-animation-name: flip_tale; animation-name: flip_tale;
}
.animated.flip_2 {
  -webkit-backface-visibility: visible; backface-visibility: visible;
  -webkit-animation-name: flip; animation-name: flip;
}

@keyframes flip {
  0%  { transform: perspective(400px) scaleX(1) translateZ(0) rotateX(-1turn); animation-timing-function: ease-out; }
  40% { transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-190deg); animation-timing-function: ease-out; }
  50% { transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-170deg); animation-timing-function: ease-in; }
  80% { transform: perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateX(180deg); animation-timing-function: ease-in; }
  to  { transform: perspective(400px) scaleX(1) translateZ(0) rotateX(180deg); animation-timing-function: ease-in; }
}
@-webkit-keyframes flip {
  0%  { -webkit-transform: perspective(400px) scaleX(1) translateZ(0) rotateX(-1turn); }
  40% { -webkit-transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-190deg); }
  50% { -webkit-transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-170deg); }
  80% { -webkit-transform: perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateX(180deg); }
  to  { -webkit-transform: perspective(400px) scaleX(1) translateZ(0) rotateX(180deg); }
}
@keyframes flip_tale {
  0%  { transform: perspective(400px) scaleX(1) translateZ(0) rotateX(-1turn); animation-timing-function: ease-out; }
  40% { transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-190deg); animation-timing-function: ease-out; }
  50% { transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-170deg); animation-timing-function: ease-in; }
  80% { transform: perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateX(360deg); animation-timing-function: ease-in; }
  to  { transform: perspective(400px) scaleX(1) translateZ(0) rotateX(360deg); animation-timing-function: ease-in; }
}
@-webkit-keyframes flip_tale {
  0%  { -webkit-transform: perspective(400px) scaleX(1) translateZ(0) rotateX(-1turn); }
  40% { -webkit-transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-190deg); }
  50% { -webkit-transform: perspective(400px) scaleX(1) translateZ(50px) rotateX(-170deg); }
  80% { -webkit-transform: perspective(400px) scale3d(.95,.95,.95) translateZ(0) rotateX(360deg); }
  to  { -webkit-transform: perspective(400px) scaleX(1) translateZ(0) rotateX(360deg); }
}

/* ===== ВЫБОР СТОРОНЫ ===== */
.sides { display: flex; gap: 10px; margin-top: 14px; }
.side-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  font-size: 15px; font-weight: 800; text-transform: uppercase;
  transition: .2s;
}
.side-btn img { width: 34px; height: 34px; border-radius: 50%; }
.side-btn.is-active {
  border-color: var(--gold-2);
  background: linear-gradient(135deg, rgba(255,229,174,.12), rgba(255,209,113,.06));
  box-shadow: 0 0 18px rgba(255, 209, 113, .18);
  color: var(--gold-1);
}
.side-btn:disabled { opacity: .5; }

/* ===== СТАВКИ ===== */
.bets {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 7px; margin-top: 10px;
}
.bet-chip {
  background: var(--bg-card);
  color: var(--text-dim);
  border-radius: 12px;
  padding: 10px 0;
  font-size: 13px; font-weight: 700;
  border: 2px solid transparent;
  transition: .2s;
}
.bet-chip.is-active { border-color: var(--gold-2); color: var(--gold-1); }
.bet-chip:disabled { opacity: .5; }

/* ===== КНОПКИ ===== */
.play-btn {
  margin-top: 12px;
  background: var(--gold-grad);
  color: #241C13;
  border-radius: 16px;
  padding: 16px;
  font-size: 16px; font-weight: 800; letter-spacing: .5px;
  box-shadow: 0 6px 26px rgba(255, 209, 113, .35);
  transition: .2s;
}
.play-btn:active { transform: scale(.98); }
.play-btn:disabled { opacity: .45; box-shadow: none; }

.cancel-btn {
  margin-top: 8px;
  background: var(--bg-card);
  color: var(--text-dim);
  border-radius: 14px;
  padding: 12px;
  font-size: 14px; font-weight: 600;
}

/* ===== ЛЕНТА ===== */
.feed { margin: 18px 0 14px; }
.feed__title {
  font-family: 'Bokor', serif;
  font-size: 19px;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.feed__title-accent {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.feed__list { display: flex; flex-direction: column; gap: 6px; }
.feed__item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
  animation: feedIn .35s ease;
}
@keyframes feedIn { from { opacity: 0; transform: translateY(-6px); } }
.feed__item b { color: var(--text); }
.feed__item .win { color: var(--green); font-weight: 700; margin-left: auto; }
.feed__item .lose { color: var(--red); font-weight: 700; margin-left: auto; }
.feed__item--empty { justify-content: center; }

/* ===== LEADERBOARD ===== */
.lb { display: flex; flex-direction: column; gap: 8px; }
.lb__item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 11px 14px;
}
.lb__item--top1 { border: 1px solid rgba(255,209,113,.55); background: linear-gradient(135deg, rgba(255,229,174,.10), var(--bg-card)); }
.lb__rank { width: 24px; text-align: center; font-weight: 800; color: var(--text-dim); font-size: 14px; }
.lb__item--top1 .lb__rank { color: var(--gold-2); }
.lb__avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-card-2) center/cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--gold-2);
}
.lb__info { flex: 1; min-width: 0; }
.lb__name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__meta { font-size: 11px; color: var(--text-dim); }
.lb__balance { font-weight: 800; color: var(--gold-2); font-size: 14px; }
.lb__empty { text-align: center; color: var(--text-dim); padding: 30px 0; font-size: 14px; }

/* ===== PROFILE ===== */
.profile { display: flex; flex-direction: column; align-items: center; padding-top: 22px; }
.profile__avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--bg-card-2) center/cover;
  border: 3px solid var(--gold-2);
  box-shadow: 0 0 30px rgba(255, 209, 113, .25);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 800; color: var(--gold-2);
}
.profile__name { font-family: 'Bokor', serif; font-size: 26px; margin-top: 10px; }
.profile__level { width: 100%; margin-top: 16px; }
.profile__level-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); font-weight: 600; margin-bottom: 5px; }
.profile__level-bar { height: 8px; border-radius: 6px; background: var(--bg-card); overflow: hidden; }
.profile__level-fill { height: 100%; background: var(--gold-grad); border-radius: 6px; width: 0%; transition: width .6s ease; }

.profile__stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; width: 100%; margin-top: 18px;
}
.pstat {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pstat__icon { font-size: 22px; }
.pstat b { font-size: 20px; color: var(--gold-1); }
.pstat span { font-size: 11px; color: var(--text-dim); font-weight: 600; }

.daily-btn {
  width: 100%; margin-top: 16px;
  background: var(--gold-grad);
  color: #241C13;
  border-radius: 16px; padding: 15px;
  font-size: 15px; font-weight: 800;
  box-shadow: 0 6px 24px rgba(255,209,113,.3);
}
.daily-btn:disabled { opacity: .45; box-shadow: none; }
.daily-note { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* ===== WITHDRAW ===== */
.wd {
  width: 100%;
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 209, 113, .18);
  border-radius: 18px;
  padding: 16px;
}
.wd__title { font-family: 'Bokor', serif; font-size: 19px; letter-spacing: .5px; }
.wd__title-accent {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wd__balance { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.wd__balance b { color: var(--gold-1); font-size: 16px; }
.wd__rate { font-size: 11px; opacity: .8; }
.wd__label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; margin: 14px 0 6px; }
.wd__nets { display: flex; gap: 8px; }
.wd__net {
  flex: 1;
  background: var(--bg-card-2);
  color: var(--text-dim);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px; font-weight: 700;
  transition: .2s;
}
.wd__net.is-active { border-color: var(--gold-2); color: var(--gold-1); }
.wd__input {
  width: 100%;
  background: #17120D;
  border: 1px solid rgba(255, 209, 113, .25);
  border-radius: 12px;
  color: var(--text);
  padding: 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.wd__input:focus { border-color: var(--gold-2); }
.wd__input:disabled { opacity: .55; }
.wd__warn {
  font-size: 11.5px; color: #E5B864;
  background: rgba(255, 209, 113, .07);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 8px;
  line-height: 1.45;
}
.wd__save {
  width: 100%;
  margin-top: 8px;
  background: var(--bg-card-2);
  color: var(--gold-1);
  border: 1px solid rgba(255, 209, 113, .35);
  border-radius: 12px;
  padding: 11px;
  font-size: 13px; font-weight: 700;
  transition: .2s;
}
.wd__save:active { transform: scale(.98); }
.wd__save:disabled { opacity: .5; }
.wd__row { display: flex; gap: 8px; }
.wd__input--amount { flex: 1; }
.wd__btn {
  background: var(--gold-grad);
  color: #241C13;
  border-radius: 12px;
  padding: 0 22px;
  font-size: 14px; font-weight: 800;
  box-shadow: 0 4px 16px rgba(255, 209, 113, .25);
  transition: .2s;
}
.wd__btn:active { transform: scale(.97); }
.wd__btn:disabled { opacity: .5; box-shadow: none; }
.wd__history { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.wd__item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card-2);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px; color: var(--text-dim);
}
.wd__item b { color: var(--text); }
.wd__item-status { margin-left: auto; font-weight: 700; }
.wd__item-status--pending { color: #E5B864; }
.wd__item-status--approved { color: var(--green); }
.wd__item-status--rejected { color: var(--red); }

/* ===== REFERRAL ===== */
.ref {
  width: 100%;
  margin: 20px 0 16px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 209, 113, .18);
  border-radius: 18px;
  padding: 16px;
}
.ref__title { font-family: 'Bokor', serif; font-size: 19px; letter-spacing: .5px; }
.ref__title-accent {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ref__desc { font-size: 12px; color: var(--text-dim); margin-top: 5px; line-height: 1.45; }
.ref__stats { display: flex; gap: 10px; margin-top: 12px; }
.ref__stat {
  flex: 1;
  background: var(--bg-card-2);
  border-radius: 12px;
  padding: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.ref__stat b { font-size: 17px; color: var(--gold-1); }
.ref__stat span { font-size: 10.5px; color: var(--text-dim); font-weight: 600; }
.ref__link {
  margin-top: 12px;
  background: #17120D;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--text-dim);
  word-break: break-all;
  border: 1px dashed rgba(255, 209, 113, .25);
}
.ref__actions { display: flex; gap: 8px; margin-top: 10px; }
.ref__btn {
  flex: 1;
  background: var(--bg-card-2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px;
  font-size: 13px; font-weight: 700;
  transition: .2s;
}
.ref__btn:active { transform: scale(.97); }
.ref__btn--share {
  background: var(--gold-grad);
  color: #241C13;
  box-shadow: 0 4px 16px rgba(255, 209, 113, .25);
}

/* ===== OVERLAYS ===== */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10, 7, 4, .78);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.overlay__card {
  background: var(--bg-card);
  border: 1px solid rgba(255,209,113,.25);
  border-radius: 24px;
  padding: 30px 28px 24px;
  width: min(320px, 86vw);
  text-align: center;
  animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes popIn { from { transform: scale(.75); opacity: 0; } }
.overlay__emoji { font-size: 46px; }
.overlay__title {
  font-family: 'Bokor', serif; font-size: 32px; margin-top: 6px; letter-spacing: 1px;
}
.overlay__title--win { color: var(--green); text-shadow: 0 0 22px rgba(149,229,100,.4); }
.overlay__title--lose { color: var(--red); }
.overlay__title--gold {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.overlay__amount { font-size: 24px; font-weight: 800; margin-top: 4px; color: var(--gold-1); }
.overlay__btn { width: 100%; margin-top: 20px; }

.overlay__close-btn {
  width: 100%;
  margin-top: 10px;
  background: var(--bg-card-2);
  color: var(--text-dim);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  transition: .2s;
}
.overlay__close-btn:active { transform: scale(.98); }

.daily-days { display: flex; gap: 5px; justify-content: center; margin-top: 14px; }
.daily-day {
  width: 34px; padding: 6px 0; border-radius: 9px;
  background: var(--bg-card-2);
  font-size: 10px; color: var(--text-dim); font-weight: 700;
}
.daily-day.done { background: var(--gold-grad); color: #241C13; }

/* ===== TOAST / CONFETTI ===== */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: var(--bg-card-2);
  border: 1px solid rgba(229,108,100,.5);
  color: var(--text);
  padding: 11px 20px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600;
  animation: toastIn .3s ease;
  max-width: 86vw;
}
@keyframes toastIn { from { transform: translate(-50%, -18px); opacity: 0; } }

.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti {
  position: absolute; top: -12px;
  width: 9px; height: 14px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .4; }
}
