@font-face {
    font-family: 'DelaGothicOne-Regular';
    src: url('./font/DelaGothicOne-Regular.ttf') format('truetype');
  }

* {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Server-authoritative multiplayer start freeze. The counter intentionally
   lives outside #game_content so the world/HUD blur never softens the number. */
#multiplayer_pregame_overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: rgba(3, 13, 22, 0.16);
    transition: opacity 140ms ease;
}

#multiplayer_pregame_overlay.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

html.mapwar-android-native-host #multiplayer_pregame_overlay {
    display: none !important;
}

#multiplayer_pregame_countdown {
    min-width: 1.55em;
    padding: 0.08em 0.28em 0.16em;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 0.32em;
    background: rgba(5, 17, 27, 0.76);
    box-shadow:
        0 10px 36px rgba(0, 0, 0, 0.48),
        inset 0 0 18px rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: clamp(72px, 15vw, 148px);
    line-height: 1;
    text-align: center;
    text-shadow: 0 5px 0 rgba(0, 0, 0, 0.52);
}

html.mapwar-multiplayer-pregame #game_content {
    filter: blur(10px) !important;
    pointer-events: none !important;
}

canvas {
    cursor: pointer;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}
body{
    font-family: 'DelaGothicOne-Regular', monospace;
    font-weight: 100;
    background-color: #1f1f1f;
    padding: 0;
    margin: 0;
}

img {
  pointer-events: none;
}

h1 {
    font-family: 'DelaGothicOne-Regular', monospace;
    font-weight: 100;
}

button {
    border: none; /* Убираем обводку */
    background: none; /* Убираем фоновый цвет */
    cursor: pointer; /* Устанавливаем курсор указателя */
}

button:hover {
    outline: none; /* Убираем выделение при наведении */
}

button:active {
    transform: scale(.95);
}

button {
    display: inline-block;
    text-decoration: none;
    border: none;
    padding: 0;
    margin: 0;
    overflow: visible;
    transition: transform .2s ease;
}

#main{
    overflow: hidden;
    /* background-color: #156da7; */
    /* background: url("./water_overlay.png"); 
    background-size:400px; */
}
.info{
    color: white;
    position: absolute;
}

.info_coin_img{
    width: 30px;
    height: 30px;
    margin-top: 9px;
}

.hud_left_stack {
    display: contents;
}

/* Обёртка: бюджет + ядерка центрируются ВМЕСТЕ как единая композиция */
.hud_top_center{
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 0;
    z-index: 4;
}

.score_info_container{
    display: flex;
    padding: 0px 7px 7px 0px;
    background-color: rgba(0, 0, 0, 0.411);
    border-radius: 8px;
    min-width: 120px;
}

/* Счётчик ядерок — рядом с гос бюджетом, в той же стилистике */
.nuke_info_container{
    display: flex;
    align-items: center;
    padding: 0px 9px 7px 4px;
    background-color: rgba(0, 0, 0, 0.411);
    border-radius: 8px;
    min-width: 64px;
}

#info_nukes {
    color: white;
    text-align: center;
    font-size: 28px;
    margin: 0;
    text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15), 2px 40px 2px rgba(0,0,0,0);
}

.front_battle_panel {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    width: min(380px, calc(100vw - 24px));
    display: none;
    box-sizing: border-box;
    max-height: min(52vh, 420px);
    overflow: hidden auto;
    z-index: 5;
    pointer-events: none;
    scrollbar-width: none;
}

.front_battle_panel.is-visible {
    display: block;
}

.front_battle_panel::-webkit-scrollbar {
    display: none;
}

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

.front_battle_item {
    box-sizing: border-box;
    padding: 6px 8px 7px;
    color: #fff;
    background: rgba(9, 14, 20, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    pointer-events: auto;
}

.front_battle_content {
    min-width: 0;
    flex: 1 1 auto;
}

.front_battle_actions {
    display: flex;
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-end;
    gap: 3px;
}

.front_battle_action {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 6px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: auto;
}

.front_battle_action_reinforce {
    background-image: url("./img/plus.png");
}

.front_battle_action_cancel {
    background-image: url("./img/reject.png");
}

.front_battle_values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.front_battle_side {
    display: flex;
    align-items: center;
    gap: 4px;
    width: calc(50% - 5px);
    min-width: 0;
}

.front_battle_right {
    justify-content: flex-end;
    text-align: right;
}

.front_battle_left {
    justify-content: flex-start;
    text-align: left;
}

.front_battle_icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    object-fit: contain;
}

.front_battle_identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 12px;
}

.front_battle_right .front_battle_identity {
    align-items: flex-end;
}

.front_battle_left .front_battle_identity {
    align-items: flex-start;
}

.front_battle_name {
    max-width: 125px;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px #000;
}

.front_battle_funds {
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    line-height: 11px;
}

.front_battle_side.is-local .front_battle_name,
.front_battle_side.is-local .front_battle_funds {
    color: #6eff70;
}

.front_battle_side.is-enemy .front_battle_name,
.front_battle_side.is-enemy .front_battle_funds {
    color: #ff6a61;
}

.front_battle_bar {
    position: relative;
    height: 9px;
    overflow: hidden;
    background: linear-gradient(90deg, #a62128, #f04b45);
    border: 1px solid rgba(0, 0, 0, 0.7);
    border-radius: 5px;
}

.front_battle_green {
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, #2da83d, #76ef65);
    transition: width 0.2s linear;
}

.front_battle_center {
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 800px) {
    .front_battle_panel {
        position: static;
        order: 3;
        width: 224px;
        transform: none;
        max-height: 42vh;
    }

    .front_battle_list {
        gap: 4px;
    }

    .front_battle_item {
        padding: 4px 5px 5px;
        gap: 3px;
    }

    .front_battle_values {
        gap: 4px;
        margin-bottom: 3px;
        font-size: 9px;
    }

    .front_battle_side {
        gap: 2px;
        width: calc(50% - 2px);
    }

    .front_battle_icon {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
    }

    .front_battle_identity {
        line-height: 9px;
    }

    .front_battle_name {
        max-width: 72px;
    }

    .front_battle_funds {
        font-size: 8px;
        line-height: 8px;
    }

    .front_battle_bar {
        height: 7px;
    }

    .front_battle_action {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }

    .info_container {
        order: 2;
    }

    .hud_top_center {
        order: 1;
    }

    .zoom_container {
        display: none !important;
    }
}

#continentCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    touch-action: none;
    overscroll-behavior: none;
}

#nuclearCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

/* Трассер ЯО (дуга + шарик) — отдельный канвас ПОЛНОГО разрешения (не зависит от
   animRenderScale, всегда чёткий). Поверх вспышки. */
#nuclearTracerCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
}

#exploreCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 4;
}

#m {
    position: fixed;
    z-index: 2;
}

#menu_content{
    width: 100vw;
    height: 100vh;
    position: fixed;
}

.logo{
    background: url(./img/strategy_io.png);
    color: white;
    width: 60%;
    height: calc(44vw * 0.5);
    font-weight: 100;
    font-size: 160px;
    padding: 0;
    margin: 0;
    text-align: center;
    background-size: cover;
    background-position: 0;
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 4px 3px 0 #7A7A7A, 4px 4px 5px #000000;
    z-index: 1; /* под кнопками меню/настроек */
    pointer-events: none; /* логотип не перехватывает клики по кнопкам под ним */
}

.container {
    text-align: center; /* Центрируем текст */
    padding: 20px; /* Отступы внутри контейнера */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.buttons_conteiner{
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100px
}

#user_input {
    font-family: 'DelaGothicOne-Regular', monospace;
    color: rgb(63, 63, 63);
    font-weight: 100;
    text-align: center;
    font-size: 52px;
    border: none;
    border-radius: 10px;
    width: 472px;
    height: 102px;
    padding: 10px; /* Отступы внутри поля ввода */
    margin-bottom: 15px; /* Отступ снизу */
    border: 1px solid #ccc; /* Обводка поля ввода */
    border-color: transparent;
    background: url("./img/input_name.png");
    background-size: cover;
    background-position: 0px;
    outline: 0;
}

#playButton {
    background: url("./img/multiplayer.png");
    background-size: cover; 
    background-position: 0;
    height: 90px;
    width: 240px;
    z-index: 3;
}

#playSolo {
    background: url("./img/play.png");
    background-size: cover; 
    background-position: 0;
    height: 90px;
    width: 240px;
    z-index: 3;
    overflow: visible;
    transition: transform .2s ease;
}

#playSolo:active {
    transform: scale(.95);
}

/* ── Difficulty popup ───────────────────────────────────────── */
/* Блокирует клики по всему экрану кроме попапа */
#diff_click_blocker {
    position: fixed;
    inset: 0;
    z-index: 48;
    display: none;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
    opacity: 0;
    transition: opacity .22s ease;
}
#diff_container {
    position: fixed;
    z-index: 49;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -40%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: auto;
}
#diff_popup {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 32px;
    pointer-events: auto;
}
#diff_dots_row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    position: relative;
    pointer-events: auto;
}
#diff_dots_line {
    position: absolute;
    top: 50%;
    left: 6px;
    right: 6px;
    height: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
    transform: translateY(-50%);
    pointer-events: none;
}
#diff_dots_wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
#diff_skull {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.6;
    flex-shrink: 0;
    filter: grayscale(0.1);
}
.sdbar_dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
    pointer-events: auto;
}
.sdbar_dot.selected {
    transform: scale(1.6);
    border-color: rgba(255,255,255,0.9);
    box-shadow: 0 0 10px rgba(255,255,255,0.35);
}
.sdbar_dot.locked { opacity: 0.42; filter: grayscale(0.3); }
.sdbar_dot.blocked { opacity: 0.16; cursor: default; }
@keyframes sdbar_shake {
    0%,100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}
.sdbar_dot.sdbar_shake { animation: sdbar_shake .35s ease; }
#diff_accept_btn {
    width: 44px;
    height: 44px;
    cursor: pointer;
    background: url('./img/accept.png') center / contain no-repeat;
    background-color: transparent;
    border: none;
    outline: none;
    transition: transform .15s ease;
    pointer-events: auto;
}
#diff_accept_btn:hover { transform: scale(1.15); }
.sdbar_unlock_prompt {
    background: rgba(12,12,12,0.96);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 7px;
    border-radius: 7px;
    white-space: nowrap;
    z-index: 100;
    display: flex;
    gap: 5px;
    align-items: center;
}
.sdbar_unlock_prompt button {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    line-height: 1.4;
}
.sdbar_unlock_yes { background: rgba(255,255,255,0.15); color: #fff; }
.sdbar_unlock_no  { background: transparent; color: rgba(255,255,255,0.35); }

/* ── Chest ───────────────────────────────────────────────────── */
#chest_btn {
    position: fixed;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#chest_btn::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    background: url(./img/plashka.png) center/contain no-repeat;
    z-index: -1;
    pointer-events: none;
}
#chest_btn_img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    transition: transform .15s ease;
}
#chest_btn:hover #chest_btn_img { transform: scale(1.1); }
#chest_badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Modal */
#chest_modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background .3s ease, backdrop-filter .3s ease, -webkit-backdrop-filter .3s ease;
    cursor: pointer;
}
#chest_modal.chest-modal-visible {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
#chest_modal_img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transform: translateY(60px) scale(0.5);
    opacity: 0;
    transition: transform .4s cubic-bezier(.17,.67,.35,1.3), opacity .3s ease;
}
#chest_modal.chest-modal-visible #chest_modal_img {
    transform: translateY(0) scale(1);
    opacity: 1;
}
#chest_modal_img.chest-open-anim {
    animation: chestPop .25s ease;
}
@keyframes chestPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}
#chest_reward_label {
    margin-top: 14px;
    font-size: 26px;
    color: #f0c040;
    font-family: 'Bounded-Black', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
}
#chest_reward_label.chest-reward-show {
    opacity: 1;
    transform: translateY(0);
}

/* Coin currency display */
.menu-top-status {
    display: contents;
}

.menu-currency-status {
    display: contents;
}

.gp-coin-display {
    position: absolute;
    top: 17px;
    right: 160px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgb(30 32 31 / 95%);
    padding: 6px 12px;
    border-radius: 20px;
}

.gp-coin-icon {
    width: 24px;
    height: 24px;
}

#gp_coin_count {
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: 16px;
    color: #ffd700;
}



.gp-nuclear-icon {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.gp-coin-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    margin: 0 2px;
}

.cups-badge {
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: 14px;
    color: #ffd700;
    position: absolute;
    bottom: 30px;
    right: 87px;
    pointer-events: none;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

#gp_nuclear_count {
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: 16px;
    color: #ffd700;
}



#slavikButtonMobile {
    display: none;
}

#slavikButton {
    background: url("./img/slavik+.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 80px;
    width: 142px;
    position: relative;
    z-index: 3;
    border: none;
    cursor: pointer;
    overflow: visible;
    transition: transform .2s ease;
    align-self: flex-end;
}

#slavikButton:active {
    transform: scale(.95);
}

