/* Напёрстки — стол, стаканчики и панель. Всё рисованное (SVG/CSS), без картинок:
   у RocketX ассетов тоже нет, стаканы у них кодовые. */

/* ── каркас экрана ───────────────────────────────────────────────────────── */
/* ВАЖНО: `.active` в селекторе обязателен. Без него `#screen-thimbles.cups`
   (id + класс) перебивает общее правило `.page { display:none }` и экран
   остаётся в потоке даже выключенным — он занимает всю высоту и сдвигает
   вниз все экраны, которые идут после него (СКУФДЕР, ХОЛОДИЛЬНИК). */
#screen-thimbles.cups.active {
    padding: 10px 12px 96px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cups-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cups-title { font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.cups-hash {
    font: 600 11px/1 ui-monospace, monospace;
    color: #9aa3b8;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 6px 8px;
}

/* ── стол ────────────────────────────────────────────────────────────────── */
.cups-table {
    position: relative;
    border-radius: 18px;
    background: radial-gradient(120% 90% at 50% 0%, #1c2540 0%, #121a2e 55%, #0d1424 100%);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 18px 40px rgba(0,0,0,.35);
    padding: 18px 12px 22px;
    overflow: hidden;
}
.cups-felt {
    position: absolute; inset: auto 0 0 0; height: 46%;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.25));
    border-top: 1px solid rgba(255,255,255,.05);
}
.cups-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    min-height: 190px;
}
.cups-slot {
    position: relative;
    flex: 1 1 0;
    max-width: 130px;
    height: 170px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cups-slot.is-locked { cursor: default; }

/* тень под стаканом */
.cups-shadow {
    position: absolute;
    bottom: 6px; left: 50%;
    width: 74%; height: 16px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.55), rgba(0,0,0,0) 70%);
    transition: transform .28s ease, opacity .28s ease;
}
.cups-slot.is-lifted .cups-shadow { transform: translateX(-50%) scale(.72); opacity: .65; }

/* сам стакан — SVG внутри кнопки */
.cups-cup {
    position: relative;
    width: 100%;
    max-width: 120px;
    transform-origin: 50% 100%;
    transition: transform .34s cubic-bezier(.22,.8,.26,1), filter .2s ease;
    will-change: transform;
}
.cups-cup svg { display: block; width: 100%; height: auto; }

/* подъём стакана в конце раунда */
.cups-slot.is-open .cups-cup { transform: translateY(-58px) rotate(-3deg); }

/* перемешивание: ездит по кругу между слотами */
.cups-slot.is-moving .cups-cup { transform: translateY(-16px) rotate(2deg); }
.cups-slot.is-moving .cups-shadow { transform: translateX(-50%) scale(.85); opacity: .7; }

/* выбор игрока */
.cups-slot.is-picked .cups-cup { filter: drop-shadow(0 0 14px rgba(239,2,203,.55)); }
.cups-slot.is-picked .cups-shadow { box-shadow: 0 0 22px rgba(239,2,203,.35); }

/* выигрыш / проигрыш */
.cups-slot.is-win .cups-cup { animation: cupsWinPulse .9s ease-out; }
.cups-slot.is-lose .cups-cup { animation: cupsShake .45s ease-in-out; }
@keyframes cupsWinPulse {
    0%   { transform: translateY(-58px) scale(1); }
    35%  { transform: translateY(-64px) scale(1.08); filter: drop-shadow(0 0 22px rgba(97,217,163,.85)); }
    100% { transform: translateY(-58px) scale(1); }
}
@keyframes cupsShake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-6px) rotate(-2deg); }
    75% { transform: translateX(6px) rotate(2deg); }
}

