@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;
    --tg-safe-area-inset-top: 0px;
    --tg-safe-area-inset-bottom: 0px;
    --device-safe-area-inset-bottom: 0px;
    --tg-app-top-offset: 0px;
    --tg-viewport-height: 100dvh;
    /* Фиксированная нижняя зона под bottom-nav + отступы (fixed, вне потока) */
    --bottom-nav-stack: calc(var(--nav-height) + 16px + max(var(--tg-safe-area-inset-bottom, 0px), var(--device-safe-area-inset-bottom, 0px)));
}

/* 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: 1100; 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: 1100; 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-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;
}

img {
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: 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;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 16px;
    position: absolute;
    top: calc(16px + var(--tg-app-top-offset, var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px))));
    padding-top: 10px;
    left: 0;
    right: 0;
    z-index: 9999;
}


.top-left-group,
.top-right-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-left-group {
    align-items: stretch;
}

.top-right-group {
    align-items: flex-end;
}

.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: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    z-index: 50;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.12s 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;
    filter: drop-shadow(0 0 30px rgba(255, 126, 58, 0.35));
}

#explosion-lottie svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.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;
}

#wd-ton-form.hidden,
#wd-stars-form.hidden {
    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 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    height: 100vh;
    z-index: 1000;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
    background: #0b0e11;
    background-image: radial-gradient(circle at 50% 30%, #1a222d 0%, #0b0e11 70%);
    padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(var(--nav-height) + 24px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.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: 12px;
    margin-bottom: 24px;
}

.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;
    width: 33.3333%;
    -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;
}

.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;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    box-sizing: border-box;
}

.top-left-group .online-users {
    width: 100px;
}

.top-left-group .channel-bonus-widget--topbar {
    width: 90px;
}

.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);
    font-variant-numeric: tabular-nums;
}

.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: none;
}

.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;
    min-width: 0;
}

.bet-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.bet-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bet-username {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
    display: inline-block;
    min-width: 52px;
    text-align: right;
}

.bet-card-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 92px;
    flex: 0 0 92px;
}

.bet-win-amount {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-block;
    min-width: 54px;
    text-align: right;
}

.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: 100vh;
    background: radial-gradient(circle at 50% 30%, #1a222d 0%, #0b0e11 70%);
    z-index: 10006;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ref-topbar {
    padding: calc(16px + env(safe-area-inset-top, 0px) + (var(--tg-header-height, 0px) / 2)) 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;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.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;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    overflow: visible;
}

.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: 12px 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    overflow: hidden;
}

.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;
    min-height: 0;
    max-height: clamp(260px, 42dvh, 420px);
    overflow-y: auto;
    padding: 4px 6px 4px 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(44, 154, 255, 0.38) transparent;
}

.ref-how {
    flex: 0 0 auto;
    margin-top: 12px;
}

.ref-referrals-list::-webkit-scrollbar {
    width: 4px;
}

.ref-referrals-list::-webkit-scrollbar-thumb {
    background: rgba(44, 154, 255, 0.38);
    border-radius: 999px;
}

.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;
    min-height: 66px;
}

.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;
    width: 25%;
    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);
}

.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: var(--tg-viewport-height, 100dvh);
    max-height: 100dvh;
    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: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 20px;
    padding-top: 100px !important;
    background: rgba(0, 136, 204, 0.05);
    border-bottom: 1px solid rgba(0, 136, 204, 0.1);
    flex-shrink: 0;
}


.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-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-back-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.92);
}

.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;
    -webkit-overflow-scrolling: touch;
    padding: 10px 16px 24px 16px;
    min-height: 0;
}

.admin-section.hidden {
    display: none !important;
}

.admin-section.active {
    display: block !important;
}

.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.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;
}

.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;
}

.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;
}

/* 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;
}

.top-bar.hidden,
.history-bar.hidden,
.controls-area.hidden,
.live-bets-panel.hidden {
    display: none !important;
}
body.admin-standalone,
html:has(body.admin-standalone) {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

body.admin-standalone {
    background:
        radial-gradient(900px 520px at 50% -120px, rgba(44, 154, 255, 0.16) 0%, rgba(15, 20, 25, 0) 55%),
        linear-gradient(180deg, #0f1419 0%, #0a0f14 100%);
}

body.admin-standalone .admin-page.admin-standalone-page {
    position: relative;
    inset: auto;
    width: min(100%, 880px);
    max-width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0 auto;
    overflow: visible;
    transform: none !important;
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)) !important;
}

body.admin-standalone .admin-page-header {
    position: sticky;
    top: 0;
    z-index: 30;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)) !important;
    backdrop-filter: blur(18px);
}

body.admin-standalone .admin-tabs {
    position: sticky;
    top: calc(74px + env(safe-area-inset-top, 0px));
    z-index: 29;
    background: linear-gradient(180deg, rgba(11, 14, 18, 0.96) 0%, rgba(11, 14, 18, 0.9) 100%);
}

body.admin-standalone .admin-page-content {
    display: flex;
    flex-direction: column;
    min-height: auto;
    overflow: visible;
    padding-bottom: 32px;
}

body.admin-standalone .admin-section {
    overflow: visible;
}

.history-bar {
    gap: 8px;
}

#bet-overlay.modal-overlay {
    z-index: 10040;
    padding: 0;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#bet-sheet.betting-sheet {
    z-index: 10060;
}

#topup-overlay.modal-overlay {
    z-index: 10040;
    padding: 0;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#topup-sheet.topup-sheet {
    z-index: 10060;
    max-height: min(94vh, calc(var(--tg-viewport-height, 100dvh) - 10px));
    display: flex;
    flex-direction: column;
}

#topup-sheet .sheet-body {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    padding-bottom: calc(34px + var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.history-bar {
    gap: 8px;
    padding: 6px 14px;
}

.history-pill,
.live-pill {
    min-width: 54px;
    height: 30px;
    padding: 0 11px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
}

.history-pill {
    flex: 0 0 auto;
}

.history-modal-content {
    background: #1b2430;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px 24px 0 0;
    padding: 16px 14px 0;
    max-height: 86vh;
}

.history-header {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#full-history-list {
    gap: 14px;
    padding: 8px 6px 24px;
}

.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(49, 31, 44, 0.7) 0%, rgba(45, 34, 49, 0.58) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.history-entry.win {
    background: linear-gradient(135deg, rgba(18, 56, 48, 0.82) 0%, rgba(24, 48, 44, 0.72) 100%);
    border-color: rgba(52, 199, 89, 0.28);
}

.history-entry.loss {
    border-color: rgba(255, 91, 99, 0.28);
}

.history-entry-left,
.history-entry-right {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-entry-right {
    align-items: flex-end;
    text-align: right;
}

.history-entry-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}

.history-entry-amount span {
    font-size: 0.96rem;
    color: #ffb347;
}

.history-entry-meta {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.history-entry-multiplier {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1bb6ff;
}

.history-entry-result {
    font-size: 1rem;
    font-weight: 800;
    color: #ff5b63;
}

.history-entry.win .history-entry-result {
    color: #38d66b;
}

.promo-modal-card {
    max-width: 400px;
}

.promo-input {
    text-transform: uppercase;
}

.promocode-result-msg {
    margin: 0 20px 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid rgba(52, 199, 89, 0.24);
    color: #9df0b4;
    font-size: 0.92rem;
    font-weight: 700;
}

.promo-modal-actions {
    padding: 0 20px 20px;
}

.withdrawal-modal-card {
    background: linear-gradient(180deg, #141c2b 0%, #121826 100%);
    border-radius: 22px;
    max-width: 346px;
    width: min(346px, calc(100vw - 28px));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    max-height: min(88vh, 720px);
    overflow-y: auto;
    scrollbar-width: none;
}

.withdrawal-modal-card .wm-header {
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(20, 28, 43, 0.98) 0%, rgba(20, 28, 43, 0.92) 100%);
    backdrop-filter: blur(10px);
}

.withdrawal-modal-card .wm-section {
    padding: 10px 14px 0;
}

.withdrawal-modal-card .wm-curr-tab {
    padding: 11px 10px;
    min-height: 44px;
}

.withdrawal-modal-card .wm-input {
    padding: 13px 14px;
}

.wm-min-note {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 600;
}

.wm-wallet-connect-btn {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid rgba(0, 136, 204, 0.32);
    background: rgba(0, 136, 204, 0.12);
    color: #17a7ff;
    font-size: 0.96rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.wm-wallet-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(33, 43, 63, 0.9);
    border: 1px solid rgba(0, 136, 204, 0.28);
    border-radius: 14px;
    padding: 12px 14px;
}

.wm-wallet-banner-left {
    min-width: 0;
    flex: 1 1 auto;
}

.wm-wallet-addr-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f5f9ff;
    font-size: 0.92rem;
    font-weight: 700;
}

.wm-wallet-change {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.86);
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
}

.wm-stars-info {
    margin: 12px 14px 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 214, 10, 0.22);
    background: rgba(255, 214, 10, 0.08);
}

.wm-withdraw-status-panel {
    padding-bottom: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 12px;
}

.wm-withdraw-status-body {
    margin-top: 6px;
}

.wm-withdraw-status-card {
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wm-withdraw-status-card.pending {
    border-color: rgba(255, 214, 10, 0.24);
}

.wm-withdraw-status-card.approved {
    border-color: rgba(52, 199, 89, 0.24);
}

.wm-withdraw-status-card.rejected {
    border-color: rgba(255, 59, 48, 0.24);
}

.wm-withdraw-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.8rem;
}

.wm-withdraw-status-main {
    margin-top: 8px;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
}

.wm-withdraw-status-note {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.74rem;
    line-height: 1.35;
    word-break: break-all;
}

.wm-withdraw-status-empty {
    margin: 0;
    padding: 14px;
    border-radius: 14px;
    text-align: center;
    color: rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}