/* Glory Path button badges */
.gp-badge {
    position: absolute;
    font-family: 'DelaGothicOne-Regular', monospace;
    font-weight: bold;
    color: #fff;
    pointer-events: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gp-badge-unlocked {
    font-size: 12px;
    top: 52%;
    left: 10%;
    transform: translateY(-40%);
    color: #7b4700;
}

.gp-badge-unclaimed {
    font-size: 13px;
    top: 40%;
    right: 33%;
    transform: translateY(-50%);
}

.gp-badge-unlocked.gp-1digit {
    font-size: 12px;
    top: 52%;
    left: 13%;
    transform: translateY(-40%);
    color: #7b4700;
}

.gp-badge-unclaimed.gp-2digit {
    font-size: 10px;
    top: 40%;
    right: 31%;
    transform: translateY(-50%);
}


#game_content {
    display: none;
    width: 100vw;
    height: 100vh;
    position: fixed;
    z-index: 1;
    overflow: hidden;
    background-color: transparent;
}

#vignette-layer {
    width: 100%;
    height: 100%;
    padding: -10px;
    background: rgba(255,255,255,0.01);
    overflow: hidden;
    pointer-events: none;
    position: absolute;
    top: 0;
    background: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 0) 55%,
        rgba(0, 0, 0, 0.05) 65%,
        rgba(0, 0, 0, 0.15) 75%,
        rgba(0, 0, 0, 0.3) 85%,
        rgba(0, 0, 0, 0.5) 95%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

#vignette-layer::after{
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2N89+7dfwAI1QMLFsZIZwAAAABJRU5ErkJggg==');
    opacity: 0.05;
    pointer-events: none;
}

#vignette-layer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;  /* достаточно большой круг */
    height: 200%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 50%;
    box-shadow:
        inset 0 0 150px 120px rgba(0, 0, 0, 0.20),
        inset 0 0 200px 240px rgba(0, 0, 0, 0.10),
        inset 0 0 300px 400px rgba(0, 0, 0, 0.05);

}

/* Красная виньетка "под атакой" — статичный градиент, анимируется только
   opacity (композитится на GPU), без поканадровой пересборки CSS-градиента. */
#vignette-red-layer {
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;          /* поверх карты (canvas z-index:2, тот же слой, но позже в DOM), под UI (z-index:3) */
    opacity: 0;
    will-change: opacity;
    background: radial-gradient(
        circle at center,
        rgba(137, 44, 44, 0) 55%,
        rgba(196, 33, 33, 0.05) 65%,
        rgba(185, 21, 21, 0.15) 75%,
        rgba(194, 58, 58, 0.3) 85%,
        rgba(194, 58, 58, 0.5) 95%,
        rgba(194, 58, 58, 0.7) 100%
    );
}

#vignette-red-layer.under-attack-pulse {
    animation: vignetteAttackPulse 2000ms ease-in-out;
}

@keyframes vignetteAttackPulse {
    0%   { opacity: 0; }
    50%  { opacity: 1; }
    100% { opacity: 0; }
}

#leaveButton{
    background: url("./img/leave_room.png");
    background-size: cover;
    height: 60px;
    width: 120px;
    position: fixed;
    background-position: 0;
    bottom: -1px;
    left: 10px;
    z-index: 3;
}

#ironButton{
    position: fixed;
    right: 10px;
    bottom: 5px;
    z-index: 3;
}

.iron {
    background: url(./img/iron_dissabled.png);
    background-size: cover;
    height: 50px;
    width: 50px;
    border: none;
    cursor: pointer;
  }
  
  .iron-disabled {
    background: url(./img/iron.png);
    background-size: cover;
  }


#waiting_content{
    display: none;
    width: 100vw;
    height: 100vh;
    position: fixed;
    background: url(./img/dark_bg.png);
    background-size: cover;
}

.leaveWaiting{
    background: url(./img/leave_room.png) !important;
    background-size: cover !important;
    height: 165px !important;
    width: 330px !important;
    position: fixed !important;
    z-index: 3 !important;
    top: 70% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}


.waiting_container{
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: fixed;
    font-size: 28px;
    flex-direction: column-reverse;
}

.processing_search_content video {
    width: 228px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    display: block;
}

.processing_search_content {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.time {
    background: url("./img/clock.png");
    background-size: cover;
    height: 80px;
    width: 80px;
}

.players{
    background: url("./img/multi_icon.png");
    background-size: cover;
    height: 80px;
    width: 80px;
}

.leaderboard_container {
    cursor: pointer;
    font-size: 14px;
    color: white;
    position: fixed;
    width: 260px;
    height: 330px;
    background-color: rgba(0, 0, 0, 0.411);
    border-radius: 8px;
    right: 10px;
    top: 10px;
    z-index: 3;
    box-sizing: border-box;
    overflow: visible;
    transition: height 180ms ease;
}

.leaderboard_container.is-collapsed {
    height: 185px;
}

.leaderboard_container.is-collapsed #top_holder {
    height: 120px;
    overflow: hidden;
}

.leader_img{
    width: 40px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#top_holder{
    width: 100%;
    height: 78%;
    overflow: auto;
    overflow: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
}

#top_holder::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.top-player-row:hover{
    color: #efac0a;
    font-weight: bold;
}

#countdown{
    width: 60px;
}

#self-rank{
    margin-top: 4px;
    color: #efac0a;
    font-weight: bold;
    margin-left: 10px;
}

.info_container{
    font-size: 14px;
    color: white;
    position: fixed;
    width: 160px;
    height: 160px;
    background-color: rgba(0, 0, 0, 0.411);
    border-radius: 8px;
    left: 10px;
    top: 10px;
    z-index: 3;
    padding: 8px;
    box-sizing: border-box;
    overflow: visible;
    transition: height 180ms ease;
}

.info_container.is-collapsed {
    height: 66px;
}

.info_container.is-collapsed .info_row_collapsible {
    display: none;
}

.hud_panel_toggle {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    bottom: auto;
    width: 100%;
    height: 18px;
    padding: 0;
    box-sizing: border-box;
    transform: none;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    pointer-events: auto;
    z-index: 2;
}

.hud_toggle_chevron {
    position: absolute;
    left: 50%;
    top: 3px;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(255, 255, 255, 0.92);
    border-bottom: 2px solid rgba(255, 255, 255, 0.92);
    transform: translateX(-50%) rotate(45deg);
    transition: transform 160ms ease, top 160ms ease;
}

.hud_panel_toggle[aria-expanded="true"] .hud_toggle_chevron {
    top: 7px;
    transform: translateX(-50%) rotate(-135deg);
}

.hud_panel_toggle:active {
    filter: brightness(1.25);
}

