@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

@keyframes notifSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes notifSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@keyframes progressShrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

.notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-bottom-left-radius: 12px;
}

:root {
    --bg-color: #0b0e11;
    --card-bg: #151a21;
    --primary-blue: #0088cc;
    --accent-blue: #2c9aff;
    --text-color: #ffffff;
    --text-secondary: #7f8fa4;
    --danger-red: #ff3b30;
    --success-green: #34c759;
    --nav-height: 60px;
}

/* Tournament (Leaderboard) */
.tourn-page{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100%;
    z-index: 10006;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: radial-gradient(900px 520px at 50% -120px, rgba(44,154,255,0.18) 0%, rgba(15,20,25,0.0) 55%),
        linear-gradient(180deg,#0f1419 0%,#0a0f14 100%);
}

.tourn-hero{
    position: sticky;
    top: 0;
    z-index: 30;
}

.tourn-hero-bg{
    position:absolute;
    inset:0;
    pointer-events:none;
    background: rgba(10,15,20,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
}

/* subtle dot pattern */
.tourn-hero-bg::after{
    display: none;
}

.tourn-header{
    position: relative;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 16px 10px;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: 10px;
    align-items: center;
}

.tourn-back,
.tourn-refresh{
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tourn-title{ display:flex; flex-direction:column; min-width:0; }
.tourn-title-row{ display:flex; align-items:center; gap:8px; font-weight: 900; letter-spacing:-0.4px; }
.tourn-title-row ion-icon{ color: #f5c542; font-size: 18px; }
.tourn-sub{ opacity:0.78; font-size:0.85rem; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.tourn-sub #leaderboard-season-timer{ font-variant-numeric: tabular-nums; font-weight: 950; opacity: 0.98; }

.tourn-sub .tourn-season-badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    font-weight: 900;
    letter-spacing:-0.2px;
}
.tourn-sub .tourn-season-badge b{ color:#ffffff; }
.tourn-sub .tourn-season-badge .muted{ opacity:0.75; font-weight: 800; }

.tourn-sub .tourn-rule{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(44,154,255,0.35);
    background: rgba(44,154,255,0.12);
    color:#d8efff;
    font-weight: 900;
}

.tourn-cta{
    width: 100%;
    display:flex;
    align-items:center;
    justify-content: center;
    gap: 10px;
    padding: 14px 14px;
    border-radius: 18px;
    font-weight: 1000;
    letter-spacing: -0.2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

/* blue “bonus” CTA */
.tourn-cta--blue{
    border: 1px solid rgba(44,154,255,0.45);
    background: linear-gradient(135deg, #2c9aff 0%, #0077ff 55%, rgba(0,119,255,0.35) 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* soft shimmer */
.tourn-cta--blue::after{
    content:"";
    position:absolute;
    top: -20%;
    left: -60%;
    width: 55%;
    height: 140%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.24) 45%, transparent 100%);
    transform: skewX(-18deg);
    animation: tournShimmer 3.8s ease-in-out infinite;
    opacity: 0.9;
}
@keyframes tournShimmer{
    0% { transform: translateX(0) skewX(-18deg); opacity:0.0; }
    8% { opacity:0.85; }
    40% { transform: translateX(210%) skewX(-18deg); opacity:0.0; }
    100% { transform: translateX(210%) skewX(-18deg); opacity:0.0; }
}

.tourn-cta--blue:active{ transform: translateY(1px); }

.tourn-cta-text{ flex:1; text-align:center; }

.tourn-body{ padding: 14px 16px calc(18px + var(--tg-safe-area-inset-bottom, 0px)); display:flex; flex-direction:column; gap: 12px; }

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

/* Removed "Your place" section
.tourn-you{
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(135deg, rgba(44,154,255,0.16) 0%, rgba(255,255,255,0.05) 55%, rgba(0,119,255,0.08) 100%);
    padding: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.22);
}
.tourn-you-top{ display:flex; align-items:baseline; justify-content: space-between; gap: 10px; }
.tourn-you-title{ font-weight: 900; letter-spacing:-0.2px; opacity:0.9; }
.tourn-you-rank{ font-weight: 1000; color:#d8efff; }
.tourn-you-main{ display:flex; align-items:flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.tourn-you-points .pts{ font-weight: 900; font-size: 1.35rem; letter-spacing:-0.5px; }
.tourn-you-points .lbl{ opacity:0.7; font-size: 0.85rem; margin-top: 2px; }
.tourn-you-next{ opacity:0.75; font-size: 0.85rem; text-align:right; line-height:1.25; }

.tourn-you.sticky{
    position: sticky;
    top: calc(64px + var(--tg-header-height, 0px));
    z-index: 10;
}

@media (max-width: 380px){
  .tourn-you-main{ flex-direction: column; align-items:flex-start; }
  .tourn-you-next{ text-align:left; }
}
*/

.tourn-meta-chip{
    display:inline-flex;
    align-items:center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    font-weight: 800;
    font-size: 0.85rem;
    color: #cfeaff;
}
.tourn-meta-text{ opacity:0.7; font-size:0.85rem; }

.tourn-podium{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.tourn-podium-card{
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
    border-radius: 18px;
    padding: 10px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tourn-podium-card .medal{
    position:absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 10px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 14px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.14);
}

.tourn-podium-card.p1{ transform: translateY(-6px); }

.tourn-podium-card .place{ font-weight: 900; opacity: 0.9; font-size: 0.9rem; }
.tourn-podium-card .name{ font-weight: 900; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tourn-podium-card .val{ margin-top: 4px; opacity: 0.75; font-size: 0.82rem; }

.tourn-podium-card.p1{
    background: linear-gradient(135deg, rgba(245,197,66,0.16) 0%, rgba(255,255,255,0.05) 55%);
    border-color: rgba(245,197,66,0.30);
    box-shadow: 0 18px 44px rgba(0,0,0,0.28);
}
.tourn-podium-card.p2{
    background: linear-gradient(135deg, rgba(210,210,210,0.12) 0%, rgba(255,255,255,0.05) 55%);
    border-color: rgba(210,210,210,0.22);
}
.tourn-podium-card.p3{
    background: linear-gradient(135deg, rgba(205,127,50,0.12) 0%, rgba(255,255,255,0.05) 55%);
    border-color: rgba(205,127,50,0.22);
}

.tourn-podium-avatar{
    width: 44px;
    height: 44px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    margin: 8px auto 0;
    display:block;
}

.tourn-prize-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
    z-index: 10;
}

.tourn-frog-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px auto 12px;
    padding: 0 16px;
    position: relative;
}

.tourn-frog-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.tourn-frog-timer {
    position: absolute;
    top: 28px;
    right: 24px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tourn-section-title{ margin-top: 2px; font-weight: 900; letter-spacing:-0.3px; }

.tourn-list{ display:flex; flex-direction:column; gap: 10px; }

.tourn-row{
    display: grid;
    grid-template-columns: 40px 40px 1fr auto auto;
    align-items:center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.05);
}

.tourn-row-prize {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-left: auto;
    flex-shrink: 0;
}

.tourn-row .place{
    width: 34px;
    text-align:center;
    font-weight: 1000;
}

.tourn-row img{
    width: 42px;
    height: 42px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
}

.tourn-row .main{ flex:1; min-width:0; }
.tourn-row .name{ font-weight: 900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.tourn-row .points{
    display:flex;
    flex-direction: column;
    align-items:flex-end;
    gap: 2px;
    min-width: 84px;
}
.tourn-row .points .v{ font-weight: 900; font-size: 1.05rem; letter-spacing:-0.3px; }
.tourn-row .points .l{ opacity:0.65; font-size: 0.78rem; }

.tourn-row.is-top{ background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.14); }
.tourn-row.is-me{ background: rgba(44,154,255,0.16); border-color: rgba(44,154,255,0.34); }

/* Medal for top-3 places */
.medal-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}
.medal-emoji {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.medal-num {
    font-size: 0.65rem;
    font-weight: 900;
    opacity: 0.7;
    margin-top: -2px;
}

.tourn-loading{ opacity:0.7; text-align:center; padding: 24px 0; }
.tourn-footnote{ opacity:0.6; font-size: 0.8rem; line-height: 1.35; padding: 6px 2px; }

@media (max-width: 380px){
    .tourn-podium{ grid-template-columns: 1fr; }
}


/* Admin Leaderboard editor */
.lb-editor-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px;
}

.lb-editor-title {
    display:flex;
    align-items:center;
    gap:8px;
    font-weight: 800;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.lb-editor-title ion-icon { color: #2c9aff; font-size: 18px; }

.lb-editor-sub {
    font-size: 0.85rem;
    opacity: 0.72;
    line-height: 1.35;
    margin-bottom: 10px;
}

.lb-editor-list {
    display:flex;
    flex-direction: column;
    gap: 10px;
}

.lb-row {
    display:flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

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

.lb-row-badge {
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0,136,204,0.16);
    border: 1px solid rgba(0,136,204,0.26);
    color: #7fd0ff;
    font-weight: 800;
    font-size: 0.85rem;
}

.lb-row-actions {
    display:flex;
    gap: 8px;
}

.lb-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
    display:flex;
    align-items:center;
    justify-content:center;
}

.lb-icon-btn.danger { background: rgba(255,59,48,0.12); border-color: rgba(255,59,48,0.22); }

.lb-grid {
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lb-field {
    display:flex;
    flex-direction: column;
    gap: 6px;
}

.lb-field label {
    font-size: 0.8rem;
    opacity: 0.75;
}

.lb-field input,
.lb-field select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    outline: none;
    color: #fff;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 0.92rem;
}

.lb-grid-3 {
    display:grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 380px) {
    .lb-grid-3 { grid-template-columns: 1fr; }
    .lb-grid { grid-template-columns: 1fr; }
}

.lb-help-mini {
    font-size: 0.8rem;
    opacity: 0.68;
}

.lb-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.lb-avatar-inline {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.10);
}

.lb-inline {
    display:flex;
    align-items:center;
    gap: 10px;
}

.lb-inline .lb-grow { flex: 1; min-width: 0; }

.lb-inline input { width: 100%; }

.profile-bonus-btn {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 18px;
    padding: 14px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    letter-spacing: -0.2px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #0088cc 0%, #2c9aff 100%);
    box-shadow: 0 12px 34px rgba(0, 136, 204, 0.30);
}

.profile-bonus-btn ion-icon {
    font-size: 20px;
}

.profile-bonus-btn.glow {
    animation: profileBonusGlow 1.6s ease-in-out infinite;
}

@keyframes profileBonusGlow {
    0%, 100% { box-shadow: 0 12px 34px rgba(0, 136, 204, 0.30); }
    50% { box-shadow: 0 14px 42px rgba(44, 154, 255, 0.55); }
}

.profile-bonus-btn.hidden { display: none !important; }

#splash-loader {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: #000;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    /* Splash is purely cosmetic — never absorb taps. Without this, the 2.4s
     * splash dwell + 0.6s fade-out (~3s) make the bottom-nav feel dead on
     * cold start. */
    pointer-events: none;
}

#splash-loader.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-star-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: splashStarPulse 2.4s ease-in-out infinite;
}

.splash-star-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(0.35) brightness(2.5)
            drop-shadow(0 0 12px rgba(255, 255, 255, 0.3))
            drop-shadow(0 0 30px rgba(200, 200, 220, 0.12));
    opacity: 0.7;
}

@keyframes splashStarPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.07);
        opacity: 0.9;
    }
}

.splash-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.splash-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, #0088cc, #00aaff, #2c9aff, #00d2ff);
    box-shadow: 0 0 10px rgba(0, 136, 204, 0.6), 0 0 20px rgba(44, 154, 255, 0.3);
    animation: splashProgressGrow 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes splashProgressGrow {
    0%   { width: 0%; }
    20%  { width: 25%; }
    50%  { width: 55%; }
    80%  { width: 85%; }
    100% { width: 100%; }
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Allow typing/selecting text in form fields (admin inputs, etc.) */
input,
textarea,
select {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    pointer-events: auto;
}

input:disabled,
textarea:disabled,
select:disabled {
    pointer-events: none;
}

.lb-field input,
.lb-field select {
    -webkit-user-select: text;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: #0b0e14;
    color: #fff;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-color);
    overflow: hidden;
}

.betting-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    background: linear-gradient(180deg, #1c2533 0%, #151a21 100%);
    border-radius: 24px 24px 0 0;
    padding: 0;
    box-sizing: border-box;
    z-index: 10060;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-top: 2px solid rgba(0, 136, 204, 0.3);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    padding-bottom: calc(12px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.betting-sheet.dragging {
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
    transition: none;
}

.betting-sheet.dragging:not(.hidden) {
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
}


/* Subscribe suggestion sheet */
.subscribe-sheet {
    pointer-events: auto;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(25, 28, 35, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    transform: translateY(120%);
    transition: transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    min-height: 360px;
}

.subscribe-sheet.show {
    transform: translateY(0) !important;
}

.subscribe-sheet.dragging {
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
    transition: none !important;
}

.subscribe-sheet.dragging.show {
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
}

.subscribe-sheet:not(.dragging) {
    transform: translateY(120%);
}

.subscribe-sheet.show:not(.dragging) {
    transform: translateY(0) !important;
}

.subscribe-sheet {
    will-change: transform;
}

.subscribe-sheet-open {
    /* attached to body while sheet is open */
    overflow: hidden;
}

/* Dim + blur the app behind the sheet */
/* When the sheet is open we dim via #subscribe-page.
   IMPORTANT: do NOT blur/transform #main-app here — Telegram WebView can glitch fixed layers and you end up with "only blur". */
.subscribe-sheet-open #main-app {
    filter: none;
    transform: none;
}

/* legacy: replaced by .subscribe-dim + full-screen #subscribe-page */

/* NOTE: dim overlay moved into #subscribe-page as a real element
   because Telegram WebView can place body::before above everything and block clicks */
/* .subscribe-sheet-open::before removed */

.subscribe-dim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    /* no blur here: Telegram WebView often shows "only blur" when stacking fixed layers */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 100000;
}

/* subscribe wrapper covers whole screen so dim receives clicks */
#subscribe-page {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 100000;
    pointer-events: auto;
    padding: 0 14px calc(18px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box;
}

#subscribe-page .subscribe-sheet {
    position: fixed;
    /* Slight left shift to match Telegram WebView visual centering */
    left: 0px;
    right: 44px;
    bottom: calc(18px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    max-width: 480px;
    margin: 0 auto;
    z-index: 100001;
}

.subscribe-sheet-open #subscribe-page {
    display: block;
}

.subscribe-sheet-open #main-app {
    filter: none;
    transform: none;
}

#subscribe-page {
    transition: opacity 0.25s ease;
    opacity: 0;
}

/* keep sheet above the dim layer */
#subscribe-sheet {
    position: relative;
    z-index: 100001;
}

.subscribe-sheet-open #subscribe-page {
    opacity: 1;
}

/* Keep JS transforms working during drag */
.subscribe-sheet.js-transform {
    will-change: transform;
}

.subscribe-sheet.js-transform.show:not(.dragging) {
    transform: translateY(0) !important;
}

.subscribe-sheet.js-transform:not(.show):not(.dragging) {
    transform: translateY(120%) !important;
}

