/* ===============================
   WORLD CAPITAL — GAME FOOTER HUD
================================ */

.game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 52px;
    background: linear-gradient(180deg, #0b1220 0%, #070c17 100%);
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 3000;
    color: #fff;
    font-size: 13px;
    gap: 12px;
    flex-wrap: nowrap;
}

main, .game-content { padding-bottom: 70px; }

/* ── SEZIONI ────────────────────────────────────────────── */
.footer-section {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.footer-section.footer-system {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 140px;
}

.footer-section.footer-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.footer-title {
    font-size: 10px;
    opacity: 0.5;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .06em;
    white-space: nowrap;
}

.footer-text {
    font-size: 12px;
    opacity: 0.85;
    white-space: nowrap;
}

/* ── CENTRO ─────────────────────────────────────────────── */
.footer-balance-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;
}

.player-type-inline {
    font-size: 12px;
    font-weight: 600;
    color: #2ecc71;
    white-space: nowrap;
}

.player-type-inline strong {
    background: rgba(46,204,113,.15);
    padding: 3px 8px;
    border-radius: 6px;
}

.patrimony-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}

.footer-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffd54f;
    white-space: nowrap;
}

.footer-separator {
    opacity: 0.25;
    font-weight: 600;
    flex-shrink: 0;
}

/* ── BOTTONI ────────────────────────────────────────────── */
.footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,.12);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-btn:hover {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.3);
}

.footer-btn.logout {
    background: rgba(192,57,43,.5);
    border-color: rgba(231,76,60,.3);
}

.footer-btn.logout:hover { background: rgba(231,76,60,.7); }

.chat-btn {
    background: rgba(22,160,133,.2) !important;
    border-color: rgba(26,188,156,.3) !important;
}

.chat-btn:hover {
    background: rgba(22,160,133,.4) !important;
}

.notif-btn {
    background: rgba(37,99,235,.2) !important;
    border-color: rgba(59,130,246,.3) !important;
}

.notif-btn:hover {
    background: rgba(37,99,235,.35) !important;
}

/* ── BADGE ──────────────────────────────────────────────── */
.chat-badge,
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    padding: 0 3px;
    border-radius: 50%;
    line-height: 1;
}

.notif-badge.pulse { animation: pulse-badge .4s ease; }

@keyframes pulse-badge {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .game-footer {
        flex-wrap: wrap;
        min-height: auto;
        padding: 6px 12px;
        gap: 6px;
    }

    /* Notifiche e chat nella riga superiore */
    .footer-balance-row {
        order: 1;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        border-bottom: 1px solid rgba(255,255,255,.06);
        padding-bottom: 5px;
    }

    .footer-section.footer-system {
        order: 2;
        min-width: auto;
    }

    .footer-section.footer-actions {
        order: 3;
        margin-left: auto;
    }

    .footer-title { display: none; }
    .footer-separator { display: none; }

    .patrimony-inline { font-size: 11px; }
    .footer-value { font-size: 14px; }
    .player-type-inline { font-size: 11px; }

    main, .game-content { padding-bottom: 100px; }
}

@media (max-width: 600px) {
    .footer-section.footer-system { display: none; }
    .footer-value { font-size: 13px; }
    .footer-btn { padding: 4px 8px; font-size: 11px; }
}

/* ── PANNELLO NOTIFICHE ─────────────────────────────────── */
.notif-panel {
    position: fixed;
    bottom: 60px;
    right: 16px;
    width: 360px;
    max-height: 460px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 32px rgba(0,0,0,.35);
    border: 1px solid #1f2640;
    z-index: 7000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #0f172a;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-panel-actions { display: flex; gap: 8px; align-items: center; }

.notif-read-all {
    background: rgba(255,255,255,.12);
    border: none; color: #fff; font-size: 11px;
    padding: 3px 10px; border-radius: 6px; cursor: pointer;
}

.notif-read-all:hover { background: rgba(255,255,255,.25); }

#notifClose {
    background: none !important; border: none !important;
    color: rgba(255,255,255,.5) !important; font-size: 18px !important;
    cursor: pointer !important; padding: 0 !important;
}

.notif-list { overflow-y: auto; flex: 1; }

.notif-loading, .notif-empty {
    padding: 24px; text-align: center; color: #94a3b8; font-size: 13px;
}

.notif-item {
    display: flex; gap: 10px; padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9; cursor: pointer;
    transition: background .12s; position: relative;
    background: #fff; color: #111;
}

.notif-item:hover  { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item.urgent { border-left: 3px solid #ef4444; }

.notif-item-icon   { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.notif-item-body   { flex: 1; min-width: 0; }
.notif-item-title  { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.notif-item-msg    { font-size: 12px; color: #64748b; line-height: 1.4; margin-bottom: 3px; }
.notif-item-action { display: inline-block; font-size: 12px; color: #2563eb; font-weight: 600; text-decoration: none; }
.notif-item-time   { font-size: 11px; color: #94a3b8; }

.notif-dot {
    position: absolute; top: 14px; right: 12px;
    width: 7px; height: 7px; background: #3b82f6; border-radius: 50%;
}

/* ── POPUP URGENTE ──────────────────────────────────────── */
.notif-popup {
    position: fixed; top: 80px; right: 20px; width: 340px;
    background: #fff; border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
    border: 1px solid #e2e8f0; z-index: 9999;
    animation: slideInRight .3s ease; overflow: hidden; display: none;
}

.notif-popup.urgent { border-left: 4px solid #ef4444; }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.notif-popup-inner {
    display: flex; gap: 10px; padding: 14px 16px; align-items: flex-start;
}

.notif-popup-icon  { font-size: 22px; flex-shrink: 0; }
.notif-popup-content { flex: 1; min-width: 0; }
.notif-popup-title { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 3px; }
.notif-popup-msg   { font-size: 12px; color: #475569; line-height: 1.4; }

.notif-popup-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

.notif-popup-btn {
    background: #15803d; border: none; color: #fff;
    font-size: 11px; font-weight: 600; padding: 5px 10px;
    border-radius: 6px; cursor: pointer; white-space: nowrap;
}

.notif-popup-dismiss {
    background: none; border: none; color: #94a3b8;
    font-size: 16px; cursor: pointer; padding: 0; line-height: 1;
}

.notif-popup-dismiss:hover { color: #475569; }