.world_info{
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.info_row{
    text-align: right;
    display: flex;
    width: 100%;
    height: 100%;
}

.info_row h1 {
    font-size: 20px;
    margin-top: 12px;
    margin-bottom: 0;
}

.info_icon{
    width: 50px;
    height: 50px;
}

#info_score {
    color: white;
    text-align: center;
    font-size: 28px;
    width: 100%;
    margin: 0;
    text-shadow: 0 1px 0 #CCCCCC, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15), 2px 40px 2px rgba(0,0,0,0);
}

.slider-container{
    display: flex;
    position: fixed;
    width: 292px;
    height: 48px;
    bottom: -10px;
    left: 50%;
    transform: translate(-50%, -50%);
    background-size: cover;
    color: white;
    text-shadow: 0px 0px 4px #000000;
    background-color: #00000069;
    border-radius: 25px;
}

.menu_interactive_container{
    position: fixed;
    width: 360px;
    height: 70px;
    bottom: -26px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: url(./img/menu_container_background.png);
    background-size: cover;
    background-position-y: -12px;

    display: none;
}

.button_menu_container{
    display: flex;
    width: 90%;
    height: 48px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
    justify-content: space-around;
}

.menu_interactive_button {
    width: 60px;
    height: 60px;
    border: none;
    background: #ccc;
    border-radius: 10px;
    transition: transform 0.25s ease, background 0.25s ease;
    cursor: pointer;
}

.menu_interactive_button.disabled_menu_button {
    opacity: 0.5;
    cursor: default;
    pointer-events: none; /* Полный запрет клика */
}

/* Активная кнопка — поднимается вверх */
.menu_interactive_button.active {
    transform: translateY(-12px);
    background: #e0e0e0;
}

#chat_menu_icon_button{
    background: url(./img/chat_menu_icon.png);
    background-size: cover;
}

#alliance_menu_icon_button{
    background: url(./img/alliance_menu_icon.png);
    background-size: cover;
}

#attack_menu_icon_button{
    background: url(./img/attack_menu_icon.png);
    background-size: cover;
}

#money_send_menu_icon_button{
    background: url(./img/money_send_menu_icon.png);
    background-size: cover;
}

#target_menu_icon_button{
    background: url(./img/target_menu_icon.png);
    background-size: cover;
}

#nuclear_menu_icon_button{
    background: url(./img/nuclear_attack.png);
    background-size: cover;
}

#nuclear_menu_icon_button.active{
    background: url(./img/nuclear_attack_innactive.png);
    background-size: cover;
    box-shadow: 0 0 8px 2px rgba(255, 80, 0, 0.8);
}

.btn {
    width: 30px;
    height: 100%;
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    z-index: 2;
    margin-left: 5px;
    margin-right: 5px;
}

.bar {
    position: relative;
    flex-grow: 1;
    height: 70%;
    border-radius: 5px;
    margin-top: 6px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.label {
    position: relative;
    z-index: 2;
    font-weight: bold;
    pointer-events: none;
}

#decrease{
    border-radius: 12px 0px 0px 12px;
}

#increase{
    border-radius: 0px 12px 12px 0px;
}

.global_online_container{
    width: 100px;
    height: 50px;
    position: fixed;
    top: 10px;
    left: 10px;
    display: flex;
}

#global_online_count{
    color: #b39f69;
    margin: 0;
}

.notification-holder {
    position: fixed;
    bottom: 60px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3;
    max-height: 600px;
    overflow: hidden;
}

.notification {
    padding: 5px 20px;
    background: url(./img/atack_slider_bg.png);
    background-position: 0;
    background-size: cover;
    color: #bbab7f;
    border-radius: 5px;
    width: 200px;
    word-wrap: break-word;
    opacity: 0;
    transform: translateX(100%); /* Начинаем за правым краем */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    display: flex;
    text-align: center;
    text-shadow: 3px 3px 0px #000000;
    gap: 5px;
}

.notification.visible {
    opacity: 1;
    transform: translateX(0); /* Плавно выезжаем на место */
}

.notification h1 {
    width: 50%;
    font-size: 14px;
}

.notification img {
    width: 20%;
}

.subText{
    text-align: right !important;
    width: 30% !important;
}

.timer-bar {
    width: 0%;
    height: 6%;
    position: absolute;
    background-color: #bbab7f6b;
    transition: width linear;
    left: 53px;
    bottom: 6px;
}

.alliance{
    background: url(./img/alliances_show_dissabled.png);
    background-size: cover;
    height: 50px;
    width: 50px;
    border: none;
    cursor: pointer;
    position: fixed;
    right: 70px;
    bottom: 5px;
    z-index: 3;
}

.alliance-disabled{
    background: url(./img/alliances_show.png);
    background-size: cover;
    height: 50px;
    width: 50px;
}

.regions{
    background: url(./img/regions_show_dissabled.png);
    background-size: cover;
    height: 50px;
    width: 50px;
    border: none;
    cursor: pointer;
    position: fixed;
    right: 130px;
    bottom: 5px;
    z-index: 3;
}

.regions-disabled{
    background: url(./img/regions_show.png);
    background-size: cover;
    height: 50px;
    width: 50px;
}

.container-l {
    position: relative;
    width: 214px;
    height: 214px;
    margin-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.piece {
    position: absolute;
    width: 128px;
    height: 128px;
    background-image: url(./img/loading_anim.png);
    background-size: 256px 256px;
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.piece1 { background-position: 0 0; }
.piece2 { background-position: -128px 0; left: 128px; }
.piece3 { background-position: 0 -128px; top: 128px; }
.piece4 { background-position: -128px -128px; left: 128px; top: 128px; }

.enter1, .enter2, .enter3, .enter4 {
    transform: translate(0, 0) scale(1);
    opacity: 1;
}

.rotate {
    animation: rotate 0.6s ease forwards;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.explode1 { transform: translate(-300px, -200px) rotate(-45deg); opacity: 0; }
.explode2 { transform: translate(300px, -250px) rotate(60deg); opacity: 0; }
.explode3 { transform: translate(-280px, 280px) rotate(90deg); opacity: 0; }
.explode4 { transform: translate(250px, 300px) rotate(-90deg); opacity: 0; }

.progress-bar-l {
    width: 550px;
    height: 55px;
    overflow: hidden;
    top: 300px;
    left: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
}

.progress-fill-l {
    width: 100%;
    height: 100%;
    background: url(./img/loading_slider_bg.png);
    background-size: 98% 750%;
    background-repeat: no-repeat;
    background-position: left center;
    position: absolute;
    clip-path: inset(0 100% 0 0); /* Сначала всё скрыто */
    animation: revealClip 5s linear forwards;
}

@keyframes revealClip {
    0% {
        clip-path: inset(0 100% 0 0); /* полностью скрыто */
    }
    100% {
        clip-path: inset(0 0% 0 0); /* полностью видно */
    }
}
.loading_anim_container{
    width: 214px;
    height: 214px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    top: 400px;
}

#loadingWorld{
    display: none;
}

.top-player-row{
    padding: 4px 12px;
}

#endgame_block {
    width: 480px;
    height: 570px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1s ease;
    display: block;
    pointer-events: none;
    z-index: 3;
}

.endgame_container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

#endgame_block_img {
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

#endgame_name {
    margin: 0;
    color: white;
    font-size: 40px;
    text-align: center;
    margin-bottom: 20px
}