.subscribe-sheet.js-transform.dragging {
    transition: none !important;
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
}

.subscribe-sheet.js-transform.dragging.show {
    transform: translateY(var(--subscribe-drag-y, 0px)) !important;
}
.subscribe-sheet-handle {
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    margin: 10px auto 0;
}

.subscribe-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
}

.subscribe-sheet-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subscribe-sheet-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 12px;
}

.subscribe-sheet-h1 {
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -0.3px;
}

.subscribe-sheet-sub {
    opacity: 0.7;
    font-size: 0.82rem;
    margin-top: 2px;
}

.subscribe-sheet-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.subscribe-sheet-body {
    padding: 10px 14px 14px;
}

.subscribe-sheet-reward {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
}

.subscribe-reward-pill {
    flex: 0 0 auto;
    font-weight: 900;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(52, 199, 89, 0.14);
    border: 1px solid rgba(52, 199, 89, 0.25);
    color: #34c759;
}

.subscribe-sheet-message {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.35;
    opacity: 0.85;
    min-width: 0;
}

.subscribe-sheet-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
}

.subscribe-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #0088cc 0%, #2c9aff 100%);
    box-shadow: 0 8px 22px rgba(0, 136, 204, 0.25);
}

.subscribe-secondary-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.subscribe-sheet-hint {
    text-align: center;
    opacity: 0.55;
    font-size: 0.78rem;
    margin-top: 10px;
}

/* (dup) handled above */

/* Auto cashout input styling */
.auto-cashout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(40, 45, 55, 0.8) 0%, rgba(30, 35, 45, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auto-cashout-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
    flex-shrink: 0;
}

.auto-cashout-toggle input {
    display: none;
}

.auto-cashout-toggle .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auto-cashout-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auto-cashout-toggle input:checked + .toggle-slider {
    background: rgba(76, 217, 100, 0.8);
    border-color: rgba(76, 217, 100, 1);
}

.auto-cashout-toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.auto-cashout-toggle input:not(:checked) + .toggle-slider {
    background: rgba(255, 255, 255, 0.1);
}

.auto-cashout-disabled {
    opacity: 0.55;
}

.betting-sheet:not(.hidden) {
    transform: translateY(0);
}

.betting-sheet.hidden {
    transform: translateY(100%);
}

.betting-sheet .sheet-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.betting-sheet .sheet-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.betting-sheet .sheet-header .close-sheet-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.sheet-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 20px 16px 20px;
    position: relative;
}

.sheet-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.close-sheet-btn {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-sheet-btn:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(0.9);
}

.betting-sheet .sheet-body {
    padding: 0 20px 20px 20px;
    padding-bottom: calc(20px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.input-group {
    margin-bottom: 20px;
}

#bet-input {
    width: 100%;
    background: linear-gradient(180deg, rgba(40, 45, 55, 0.95) 0%, rgba(30, 35, 45, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    color: #fff;
    padding: 14px 16px;
    font-size: 1.3rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#bet-input:focus {
    outline: none;
    border-color: rgba(0, 136, 204, 0.5);
}

#bet-input:focus {
    outline: none;
}

.quick-amounts {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.quick-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quick-btn:active {
    background: rgba(0, 136, 204, 0.2);
    border-color: rgba(0, 136, 204, 0.3);
    color: #fff;
    transform: scale(0.96);
}

.confirm-bet-btn {
    width: 100%;
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-bet-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.3);
}

.multiplier-control {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 6px 10px;
    flex: 1;
}

.multiplier-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    user-select: none;
}

.multiplier-btn:active {
    background: rgba(0, 136, 204, 0.5);
    transform: scale(0.9);
}

.multiplier-display {
    flex: 1;
    text-align: center;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    min-width: 50px;
}

.top-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    /* Telegram's --tg-content-top is the only inset that's correct in BOTH
     * compact (where it's 0 — chrome is drawn above the WebView) AND
     * fullscreen (where it equals chrome+notch height, since the chrome is
     * transparent and overlays the content). env() alone misses the chrome
     * portion in compact-but-expanded mode, which is why balance/RU were
     * being eaten by the Закрыть button on the user's iPhone. */
    padding: calc(2px + var(--tg-content-top, env(safe-area-inset-top, 0px))) 10px 2px !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    min-height: 32px;
}

.top-left-group, .top-right-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}
.top-left-group { gap: 10px; }
.top-right-group { gap: 6px; }

/* Hide multiplier line-graph (per request — show only big multiplier near rocket) */
.multiplier-graph { display: none !important; }

/* Big live multiplier overlay shown over the rocket */
.big-multiplier {
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 14vw, 96px);
    color: #fff;
    text-shadow: 0 0 18px rgba(0, 200, 255, 0.55), 0 0 40px rgba(255, 80, 200, 0.35);
    letter-spacing: -0.02em;
    pointer-events: none;
    z-index: 15;
    transition: color 0.15s ease, text-shadow 0.15s ease, transform 0.1s ease;
    line-height: 1;
}
.big-multiplier.crashed {
    color: #ff3b30;
    text-shadow: 0 0 24px rgba(255, 59, 48, 0.7), 0 0 60px rgba(255, 59, 48, 0.4);
}
.big-multiplier.hidden { display: none; }

.online-users {
    background: transparent;
    backdrop-filter: none;
    padding: 0px 4px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4cd964;
    border: none;
}

#user-count {
    transition: all 0.3s ease;
    display: inline-block;
}

@keyframes onlineCountPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.online-dot {
    width: 8px;
    height: 8px;
    background-color: #4cd964;
    border-radius: 50%;
    box-shadow: 0 0 5px #4cd964;
}

.balance-container {
    background: transparent;
    backdrop-filter: none;
    padding: 6px 6px 6px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.ton-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.ton-icon-small {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

#balance {
    font-weight: 700;
    font-size: 0.95rem;
}

.add-funds-btn {
    background: var(--primary-blue);
    border: none;
    border-radius: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
}

.history-bar {
    position: relative;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 15;
    background: transparent;
    margin-bottom: 0;
    margin-top: -80px;
}

.history-bar::-webkit-scrollbar {
    display: none;
}

.history-pill {
    padding: 2px 0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: #1e2530;
    color: #a5bddc;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 36px;
    height: 32px;
    min-width: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.history-pill.win {
    color: var(--success-green);
    background-color: rgba(52, 199, 89, 0.1);
    border-color: rgba(52, 199, 89, 0.2);
}

.history-pill.gold {
    color: #ffd60a;
    background-color: rgba(255, 214, 10, 0.1);
    border-color: rgba(255, 214, 10, 0.2);
}

.history-pill.high-tier {
    color: #ff453a;
    background-color: rgba(255, 69, 58, 0.1);
    border-color: rgba(255, 69, 58, 0.2);
    box-shadow: 0 0 8px rgba(255, 69, 58, 0.2);
}

.live-pill {
    flex: 0 0 auto;
    min-width: 44px;
    height: 32px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    color: #0088cc;
    background: rgba(0, 136, 204, 0.12);
    border: 1px solid rgba(0, 136, 204, 0.25);
    box-shadow: 0 0 8px rgba(0, 136, 204, 0.15);
    transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, min-width 0.3s ease;
    font-family: 'Outfit', sans-serif;
    position: relative;
    overflow: hidden;
}

.live-pill .lp-text {
    display: inline-block;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.live-pill .lp-text.out {
    opacity: 0;
    transform: scale(0.7) translateY(3px);
}

.live-pill .lp-text.in {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.live-pill.crashed {
    animation: pillShake 0.35s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes pillShake {
    0%, 100% { transform: translateX(0); }
    15%, 85% { transform: translateX(1px); }
    30%, 70% { transform: translateX(-2px); }
    45% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
}

.settings-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.game-stage {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #131820 0%, #060709 100%);
    overflow: hidden;
    perspective: 1000px;
    padding-top: 20px;
    padding-bottom: 80px;
}

.scanlines,
.noise {
    display: none;
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

@keyframes noise {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(-1%, -1%);
    }

    20% {
        transform: translate(1%, 1%);
    }

    30% {
        transform: translate(-2%, 2%);
    }

    40% {
        transform: translate(2%, -2%);
    }

    50% {
        transform: translate(0, 0);
    }

    60% {
        transform: translate(1%, -1%);
    }

    70% {
        transform: translate(-1%, 1%);
    }

    80% {
        transform: translate(2%, 2%);
    }

    90% {
        transform: translate(-2%, -2%);
    }

    100% {
        transform: translate(0, 0);
    }
}

.admin-prize-row {
    display: grid;
    grid-template-columns: 70px 90px 90px 80px 1fr 50px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.admin-prize-row input,
.admin-prize-row select {
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
}

.prize-remove-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}


.meteor {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(-45deg);
    opacity: 0;
    z-index: 0;
    pointer-events: none;
    animation: meteor-fall 2s linear forwards;
}

@keyframes meteor-fall {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(-45deg);
    }

    100% {
        opacity: 0;
        transform: translate(-200px, 200px) rotate(-45deg);
    }
}

.floating-planet {
    position: absolute;
    pointer-events: none;
    z-index: 4;
    will-change: opacity, left, top;
}

.p-sphere {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.p-detail {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.p-rings-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.p-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border-style: solid;
}

.p-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.p-moon {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: moonOrbit var(--orbit-dur) linear infinite;
}

@keyframes moonOrbit {
    0%   { transform: rotate(0deg)   translateX(var(--orbit-r)) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(var(--orbit-r)) rotate(-360deg); }
}

.multiplier-graph {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.multiplier-graph.active {
    opacity: 1;
}

.countdown-display {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.countdown-display:not(.hidden) {
    animation: countdownAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes countdownAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.countdown-text {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.circular-timer {
    position: relative;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-timer svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.circular-timer-bg {
    fill: none;
    stroke: rgba(0, 136, 204, 0.2);
    stroke-width: 8;
}

.circular-timer-progress {
    fill: none;
    stroke: #0088cc;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.15s ease;
    will-change: stroke-dashoffset;
    filter: drop-shadow(0 0 12px currentColor);
}

.countdown-number {
    font-size: 4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 0 30px rgba(0, 136, 204, 0.8), 0 0 60px rgba(0, 136, 204, 0.4);
    font-family: 'Outfit', sans-serif;
    position: relative;
    z-index: 1;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}

@keyframes numberOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-30px) rotateX(90deg);
    }
}

@keyframes numberIn {
    0% {
        opacity: 0;
        transform: scale(1.8) translateY(30px) rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

@keyframes circlePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 400px) {
    .circular-timer {
        width: 144px;
        height: 144px;
    }
    
    .countdown-number {
        font-size: 3.2rem;
    }
}

.countdown-display.hidden {
    display: none;
}

.crashed-text {
    color: var(--danger-red);
    text-shadow: 0 0 30px rgba(255, 59, 48, 0.4);
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.rocket-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.5s ease-out;
}

.rocket-container::before {
    content: '';
    position: absolute;
    width: 170px;
    height: 170px;
    background: radial-gradient(circle, rgba(255, 149, 0, 0.12) 0%, rgba(255, 120, 0, 0.06) 30%, transparent 60%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

.rocket-container.hidden {
    display: none;
}

#rocket-lottie {
    width: 100%;
    height: 100%;
}

.explosion-container {
    position: absolute;
    top: 52%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 155px;
    height: 155px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.1s ease-in;
}

.explosion-container.show {
    opacity: 1;
}

.explosion-container.hidden {
    display: none;
    opacity: 0;
}

#explosion-lottie {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#explosion-lottie svg {
    width: 100% !important;
    height: 100% !important;
}

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

.countdown-display.hidden,
.rocket-container.hidden,
.explosion-container.hidden,
.pay-form.hidden,
.ton-pending-view.hidden,
.profile-page.hidden,
.game-stage.hidden {
    display: none !important;
}

/* Body classes set by __openDuelPage / __openJackpotPage. We lock body
   overflow and aggressively hide every sibling that could otherwise leak
   into the viewport (synced with the inject-CSS block in script.js). */
body.duel-open,
body.jp-open {
    overflow: hidden !important;
}
body.duel-open #main-app,
body.jp-open #main-app,
body.duel-open #leaderboard-page,
body.jp-open #leaderboard-page,
body.duel-open #subscribe-page,
body.jp-open #subscribe-page,
body.duel-open #subscribe-gate-page,
body.jp-open #subscribe-gate-page,
body.duel-open #history-page,
body.jp-open #history-page,
body.duel-open #withdrawal-overlay,
body.jp-open #withdrawal-overlay,
body.duel-open #bet-overlay,
body.jp-open #bet-overlay,
body.duel-open #topup-overlay,
body.jp-open #topup-overlay,
body.duel-open #bet-sheet,
body.jp-open #bet-sheet,
body.duel-open #topup-sheet,
body.jp-open #topup-sheet,
body.duel-open tc-root,
body.jp-open tc-root {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}
body.duel-open #jackpot-page { display: none !important; }
body.jp-open #duel-page { display: none !important; }

#history-page.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.betting-sheet.hidden {
    display: block !important;
}

.topup-sheet.hidden {
    display: block !important;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modal-content {
    background: linear-gradient(180deg, #1c2533 0%, #151a21 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 20px;
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.close-modal-btn:active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.fade-transition {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.withdrawal-modal-card {
    background: #111827;
    border-radius: 20px;
    width: calc(100% - 32px);
    max-width: 360px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
    animation: wmSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.withdrawal-modal-card::-webkit-scrollbar {
    display: none;
}

@keyframes wmSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.wm-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.wm-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-title-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #0088cc, #005588);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
}

.wm-close {
    background: rgba(255, 255, 255, 0.07);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.wm-close:active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.wm-section {
    padding: 10px 16px 0;
}

.wm-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #7f8fa4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.wm-currency-tabs {
    display: flex;
    gap: 8px;
}

.wm-curr-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

.wm-curr-tab.active {
    border-color: #0088cc;
    background: rgba(0, 136, 204, 0.12);
    color: #fff;
}

.wm-curr-tab:active {
    transform: scale(0.97);
}

.wm-amount-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wm-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.wm-input:focus {
    border-color: rgba(0, 136, 204, 0.6);
}

.wm-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.wm-max-btn {
    background: rgba(0, 136, 204, 0.15);
    border: 1.5px solid rgba(0, 136, 204, 0.3);
    border-radius: 12px;
    color: #0088cc;
    padding: 0 16px;
    height: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wm-max-btn:active {
    background: rgba(0, 136, 204, 0.3);
    transform: scale(0.96);
}

.wm-wallet-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(52, 199, 89, 0.08);
    border: 2px solid rgba(52, 199, 89, 0.3);
    border-radius: 24px;
    padding: 32px 28px;
    margin-bottom: 16px;
    min-height: 120px;
}

.wm-wallet-banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wm-wallet-addr-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-wallet-change {
    background: rgba(255, 59, 48, 0.15);
    border: 1.5px solid rgba(255, 59, 48, 0.3);
    border-radius: 14px;
    color: #ff3b30;
    font-size: 1.1rem;
    padding: 16px 24px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: 700;
}

.wm-wallet-change:active {
    background: rgba(255, 255, 255, 0.15);
}

.wm-connect-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #7f8fa4;
    margin-top: 8px;
}

.wm-stars-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 16px 0;
    background: rgba(255, 214, 10, 0.06);
    border: 1px solid rgba(255, 214, 10, 0.18);
    border-radius: 10px;
    padding: 10px;
    color: #fff;
    font-size: 0.8rem;
}

.wm-fee-block {
    margin: 10px 16px 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 14px;
}

.wm-fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

.wm-fee-total {
    font-size: 1rem;
    color: #fff;
}

.wm-fee-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 10px 0;
}

.wm-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 12px 16px 16px;
    padding: 12px;
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.35);
    transition: all 0.2s ease;
}

.wm-submit-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.2);
}

.wm-submit-btn ion-icon {
    font-size: 1.2rem;
}

.controls-area {
    padding: 6px 16px;
    background: rgba(21, 26, 33, 0.85);
    z-index: 30;
    position: relative;
    border-radius: 20px 20px 0 0;
    box-shadow: none;
    margin-bottom: 0;
}

/* When bet sheet is open, hide controls area to prevent overlap */
body.bet-sheet-open .controls-area {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.bet-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #0088cc 0%, #006699 100%);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s, background 0.3s;
    letter-spacing: 0.5px;
}

.bet-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

.bet-btn.active-cashout {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bet-btn.active-cashout:active {
    transform: scale(0.98);
}

@keyframes pulseGold {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    }
}

.bet-btn.disabled-grey {
    background: #2c3e50;
    color: #7f8fa4;
    cursor: not-allowed;
    border: 1px solid #34495e;
}

.profile-page {
    flex: 1;
    display: block;
    padding: 16px;
    padding-top: 24px;
    background: #0b0e11;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
    z-index: 50;
    background-image: radial-gradient(circle at 50% 30%, #1a222d 0%, #0b0e11 70%);
    height: calc(100vh - var(--nav-height));
    padding-bottom: calc(var(--nav-height) + 40px);
    box-sizing: border-box;
    width: 100%;
}

.profile-page::-webkit-scrollbar {
    width: 6px;
}

.profile-page::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.profile-page::-webkit-scrollbar-thumb {
    background: rgba(0, 136, 204, 0.5);
    border-radius: 3px;
}

.profile-page::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 136, 204, 0.7);
}

#history-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
}

#history-page:not(.hidden) {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
}

#history-page.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.history-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    flex-shrink: 0;
    position: relative;
    cursor: grab;
    touch-action: none;
    transition: background 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.history-header:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.02);
}

