/* ============================================================
   🪙 ВИДЖЕТ МОНЕТ — правый верхний угол
   ============================================================ */
#coinWidget {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* Кнопка-пилюля с монетами */
#coinToggleBtn {
    background: linear-gradient(145deg, #f1c40f, #d4a017);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #1a1a2e;
    cursor: pointer;
    box-shadow: 0 3px 0 #9c7a0c, 0 0 15px rgba(241, 196, 15, 0.4);
    transition: 0.15s;
}

#coinToggleBtn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #9c7a0c;
}

/* Маленькая менюшка */
#coinMenu {
    display: none;
    background: rgba(15, 20, 35, 0.95);
    border: 2px solid #f1c40f;
    border-radius: 16px;
    padding: 12px 16px;
    min-width: 180px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    color: #fff;
}

#coinWidget.coin-open #coinMenu {
    display: block;
}

.coin-menu-title {
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-align: center;
    color: #f1c40f;
}

.coin-menu-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #ddd;
}

.coin-menu-row b { color: #fff; }

#coinResetBtn {
    width: 100%;
    margin-top: 8px;
    background: #c0392b;
    border: none;
    border-radius: 10px;
    padding: 5px;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 0 #78281f;
}
#coinResetBtn:active {
    transform: translateY(2px);
    box-shadow: none;
}

/* Всплывашка "+10 🪙" по центру экрана */
.coin-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.2rem;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.8), 0 2px 4px #000;
    z-index: 9995;
    pointer-events: none;
    animation: coinToast 2s ease forwards;
}

@keyframes coinToast {
    0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
    20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    70%  { opacity: 1; transform: translate(-50%, -60%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -120%) scale(0.9); }
}

/* Пульсация кнопки при получении монет */
@keyframes coinPulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}
#coinWidget.coin-pulse #coinToggleBtn {
    animation: coinPulse 0.6s ease;
}

/* На телефоне сдвигаем игру вниз, чтобы монетки не мешали HUD */
@media (max-width: 768px) {
    #gameScreen { padding: 42px 8px 8px 8px; }
    #coinToggleBtn { font-size: 0.8rem; padding: 4px 10px; }
    .coin-toast { font-size: 1.6rem; }
}