#googleLogin {
    background-image: url(./img/betterID.png);
    background-size: cover;
    width: 286px;
    height: 70px;
    position: relative;
    background-position-y: -4px;
}

#betterId {
    width: 300px;
    height: 70px;
    margin-top: 14px;
}


#top_menu_dropdown {
    position: absolute;
    top: -8px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 20; /* настройки/меню выше логотипа */
}

#leaderboard_menu_button {
    background: url("./img/leaderboard_menu.png");
    height: 80px;
    width: 142px;
    background-size: cover;
    position: relative;
    top: 0;
    right: 0;
    overflow: visible;
    flex-shrink: 0;
}

#top_menu_items {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    overflow: hidden;
    max-height: 0;
    pointer-events: none;
    transform: translateY(-10px);
    opacity: 0;
    /* overflow переключаем с задержкой: во время слайда — hidden (чистое раскрытие),
       после раскрытия — visible (hover-увеличение иконок не режется по бокам) */
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, overflow 0s linear 0.25s;
}

#top_menu_items.open {
    max-height: 300px;
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
    overflow: visible;
    transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, overflow 0s linear 0.25s;
}

#settings_dropdown_btn {
    background: url("./img/settings_button.png") center / contain no-repeat;
    width: 64px;
    height: 64px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: transform .15s ease;
}
#settings_dropdown_btn:hover { transform: scale(1.1); }

#leaders_dropdown_btn {
    background: url("./img/leaders_button.png") center / contain no-repeat;
    width: 64px;
    height: 64px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: transform .15s ease;
}
#leaders_dropdown_btn:hover { transform: scale(1.1); }

/* ── Settings button ─────────────────────────────────────────── */

/* ── Settings (quality) popup ────────────────────────────────── */


.leaderboard_popup_overlay {
   width: 100%;
   height: 100%;
   position: absolute;
   z-index: 2;
   filter: blur(8px);
}

.leaderboard_content_popup{
    position: absolute;
    width: 400px;
    height: 570px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: url("./img/leaderboard_bg_out.png") center / cover no-repeat;
    z-index: 3;
}

.leaderboard_content_popup::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: url("./img/leaderboard_bg.png") center / cover no-repeat;
    z-index: 20;
    pointer-events: none;
}

#leaderboard_popup{
    display: none;
}

/* ============ MENU BUTTON EFFECTS ============ */

/* Wrapper for buttons with particle effects */
.menu-fx-wrap {
    position: relative;
    display: inline-block;
}


/* Particles flying out from buttons */
.menu-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    z-index: 4;
}

.menu-particle.spark {
    width: 3px;
    height: 3px;
    background: #fff;
    box-shadow: 0 0 4px 1px rgba(255,255,255,0.8);
    animation: sparkFly var(--dur) var(--delay) ease-out infinite;
}

.menu-particle.star {
    width: 5px;
    height: 5px;
    background: #ffd700;
    box-shadow: 0 0 6px 2px rgba(255,215,0,0.5);
    animation: sparkFly var(--dur) var(--delay) ease-out infinite;
}

@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    60% { opacity: 0.5; }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* Pulsing glow — drop-shadow follows PNG shape */
.menu-fx-wrap.glow-green > button,
.menu-fx-wrap.glow-green > input {
    animation: glowGreen 2.5s ease-in-out infinite;
}
.menu-fx-wrap.glow-blue > button,
.menu-fx-wrap.glow-blue > input {
    animation: glowBlue 2.5s ease-in-out infinite;
}
.menu-fx-wrap.glow-gold > button,
.menu-fx-wrap.glow-gold > input {
    animation: glowGold 2.5s ease-in-out infinite;
}
.menu-fx-wrap.glow-purple > button,
.menu-fx-wrap.glow-purple > input {
    animation: glowPurple 2.5s ease-in-out infinite;
}
.menu-fx-wrap.glow-cyan > button,
.menu-fx-wrap.glow-cyan > input {
    animation: glowCyan 2.5s ease-in-out infinite;
}

@keyframes glowGreen {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(76,175,80,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(76,175,80,0.8)) drop-shadow(0 0 6px rgba(76,175,80,0.4)); }
}
@keyframes glowBlue {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(33,150,243,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(33,150,243,0.8)) drop-shadow(0 0 6px rgba(33,150,243,0.4)); }
}
@keyframes glowGold {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255,215,0,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(255,215,0,0.8)) drop-shadow(0 0 6px rgba(255,215,0,0.4)); }
}
@keyframes glowPurple {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(180,76,255,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(180,76,255,0.8)) drop-shadow(0 0 6px rgba(180,76,255,0.4)); }
}
@keyframes glowCyan {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(0,188,212,0.3)); }
    50% { filter: drop-shadow(0 0 14px rgba(0,188,212,0.8)) drop-shadow(0 0 6px rgba(0,188,212,0.4)); }
}

/* Bounce on hover for desktop */
@media (hover: hover) {
    .menu-fx-wrap:hover {
        animation: menuBounce 0.4s ease;
    }
}

@keyframes menuBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    70% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

/* ============ GLORY PATH ============ */

/* Loading overlay — blurs menu, shows spinner, then opens Glory Path */
.gp-loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9;
    animation: gpFadeIn 0.3s ease;
}

@keyframes gpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gp-spinner {
    width: 56px;
    height: 56px;
    animation: gpSpin 0.8s linear infinite;
}

.gp-spinner svg {
    width: 100%;
    height: 100%;
}

@keyframes gpSpin {
    to { transform: rotate(360deg); }
}

/* Desktop: slide-out panel from right, below glory button */
.glory-path-popup {
    display: none;
    position: fixed;
    top: 160px;
    right: 0;
    width: 320px;
    height: calc(100vh - 180px);
    z-index: 10;
    background: url('./img/bg_glory.png') center / cover no-repeat;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5);
    border-radius: 16px 0 0 16px;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.35s ease;
}

.glory-path-popup.gp-open {
    transform: translateX(0);
}

.glory-path-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    flex-shrink: 0;
    background: url('./img/glory_accept_bg.png') center center / 100% 100% no-repeat;
    height: 80px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
    filter: drop-shadow(0 -4px 10px rgba(0,0,0,0.5));
}