.history-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.history-header:active::before {
    width: 50px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%) scale(1.1);
}

.history-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    margin: 0;
    pointer-events: none;
    user-select: none;
}

#full-history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 20px;
    touch-action: pan-y;
}

#full-history-list::-webkit-scrollbar {
    width: 5px;
}

#full-history-list::-webkit-scrollbar-track {
    background: transparent;
}

#full-history-list::-webkit-scrollbar-thumb {
    background: rgba(0, 136, 204, 0.4);
    border-radius: 3px;
}

#full-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 136, 204, 0.6);
}

.history-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.history-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.05);
}

.history-card.win {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.history-card.loss {
    border-left: 4px solid #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.h-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.h-date {
    font-size: 0.8rem;
    color: #7f8fa4;
    margin-top: 4px;
}

.h-result {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.h-mult {
    font-size: 1.3rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.h-profit {
    font-size: 0.9rem;
    font-weight: 700;
}

.text-win {
    color: #10b981;
}

.text-loss {
    color: #ef4444;
}

.profile-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 80px;
    margin-bottom: 30px;
}

.avatar-ring-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #0088cc, #00d2ff);
    margin-bottom: 12px;
}

.avatar-img-large {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0f141a;
}

.username-display-large {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.user-id-badge {
    margin-top: 5px;
    font-size: 0.8rem;
    color: #7f8fa4;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.stat-card:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.stat-icon {
    font-size: 1.8rem;
    color: #7f8fa4;
    flex-shrink: 0;
}

.stat-icon.gold {
    color: #FFD700;
}

.stat-icon.blue {
    color: #0088cc;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ton-mini {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.profile-menu {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    overflow: hidden;
}

.menu-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.menu-item.hidden {
    display: none !important;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 136, 204, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0088cc;
    font-size: 1.2rem;
}

.menu-item span {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
}

.arrow {
    color: #5a6b7c;
    font-size: 1.2rem;
}

.badge {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.verified {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.live-bets-panel {
    background: rgba(21, 26, 33, 0.75);
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--nav-height) + 10px);
    min-height: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: none;
}

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

.admin-crash-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 59, 48, 0.45);
    background: rgba(255, 59, 48, 0.12);
    color: #ff453a;
    font-weight: 900;
    letter-spacing: 0.4px;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.admin-crash-inline-btn ion-icon {
    font-size: 16px;
}

.admin-crash-inline-btn.hidden {
    display: none !important;
}

.admin-crash-inline-btn:active {
    transform: translateY(1px);
}

.total-bets-value {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bets-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 100px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.7;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;

    /* Keep this block in sync with the later .bottom-nav definition.
       We account for the safe-area by increasing the height, otherwise
       adding padding-bottom makes icons/text "slide" on phones. */
    box-sizing: border-box;
    height: calc(var(--nav-height) + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    background: rgb(21, 26, 33);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    padding-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #556070;
    text-decoration: none;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.nav-item span {
    display: block;
    font-size: 0.72rem;
    line-height: 1;
    margin-top: 2px;
    opacity: 0.95;
}

.nav-item ion-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary-blue);
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background-color: #000;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    position: absolute;
    top: 40px;
    padding-top: calc(10px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    z-index: 9999;
}

.online-users {
    background: rgba(30, 30, 36, 0.95);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4cd964;
}

.online-dot {
    width: 8px;
    height: 8px;
    background-color: #4cd964;
    border-radius: 50%;
    box-shadow: 0 0 5px #4cd964;
}

.balance-container {
    background: rgba(30, 30, 36, 0.95);
    padding: 6px 6px 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.diamond-icon {
    color: var(--diamond-color);
}

#balance {
    font-weight: 700;
    font-size: 1rem;
}

.add-funds-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
}

.game-stage {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
    perspective: 1000px;
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}


.crashed-text {
    color: var(--danger-red);
    text-shadow: 0 0 40px rgba(255, 59, 48, 0.8);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.explosion-container {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    z-index: 6;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#explosion-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.history-pill {
    flex: 0 0 auto;
    width: 50px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    background-color: #232830;
    color: #556070;
    border: none;
    opacity: 1;
}

.history-pill.win {
    background: #1e3a2a;
    color: #4cd964;
}

.history-pill.gold {
    background: #3a321e;
    color: #ffd60a;
}

.bet-btn.disabled-grey {
    background: #232830;
    color: #556070;
    box-shadow: none;
    cursor: default;
    transform: none;
}

.bet-btn.active-cashout {
    background: linear-gradient(180deg, #ff9500 0%, #cc7a00 100%);
    box-shadow: 0 4px 0 #995c00;
    color: white;
}

.live-bets-panel {
    background: rgba(21, 26, 33, 0.75);
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: none;
    padding-bottom: var(--nav-height);
    min-height: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: none;
}

.bets-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.bet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 0.9rem;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(25, 28, 35, 0.85);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.bet-row.my-bet {
    background: rgba(0, 136, 204, 0.12);
    border: 1px solid rgba(0, 136, 204, 0.25);
}

.bet-row.win-row {
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid rgba(52, 199, 89, 0.25);
    animation: winPulse 0.5s ease;
}

.bet-row.loss-row {
    background: rgba(255, 59, 48, 0.12);
    border: 1px solid rgba(255, 59, 48, 0.25);
    opacity: 0.7;
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.bet-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.bet-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.bet-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bet-username {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.bet-details {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.bet-amount-text {
    color: #7f8fa4;
    font-weight: 500;
}

.bet-multiplier {
    color: #00d4ff;
    font-weight: 600;
}

.bet-card-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bet-win-amount {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
}

.bet-icon-ton {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.bet-icon-star {
    width: 16px;
    height: 16px;
    opacity: 0.8;
    border-radius: 50%;
}

.bets-list {
    padding-top: 8px;
    padding-bottom: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.profile-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.icon-btn {
    background: rgba(40, 44, 52, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
}

.lang-flag {
    width: 24px;
    border-radius: 4px;
}

.profile-balance-badge {
    background: rgba(40, 44, 52, 0.8);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    margin-left: auto;
}

.profile-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.avatar-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 2px;
    margin-bottom: 12px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.username-display {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 16px 0;
}

.level-progress-bar {
    width: 100%;
    height: 24px;
    background: #1e2530;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: #34c759;
    width: 0%;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 700;
    color: #7f8fa4;
    text-transform: lowercase;
}

.profile-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.action-btn {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}

.action-btn.primary {
    background: #007aff;
    color: white;
}

.action-btn.outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.profile-section {
    background: transparent;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #7f8fa4;
}

.link-btn {
    color: #007aff;
    text-decoration: none;
    font-size: 0.85rem;
}

.inventory-grid {
    display: flex;
    gap: 12px;
}

.inv-slot {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #333;
}

.inv-slot.next {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #555;
}

.ref-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: linear-gradient(180deg, #0f1419 0%, #0a0f14 100%);
    z-index: 10006;
    overflow-y: auto;
}

.ref-topbar {
    /* --tg-content-top already sums device notch + Telegram's chrome
     * strip; the old (env + header/2) was a half-correct hack from
     * before that variable existed. */
    padding: calc(16px + var(--tg-content-top, env(safe-area-inset-top, 0px))) 16px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    background: rgba(15, 20, 25, 0.86);
    backdrop-filter: blur(12px);
}

.ref-back {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ref-back ion-icon {
    font-size: 20px;
}

.ref-topbar-title {
    display: flex;
    flex-direction: column;
}

.ref-h1 {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
}

.ref-subtitle {
    opacity: 0.7;
    font-size: 0.85rem;
}

.ref-topbar-spacer {
    flex: 1;
}

.ref-content {
    padding: 14px 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ref-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
}

.ref-hero-bg {
    position: absolute;
    inset: -40px;
    background:
        radial-gradient(circle at 20% 0%, rgba(44, 154, 255, 0.22), transparent 55%),
        radial-gradient(circle at 90% 20%, rgba(52, 199, 89, 0.16), transparent 55%);
    pointer-events: none;
}

.ref-hero-main {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
}

.ref-hero-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(0, 122, 255, 0.14);
    border: 1px solid rgba(0, 122, 255, 0.22);
    flex: 0 0 46px;
}

.ref-hero-icon ion-icon {
    font-size: 22px;
}

.ref-hero-title {
    font-weight: 900;
    letter-spacing: -0.3px;
}

.ref-hero-desc {
    margin-top: 4px;
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.35;
}

.ref-stats {
    display: flex;
    gap: 10px;
}

.ref-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 14px;
}

.ref-stat-label {
    opacity: 0.7;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    margin-top: 8px;
    letter-spacing: -0.6px;
}

.ref-stat-value.small {
    font-size: 1.15rem;
    letter-spacing: -0.3px;
}

.ref-link-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
}

.ref-link-title {
    opacity: 0.8;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.ref-link-box {
    font-size: 0.92rem;
    word-break: break-all;
    line-height: 1.35;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.ref-link-box:active {
    transform: scale(0.995);
}

.ref-referrals {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ref-referrals-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ref-referrals-title {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ref-referrals-meta {
    opacity: 0.65;
    font-size: 0.85rem;
}

.ref-referrals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 12px;
    border-radius: 14px;
}

.ref-row-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ref-row-name {
    font-weight: 800;
    font-size: 0.95rem;
}

.ref-row-sub {
    opacity: 0.65;
    font-size: 0.8rem;
}

.ref-row-right {
    opacity: 0.75;
    font-weight: 800;
    font-size: 0.85rem;
}

.ref-empty {
    text-align: center;
    padding: 14px 10px;
    opacity: 0.55;
}

.ref-link-actions {
    margin-top: 12px;
}

.ref-btn {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    padding: 12px 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ref-btn ion-icon {
    font-size: 18px;
}

.ref-btn-primary {
    background: rgba(0, 122, 255, 0.95);
    border-color: rgba(0, 122, 255, 0.25);
}

.ref-how {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ref-how-title {
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ref-how-text {
    opacity: 0.7;
    font-size: 0.88rem;
    line-height: 1.45;
}

.profile-footer-stats {
    padding: 16px;
    background: #11141a;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: #7f8fa4;
}

.stat-label .val {
    color: #fff;
    font-weight: 700;
    margin-left: 4px;
}

.withdraw-btn {
    flex: 0 0 100px;
    background: #1c2b3d;
    color: #007aff;
    padding: 10px;
}

.bet-status {
    font-weight: 600;
}

.bet-status.cashed-out {
    color: var(--success-green);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 480px;
    width: 100%;

    /* Safe-area: on mobile (especially iOS) the home-indicator inset adds extra space.
       If we keep a fixed height AND add padding, content "slides" / gets cramped.
       So we include the safe-area in the element height. */
    box-sizing: border-box;
    height: calc(var(--nav-height) + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    min-height: calc(var(--nav-height) + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    padding-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));

    background: rgb(20, 20, 23);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10050;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.bottom-nav.force-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    color: #666;
    text-decoration: none;
    gap: 4px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.nav-item span {
    display: block;
    font-size: 0.72rem;
    line-height: 1;
    margin-top: 2px;
    opacity: 0.95;
}

.nav-item ion-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary-blue) !important;
}
.nav-item.active ion-icon,
.nav-item.active span {
    color: var(--primary-blue) !important;
}

/* ─── Duel vs Bot page ─────────────────────────────────────────────────── */
.duel-page {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(180deg, #0b0e11 0%, #14141f 60%, #1a1a2e 100%);
    z-index: 10040;
    padding: 0 0 calc(var(--nav-height, 60px) + 30px) 0;
    overflow-y: auto;
    overflow-x: hidden;
    color: #fff;
    transition: opacity 0.15s ease;
    contain: layout style paint;
}

.duel-page.hidden {
    display: none;
}

.duel-page:not(.hidden) {
    display: block;
}

.duel-hero {
    padding: 28px 18px 8px;
    text-align: center;
}

.duel-header .duel-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #fff;
}

.duel-header .duel-title ion-icon {
    font-size: 1.6rem;
    color: #ffd60a;
}

.duel-header .duel-subtitle {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}

.duel-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 480px;
    margin: 0 auto;
}

.duel-card {
    background: rgba(25, 28, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.duel-field-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    font-weight: 500;
}

.duel-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.duel-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.15s ease;
    min-width: 0;
    -moz-appearance: textfield;
}

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

.duel-input:focus {
    border-color: var(--primary-blue, #0088cc);
}

.duel-target-input {
    text-align: center;
}

.duel-step-btn {
    width: 44px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.duel-step-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

.duel-curr-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 3px;
    gap: 3px;
}

.duel-curr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: transparent;
    border: none;
    border-radius: 9px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.duel-curr-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.duel-curr-ic {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.duel-quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.duel-quick-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    padding: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.duel-quick-btn:active {
    background: rgba(255, 255, 255, 0.14);
}

.duel-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.duel-launch-btn {
    background: linear-gradient(135deg, #ff5e3a 0%, #ff2a68 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 24px rgba(255, 94, 58, 0.3);
    transition: opacity 0.15s ease, transform 0.05s ease;
}

.duel-launch-btn:active {
    transform: translateY(1px);
}

.duel-launch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.duel-result-panel {
    background: rgba(25, 28, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px;
    backdrop-filter: blur(20px);
    animation: duel-pop-in 0.18s ease-out;
}

.duel-result-panel.hidden {
    display: none;
}

@keyframes duel-pop-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.duel-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.duel-result-title.win  { color: #4ade80; }
.duel-result-title.lose { color: #ff5e3a; }
.duel-result-title.draw { color: #ffd60a; }

.duel-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    font-size: 0.95rem;
    opacity: 0;
    animation: duel-row-in 0.25s ease-out forwards;
}

.duel-result-row:nth-child(2) { animation-delay: 0.05s; }
.duel-result-row:nth-child(3) { animation-delay: 0.35s; }
.duel-result-row:nth-child(4) { animation-delay: 0.65s; }
.duel-result-row:nth-child(5) { animation-delay: 0.9s; }

@keyframes duel-row-in {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

.duel-result-row:last-child {
    border-bottom: none;
}

.duel-result-row--final {
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    font-size: 1.05rem;
    font-weight: 700;
}

.duel-result-key {
    color: rgba(255, 255, 255, 0.6);
}

.duel-result-val {
    color: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.duel-result-val.win  { color: #4ade80; }
.duel-result-val.lose { color: #ff5e3a; }

.duel-history {
    background: rgba(25, 28, 35, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 14px;
}

.duel-history-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 10px;
}

.duel-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.duel-history-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    padding: 16px 0;
}

.duel-history-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    align-items: center;
}

.duel-history-item .dh-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.duel-history-item.win  .dh-icon { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.duel-history-item.lose .dh-icon { background: rgba(255, 94, 58, 0.15);  color: #ff5e3a; }
.duel-history-item.draw .dh-icon { background: rgba(255, 214, 10, 0.15); color: #ffd60a; }

.duel-history-item .dh-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
}

.duel-history-item .dh-meta b {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.duel-history-item .dh-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.duel-history-item.win  .dh-amount { color: #4ade80; }
.duel-history-item.lose .dh-amount { color: #ff5e3a; }
.duel-history-item.draw .dh-amount { color: #ffd60a; }

.close-topup-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.topup-methods {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px;
    border-radius: 12px;
}

.pay-method-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.pay-method-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pay-method-btn .star-icon {
    color: #FFD700;
    font-size: 1.2rem;
}

.pay-method-btn .ton-icon {
    width: 18px;
    height: 18px;
}

.pay-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-badge {
    background: linear-gradient(135deg, #ff3b30, #ff9500);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
    vertical-align: middle;
}

.admin-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    /* более минимальный премиум-фон без декоративных точек/сеток */
    background: linear-gradient(180deg, #0f1419 0%, #0b0e11 100%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    overflow: hidden;
}

.admin-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* убрали "точечную сетку" — она выглядит дёшево на мобиле */
    background-image: none;
    opacity: 0;
}

.admin-page > * { position: relative; z-index: 1; }

.admin-page:not(.hidden) {
    transform: translateX(0);
}

.admin-page.hidden {
    transform: translateX(100%);
}

.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    padding-top: 100px !important;
    background: linear-gradient(180deg, rgba(0, 136, 204, 0.10) 0%, rgba(0, 0, 0, 0.0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    position: relative;
}

.admin-page-header::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,170,255,0.0), rgba(0,170,255,0.35), rgba(0,170,255,0.0));
    opacity: 0.6;
}

.admin-page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 420px at 50% -120px, rgba(0, 170, 255, 0.20), rgba(0,0,0,0.0) 60%),
        radial-gradient(700px 260px at 0% 0%, rgba(255, 215, 0, 0.06), rgba(0,0,0,0.0) 55%);
    opacity: 0.9;
}

.admin-page-header > * { position: relative; z-index: 1; }

.admin-page-title {
    letter-spacing: -0.2px;
}

.admin-page-title ion-icon {
    filter: drop-shadow(0 6px 18px rgba(0,170,255,0.25));
}

.admin-back-btn {
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.admin-back-btn:active {
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.admin-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(14px);
    background: rgba(12, 16, 21, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
}

.admin-tab-btn {
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.38), rgba(0, 170, 255, 0.16));
    border-color: rgba(0, 170, 255, 0.55);
    box-shadow: 0 10px 26px rgba(0, 170, 255, 0.14);
}

.admin-tab-btn.active ion-icon {
    color: #7dd3ff;
}

.admin-page-content {
    padding: 14px 16px 26px 16px;
}

.admin-section {
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
}

.admin-section h4 {
    font-size: 1.02rem;
    letter-spacing: -0.2px;
}

.admin-section-desc {
    margin-bottom: 14px;
}

.admin-btn {
    border-radius: 14px;
    box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}

.admin-btn.save-btn,
.admin-btn.success-btn {
    box-shadow: 0 16px 36px rgba(0, 170, 255, 0.16);
}

.admin-btn.danger-btn {
    box-shadow: 0 16px 36px rgba(255, 69, 58, 0.14);
}

.admin-card {
    box-shadow: 0 18px 40px rgba(0,0,0,0.26);
}

.admin-toolbar {
    box-shadow: 0 18px 40px rgba(0,0,0,0.22);
}

.admin-input,
.admin-select {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.admin-chip {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.admin-chip.active {
    box-shadow: 0 12px 26px rgba(0,170,255,0.14);
}

.admin-empty {
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}

/* nicer scrollbar inside admin */
.admin-page-content::-webkit-scrollbar { width: 8px; }
.admin-page-content::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 999px; }
.admin-page-content::-webkit-scrollbar-thumb { background: rgba(0,170,255,0.22); border-radius: 999px; }
.admin-page-content::-webkit-scrollbar-thumb:hover { background: rgba(0,170,255,0.32); }

/* remove "double" backgrounds from toolbars/cards */
.admin-toolbar { border-radius: 18px; }
.admin-input { border-radius: 16px; }
.admin-select { border-radius: 16px; }

/* ensure icon buttons inside admin-input look clean */
.admin-input .admin-btn {
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
}
.admin-input .admin-btn:active { background: rgba(255,255,255,0.08); }

@media (prefers-reduced-motion: reduce) {
    .admin-page, .admin-section, .admin-tab-btn, .admin-btn { transition: none !important; animation: none !important; }
}

.admin-page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00aaff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-page-title ion-icon {
    font-size: 1.4rem;
}

.admin-header-spacer {
    width: 44px;
}

.admin-page-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px 20px 16px;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 16px 0 16px;
    overflow-x: auto;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.admin-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-tab-btn.hidden {
    display: none !important;
}

.admin-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 24px;
}

.astat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.astat-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.98);
}

.astat-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 136, 204, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0088cc;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.astat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.astat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.astat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

    .admin-balances-row {
        display: flex;
        gap: 12px;
        margin-top: 24px;
        padding-top: 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .abalance-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 12px;
        background: rgba(255, 255, 255, 0.05);
        padding: 18px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        transition: all 0.2s ease;
    }

    .abalance-item:active {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(0.98);
    }

    .abalance-header {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.6);
        font-weight: 600;
    }

    .abalance-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .abalance-icon img {
        width: 20px;
        height: 20px;
        object-fit: contain;
        max-width: 20px;
        max-height: 20px;
    }

    .blue-bg {
        background: rgba(0, 136, 204, 0.2);
    }

    .star-bg {
        background: rgba(255, 215, 0, 0.2);
    }

    .star-bg img {
        width: 20px;
        height: 20px;
        max-width: 20px;
        max-height: 20px;
        object-fit: contain;
        border-radius: 50%;
    }

    .abalance-val {
        font-size: 1.6rem;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .blue-text {
        color: #00aaff;
    }

    .star-text {
        color: #ffd700;
    }

.admin-tab-btn ion-icon {
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.3), rgba(0, 170, 255, 0.2));
    border-color: rgba(0, 136, 204, 0.5);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.admin-tab-btn.active ion-icon {
    color: #0088cc;
}

.admin-section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    animation: fadeSlideUp 0.3s ease;
    overflow-x: hidden;
}

.admin-section.hidden {
    display: none !important;
}

.admin-section-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    line-height: 1.4;
}

.admin-section h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section h4 ion-icon {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
}

.admin-section h4.gold-title {
    color: #FFD700;
}

.admin-section h4.gold-title ion-icon {
    color: #FFD700;
}

.admin-section .input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-section .input-group:last-child {
    margin-bottom: 0;
}

.admin-section input[type="text"],
.admin-section input[type="number"],
.admin-section select,
.admin-section textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    min-height: 48px;
}

#admin-wallet-input {
    padding: 22px 24px !important;
    font-size: 1.1rem !important;
    min-height: 64px !important;
    font-weight: 500;
}

.admin-section input[type="text"]:focus,
.admin-section input[type="number"]:focus {
    outline: none;
    border-color: rgba(255, 59, 48, 0.4);
    background: rgba(0, 0, 0, 0.4);
}

.admin-section input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.admin-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 20px;
    min-height: 48px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.admin-btn:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.1);
}

.admin-btn.save-btn,
.admin-btn.success-btn {
    background: linear-gradient(135deg, #0088cc, #00aaff);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.admin-btn.save-btn:hover,
.admin-btn.success-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.35);
    filter: brightness(1.1);
}

.admin-btn.danger-btn {
    background: linear-gradient(135deg, #ff3b30, #ff453a);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.2);
}

.admin-btn.danger-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 59, 48, 0.35);
    filter: brightness(1.1);
}

.admin-buttons-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Admin UI v2 (toolbar/cards) */
.admin-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 18px;
    transition: border-color 0.2s;
}

.admin-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.admin-card + .admin-card { margin-top: 14px; }

.admin-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 14px;
}

.admin-card-title ion-icon { color: #7dd3ff; font-size: 1.15rem; }

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.admin-field label {
    display: block;
    font-size: 0.78rem;
    opacity: 0.7;
    margin: 0 0 6px 2px;
}

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.06);
}

.admin-toggle-title { font-weight: 700; }
.admin-toggle-sub { font-size: 0.78rem; opacity: 0.65; margin-top: 2px; }

.admin-toolbar {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
}

.admin-toolbar-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

.admin-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.admin-chip-row::-webkit-scrollbar { display: none; }

.admin-chip {
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.75);
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.admin-chip.active {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.35), rgba(0, 170, 255, 0.18));
    border-color: rgba(0, 136, 204, 0.55);
    color: #fff;
}

.admin-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 0 12px;
    min-height: 48px;
}

.admin-input ion-icon { color: rgba(255,255,255,0.55); font-size: 1.05rem; }

.admin-input input {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    font-size: 0.92rem !important;
}

.admin-select {
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 12px 12px;
    color: #fff;
    font-weight: 700;
}

.admin-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-empty {
    text-align: center;
    padding: 34px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.70);
}

.admin-empty ion-icon { font-size: 38px; opacity: 0.6; margin-bottom: 10px; }

@media (max-width: 420px) {
    .admin-toolbar-row { flex-direction: column; align-items: stretch; }
    .admin-select { width: 100% !important; }
}

.admin-buttons-row .admin-btn {
    flex: 1;
}

.topup-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    transform: translateY(100%);
    background: linear-gradient(180deg, #1c2533 0%, #151a21 100%);
    border-radius: 24px 24px 0 0;
    padding: 0;
    z-index: 5000;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    border-top: 2px solid rgba(0, 136, 204, 0.3);
    overflow: hidden;
}

.topup-sheet:not(.hidden) {
    transform: translateY(0);
}

.topup-sheet .sheet-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    cursor: grab;
}

.topup-sheet .sheet-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.topup-sheet .sheet-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.topup-sheet .close-topup-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topup-sheet .close-topup-btn:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-50%) scale(0.9);
}

.topup-sheet .sheet-body {
    padding: 20px;
    padding-bottom: 32px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

.topup-methods {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pay-method-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s ease;
    cursor: pointer;
}

.pay-method-btn.active {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.3), rgba(0, 170, 255, 0.2));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.2);
}