/* шарик под стаканом */
.cups-ball {
    position: absolute;
    bottom: 10px; left: 50%;
    width: 34px; height: 34px;
    margin-left: -17px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff 0%, #ffd8f4 22%, #ff35c8 62%, #a3007a 100%);
    box-shadow: 0 6px 14px rgba(0,0,0,.5), 0 0 18px rgba(255,53,200,.45);
    transform: translateY(26px) scale(.6);
    opacity: 0;
    transition: transform .3s cubic-bezier(.22,.8,.26,1), opacity .2s ease;
}
.cups-slot.is-open .cups-ball { transform: translateY(0) scale(1); opacity: 1; }

/* ── статус ──────────────────────────────────────────────────────────────── */
.cups-status {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #cfd6e6;
    min-height: 18px;
}
.cups-status.is-win { color: #61d9a3; }
.cups-status.is-lose { color: #ff6b8a; }

/* ── панель ставки (как у них: Hash / Твоя ставка / МАКС / ИГРАТЬ за …) ──── */
.cups-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    padding: 10px;
}
.cups-bet-row { display: flex; align-items: center; gap: 8px; }
.cups-bet-label { font-size: 12px; color: #9aa3b8; font-weight: 700; }
.cups-bet-input {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    padding: 8px 10px;
}
.cups-bet-input input {
    flex: 1 1 auto; min-width: 0;
    background: transparent; border: 0; outline: none;
    color: #fff; font: 800 16px/1.2 inherit;
}
.cups-max {
    flex: none;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #cfd6e6; font: 800 11px/1 inherit;
    padding: 8px 10px; border-radius: 10px; cursor: pointer;
}
.cups-chips { display: flex; gap: 6px; }
.cups-chip {
    flex: 1 1 0;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: #dfe4ef; font: 700 12px/1 inherit;
    padding: 9px 0; border-radius: 10px; cursor: pointer;
}
.cups-chip.is-on { border-color: #ef02cb; color: #fff; background: rgba(239,2,203,.16); }
.cups-play {
    border: 0; cursor: pointer;
    border-radius: 14px;
    padding: 14px 16px;
    font: 800 15px/1 inherit;
    color: #fff;
    background: linear-gradient(180deg, #ff35c8, #d0009f);
    box-shadow: 0 10px 26px rgba(239,2,203,.28);
}
.cups-play[disabled] { opacity: .55; cursor: default; box-shadow: none; }
.cups-verify {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    color: #cfd6e6; font: 700 12px/1 inherit;
    padding: 10px; border-radius: 12px; cursor: pointer;
}

/* ── лента «Победа дня» ─────────────────────────────────────────────────── */
.cups-feed { display: flex; flex-direction: column; gap: 6px; }
.cups-feed-head {
    display: flex; justify-content: space-between;
    font: 700 11px/1 inherit; color: #8b93ad; text-transform: uppercase; letter-spacing: .06em;
}
.cups-feed-list { display: flex; flex-direction: column; gap: 6px; }
.cups-feed-row {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
}
.cups-feed-row b { font-weight: 700; }
.cups-feed-row .ok { color: #61d9a3; }
.cups-feed-row .bad { color: #ff6b8a; }
.cups-feed-empty { color: #6f778c; font-size: 12px; }

/* ── окно «Данные для проверки» ─────────────────────────────────────────── */
.cups-modal {
    position: fixed; inset: 0; z-index: 9000;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(4,6,12,.66);
    backdrop-filter: blur(3px);
}
.cups-sheet {
    width: 100%; max-width: 520px;
    background: #131a2b;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px 18px 0 0;
    padding: 16px;
    display: flex; flex-direction: column; gap: 10px;
    max-height: 82vh; overflow: auto;
}
.cups-sheet h3 { margin: 0; font-size: 15px; }
.cups-sheet pre {
    margin: 0; padding: 10px;
    background: rgba(0,0,0,.35);
    border-radius: 10px;
    font: 600 11px/1.5 ui-monospace, monospace;
    color: #b9c3d8;
    white-space: pre-wrap; word-break: break-all;
}
.cups-sheet-ok { color: #61d9a3; font-weight: 700; font-size: 13px; }
.cups-sheet-bad { color: #ff6b8a; font-weight: 700; font-size: 13px; }
.cups-sheet-actions { display: flex; gap: 8px; }
.cups-sheet-actions button {
    flex: 1 1 0; padding: 12px; border-radius: 12px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: #e6ebf5; font: 700 13px/1 inherit;
}
.cups-sheet-actions .accent {
    border: 0; background: linear-gradient(180deg, #ff35c8, #d0009f); color: #fff;
}

@media (min-width: 1024px) {
    #screen-thimbles.cups { max-width: 620px; margin: 0 auto; }
    .cups-row { min-height: 220px; }
}

/* ── панель как у RocketX: Hash | Твоя ставка | x2.5, затем − / + / Макс ────
   Их палитра: акцент #ef02cb (лайм), панели #191919, приглушённый #919191,
   красный #fd6c6c, внутренние блики inset … #ffffff33. */
.cups-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cups-hash-cell,
.cups-mult-cell {
    width: 30%;
    height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: rgba(25,25,25,.55);
    box-shadow: inset 2px 2px 0 -2px #ffffff33, inset -2px -2px 2px -2px #ffffff33;
    font: 700 12px/1 ui-monospace, monospace;
}
.cups-hash-cell { color: rgba(255,255,255,.5); }
.cups-mult-cell { color: #fff; font-family: inherit; font-size: 13px; }
.cups-bet-title {
    flex: 1 1 auto;
    text-align: center;
    font: 700 13px/1 inherit;
    color: rgba(255,255,255,.42);
}
.cups-bet-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cups-step {
    flex: none;
    width: 43px; height: 43px;
    border: 0; border-radius: 12px;
    background: #1a1a1a; color: #fff;
    font: 700 20px/1 inherit; cursor: pointer;
    box-shadow: inset 2px 2px 0 -2px #ffffff33, inset -2px -2px 2px -2px #ffffff33;
}
.cups-step:disabled { opacity: .4; cursor: default; }
.cups-play {
    background: linear-gradient(183.4deg, #FFFFFF 2.8%, #ef02cb 125.53%);
    color: #14210a;
    text-shadow: 0 1px 0 rgba(255,255,255,.35);
    box-shadow: 0 0 48.3px rgba(239, 2, 203,.25), 0 0 62.5px rgba(242, 54, 234,.1),
                inset 2px 2px 0 -2px #ffffff55;
    border-radius: 16px;
    font-size: 15px;
}
.cups-play[disabled] { filter: saturate(.6) brightness(.8); box-shadow: none; }
.cups-max {
    background: rgba(25,25,25,.6);
    border: 0;
    box-shadow: inset 2px 2px 0 -2px #ffffff33, inset -2px -2px 2px -2px #ffffff33;
    color: #e8ecf6;
    height: 43px; padding: 0 14px; border-radius: 12px;
}
.cups-chip.is-on { border-color: #ef02cb; color: #ef02cb; background: rgba(239, 2, 203,.12); }
.cups-status.is-win { color: #fff; }
.cups-status.is-lose { color: #fd6c6c; }
.cups-verify { border: 1px solid rgba(255,255,255,.1); background: rgba(25,25,25,.5); }

.cups-bet-line .cups-step { width: 40px; height: 40px; }
.cups-bet-line .cups-max { height: 40px; padding: 0 12px; font-size: 11px; flex: none; }
.cups-bet-line .cups-bet-input { padding: 6px 8px; }
.cups-bet-line .cups-bet-input input { font-size: 15px; }
.cups-panel { padding: 8px; }
.cups-hash-cell, .cups-mult-cell { height: 30px; font-size: 11px; }

/* «Макс» больше не вылезает за край: инпут ужимается первым */
.cups-bet-line { gap: 6px; }
.cups-bet-input { min-width: 0; overflow: hidden; }
.cups-bet-input input { min-width: 0; width: 100%; }
.cups-bet-line .cups-max { max-width: 64px; }

/* ── окно итога: крупная сумма, лайм/красный, как у RocketX ─────────────── */
.cups-result {
    width: 100%; max-width: 420px;
    margin: auto;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px 18px 18px;
    background: #191919;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
}
.cups-result-sum {
    font: 800 52px/1 Unbounded, Onest, system-ui, sans-serif;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
}
.cups-result-sum.is-win { color: #fff; text-shadow: 0 0 28px rgba(255,255,255,.28); }
.cups-result-sum.is-lose { color: #fd6c6c; }
.cups-result-note { font: 700 13px/1.3 inherit; }
.cups-result-note.is-win { color: rgba(239, 2, 203,.7); }
.cups-result-note.is-lose { color: rgba(253,108,108,.75); }
.cups-result-sub { font: 600 12px/1.3 inherit; color: #919191; margin-top: 2px; }
.cups-result-btn {
    margin-top: 14px;
    width: 100%;
    padding: 13px;
    border: 0; border-radius: 14px; cursor: pointer;
    background: linear-gradient(183.4deg, #FFFFFF 2.8%, #ef02cb 125.53%);
    color: #14210a; font: 800 14px/1 inherit;
}
.cups-modal.cups-show-result { align-items: center; padding: 18px; }

/* Стаканчики: шире сверху, лаймовый ободок (их акцент #ef02cb), мягкая тень.
   Форму уточню по скриншоту их стола — пока делаю по их палитре. */
.cups-cup { --cup-rim: #ef02cb; }
.cups-cup svg ellipse[fill="url(#cupRim)"] { fill: var(--cup-rim); opacity: .35; }
.cups-slot.is-open .cups-cup { filter: drop-shadow(0 6px 18px rgba(239, 2, 203,.22)); }
.cups-slot.is-picked .cups-cup { filter: drop-shadow(0 0 14px rgba(239, 2, 203,.5)); }
.cups-cup svg { transform: scaleX(1.06); }

.cups-mode { display: flex; gap: 6px; margin: 6px 0; }
.cups-mode-opt {
    flex: 1 1 0; padding: 10px 0; cursor: pointer;
    border: 1px solid rgba(255,255,255,.10); border-radius: 12px;
    background: rgba(25,25,25,.6); color: #9aa3b8; font: 700 12px/1 inherit;
}
.cups-mode-opt.is-on { border-color: #ef02cb; color: #ef02cb; background: rgba(239, 2, 203,.10); }
.cups-gifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 168px; overflow-y: auto; }
.cups-gift {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 4px; cursor: pointer;
    border: 1px solid rgba(255,255,255,.10); border-radius: 12px;
    background: rgba(25,25,25,.55); color: #e6ebf5; font: 700 10px/1.2 inherit;
}
.cups-gift img { width: 44px; height: 44px; object-fit: contain; }
.cups-gift b { font-size: 9.5px; text-align: center; }
.cups-gift.is-on { border-color: #ef02cb; box-shadow: 0 0 14px rgba(239, 2, 203,.25); }
.cups-gift-empty { grid-column: 1 / -1; color: #6f778c; font-size: 12px; padding: 10px 0; }

/* ── Стол не должен сжиматься в полоску в низком окне (Telegram Desktop) ────
   Раньше при коротком окне от таблицы оставалась полоска: высота строки была
   фиксированной, а таблица обрезала её overflow:hidden. Теперь высота стола
   адаптивная, стаканы масштабируются, содержимое скроллится. */
#screen-thimbles.cups { overflow-y: auto; }
.cups-table { overflow: hidden; min-height: clamp(150px, 30vh, 260px); }
.cups-row { min-height: clamp(130px, 26vh, 210px); height: clamp(130px, 26vh, 210px); }
.cups-slot { height: 100%; }
.cups-cup { max-width: min(120px, 26vh); }
.cups-ball { width: clamp(22px, 5vh, 34px); height: clamp(22px, 5vh, 34px); margin-left: calc(clamp(22px, 5vh, 34px) / -2); }