.glory-path-close {
    width: 60px;
    height: 60px;
    background: url('./img/accept.png') center / contain no-repeat;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.glory-path-close:active {
    transform: scale(0.9);
}

/* Scrollable track area with line behind */
.glory-path-track {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 10px 0 90px 0;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0;
    position: relative;
    box-sizing: border-box;
}

/* The wavy line — behind track */
.gp-line-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./img/glory_line.png') center / 100% 100% no-repeat;
    z-index: 0;
    pointer-events: none;
}

.glory-path-track::-webkit-scrollbar {
    display: none;
}
.glory-path-track {
    scrollbar-width: none;
}
.glory-path-track::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Step row */
.gp-tier {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
    z-index: 1;
}

/* Step image container — centered */
.gp-step {
    position: relative;
    width: 280px;
    max-width: 100%;
    height: auto;
    flex-shrink: 0;
}

.gp-step-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

.gp-step-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: 28px;
    color: #fca8ff;
    font-weight: 100;
    text-shadow: 0 3px 8px rgba(0,0,0,0.5), 0 0 20px rgba(252,168,255,0.3);
    z-index: 1;
}

.gp-step.locked .gp-step-img {
    filter: brightness(0.4) saturate(0.3);
}

.gp-step.locked .gp-step-number {
    color: rgba(252,168,255,0.3);
}

.gp-step.current {
    transform: scale(1.05);
}

.gp-step.current .gp-step-img {
    filter: brightness(1.15);
}

/* Claimable step — pulsing glow */
.gp-step.claimable {
    animation: claimPulse 1.5s ease-in-out infinite;
    cursor: pointer;
}

@keyframes claimPulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(255,215,0,0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(255,215,0,0.8)); }
}

.gp-step.claimable:active {
    transform: scale(0.95);
}

/* Claim button overlay on step */
.gp-claim-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255,180,0,0.85);
    color: #fff;
    font-family: 'DelaGothicOne-Regular', monospace;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 10px;
    z-index: 3;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.gp-claimed-check {
    background: rgba(0,180,0,0.7);
}

/* Coins image between steps */
.gp-coins-wrap {
    position: relative;
    width: 50px;
    margin: -20px auto -20px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    justify-content: center;
}

.gp-coins-wrap .gp-coins-glow,
.gp-coins-wrap .gp-coins-sparkle {
    display: none;
}

.gp-coins-wrap .gp-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ffd700;
    box-shadow: 0 0 4px 1px rgba(255,215,0,0.6);
    pointer-events: none;
    opacity: 0;
    animation: particleFly var(--dur) var(--delay) ease-out infinite;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    70% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.2);
    }
}

.gp-coins {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

.gp-coins-wrap.locked .gp-coins-glow,
.gp-coins-wrap.locked .gp-coins-sparkle {
    display: none;
}

.gp-coins-wrap.locked .gp-coins {
    filter: brightness(0.3) saturate(0) drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

.leaderboard_content {
    width: 305px;
    height: 513px;
    z-index: 10;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.leaderboard_list {
    width: 305px;
    max-height: 460px;
    overflow: auto;
    position: relative;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin-top: 152px;
}

.leaderboard_list::-webkit-scrollbar{
    display: none;
}

.leaderboard_item {
    width: 90%;
    height: 38px;
    position: relative;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.leaderboard_item_place{
    color: silver;
    font-size: 16px;
}

.leaderboard_item_name{
    color: silver;
    font-size: 16px;
}

.cup_holder{
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    flex-direction: row-reverse;
    justify-content: space-around;
}

.leaderboard_item_container{
    width: 100%;
    height: 60px;
    background: #1e201f;
    background-size: cover;
    border-radius: 6px;
    display: flex;
    margin-bottom: 10px;
    flex-direction: column;
    justify-content: center;
}

.leaderboard_item_cup_img{
    width: 36px;
    height: 36px;
}

.leaderboard_cups_count{
    position: relative;
    margin: -25px;
    top: -1px;
    color: silver;
    font-size: 10px;
}

#blur_overlay {
    width: 100%;
    height: 100%;
    filter: none;
    background: url(./img/bg.png);
    background-size: cover;
}

.zoom_container{
    width: 50px;
    height: 105px;
    position: absolute;
    left: 10px;
    top: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#zoom_plus{
    width: 50px;
    height: 50px;
    background: url("./img/zoom_plus.png");
    background-size: cover;
}

#zoom_minus{
    width: 50px;
    height: 50px;
    background: url("./img/zoom_minus.png");
    background-size: cover;
}

* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

button:active {
  background-color: inherit; 
}

button:focus,
button:active {
  outline: none;
  box-shadow: none;
}

.revard_cup{
    width: 40px;
    height: 40px;
}

.rc{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin: 4px auto 6px;
    background-color: rgba(0, 0, 0, 0.411);
    border-radius: 10px;
}

#revard_cup_count{
    color: #ba8924;
    font-size: 20px;
    text-shadow: 1px 1px 2px #040b0b;
}

#endgame_coin_count {
    color: #f0c040;
    font-size: 20px;
    text-shadow: 1px 1px 2px #040b0b;
}

.revard_buttons_holder{
    display: flex;
    gap: 5px;
}

#accept_revard_button{
    width: 90px;
    height: 90px;
    background: url(./img/accept.png);
    background-size: cover;
}

#reject_revard_button{
    width: 90px;
    height: 90px;
    background: url(./img/ads_case_reward.png);
    background-size: cover;
}

#endgame_block_img{
    width: 280px;
    height: 320px;
    background-repeat: no-repeat;
    background-position: center;
}

@media (max-width: 800px) {
    .logo,
    .preloader-logo {
        display: none !important;
    }

    #endgame_block {
        width: min(480px, 95vw);
        height: auto;
        max-height: 95vh;
    }

    #endgame_block_img {
        width: 280px;
        height: min(280px, 70vw);
        background-size: cover;
    }

    #endgame_name {
        font-size: 28px;
    }