.pay-method-btn:active {
    transform: scale(0.96);
}

.pay-method-btn .star-icon {
    color: #FFD700;
    font-size: 1.2rem;
}

.pay-method-btn .ton-icon {
    width: 20px;
    height: 20px;
}

.pay-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeSlideUp 0.3s ease;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pay-form .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 4px;
}

.pay-form .input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 14px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.pay-form .input-group input:focus {
    outline: none;
}

.pay-form .input-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.pay-form .quick-amounts {
    display: flex;
    gap: 10px;
}

.pay-form .quick-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pay-form .quick-btn:active {
    background: rgba(0, 136, 204, 0.2);
    border-color: rgba(0, 136, 204, 0.3);
    color: #fff;
    transform: scale(0.96);
}

.pay-form .confirm-bet-btn {
    background: linear-gradient(135deg, #00aaff 0%, #0088cc 100%);
    border: none;
    border-radius: 14px;
    padding: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 170, 255, 0.4);
    margin-top: 8px;
}

.pay-form .confirm-bet-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 136, 204, 0.3);
}

.pay-form .confirm-bet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bet-currency-selector {
    display: flex;
    gap: 6px;
    background: linear-gradient(180deg, rgba(40, 45, 55, 0.95) 0%, rgba(30, 35, 45, 0.95) 100%);
    padding: 5px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.bet-curr-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 10px 16px;
    border-radius: 999px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Inter', sans-serif;
}

.bet-curr-btn.active {
    background: linear-gradient(135deg, #0088cc 0%, #00aaff 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 136, 204, 0.35);
}

.bet-curr-btn:active {
    transform: scale(0.96);
}

.bet-curr-btn img {
    vertical-align: middle;
}

.ton-rate-info {
    display: none;
}

.ton-rate-info span {
    color: #0088cc;
    font-weight: 600;
}

.ton-amount-info {
    text-align: center;
    font-size: 1rem;
    margin: 8px 0 4px;
    color: rgba(255, 255, 255, 0.7);
}

.ton-amount-info span {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
}

.ton-fee-info {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin: -8px 0 12px;
}

.ton-fee-info.hidden {
    display: none !important;
    margin: 0;
    padding: 0;
}

[data-tc-wallets-modal-container],
[data-tc-wallets-modal-container] *,
tc-root,
tc-root * {
    z-index: 999999 !important;
}

.ton-connect-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
    width: 100%;
}

#ton-connect-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#ton-connect-btn>div,
#ton-connect-btn>button {
    margin: 0 auto !important;
}

.ton-pending-view {
    text-align: center;
    padding: 20px;
    animation: fadeSlideUp 0.3s ease;
}

.ton-pending-view h4 {
    color: #FFD700;
    font-size: 1.2rem;
    margin: 0 0 16px 0;
}

.ton-pending-view p {
    color: rgba(255, 255, 255, 0.7);
    margin: 8px 0;
    font-size: 0.95rem;
}

.ton-pending-view b {
    color: #fff;
}