.leaderboard_list {
        margin-top: 96px;
    }

    #top_menu_dropdown {
        top: max(44px, calc(env(safe-area-inset-top, 0px) + 10px));
        right: 8px;
    }

    #leaderboard_menu_button {
        height: 60px;
        width: 106px;
    }

    #settings_dropdown_btn,
    #leaders_dropdown_btn {
        width: 52px;
        height: 52px;
    }

    .cups-badge {
        font-size: 12px;
        bottom: 22px;
        right: 62px;
    }

    .gp-coin-display {
        position: absolute;
        top: max(75px, calc(env(safe-area-inset-top, 0px) + 48px));
        right: 122px;
        left: auto;
        transform: translateY(-50%);
        background: rgb(30 32 31 / 95%);
        padding: 5px 8px;
        border-radius: 20px;
        z-index: 10;
        font-size: 13px;
        gap: 4px;
    }

    .gp-coin-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .gp-nuclear-icon {
        width: 25px !important;
        height: 25px !important;
        object-fit: contain;
    }

    #gp_coin_count, #gp_nuclear_count {
        font-size: 13px;
    }




    #waiting_content{
        background: url(./img/dark_bg_mobile.png);
        background-size: cover;
    }

    #menu_button{
        background: url("./img/menu_button.png");
        background-size: cover;
        height: 45px;
        width: 50px;
        position: fixed;
        background-position: 0;
        bottom: 8px;
        left: 10px;
        z-index: 3;
    }

    .menu-btn {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .menu-btn.show {
        opacity: 1;
        pointer-events: auto;
    }

    #leaveButton{
        background: url("./img/reject.png");
        bottom: 8px;
        left: 70px;
        height: 45px;
        width: 50px;
        position: fixed;
        background-position: 0;
        background-size: cover;
    }

    .info_coin_img {
        width: 30px;
        height: 26px;
        margin-top: 0px;
    }

    .hud_left_stack {
        position: fixed;
        left: max(7px, calc(env(safe-area-inset-left, 0px) + 7px));
        top: max(24px, calc(env(safe-area-inset-top, 0px) + 11px));
        z-index: 4;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        pointer-events: none;
    }

    /* На мобиле бюджет, ядерки и статистика двигаются одним стеком. */
    .hud_top_center{
        position: static;
        left: auto;
        top: auto;
        transform: none;
        margin-top: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        pointer-events: auto;
    }

    .score_info_container{
        padding: 0px 4px 0px 0px;
        min-width: 114px;
    }

    .global_online_container{
        top: max(52px, calc(env(safe-area-inset-top, 0px) + 16px));
    }

    #menu_content .menu-top-status {
        position: absolute;
        top: max(10px, calc(env(safe-area-inset-top, 0px) + 10px));
        left: 8px;
        right: 8px;
        z-index: 30;
        height: 56px;
        padding: 3px 5px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        border-radius: 8px;
    }

    #menu_content .menu-top-status .global_online_container {
        position: static;
        flex: 0 0 66px;
        width: 66px;
        height: 48px;
        display: flex;
        align-items: center;
    }

    #menu_content .menu-top-status .global_online_container img {
        width: 40px;
        height: 40px;
        object-fit: contain;
    }

    #menu_content .menu-top-status .global_online_container h1 {
        font-size: 24px;
        line-height: 1;
    }

    #menu_content .menu-top-status .menu-currency-status {
        display: flex;
        align-items: center;
        gap: 2px;
        flex: 0 1 auto;
        min-width: 0;
    }

    #menu_content .menu-top-status .gp-coin-display {
        position: static;
        top: auto;
        right: auto;
        left: auto;
        transform: none;
        flex: 0 1 auto;
        min-width: 82px;
        padding: 5px 7px;
        border-radius: 16px;
        box-sizing: border-box;
    }

    #menu_content .menu-top-status #shop_plus_btn {
        position: static !important;
        top: auto !important;
        right: auto !important;
        flex: 0 0 32px;
        width: 32px !important;
        height: 32px !important;
    }

    #menu_content .menu-top-status #top_menu_dropdown {
        position: relative;
        top: auto;
        right: auto;
        flex: 0 0 112px;
        width: 112px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #menu_content .menu-top-status #leaderboard_menu_button {
        position: relative;
        top: auto;
        right: auto;
        width: 112px;
        height: 32px;
        flex: 0 0 32px;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

    #menu_content .menu-top-status .cups-badge {
        right: auto;
        bottom: 8px;
        left: 25px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="2"] {
        left: 20px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="3"] {
        left: 13px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="4"] {
        left: 5px;
    }

    #menu_content .menu-top-status #top_menu_items {
        position: absolute;
        top: 56px;
        right: 0;
    }

    /* Счётчик ядерок на мобиле — ПОД бюджетом (обёртка в колонку) */
    .nuke_info_container{
        padding: 0px 4px 0px 0px;
        min-width: 113px;
    }

    #info_nukes {
        font-size: 14px;
        margin-left: 28px;
        margin-top: -7px;
    }

    #playSolo {
        height: 74px;
        width: 130px;
        background: url(./img/play_mobile.png);
        background-size: cover;
        background-position: 0;
    }

    #playButton {
        height: 74px;
        width: 130px;
        background: url(./img/multiplayer_mobile.png);
        background-size: cover;
        background-position: 0;
    }

    #slavikButton {
        display: none;
    }

    #slavikButtonMobile {
        display: block;
        height: 101px;
        width: 286px;
        background: url("./img/slavik+.png") center / contain no-repeat;
        background-color: transparent;
        border: none;
        margin: 0 auto 15px auto;
        cursor: pointer;
        transition: transform .2s ease;
        position: relative;
        z-index: 2;
    }

    #slavikButtonMobile:active {
        transform: scale(.95);
    }

    #slavikButtonMobile .gp-badge-unlocked {
        font-size: 15px;
        top: 51%;
        left: 24.2%;
        transform: translateY(-40%);
        width: 30px;
        height: 30px;
    }

    #slavikButtonMobile .gp-badge-unclaimed {
        top: 41%;
        right: 37%;
        transform: translateY(-50%);
        width: 22px;
        height: 22px;
    }

  

    #blur_overlay {
        background: url('./img/bg_mobile.png');
        background-size: cover;
    }

    #googleLogin {
        width: 166px;
        height: 40px;
        margin-top: 8px;
        background-position-y: 0px;
    }

    .nsm7Bb-HzV7m-LgbsSe { 
        width: 200px !important;
        height: 50px !important;
    }

    #betterId {
        width: 200px;
        height: 50px;
        margin-top: -10px;
    }

    .logo {
        width: 90%;
    }

    #user_input {
        font-size: 42px;
        width: 260px;
        height: 46px;
        margin-bottom: 0;
    }

    .leaveWaiting {
        height: 140px !important;
        width: 260px !important;
        top: 70% !important;
    }

    .loading_anim_container {
        top: 264px;
    }

    .progress-bar-l {
        width: 300px;
        height: 36px;
    }

    .slider-container {
        width: 230px;
        height: 48px;
        bottom: -10px;
        transition: bottom 0.3s ease;
    }

    .info_row h1 {
        font-size: 12px;
    }

    .info_container {
        position: relative;
        width: 118px;
        height: 140px;
        top: auto;
        left: auto;
        margin: 0 0 12px;
        box-sizing: border-box;
        pointer-events: auto;
    }

    .info_container.is-collapsed {
        height: 56px;
    }

    .info_icon {
        width: 40px;
        height: 40px;
    }

    .leaderboard_container {
        width: 120px;
        height: 171px;
        font-size: 7px;
        top: max(24px, calc(env(safe-area-inset-top, 0px) + 11px));
        right: max(7px, calc(env(safe-area-inset-right, 0px) + 7px));
        margin-top: 0;
    }

    .leaderboard_container.is-collapsed {
        height: 105px;
    }

    .leaderboard_container.is-collapsed #top_holder {
        height: 58px;
    }

    .hud_panel_toggle {
        width: 100%;
        height: 15px;
        border-radius: 6px;
    }

    .hud_toggle_chevron {
        top: 2px;
        width: 6px;
        height: 6px;
        border-right-width: 1.5px;
        border-bottom-width: 1.5px;
    }

    .hud_panel_toggle[aria-expanded="true"] .hud_toggle_chevron {
        top: 6px;
    }

    .label {
        font-size: 14px;
    }

    #info_score {
        font-size: 14px;
    }

    .top-player-row {
        padding: 1px 4px;
    }

    #self-rank {
        margin-left: 4px;
        margin-top: 0px;
    }

    .notification-holder {
        bottom: 120px;
        gap: 4px;
        max-height: 120px;
        overflow: auto;
    }

    .notification {
        width: 140px;
        height: 70px;
    }

    .notification h1 {
        font-size: 7px;
    }

    .leader_img {
        width: 24px;
    }

    .timer-bar {
        left: 26px;
        bottom: 6px;
    }

    .players {
        height: 60px;
        width: 60px;
    }

    .time {
        height: 60px;
        width: 60px;
    }

    .leaderboard_content_popup {
        width: 260px;
        height: 372px;
    }

    .leaderboard_content {
        width: 220px;
        height: 336px;
        top: 35px;
    }

    .glory-path-popup {
        top: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        background: url('./img/bg_mobile_glory.png') center / 100% 100% no-repeat;
        box-shadow: none;
        transform: translateX(100%);
        transition: transform 0.35s ease;
    }

    .glory-path-popup.gp-open {
        transform: translateX(0);
    }

    .gp-step {
        width: 92vw;
        max-width: none;
    }

    .gp-step-number {
        font-size: 42px;
    }

    .gp-coins-wrap {
        width: 60px;
        margin: -14px auto -14px;
    }

    .glory-path-footer {
        height: 100px;
    }

    .glory-path-close {
        width: 80px;
        height: 80px;
    }

    .gp-step-number {
        font-size: 32px;
    }

    .gp-coins-wrap {
        width: 60px;
        margin: -14px auto -14px;
    }

    .gp-coins {
        width: 60px;
        height: 60px;
    }

    .glory-path-footer {
        height: 80px;
    }

    .glory-path-close {
        width: 60px;
        height: 60px;
    }

    .leaderboard_item_container {
        width: 200px;
        margin-left: auto;
        margin-right: auto;
        height: 44px;
    }

    .leaderboard_item {
        height: 38px;
        font-size: 12px;
    }

    .leaderboard_cups_count {
        position: relative;
        margin: -30px;
        top: 1px;
        color: silver;
        font-size: 10px;
    }

    .leaderboard_item_name {
        color: silver;
        font-size: 10px;
        margin-right: 20px;
    }

    .leaderboard_item_cup_img {
        width: 28px;
        height: 28px;
    }

    .rc {
        margin-top: -1px;
    }

}