.ton-pending-address {
    background: rgba(0, 0, 0, 0.4);
    padding: 14px;
    border-radius: 12px;
    margin: 16px 0;
    word-break: break-all;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ton-pending-timer {
    font-size: 2rem;
    font-weight: 800;
    color: #0088cc;
    margin: 20px 0;
}

.ton-pending-cancel {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ton-pending-cancel:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.96);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 4999;
    transition: all 0.3s ease;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: auto;
}

.page-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.game-stage,
.profile-page,
.controls-area,
.live-bets-panel {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-stage.hidden,
.profile-page.hidden {
    opacity: 0;
}

.pay-form.hidden {
    display: none !important;
}

.ton-pending-view.hidden {
    display: none !important;
}

.game-stage {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.profile-page {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.controls-area {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.live-bets-panel {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.top-bar {
    transition: opacity 0.25s ease;
}

.history-bar {
    transition: opacity 0.25s ease;
}

.betting-sheet {
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.betting-sheet:not(.hidden) {
    transform: translateY(0);
}

#history-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#history-page.hidden {
    display: none !important;
}

.history-modal-content {
    background: linear-gradient(180deg, rgba(28, 37, 51, 0.9) 0%, rgba(21, 26, 33, 0.95) 100%);
    border-top: 1px solid rgba(0, 136, 204, 0.3);
    border-radius: 24px 24px 0 0;
    padding: 24px 20px;
    height: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    width: 100%;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    overflow: hidden;
}

#history-page:not(.hidden) .history-modal-content {
    transform: translateY(0);
}

.history-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    cursor: grab;
}

.history-header::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.history-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

#full-history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#full-history-list::-webkit-scrollbar {
    display: none;
}

.history-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-card.win {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1) 0%, rgba(48, 209, 88, 0.05) 100%);
    border-color: rgba(52, 199, 89, 0.2);
}

.history-card.loss {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 69, 58, 0.05) 100%);
    border-color: rgba(255, 59, 48, 0.2);
}

.h-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-amount {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.h-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.h-result {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.h-mult {
    font-size: 1.1rem;
    font-weight: 800;
}

.h-profit {
    font-size: 0.95rem;
    font-weight: 600;
}

.text-win {
    color: #34c759;
}

.text-loss {
    color: #ff3b30;
}

.topup-sheet .input-group input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 136, 204, 0.3) !important;
    border-radius: 14px !important;
    padding: 16px !important;
    color: #fff !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.topup-sheet .input-group input:focus {
    outline: none !important;
    border-color: #00aaff !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

.topup-sheet .quick-btn {
    background: rgba(0, 136, 204, 0.15) !important;
    border: 1px solid rgba(0, 136, 204, 0.3) !important;
    color: #00aaff !important;
    border-radius: 12px !important;
    padding: 12px !important;
    font-weight: 600 !important;
}

.topup-sheet .quick-btn:active {
    background: rgba(0, 136, 204, 0.3) !important;
    transform: scale(0.96) !important;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.lang-flag-gif {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes flipRotate {
    0% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
        filter: brightness(1);
    }

    50% {
        transform: perspective(400px) rotateY(90deg) scale(1.1);
        filter: brightness(1.5);
    }

    100% {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
        filter: brightness(1);
    }
}

.ton-mini,
.star-mini {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 2px;
    display: inline-block;
    border: none;
    outline: none;
    background: transparent;
}

.star-mini {
    border-radius: 50%;
    object-fit: cover;
}

.ton-icon-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.lang-selector {
    background: rgba(30, 30, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px 10px 4px 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-selector img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.lang-selector span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.lang-selector:active {
    transform: scale(0.95);
}

@keyframes langFadeSlide {
    0% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }

    50% {
        transform: scale(0.5) rotate(180deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

@keyframes langTextFade {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0;
        transform: translateY(-5px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.currency-toggle {
    display: flex;
    align-items: center;
    background: rgba(30, 30, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 0 4px;
    position: relative;
    cursor: pointer;
    width: 76px;
    height: 36px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    text-decoration: none !important;
}

.currency-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 34px;
    height: 26px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.currency-icon {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.currency-icon img {
    width: 18px;
    height: 18px;
    opacity: 0.4;
    filter: grayscale(80%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
    display: block;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 4px;
    line-height: 0;
}

.currency-icon.star img {
    border-radius: 50%;
    object-fit: contain;
    width: 18px;
    height: 18px;
}

.currency-icon.active img {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.15) drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.currency-icon.star.active img {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.0) drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.currency-toggle.is-star .currency-slider {
    transform: translateX(32px);
}

.currency-toggle:hover .currency-slider {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
}

#withdrawal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#withdrawal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

#withdrawal-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #34c759;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.withdrawal-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid #ffd700;
    overflow: hidden;
    box-sizing: border-box;
}

.withdrawal-card.pending {
    border-left-color: #ff9500;
}

.withdrawal-card.completed {
    border-left-color: #34c759;
}

.withdrawal-card.rejected {
    border-left-color: #ff3b30;
}

.withdrawal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.withdrawal-user {
    font-weight: 600;
    font-size: 1rem;
}

.withdrawal-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.withdrawal-status.pending {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.withdrawal-status.completed {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.withdrawal-status.rejected {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.withdrawal-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.withdrawal-info-item {
    display: flex;
    flex-direction: column;
}

.withdrawal-info-label {
    opacity: 0.6;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.withdrawal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.withdrawal-actions button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    box-sizing: border-box;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.withdrawal-actions button:hover {
    transform: translateY(-2px);
}

.btn-message {
    background: rgba(0, 136, 204, 0.2);
    color: #0088cc;
}

.btn-approve {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.btn-reject {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    padding-bottom: 8px;
    padding-right: 16px;
    padding-left: 16px;
}

.admin-tabs::-webkit-scrollbar {
    height: 4px;
}

.admin-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.admin-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.admin-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.admin-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: fit-content;
}

/* ========== ADMIN PANEL REDESIGN ========== */

/* Tabs: icon-only on narrow screens */
@media (max-width: 420px) {
    .admin-tab-btn span { display: none; }
    .admin-tab-btn { padding: 10px 13px; gap: 0; }
    .admin-tab-btn ion-icon { font-size: 1.25rem; }
}

/* Unified form inputs */
.admin-form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    outline: none;
    font-size: 0.93rem;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.2s ease, background 0.2s ease;
    resize: vertical;
    box-sizing: border-box;
}
.admin-form-input:focus {
    border-color: rgba(0, 170, 255, 0.35);
    background: rgba(0, 0, 0, 0.3);
}
.admin-form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Unified selects */
.admin-form-select {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 12px 36px 12px 14px;
    border-radius: 14px;
    outline: none;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    min-height: 46px;
    box-sizing: border-box;
}
.admin-form-select:focus {
    border-color: rgba(0, 170, 255, 0.35);
}

/* Form layout helpers */
.admin-form-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.admin-form-row > * { flex: 1; min-width: 0; }
.admin-form-row > .shrink { flex: 0 0 auto; }

.admin-form-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* Balance REAL/FAKE grid */
.admin-balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.admin-balance-card {
    border-radius: 14px;
    padding: 14px;
}
.admin-balance-card .admin-balance-label {
    font-weight: 800;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.admin-balance-card .admin-balance-line {
    font-size: 0.86rem;
    opacity: 0.8;
}
.admin-balance-card.real {
    background: rgba(0, 136, 204, 0.08);
    border: 1px solid rgba(0, 136, 204, 0.18);
}
.admin-balance-card.fake {
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.18);
}

/* Hint block */
.admin-hint {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 12px;
    line-height: 1.55;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border-left: 3px solid rgba(0, 170, 255, 0.25);
}
.admin-hint strong { color: rgba(255, 255, 255, 0.6); }
.admin-hint.warning-hint {
    border-left-color: rgba(255, 170, 0, 0.4);
    background: rgba(255, 170, 0, 0.06);
    color: rgba(255, 255, 255, 0.55);
}
.admin-hint code {
    background: rgba(255, 255, 255, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
}

/* Broadcast progress */
.broadcast-progress {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(0, 136, 204, 0.08);
    border-radius: 14px;
    border: 1px solid rgba(0, 136, 204, 0.12);
    display: none;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
}
.broadcast-progress.active { display: block; }
.broadcast-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.broadcast-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}
.broadcast-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0088cc, #00aaff);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Broadcast preview card */
.broadcast-preview {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    min-height: 50px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}
.broadcast-preview .preview-kind {
    display: inline-block;
    background: rgba(0, 136, 204, 0.15);
    color: #7dd3ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* User stats modal */
.user-stats-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.user-stats-modal-inner {
    background: linear-gradient(180deg, #1a1f26 0%, #0f1419 100%);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 136, 204, 0.15);
}
.user-stats-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-stats-modal-header h4 {
    margin: 0;
    color: #00aaff;
    font-size: 1rem;
}
.user-stats-modal-close {
    background: none;
    border: none;
    color: #7f8fa4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}
.user-stats-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Admin info card (for bots fake online etc) */
.admin-info-card {
    background: rgba(0, 136, 204, 0.08);
    padding: 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 136, 204, 0.15);
}
.admin-info-card h5 {
    margin: 0 0 8px 0;
    color: #7dd3ff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
}

/* Admin section desc refinement */
.admin-section-desc.muted {
    margin-top: 8px;
    opacity: 0.6;
}

/* Admin section sub-heading */
.admin-sub-heading {
    margin: 20px 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

/* Admin list (for admins list, recent users etc) */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-list-empty {
    text-align: center;
    padding: 20px;
    opacity: 0.5;
}

/* ────────────────────────────────────────────────────────────────────────
   Weekly Jackpot page (.jp-*)
   Visual language mirrors .tourn-* / .ref-* — same hero, same card chrome,
   plus a pulsing prize-pool centerpiece and a countdown card.
   ──────────────────────────────────────────────────────────────────────── */

.jp-page {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10040;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    background:
        radial-gradient(900px 520px at 50% -120px, rgba(255, 184, 0, 0.18) 0%, rgba(15,20,25,0.0) 55%),
        linear-gradient(180deg, #14110a 0%, #0a0f14 100%);
    color: #fff;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    contain: layout style paint;
}

.jp-page:not(.hidden) {
    display: block;
    opacity: 1;
}

.jp-hero {
    position: sticky;
    top: 0;
    z-index: 30;
}

.jp-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(10, 12, 16, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
}

.jp-header {
    position: relative;
    padding: calc(40px + env(safe-area-inset-top, 0px)) 16px 10px;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    gap: 10px;
    align-items: center;
}

.jp-back,
.jp-refresh {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jp-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.jp-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.jp-title-row ion-icon {
    color: #ffc857;
    font-size: 18px;
}

.jp-subtitle {
    opacity: 0.72;
    font-size: 0.82rem;
    margin-top: 2px;
}

.jp-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* The big golden centerpiece */
.jp-pool-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255, 200, 87, 0.35);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 200, 87, 0.22) 0%, rgba(255, 200, 87, 0.0) 70%),
        linear-gradient(165deg, #2a1d05 0%, #16110a 100%);
    padding: 22px 16px 20px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 200, 87, 0.08) inset;
}

.jp-pool-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 1.4px;
    font-weight: 900;
    color: #ffc857;
    opacity: 0.92;
    margin-bottom: 8px;
}

.jp-pool-main {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    animation: jp-pulse 2.6s ease-in-out infinite;
}

.jp-pool-amount {
    font-size: 2.6rem;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -1.2px;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc857 60%, #f29a1a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}

.jp-pool-unit {
    font-size: 1rem;
    font-weight: 900;
    color: #ffd277;
    opacity: 0.95;
}

.jp-pool-stars {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-weight: 900;
}

.jp-pool-stars-amount {
    font-variant-numeric: tabular-nums;
    color: #ffe9a0;
}

.jp-pool-stars-unit {
    font-size: 0.95rem;
}

.jp-pool-glow {
    position: absolute;
    pointer-events: none;
    inset: -40% -10% auto -10%;
    height: 180%;
    background: radial-gradient(closest-side, rgba(255, 200, 87, 0.18) 0%, rgba(255, 200, 87, 0) 70%);
    animation: jp-pulse 4s ease-in-out infinite;
    z-index: 0;
}

.jp-pool-eyebrow,
.jp-pool-main,
.jp-pool-stars {
    position: relative;
    z-index: 1;
}

@keyframes jp-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.03); opacity: 0.92; }
}

/* Countdown */
.jp-countdown-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.jp-countdown-label {
    font-weight: 800;
    opacity: 0.85;
}

.jp-countdown-value {
    font-weight: 1000;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
    color: #ffe9a0;
    font-size: 1.05rem;
}

/* Tickets */
.jp-tickets-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    padding: 14px 16px 12px;
}

.jp-tickets-title {
    font-weight: 900;
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

.jp-tickets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.jp-tickets-cell {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 12px;
}

.jp-tickets-cur {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    opacity: 0.85;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.jp-tickets-ic {
    width: 16px;
    height: 16px;
}

.jp-tickets-ic-emoji {
    font-size: 14px;
    line-height: 1;
}

.jp-tickets-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.jp-tickets-mine {
    font-weight: 900;
    font-size: 1.45rem;
    letter-spacing: -0.6px;
    color: #fff;
}

.jp-tickets-sep {
    opacity: 0.55;
    font-weight: 800;
}

.jp-tickets-total {
    opacity: 0.85;
    font-weight: 900;
}

.jp-tickets-hint {
    margin-top: 10px;
    font-size: 0.78rem;
    opacity: 0.65;
}

/* How it works */
.jp-how {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.jp-how-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    font-weight: 800;
}

.jp-how-summary::-webkit-details-marker {
    display: none;
}

.jp-how-summary > span {
    flex: 1;
}

.jp-how-chevron {
    transition: transform 0.2s ease;
}

.jp-how[open] .jp-how-chevron {
    transform: rotate(180deg);
}

.jp-how-body {
    padding: 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.92;
}

.jp-how-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.jp-how-bullet {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 200, 87, 0.18);
    color: #ffc857;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.78rem;
}

/* Winners */
.jp-winners-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 16px;
}

.jp-winners-title {
    font-weight: 900;
    letter-spacing: -0.2px;
    margin-bottom: 10px;
}

.jp-winners-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jp-winners-empty {
    opacity: 0.55;
    text-align: center;
    padding: 14px 0;
    font-size: 0.9rem;
}

.jp-winner-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.jp-winner-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2c9aff 0%, #0077ff 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.95rem;
    overflow: hidden;
    flex-shrink: 0;
}

.jp-winner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jp-winner-body {
    flex: 1;
    min-width: 0;
}

.jp-winner-name {
    font-weight: 900;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jp-winner-meta {
    font-size: 0.78rem;
    opacity: 0.65;
    margin-top: 2px;
}

.jp-winner-prize {
    font-weight: 1000;
    letter-spacing: -0.3px;
    color: #ffe9a0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Bottom nav: 6 items get tight; reduce typography on the smallest screens */
.bottom-nav .nav-item {
    min-width: 0;
}

.bottom-nav .nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
}

@media (max-width: 380px) {
    .bottom-nav .nav-item span {
        font-size: 0.65rem;
    }
}

/* Admin full-width button inside form-row */
.admin-btn.full { width: 100%; }
.admin-btn.flex-1 { flex: 1; }

/* Spacing utilities */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-6 { margin-bottom: 6px; }
.mb-10 { margin-bottom: 10px; }
.mb-18 { margin-bottom: 18px; }
.gap-8 { gap: 8px !important; }
.flex-2 { flex: 2 !important; }

.admin-btn-fields {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 12px;
}

/* ─── Prize Row V2 (simplified) ─── */
.admin-prize-row-v2 {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}
.admin-prize-row-v2:hover {
    border-color: rgba(0, 136, 204, 0.25);
}
.prize-row-simple {
    display: flex;
    align-items: center;
    gap: 12px;
}
.prize-row-simple .prize-place {
    flex: 1;
    min-width: 0;
}
.prize-row-simple .prize-remove-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
}
.prize-place-badge {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    min-width: 32px;
    text-align: center;
}
.admin-prize-row-v2:nth-child(1) .prize-place-badge { color: #ffd700; }
.admin-prize-row-v2:nth-child(2) .prize-place-badge { color: #c0c0c0; }
.admin-prize-row-v2:nth-child(3) .prize-place-badge { color: #cd7f32; }
.prize-thumb-wrap {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}
.prize-thumb-wrap:hover {
    border-color: #00aaff;
    transform: scale(1.05);
}
.prize-thumb-wrap.has-image {
    border-style: solid;
    border-color: rgba(0, 170, 255, 0.3);
}
.prize-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.prize-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.03);
}
.admin-prize-row-v2 .prize-remove-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ─── Prize Image Picker Modal ─── */
.prize-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.prize-picker-modal {
    background: linear-gradient(180deg, #1a1f26 0%, #0f1419 100%);
    border: 1px solid rgba(0, 136, 204, 0.2);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.prize-picker-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.prize-picker-header h4 {
    margin: 0;
    color: #00aaff;
    font-size: 1rem;
}
.prize-picker-header .close-btn,
.prize-picker-close {
    background: none;
    border: none;
    color: #7f8fa4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.prize-picker-search {
    padding: 0 16px;
    margin: 12px 0;
}
.prize-picker-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.prize-picker-search input:focus {
    border-color: rgba(0, 170, 255, 0.4);
}
.prize-picker-search input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}
.prize-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 14px 16px 16px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}
.prize-picker-item {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* square via padding hack */
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.04);
    position: relative;
}
.prize-picker-item:hover {
    border-color: rgba(0, 170, 255, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 170, 255, 0.15);
}
.prize-picker-item:active {
    transform: scale(0.95);
}
.prize-picker-item.selected {
    border-color: #00aaff;
    box-shadow: 0 0 0 2px rgba(0, 170, 255, 0.3);
}
.prize-picker-item img {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    object-fit: contain;
    display: block;
}
.prize-picker-item span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3px 4px;
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Prize picker scrollbar ─── */
.prize-picker-grid::-webkit-scrollbar {
    width: 6px;
}
.prize-picker-grid::-webkit-scrollbar-track {
    background: transparent;
}
.prize-picker-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

/* ─── Prize picker responsive ─── */
@media (max-width: 340px) {
    .prize-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Audit Log ─── */
.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.audit-log-entry {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}
.audit-log-entry:hover {
    border-color: rgba(255, 255, 255, 0.12);
}
.audit-log-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.audit-log-action {
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.audit-log-action .action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}
.action-badge.balance { background: rgba(0, 170, 255, 0.15); color: #7dd3ff; }
.action-badge.withdrawal { background: rgba(255, 204, 0, 0.15); color: #ffd60a; }
.action-badge.broadcast { background: rgba(52, 199, 89, 0.15); color: #34c759; }
.action-badge.config { background: rgba(175, 82, 222, 0.15); color: #bf5af2; }
.action-badge.admin { background: rgba(255, 59, 48, 0.15); color: #ff453a; }
.action-badge.wallet { background: rgba(255, 149, 0, 0.15); color: #ff9f0a; }
.action-badge.other { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.6); }
.audit-log-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}
.audit-log-details {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}
.audit-log-details span {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.audit-log-admin {
    font-size: 0.72rem;
    color: rgba(0, 170, 255, 0.6);
    margin-top: 4px;
}

/* ─── Top-bar hide when sheet is open ─── */
.top-bar {
    transition: opacity 0.15s ease;
}
.top-bar.sheet-open {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ─── Prize wobble animation for top-3 ─── */
@keyframes prizeWobble {
    0%, 100% { transform: rotate(0deg) scale(1); }
    20% { transform: rotate(-12deg) scale(1.08); }
    40% { transform: rotate(10deg) scale(1.05); }
    60% { transform: rotate(-6deg) scale(1.03); }
    80% { transform: rotate(4deg) scale(1.01); }
}

.tourn-row.is-top .tourn-row-prize,
.tourn-row.is-top .medal-emoji {
    animation: prizeWobble 3s ease-in-out infinite;
}
.tourn-row.is-top:nth-child(2) .tourn-row-prize,
.tourn-row.is-top:nth-child(2) .medal-emoji {
    animation-delay: 0.5s;
}
.tourn-row.is-top:nth-child(3) .tourn-row-prize,
.tourn-row.is-top:nth-child(3) .medal-emoji {
    animation-delay: 1s;
}

/* ─── Subscribe sheet video icon ─── */
video.subscribe-sheet-icon {
    object-fit: cover;
    border-radius: 12px;
}

/* =====================================================================
 *  EVAROCKET REDESIGN — DUEL & JACKPOT
 *  Cosmic / premium overhaul to match crash visual language.
 * ===================================================================== */

/* ---------- DUEL: page background gets crash-style cosmos ---------- */
.duel-page {
    background:
        radial-gradient(900px 520px at 50% -120px, rgba(44, 154, 255, 0.18) 0%, rgba(15, 20, 25, 0.0) 55%),
        radial-gradient(700px 400px at 50% 110%, rgba(122, 92, 255, 0.14) 0%, rgba(15, 20, 25, 0) 60%),
        linear-gradient(180deg, #0b0e14 0%, #0a0d12 60%, #060709 100%) !important;
}

#__redesign-duel-stars,
#__redesign-jp-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
    background-image:
        radial-gradient(1px 1px at 20% 30%,  rgba(255, 255, 255, 0.7), transparent 60%),
        radial-gradient(1px 1px at 70% 20%,  rgba(255, 255, 255, 0.5), transparent 60%),
        radial-gradient(1.5px 1.5px at 40% 70%, rgba(255, 255, 255, 0.8), transparent 60%),
        radial-gradient(1px 1px at 85% 85%,  rgba(255, 255, 255, 0.6), transparent 60%),
        radial-gradient(1px 1px at 10% 90%,  rgba(255, 255, 255, 0.4), transparent 60%);
    background-size: 320px 320px;
    animation: erStarsDrift 60s linear infinite;
}
#__redesign-jp-stars { opacity: 0.45; }

@keyframes erStarsDrift {
    from { background-position: 0 0; }
    to   { background-position: 320px 320px; }
}

.duel-body { position: relative; z-index: 1; }
.jp-body   { position: relative; z-index: 1; }

/* ---------- DUEL: hero ---------- */
.duel-hero { padding: 36px 18px 14px !important; position: relative; }
.duel-header .duel-title {
    font-size: 1.65rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.6px !important;
    gap: 10px !important;
}
.duel-header .duel-title ion-icon {
    font-size: 1.8rem !important;
    color: #ffd60a !important;
    filter: drop-shadow(0 0 12px rgba(255, 214, 10, 0.55));
}
.duel-header .duel-subtitle {
    font-size: 0.95rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-top: 8px !important;
}

/* TON-only currency badge (replaces TON/Stars toggle) */
.duel-curr-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.22) 0%, rgba(0, 136, 204, 0.18) 100%);
    border: 1px solid rgba(44, 154, 255, 0.45);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 0 0 1px rgba(44, 154, 255, 0.2) inset, 0 0 14px rgba(44, 154, 255, 0.18);
    white-space: nowrap;
}
.duel-curr-badge img {
    width: 18px !important;
    height: 18px !important;
    margin-right: 2px;
}

/* ---------- DUEL: glass card surface ---------- */
.duel-card,
.duel-result-panel,
.duel-history {
    background: linear-gradient(160deg, rgba(28, 33, 44, 0.78) 0%, rgba(18, 22, 30, 0.72) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* ---------- DUEL: amount input — premium pill ---------- */
.duel-input {
    background: linear-gradient(180deg, rgba(40, 45, 55, 0.95) 0%, rgba(22, 27, 36, 0.95) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 14px !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.duel-input:focus {
    border-color: rgba(44, 154, 255, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(44, 154, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.duel-curr-btn.active {
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.22) 0%, rgba(0, 136, 204, 0.18) 100%) !important;
    color: #fff !important;
    box-shadow: 0 0 0 1px rgba(44, 154, 255, 0.4), 0 0 14px rgba(44, 154, 255, 0.25) !important;
}

.duel-quick-btn:active {
    background: rgba(44, 154, 255, 0.18) !important;
    border-color: rgba(44, 154, 255, 0.35) !important;
}

/* ---------- DUEL: multiplier picker (gold pill) ---------- */
.duel-input-row:has(.duel-target-input) {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 4px;
    gap: 4px !important;
}
.duel-target-input {
    background: transparent !important;
    border: none !important;
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px !important;
    color: #ffe9a0 !important;
    text-shadow: 0 0 18px rgba(255, 200, 87, 0.35);
    font-variant-numeric: tabular-nums;
    box-shadow: none !important;
    text-align: center;
}
.duel-step-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
}
.duel-step-btn:active {
    background: rgba(44, 154, 255, 0.45) !important;
    transform: scale(0.9);
}

/* ---------- DUEL: LAUNCH button — cosmic blue, no more red ---------- */
.duel-launch-btn {
    background: linear-gradient(135deg, #2c9aff 0%, #0077ff 45%, #6a3dff 100%) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 16px !important;
    padding: 16px !important;
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.3px !important;
    text-transform: uppercase;
    box-shadow:
        0 10px 30px rgba(0, 119, 255, 0.45),
        0 0 30px rgba(122, 92, 255, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.duel-launch-btn::after {
    content: "";
    position: absolute;
    top: -20%;
    left: -60%;
    width: 55%;
    height: 140%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28) 45%, transparent);
    transform: skewX(-18deg);
    animation: erShimmer 3.8s ease-in-out infinite;
}
@keyframes erShimmer {
    0%   { transform: translateX(0)    skewX(-18deg); opacity: 0; }
    8%   { opacity: 0.85; }
    40%  { transform: translateX(210%) skewX(-18deg); opacity: 0; }
    100% { transform: translateX(210%) skewX(-18deg); opacity: 0; }
}
.duel-launch-btn:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 4px 16px rgba(0, 119, 255, 0.35) !important;
}

/* ---------- DUEL: result panel title glow ---------- */
.duel-result-title {
    font-size: 1.45rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.4px !important;
}
.duel-result-title.win {
    color: #fff !important;
    text-shadow: 0 0 18px rgba(0, 200, 255, 0.55), 0 0 40px rgba(255, 80, 200, 0.35) !important;
}
.duel-result-title.lose {
    text-shadow: 0 0 22px rgba(255, 59, 48, 0.55) !important;
}
.duel-result-row--final {
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.10) 0%, rgba(122, 92, 255, 0.08) 100%);
    border: 1px solid rgba(44, 154, 255, 0.22) !important;
    border-radius: 12px;
    margin-top: 10px !important;
    padding: 12px 12px !important;
}
.duel-result-row--final .duel-result-val {
    font-size: 1.15rem;
    /* Default = gold (used when the title is .win or .draw). */
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc857 60%, #f29a1a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    font-weight: 900;
}
/* When the result title is a loss, paint the payout red so win/lose
 * is visually distinct without reading the title each time. */
#duel-result-panel:has(.duel-result-title.lose) .duel-result-row--final .duel-result-val {
    background: linear-gradient(180deg, #ff8a72 0%, #ff5e3a 60%, #ff2a68 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

/* ---------- DUEL: history items — accent stripe ---------- */
.duel-history-item {
    position: relative;
    padding-left: 14px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.duel-history-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 3px;
}
.duel-history-item.win::before  { background: linear-gradient(180deg, #4ade80, #22c55e); box-shadow: 0 0 10px rgba(74, 222, 128, 0.6); }
.duel-history-item.lose::before { background: linear-gradient(180deg, #ff5e3a, #ff2a68); box-shadow: 0 0 10px rgba(255, 94, 58, 0.5); }
.duel-history-item.draw::before { background: linear-gradient(180deg, #ffd60a, #f29a1a); box-shadow: 0 0 10px rgba(255, 214, 10, 0.5); }

/* =====================================================================
 *  JACKPOT
 * ===================================================================== */
.jp-page {
    background:
        radial-gradient(900px 520px at 50% -120px, rgba(255, 200, 87, 0.22) 0%, rgba(15, 20, 25, 0) 55%),
        radial-gradient(700px 380px at 50% 100%, rgba(122, 92, 255, 0.10) 0%, rgba(15, 20, 25, 0) 60%),
        linear-gradient(180deg, #14110a 0%, #0a0d12 60%, #060709 100%) !important;
}

/* Pool card — dual-glow over existing gold */
.jp-pool-card {
    border-radius: 24px !important;
    border: 1px solid rgba(255, 200, 87, 0.4) !important;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 200, 87, 0.10) inset,
        0 0 60px rgba(255, 200, 87, 0.18) !important;
}
.jp-pool-amount {
    font-size: clamp(2.4rem, 11vw, 3.4rem) !important;
    letter-spacing: -1.6px !important;
    filter: drop-shadow(0 0 24px rgba(255, 200, 87, 0.45));
}
.jp-pool-eyebrow {
    color: #ffd277 !important;
    text-shadow: 0 0 12px rgba(255, 200, 87, 0.4);
}

/* Live dot for "draw active" indicator */
#__redesign-jp-livedot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    margin-right: 6px;
    vertical-align: middle;
    animation: erLivePulse 1.6s ease-in-out infinite;
}
@keyframes erLivePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Countdown card — upgrade to a proper card with progress bar */
.jp-countdown-card {
    border-radius: 18px !important;
    border: 1px solid rgba(255, 200, 87, 0.22) !important;
    background: linear-gradient(135deg, rgba(255, 200, 87, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%) !important;
    padding: 14px 16px 16px !important;
}
.jp-countdown-value {
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc857 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
}
#__redesign-jp-countbar {
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin-top: 10px;
}
#__redesign-jp-countbar > i {
    display: block;
    height: 100%;
    width: var(--p, 30%);
    background: linear-gradient(90deg, #f29a1a 0%, #ffc857 50%, #ffe9a0 100%);
    box-shadow: 0 0 10px rgba(255, 200, 87, 0.6);
    transition: width 0.6s ease;
}

/* Tickets — add progress bars per currency */
.jp-tickets-cell {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 12px 14px !important;
}
.jp-tickets-cell .__redesign-jp-ticket-bar {
    margin-top: 8px;
    height: 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}
.jp-tickets-cell .__redesign-jp-ticket-bar > i {
    display: block;
    height: 100%;
    width: var(--p, 0%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.jp-tickets-cell[data-curr="ton"]   .__redesign-jp-ticket-bar > i {
    background: linear-gradient(90deg, #2c9aff 0%, #0077ff 100%);
    box-shadow: 0 0 10px rgba(44, 154, 255, 0.55);
}
.jp-tickets-cell[data-curr="stars"] .__redesign-jp-ticket-bar > i {
    background: linear-gradient(90deg, #c084fc 0%, #7a5cff 100%);
    box-shadow: 0 0 10px rgba(122, 92, 255, 0.55);
}

/* Winners — gold gradient prize */
.jp-winner-prize {
    background: linear-gradient(180deg, #ffe9a0 0%, #ffc857 60%, #f29a1a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    filter: drop-shadow(0 0 6px rgba(255, 200, 87, 0.35));
}

/* =====================================================================
 *  EVAROCKET PREMIUM POLISH PASS — 7 micro-improvements
 *  Applied after the base redesign. Each block isolated to avoid
 *  conflicts with the redesign's existing animations/filters.
 * ===================================================================== */

/* 1. TON-only mode: hide any Stars UI that may still be rendered by JS */
.duel-curr-btn[data-curr="stars"],
.jp-tickets-cell[data-curr="stars"],
.jp-pool-stars,
#jp-mine-stars,
.jp-pool-stars-amount,
.jp-pool-stars-unit { display: none !important; }
.duel-curr-toggle  { pointer-events: none; }
.jp-tickets-grid   { grid-template-columns: 1fr !important; }
.jp-tickets-cell[data-curr="ton"] { padding: 16px 18px !important; }

/* 2. Numeric typography lock — tabular nums everywhere money/time lives */
.duel-result-val,
.jp-pool-amount,
.jp-tickets-mine,
.jp-tickets-total,
.jp-countdown-value,
.duel-history-item .duel-history-mult,
.duel-history-item .duel-history-amt {
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" 1, "lnum" 1 !important;
}
.jp-pool-amount      { font-feature-settings: "tnum" 1, "lnum" 1, "ss01" 1 !important; }
.jp-countdown-value  { letter-spacing: 0.5px !important; }

/* 3. Staggered fade-in for lists */
@keyframes erRiseIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.duel-history-list > .duel-history-item,
.jp-winners-list > *,
.jp-tickets-grid > .jp-tickets-cell {
    animation: erRiseIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.duel-history-list > .duel-history-item:nth-child(1),
.jp-winners-list > *:nth-child(1) { animation-delay: 40ms;  }
.duel-history-list > .duel-history-item:nth-child(2),
.jp-winners-list > *:nth-child(2) { animation-delay: 100ms; }
.duel-history-list > .duel-history-item:nth-child(3),
.jp-winners-list > *:nth-child(3) { animation-delay: 160ms; }
.duel-history-list > .duel-history-item:nth-child(4),
.jp-winners-list > *:nth-child(4) { animation-delay: 220ms; }
.duel-history-list > .duel-history-item:nth-child(5),
.jp-winners-list > *:nth-child(5) { animation-delay: 280ms; }
.duel-history-list > .duel-history-item:nth-child(n+6),
.jp-winners-list > *:nth-child(n+6) { animation-delay: 340ms; }

/* 4. Jackpot pool breathing pulse (animates text-shadow only — filter on .jp-pool-amount stays) */
@keyframes erPoolBreath {
    0%, 100% { text-shadow: 0 0 18px rgba(255, 200, 87, 0.35), 0 0 0    rgba(255, 200, 87, 0.0); }
    50%      { text-shadow: 0 0 32px rgba(255, 200, 87, 0.7),  0 0 60px rgba(255, 200, 87, 0.25); }
}
.jp-pool-amount { animation: erPoolBreath 4.2s ease-in-out infinite; }
@keyframes erPoolCardGlow {
    0%, 100% { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 200, 87, 0.10) inset, 0 0 60px rgba(255, 200, 87, 0.18); }
    50%      { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 200, 87, 0.18) inset, 0 0 90px rgba(255, 200, 87, 0.30); }
}
.jp-pool-card { animation: erPoolCardGlow 4.2s ease-in-out infinite !important; }

/* 5. iOS active-press feedback (no hover in Telegram WebView) */
.duel-curr-btn:not(.active):active {
    background: rgba(255, 255, 255, 0.06) !important;
    transform: scale(0.97);
}
.duel-history-item:active {
    background: rgba(255, 255, 255, 0.07) !important;
    transform: scale(0.985);
    transition: transform 0.08s ease, background 0.12s ease;
}
.jp-back:active,
.jp-refresh:active {
    transform: scale(0.88);
    background: rgba(255, 255, 255, 0.08) !important;
}
.jp-refresh:active ion-icon {
    animation: erRefreshSpin 0.45s ease-out;
}
@keyframes erRefreshSpin {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}
.jp-how-summary:active   { background: rgba(255, 255, 255, 0.04) !important; }
.jp-tickets-cell:active  { transform: scale(0.99); }

/* 6. Empty states — turn 'nothing yet' into a feature */
.duel-history-empty,
.jp-winners-empty {
    text-align: center !important;
    padding: 28px 16px 24px !important;
    border: 1px dashed rgba(255, 255, 255, 0.10) !important;
    border-radius: 14px !important;
    background:
        radial-gradient(220px 90px at 50% 0%, rgba(122, 92, 255, 0.08), transparent 70%),
        rgba(255, 255, 255, 0.02) !important;
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 0.92rem !important;
    letter-spacing: 0.1px;
}
.duel-history-empty::before,
.jp-winners-empty::before {
    content: "🛸";
    display: block;
    font-size: 1.9rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 14px rgba(122, 92, 255, 0.45));
    animation: erFloat 3.6s ease-in-out infinite;
}
.jp-winners-empty::before { content: "✨"; }
@keyframes erFloat {
    0%, 100% { transform: translateY(0);    }
    50%      { transform: translateY(-4px); }
}

/* 7a. Loading skeleton — apply .is-loading to any card while data is in-flight */
.duel-card.is-loading,
.jp-pool-card.is-loading,
.jp-tickets-card.is-loading,
.duel-history.is-loading {
    position: relative;
    overflow: hidden;
    pointer-events: none;
}
.duel-card.is-loading > *,
.jp-pool-card.is-loading > *,
.jp-tickets-card.is-loading > *,
.duel-history.is-loading > * { opacity: 0.35; }
.duel-card.is-loading::after,
.jp-pool-card.is-loading::after,
.jp-tickets-card.is-loading::after,
.duel-history.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 45%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 55%,
        transparent 100%);
    background-size: 220% 100%;
    animation: erSkeletonSweep 1.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes erSkeletonSweep {
    from { background-position: 220% 0;  }
    to   { background-position: -220% 0; }
}

/* 7b. Gradient-text accents for eyebrows / titles */
.duel-field-label,
.jp-tickets-title,
.jp-winners-title,
.duel-history-title {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.55));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    letter-spacing: 0.4px;
    font-weight: 700;
}
.jp-pool-eyebrow {
    background: linear-gradient(180deg, #ffe9a0, #ffc857) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}

/* =====================================================================
 *  UI tweaks from user feedback (round 2)
 *  Hero up, history compact, profile avatar up.
 * ===================================================================== */
/* Hero «Джекпот» / «Турнир» — pinned closer to the Telegram chrome */
#leaderboard-page .tourn-header,
#jackpot-page .jp-header {
    /* Use --tg-content-top (chrome + device safe area) so the title
     * clears Telegram's "Закрыть/⋯/v" strip in fullscreen as well as
     * the iPhone notch. env() alone would let the chrome cover the
     * title on iPhone Pro. */
    padding: calc(14px + var(--tg-content-top, env(safe-area-inset-top, 0px))) 16px 6px !important;
}

/* Duel: tabs sit tight under the hero; .duel-body's flex gap handles the
 * space between tabs and the bet card. Adding margin-bottom here would
 * stack on top of the gap and create a visible empty band. */
#duel-page .duel-pvp-tabs { margin: 0 16px !important; }
#duel-page .duel-body     { gap: 8px !important; padding-top: 4px !important; padding-bottom: 12px !important; }

/* CRITICAL: the global `.hidden` rule (style.css:1983) only sets
 * opacity/visibility — NOT display. Hidden duel sub-panels (invite form
 * extras, result panel, secondary mode CTA) therefore stay in flow and
 * eat ~120-200px of vertical space. Force display:none on those slots
 * so the page tightens up immediately. */
#duel-page #duel-pvp-create-invite.hidden,
#duel-page #duel-pvp-invite-result.hidden,
#duel-page #duel-pvp-incoming.hidden,
#duel-page #duel-result-panel.hidden { display: none !important; }

/* Lock page scroll while the matchmaking / lobby / battle overlays are
 * up. Without this, the user can drag .duel-body behind the backdrop,
 * which looks broken — content slips out from under the overlay.
 * The body/html portion is set by setPvpState in script.js (Telegram
 * Desktop forwards wheel events to the document — overflow:hidden on
 * #duel-page alone leaves the parent page scrollable). */
html.duel-overlay-lock,
body.duel-overlay-lock {
    overflow: hidden !important;
    overscroll-behavior: contain !important;
}
#duel-page[data-pvp-state="search"],
#duel-page[data-pvp-state="lobby"],
#duel-page[data-pvp-state="joiner-lobby"],
#duel-page[data-pvp-state="split"] {
    overflow: hidden !important;
    touch-action: none !important;
}
#duel-page[data-pvp-state="search"]       .duel-body,
#duel-page[data-pvp-state="lobby"]        .duel-body,
#duel-page[data-pvp-state="joiner-lobby"] .duel-body,
#duel-page[data-pvp-state="split"]        .duel-body { overflow: hidden !important; }
/* Lobby overlay visibility — gated by state attribute on #duel-page. */
#duel-page[data-pvp-state="lobby"]  .duel-pvp-lobby { display: flex; }
#duel-page[data-pvp-state="lobby"]  .duel-pvp-search,
#duel-page[data-pvp-state="lobby"]  .duel-pvp-split,
#duel-page[data-pvp-state="lobby"]  .duel-pvp-joiner-lobby { display: none !important; }
/* Joiner-lobby visibility */
#duel-page[data-pvp-state="joiner-lobby"] .duel-pvp-joiner-lobby { display: flex; }
#duel-page[data-pvp-state="joiner-lobby"] .duel-pvp-search,
#duel-page[data-pvp-state="joiner-lobby"] .duel-pvp-lobby,
#duel-page[data-pvp-state="joiner-lobby"] .duel-pvp-split { display: none !important; }
#duel-page[data-pvp-state="joiner-lobby"] .duel-body { filter: blur(2px); pointer-events: none; }
#duel-page[data-pvp-state="joiner-lobby"] .duel-hero { opacity: 0.35; pointer-events: none; }
#duel-page .duel-card     { padding: 14px !important; }
#duel-page .duel-history  { padding: 10px 14px 12px !important; margin-top: -2px !important; }
#duel-page .duel-history-title { margin-bottom: 6px !important; }
#duel-page .duel-history-empty { padding: 14px 12px 12px !important; font-size: 0.85rem !important; }
#duel-page .duel-history-empty::before { font-size: 1.3rem !important; margin-bottom: 4px !important; }
#duel-page .duel-result-panel.hidden { display: none !important; margin: 0 !important; }

/* Profile: avatar pulled up to the top of the page. --tg-content-top
 * accounts for both the iPhone notch AND Telegram's own header strip,
 * so the avatar can't end up sliced in half by the "Закрыть" button. */
#profile-page .profile-user-info { margin-top: 8px !important; margin-bottom: 18px !important; }
#profile-page                     { padding-top: calc(12px + var(--tg-content-top, env(safe-area-inset-top, 0px))) !important; }

/* =====================================================================
 *  PVP DUEL UI — tabs, searching, split-screen battle, result
 *  Lives inside #duel-page. State-driven via data-pvp-state attribute.
 * ===================================================================== */

/* State machine: show only the slice matching current state */
#duel-page .duel-pvp-search,
#duel-page .duel-pvp-lobby,
#duel-page .duel-pvp-joiner-lobby,
#duel-page .duel-pvp-split { display: none; }
#duel-page[data-pvp-state="pre"]    .duel-body          { display: flex !important; }
#duel-page[data-pvp-state="search"] .duel-pvp-search    { display: flex; }
#duel-page[data-pvp-state="search"] .duel-body          { filter: blur(2px); pointer-events: none; }
#duel-page[data-pvp-state="lobby"]  .duel-body          { filter: blur(2px); pointer-events: none; }
#duel-page[data-pvp-state="lobby"]  .duel-hero          { opacity: 0.35; pointer-events: none; }
#duel-page[data-pvp-state="split"]  .duel-pvp-split     { display: flex; flex-direction: column; }
#duel-page[data-pvp-state="split"]  .duel-body          { display: none !important; }
#duel-page[data-pvp-state="split"]  .duel-hero          { display: none !important; }

/* ---------- Mode tabs ---------- */
.duel-pvp-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 14px;
    margin: 0 16px 14px;
    max-width: 480px;
}
@media (min-width: 481px) { .duel-pvp-tabs { margin: 0 auto 14px; } }
.duel-pvp-tab {
    flex: 1;
    padding: 10px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    /* Higher base contrast — at 0.55 the inactive tab reads as "also
     * selected" on Telegram's dimmed WebView. */
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    /* Long Cyrillic labels would otherwise wrap mid-word on narrow
     * phones (iPhone SE / mini). Truncate visually instead. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s ease, color 0.2s ease;
}
.duel-pvp-tab.is-active {
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.30) 0%, rgba(0, 136, 204, 0.22) 100%);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(44, 154, 255, 0.55) inset, 0 0 16px rgba(44, 154, 255, 0.25);
}

/* ---------- Incoming-invite card ---------- */
.duel-pvp-invite-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    margin: 0 16px 12px;
    max-width: 480px;
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.18) 0%, rgba(44, 154, 255, 0.05) 100%);
    border: 1px solid rgba(44, 154, 255, 0.35);
    animation: duelPulseInvite 1.8s ease-in-out infinite;
}
@media (min-width: 481px) { .duel-pvp-invite-card { margin: 0 auto 12px; } }
.duel-pvp-invite-card .invite-ava {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(44, 154, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}
.duel-pvp-invite-card .invite-ava img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.duel-pvp-invite-card .invite-body { flex: 1; min-width: 0; }
.duel-pvp-invite-card .invite-body b { display: block; font-weight: 800; }
.duel-pvp-invite-card .invite-body small { color: rgba(255, 255, 255, 0.6); font-size: 12px; }
.duel-pvp-invite-card .invite-accept {
    padding: 8px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #34c759, #22a14a);
    color: #fff;
    font-weight: 800;
    border: 0;
    cursor: pointer;
}
@keyframes duelPulseInvite {
    0%, 100% { box-shadow: 0 0 0 0 rgba(44, 154, 255, 0.45); }
    50%      { box-shadow: 0 0 0 8px rgba(44, 154, 255, 0); }
}

/* ---------- Invite-link result ---------- */
.duel-pvp-invite-result {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.duel-pvp-deeplink {
    display: block;
    font-size: 12px;
    word-break: break-all;
    color: #2c9aff;
    background: #0b0e11;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: -apple-system, system-ui, monospace;
}
.duel-pvp-invite-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.duel-pvp-btn-ghost {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.duel-pvp-btn-ghost:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.10); }
.duel-pvp-invite-hint {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- Searching state ---------- */
.duel-pvp-search {
    position: fixed;
    inset: 0;
    z-index: 10100;
    align-items: center;
    justify-content: center;
}
.duel-pvp-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 10, 14, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.duel-pvp-search-core {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: duelFadeUp 0.35s ease;
}
.duel-pvp-loader {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, rgba(44, 154, 255, 0.18), transparent 70%);
}
.duel-pvp-loader::before,
.duel-pvp-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #2c9aff;
    animation: duelSpin 1.4s linear infinite;
    box-shadow: 0 0 30px rgba(44, 154, 255, 0.6), inset 0 0 24px rgba(44, 154, 255, 0.35);
}
.duel-pvp-loader::after {
    inset: 14px;
    border-top-color: #7fd1ff;
    animation-duration: 0.9s;
    animation-direction: reverse;
    box-shadow: none;
}
.duel-pvp-timer {
    font-size: 32px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    color: #fff;
}
.duel-pvp-timer span {
    color: rgba(255, 255, 255, 0.45);
    font-size: 18px;
    margin-left: 6px;
}
.duel-pvp-search-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.78);
    animation: duelTextPulse 1.6s ease-in-out infinite;
}
.duel-pvp-search-text .dots {
    display: inline-block;
    animation: duelDots 1.4s steps(4) infinite;
}
.duel-pvp-cancel {
    margin-top: 10px;
    padding: 12px 32px;
    border-radius: 14px;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: #ff7a72;
    font-weight: 800;
    cursor: pointer;
}
.duel-pvp-cancel:active { transform: scale(0.97); }

@keyframes duelFadeUp     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes duelSpin       { to { transform: rotate(360deg); } }
@keyframes duelTextPulse  { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes duelDots       { 0% { width: 0;   } 33% { width: 0.4em; } 66% { width: 0.8em; } 100% { width: 1.2em; } }

/* ---------- Invite lobby (state=lobby) ---------- */
.duel-pvp-lobby {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.duel-pvp-lobby .duel-pvp-search-backdrop {
    /* reuse the same blurred-veil treatment as the random-queue overlay */
    background: rgba(7, 10, 14, 0.9);
}
.duel-pvp-lobby-core {
    position: relative;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 22px 22px;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(28, 33, 44, 0.92) 0%, rgba(18, 22, 30, 0.92) 100%);
    border: 1px solid rgba(44, 154, 255, 0.30);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                0 0 40px rgba(44, 154, 255, 0.18);
    backdrop-filter: blur(20px);
    animation: duelFadeUp 0.4s ease;
}
.duel-pvp-lobby-pulse {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(44, 154, 255, 0.35) 0%, rgba(44, 154, 255, 0.0) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: duelLobbyPulse 1.8s ease-in-out infinite;
}
.duel-pvp-lobby-pulse span {
    font-size: 44px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(44, 154, 255, 0.6));
}
@keyframes duelLobbyPulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 20px rgba(44, 154, 255, 0.25); }
    50%      { transform: scale(1.06); box-shadow: 0 0 36px rgba(44, 154, 255, 0.45); }
}
.duel-pvp-lobby-title {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.3px;
    text-align: center;
}
.duel-pvp-lobby-sub {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    margin-top: -4px;
    animation: duelTextPulse 1.8s ease-in-out infinite;
}
.duel-pvp-lobby-meta {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}
.duel-pvp-lobby-meta .lobby-cell {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.duel-pvp-lobby-meta .lobby-key {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
}
.duel-pvp-lobby-meta .lobby-val {
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.duel-pvp-lobby-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.duel-pvp-lobby-share,
.duel-pvp-lobby-copy {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.15s ease, background 0.15s ease;
}
.duel-pvp-lobby-share {
    /* Primary action — push the cosmic gradient. */
    background: linear-gradient(135deg, #2c9aff 0%, #0077ff 60%, #6a3dff 100%);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 22px rgba(0, 119, 255, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.duel-pvp-lobby-share:active,
.duel-pvp-lobby-copy:active { transform: translateY(1px) scale(0.99); }
.duel-pvp-lobby-cancel {
    /* Cancel button styling already inherits from .duel-pvp-cancel above. */
    margin-top: 6px;
    padding: 10px 28px;
}

/* ---------- Joiner-lobby (decoration on top of the shared .lobby-core) ---------- */
.duel-pvp-joiner-lobby {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.duel-pvp-joiner-lobby .duel-pvp-search-backdrop { background: rgba(7, 10, 14, 0.92); }
.duel-pvp-joiner-core {
    /* Slightly wider than the creator lobby — there's a target picker. */
    max-width: 380px;
}
.duel-pvp-joiner-ava {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 200, 87, 0.40) 0%, rgba(255, 200, 87, 0) 70%);
    border: 2px solid rgba(255, 200, 87, 0.45);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(255, 200, 87, 0.35);
}
.duel-pvp-joiner-ava span { font-size: 40px; line-height: 1; }
.duel-pvp-joiner-ava img  { width: 100%; height: 100%; object-fit: cover; }
.duel-pvp-joiner-stake-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
}
.duel-pvp-joiner-stake-row .lobby-key { font-size: 12px; color: rgba(255,255,255,0.6); font-weight: 600; }
.duel-pvp-joiner-stake-row .lobby-val { font-size: 17px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }

.duel-pvp-joiner-target-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}
.duel-pvp-joiner-target-wrap > .lobby-key {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}
.duel-pvp-joiner-target-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.duel-pvp-joiner-target-row .duel-input {
    flex: 1;
    text-align: center;
    font-size: 1.35rem;
}
.duel-pvp-joiner-target-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.duel-pvp-joiner-target-presets .duel-quick-btn {
    padding: 8px 0;
    font-size: 13px;
}
.duel-pvp-joiner-target-presets .duel-quick-btn.is-active {
    background: rgba(44, 154, 255, 0.22) !important;
    border-color: rgba(44, 154, 255, 0.5) !important;
    color: #fff !important;
}
.duel-pvp-joiner-actions {
    grid-template-columns: 1fr;
}
.duel-pvp-joiner-actions .duel-pvp-lobby-share {
    font-size: 16px;
    padding: 14px;
}

/* ---------- History row PvP badge ---------- */
.duel-history-item .dh-mode {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}
.duel-history-item .dh-mode-pvp {
    background: linear-gradient(135deg, rgba(44, 154, 255, 0.32), rgba(122, 92, 255, 0.32));
    color: #cfe5ff;
    border: 1px solid rgba(44, 154, 255, 0.45);
}
/* Slightly stronger left-stripe accent on PvP rows so they pop out of the
 * mostly-bot history list. */
.duel-history-item.is-pvp::before {
    background: linear-gradient(180deg, #2c9aff, #6a3dff) !important;
    box-shadow: 0 0 10px rgba(44, 154, 255, 0.5) !important;
}

/* ---------- Split-screen battle ---------- */
.duel-pvp-split {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0b0e14 0%, #060709 100%);
    overflow: hidden;
    z-index: 5;
}
.duel-pvp-battle-banner {
    position: absolute;
    /* Push below the iOS notch — `.duel-pvp-split { inset: 0 }` ignores
     * the page-level safe-area padding. */
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #ff3b30, #ffd166, #ff3b30);
    background-size: 200% 100%;
    color: #0b0e11;
    animation: duelBannerSlide 2.4s linear infinite, duelFadeUp 0.4s ease;
}
@keyframes duelBannerSlide { to { background-position: 200% 0; } }

.duel-pvp-arena {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    position: relative;
    min-height: 0;
    height: 100%;
}
.duel-pvp-side {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 12px 12px;
    transition: background 0.3s ease;
}
.duel-pvp-side--left  { background: linear-gradient(135deg, rgba(44, 154, 255, 0.10), transparent 60%); }
.duel-pvp-side--right { background: linear-gradient(225deg, rgba(255, 209, 102, 0.10), transparent 60%); }
.duel-pvp-side .side-avatar {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    /* When the slot shows an emoji fallback (no Telegram avatar), 32px
     * looks lost in a 74px circle. 44px matches the visual weight of an
     * <img> filling the slot. */
    font-size: 44px;
    line-height: 1;
    animation: duelAvatarIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.duel-pvp-side .side-avatar img { width: 100%; height: 100%; object-fit: cover; }
.duel-pvp-side .side-name { font-weight: 800; margin-top: 10px; font-size: 14px; }
.duel-pvp-side .side-target {
    font-size: 34px;
    font-weight: 900;
    margin-top: 8px;
    background: linear-gradient(180deg, #fff, #7fd1ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
}
.duel-pvp-side .side-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.duel-pvp-side.is-armed .side-glow {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(255, 209, 102, 0.35), transparent 65%);
    animation: duelArmedPulse 1s ease-in-out infinite;
}
.duel-pvp-side.is-win .side-glow {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(52, 199, 89, 0.55), transparent 70%);
}
.duel-pvp-side.is-lose .side-glow {
    opacity: 1;
    background: radial-gradient(circle at center, rgba(255, 59, 48, 0.5), transparent 70%);
}
@keyframes duelAvatarIn   { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes duelArmedPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ── Flying rocket (mirrors the crash game's rising rocket) ─────────
 * Each side gets a vertical flight track below the target number.
 * JS sets --rocket-y (negative, in px) and --trail-h (positive, in px)
 * inside the multiplier tick loop so both rockets fly in sync with the
 * live multiplier. Armed/win/lose classes added by the resolution
 * code freeze, celebrate, or explode the rocket accordingly. */
.duel-pvp-side .side-flight {
    position: relative;
    width: 64px;
    height: 140px;
    margin-top: 14px;
    overflow: visible;
}
.duel-pvp-side .side-flight-rocket {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 64px;
    transform: translateX(-50%) translateY(var(--rocket-y, 0px));
    transition: transform 0.15s linear, filter 0.25s ease;
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(255, 200, 87, 0.55));
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* The Lottie player injects an inline SVG; fill the slot. */
.duel-pvp-side .side-flight-rocket svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
/* Emoji fallback if the Lottie library / JSON failed to load. The
 * fallback stays in the DOM until Lottie's loadAnimation replaces it. */
.duel-pvp-side .side-flight-rocket .rocket-fallback {
    font-size: 38px;
    line-height: 1;
}
.duel-pvp-side .side-flight-trail {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 5px;
    height: var(--trail-h, 0px);
    margin-left: -2.5px;
    border-radius: 3px;
    background: linear-gradient(to top, #ff3b30 0%, #ff8a3c 40%, #ffd166 80%, transparent 100%);
    opacity: 0.78;
    z-index: 1;
    transition: height 0.15s linear;
    box-shadow: 0 0 12px rgba(255, 138, 60, 0.5);
    pointer-events: none;
}
/* Countdown phase: rocket sits on the launchpad, no trail yet. */
.duel-pvp-split[data-phase="countdown"] .side-flight-trail { height: 0 !important; }
.duel-pvp-split[data-phase="countdown"] .side-flight-rocket { transform: translateX(-50%) translateY(0px) !important; }
/* Armed (this side's target reached — cashed out): gold pulse, frozen. */
.duel-pvp-side.is-armed .side-flight-rocket {
    filter: drop-shadow(0 0 14px #ffd166) drop-shadow(0 0 28px #ffd166);
    animation: duelRocketArmed 0.8s ease-in-out infinite;
}
@keyframes duelRocketArmed {
    0%, 100% { filter: drop-shadow(0 0 12px #ffd166); }
    50%      { filter: drop-shadow(0 0 22px #ffd166) drop-shadow(0 0 36px #ffd166); }
}
/* Win: bigger, green glow. */
.duel-pvp-side.is-win .side-flight-rocket {
    animation: duelRocketWin 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards;
}
@keyframes duelRocketWin {
    0%   { filter: drop-shadow(0 0 14px #ffd166); }
    100% { filter: drop-shadow(0 0 22px #4ade80) drop-shadow(0 0 40px #4ade80);
           transform: translateX(-50%) translateY(var(--rocket-y, 0px)) scale(1.35); }
}
/* Lose: explosion at current altitude, fade trail. */
.duel-pvp-side.is-lose .side-flight-rocket {
    animation: duelRocketBoom 0.55s ease forwards;
}
.duel-pvp-side.is-lose .side-flight-trail {
    animation: duelTrailFade 0.55s ease forwards;
}
@keyframes duelRocketBoom {
    0%   { transform: translateX(-50%) translateY(var(--rocket-y, 0px)) scale(1);  opacity: 1; filter: drop-shadow(0 0 12px #ff3b30); }
    35%  { transform: translateX(-50%) translateY(var(--rocket-y, 0px)) scale(1.9); opacity: 1; filter: drop-shadow(0 0 40px #ff3b30) drop-shadow(0 0 60px #ff8a3c); }
    100% { transform: translateX(-50%) translateY(var(--rocket-y, 0px)) scale(0.1); opacity: 0; }
}
@keyframes duelTrailFade { to { opacity: 0; } }

.duel-pvp-divider {
    position: relative;
    background: linear-gradient(180deg, transparent, #2c9aff 20%, #ffd166 50%, #2c9aff 80%, transparent);
    box-shadow: 0 0 14px rgba(44, 154, 255, 0.6);
}
.duel-pvp-divider .divider-pulse {
    position: absolute;
    top: 0;
    left: -3px;
    right: -3px;
    bottom: 0;
    background: linear-gradient(180deg, transparent, #fff, transparent);
    animation: duelDividerPulse 2s ease-in-out infinite;
    opacity: 0.7;
}
@keyframes duelDividerPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.9; transform: scaleY(1.02); } }

.duel-pvp-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 140px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(44, 154, 255, 0.9);
    animation: duelCountdownAnim 1s ease forwards;
    pointer-events: none;
}
@keyframes duelCountdownAnim {
    0%   { transform: translate(-50%, -50%) scale(2);  opacity: 0; }
    30%  { transform: translate(-50%, -50%) scale(1);  opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
}
.duel-pvp-split[data-phase="live"]   .duel-pvp-countdown,
.duel-pvp-split[data-phase="crash"]  .duel-pvp-countdown,
.duel-pvp-split[data-phase="result"] .duel-pvp-countdown { display: none; }

.duel-pvp-multiplier-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 72px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #ffd166 0%, #ff8a3c 60%, #ff3b30 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 50px rgba(255, 138, 60, 0.5);
    opacity: 0;
    display: none;
    pointer-events: none;
}
.duel-pvp-split[data-phase="live"] .duel-pvp-multiplier-center {
    display: block;
    opacity: 1;
    animation: duelMultPop 0.4s ease, duelMultBreath 1.3s ease-in-out infinite;
}
.duel-pvp-split[data-phase="crash"] .duel-pvp-multiplier-center {
    display: block;
    animation: duelMultCrash 0.55s ease forwards;
    -webkit-text-fill-color: #ff3b30;
}
@keyframes duelMultPop    { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes duelMultBreath { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.06); } }
@keyframes duelMultCrash  { 0% { transform: translate(-50%, -50%) scale(1); } 40% { transform: translate(-50%, -50%) scale(1.25) rotate(-3deg); } 100% { transform: translate(-50%, -50%) scale(0.7) rotate(2deg); opacity: 0.5; } }