@media (max-width: 320px) and ( max-height: 430px) {
    .global_online_container {
        display: none;
    }
}

@media (max-width: 360px) and ( max-height: 900px) {

    .score_info_container {
        top: -3px;
    }

    .regions {
        height: 40px;
        width: 40px;
        right: 100px;
        bottom: 10px;
    }

    .alliance {
        height: 40px;
        width: 40px;
        right: 54px;
        bottom: 10px;
    }

    #ironButton{
        right: 10px;
        bottom: 10px;
        height: 40px;
        width: 40px;
    }

    .iron{
        height: 40px;
        width: 40px;
    }
    
}

.ios-install-prompt {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 10px));
    z-index: 1000005;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: auto;
    max-width: 520px;
    margin: 0 auto;
    padding: 14px;
    box-sizing: border-box;
    border: 2px solid #2b9cff;
    border-radius: 8px;
    background: rgba(17, 18, 20, 0.96);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0;
    transform: translateY(calc(100% + 28px));
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.ios-install-prompt.show {
    opacity: 1;
    transform: translateY(0);
}

.ios-install-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.ios-install-copy {
    min-width: 0;
    flex: 1;
}

.ios-install-title {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
}

.ios-install-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.38;
    color: #e6e8ec;
}

.ios-install-dismiss {
    flex: 0 0 auto;
    min-height: 34px;
    margin: 8px 0 0;
    padding: 7px 11px;
    border: 0;
    border-radius: 6px;
    background: #2b9cff;
    color: #07111b;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
}

.ios-install-dismiss:active {
    transform: scale(0.96);
}

@media (max-width: 430px) {
    .ios-install-prompt {
        gap: 10px;
        padding: 12px;
    }

    .ios-install-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .ios-install-title {
        font-size: 16px;
    }

    .ios-install-text {
        font-size: 13px;
    }
}

@media (max-width: 350px) {
    #menu_content .menu-top-status {
        padding-right: 0;
        padding-left: 0;
        justify-content: space-between;
        gap: 2px;
    }

    #menu_content .menu-top-status .global_online_container {
        flex-basis: 54px;
        width: 54px;
    }

    #menu_content .menu-top-status .global_online_container img {
        width: 34px;
        height: 34px;
    }

    #menu_content .menu-top-status .global_online_container h1 {
        font-size: 20px;
    }

    #menu_content .menu-top-status .menu-currency-status {
        flex: 0 0 111px;
        width: 111px;
    }

    #menu_content .menu-top-status .gp-coin-display {
        flex: 0 0 77px;
        width: 77px;
        min-width: 77px;
        padding-right: 4px;
        padding-left: 4px;
        gap: 2px;
    }

}

@media (min-width: 801px) {
    #menu_content .menu-top-status #top_menu_dropdown {
        top: 14px;
    }

    #menu_content .menu-top-status #leaderboard_menu_button {
        width: 142px;
        height: 41px;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

    #menu_content .menu-top-status .cups-badge {
        right: auto;
        bottom: 10px;
        left: 32px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="2"] {
        left: 25px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="3"] {
        left: 17px;
    }

    #menu_content .menu-top-status .cups-badge[data-digits="4"] {
        left: 6px;
    }
}
