/* ============================================================
   WORLDWIDEGANGSTER – toppbar (header)
   Desktop ≥960px: spelarblock (level + HP/XP), resurser, notiser, språk, profil.
   <960px: kompakta chips (mobile.css) + tunna HP/XP-linjer längs underkanten.
   ============================================================ */

.gwh-appbar.mud-appbar {
    background: linear-gradient(180deg, rgba(13,17,23,.97) 0%, rgba(17,21,28,.97) 100%) !important;
    border-bottom: 1px solid rgba(197,31,31,.35);
    box-shadow: 0 6px 22px rgba(0,0,0,.55);
    /* OBS: ingen backdrop-filter/transform här – det gör appbaren till containing block för
       position:fixed-barn (profil-dropdownen) som då klipps av overflow:hidden. */
    overflow: hidden;
}
.gwh-appbar .mud-toolbar { gap: 0; position: relative; }

.gwh-spacer { flex: 1 1 auto; min-width: 8px; }
.gwh-loading { color: #484f58; font-size: 12px; margin-right: 12px; }

/* ── Spelarblock ── */
.gwh-player {
    display: flex; align-items: center; gap: 12px;
    margin-left: 14px; padding: 5px 14px 5px 6px;
    border-left: 1px solid rgba(255,255,255,.06);
}
.gwh-lvl {
    position: relative; flex: 0 0 auto;
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-decoration: none; line-height: 1;
    background: radial-gradient(circle at 30% 20%, #3a2a0c, #1a1406 70%);
    border: 1px solid #d2992299;
    box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 14px rgba(210,153,34,.25), inset 0 1px 0 rgba(255,255,255,.08);
    transition: transform .15s ease, box-shadow .15s ease;
}
.gwh-lvl:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 18px rgba(210,153,34,.45); }
.gwh-lvl__label { font-size: 8px; font-weight: 800; letter-spacing: 1.5px; color: #b08800; }
.gwh-lvl__num { font-size: 17px; font-weight: 900; color: #ffd166; margin-top: 2px; font-variant-numeric: tabular-nums; }

.gwh-bars { display: flex; flex-direction: column; gap: 5px; width: 190px; }
.gwh-bar__meta { display: flex; justify-content: space-between; align-items: baseline; line-height: 1; margin-bottom: 3px; }
.gwh-bar__name { font-size: 9.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.gwh-bar__val { font-size: 10.5px; font-weight: 800; color: #e6edf3; font-variant-numeric: tabular-nums; }
.gwh-bar__val small { font-size: 9.5px; font-weight: 600; color: #6e7681; }
.gwh-track {
    height: 6px; border-radius: 999px; overflow: hidden;
    background: rgba(255,255,255,.06);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.6);
}
.gwh-fill { height: 100%; border-radius: 999px; transition: width .45s ease; position: relative; }
.gwh-fill::after { /* diskret glans */
    content: ""; position: absolute; inset: 0 0 50% 0; border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0));
}
.gwh-bar--hp .gwh-bar__name { color: #ff6b6b; }
.gwh-bar--hp .gwh-fill { background: linear-gradient(90deg, #b3261e, #ff5c5c); box-shadow: 0 0 8px rgba(255,92,92,.45); }
.gwh-bar--hp.is-low .gwh-fill { animation: gwh-pulse 1.2s ease-in-out infinite; }
.gwh-bar--xp .gwh-bar__name { color: #b69cff; }
.gwh-bar--xp .gwh-fill { background: linear-gradient(90deg, #5b34c7, #a371f7); box-shadow: 0 0 8px rgba(163,113,247,.45); }
@keyframes gwh-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* ── Resurser ── */
.gwh-stats { display: flex; align-items: center; gap: 6px; margin-right: 8px; }
.gwh-stat {
    display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px;
    border-radius: 11px; white-space: nowrap; text-decoration: none; color: #e6edf3;
    background: linear-gradient(180deg, rgba(35,42,51,.9), rgba(22,27,34,.9));
    border: 1px solid #2b313a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    transition: border-color .15s ease, background .15s ease;
}
a.gwh-stat:hover { border-color: #48505c; background: linear-gradient(180deg, rgba(45,52,62,.95), rgba(26,31,39,.95)); }
.gwh-stat__icon { font-size: 15px; line-height: 1; }
.gwh-stat__col { display: flex; flex-direction: column; gap: 3px; }
.gwh-stat__val { font-size: 13px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.gwh-stat__val small { font-size: 10.5px; font-weight: 600; color: #6e7681; }
.gwh-stat__txt { font-size: 12px; font-weight: 700; }
.gwh-mini { display: block; width: 64px; height: 3px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.gwh-mini i { display: block; height: 100%; border-radius: 999px; transition: width .45s ease; }
.gwh-stat--money .gwh-stat__val { color: #3fb950; }
.gwh-money-short { display: none; }
.gwh-stat--dia { border-color: #1a4f78; background: linear-gradient(180deg, #10263a, #0c1a28); }
.gwh-stat--dia .gwh-stat__val { color: #7dd3fc; }
.gwh-stat--zone .gwh-stat__txt { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwh-stat--zone { color: #58a6ff; border-color: #1d3b5e; background: linear-gradient(180deg, #0f2033, #0b1624); }
.gwh-zone-icon { font-size: 17px !important; color: #58a6ff; }
.gwh-stat--jail { color: #ffb86b; border-color: #8a5a1c; background: linear-gradient(180deg, #2a1a08, #1c1206); }

/* ── Ikonknapp (notiser) ── */
.gwh-iconbtn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-right: 6px; border-radius: 11px;
    color: #8b949e; text-decoration: none;
    background: linear-gradient(180deg, rgba(35,42,51,.9), rgba(22,27,34,.9));
    border: 1px solid #2b313a;
    transition: color .15s ease, border-color .15s ease;
}
.gwh-iconbtn:hover { color: #e6edf3; border-color: #48505c; }
.gwh-iconbtn.has-unread { color: #ffd166; border-color: #6b5214; }
.gwh-badge {
    position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: #e5383b; color: #fff; border: 2px solid #0d1117;
    font-size: 9.5px; font-weight: 900; line-height: 13px; text-align: center;
}

/* ── Mobil: HP/XP-linjer längs underkanten ── */
.gwh-mbars { display: none; }

/* Mellanbredd: kompaktera stegvis så inget klipps */
@media (max-width: 1360px) {
    .gwh-money-full { display: none; }
    .gwh-money-short { display: inline; }
    .gwh-stat--zone .gwh-stat__txt { display: none; }
}
@media (max-width: 1180px) {
    .gwh-bars { width: 150px; }
    .gwh-mini { width: 46px; }
    .gwh-stat { padding: 0 10px; }
    .gwh-stat--jail .gwh-stat__txt { display: none; }
}
@media (max-width: 1060px) {
    .gwh-stat--zone { display: none; }
    .gwh-bar__val small { display: none; }
}
@media (max-width: 959.98px) {
    /* Slank list under toppbaren: Lvl-pill (guld) + HP (blodröd) + XP (guld) */
    .gwh-mbars {
        position: fixed; left: 0; right: 0; top: var(--mud-appbar-height, 56px); height: 26px; box-sizing: border-box;
        display: flex; align-items: center; gap: 8px; padding: 0 10px;
        background: linear-gradient(180deg, #0d0b08f2, #0a0806f2); border-bottom: 1px solid #d4af3733;
        backdrop-filter: blur(6px); z-index: 1250;
    }
    .gwh-mbars__lvl {
        flex: 0 0 auto; height: 16px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px;
        background: linear-gradient(180deg, #2c2410, #15110a); border: 1px solid #d4af3799; color: #c9b77a;
        font-size: 10px; font-weight: 700; text-decoration: none; letter-spacing: .02em; white-space: nowrap;
    }
    .gwh-mbars__lvl b { color: #f5d77a; font-weight: 900; }
    .gwh-mbar { position: relative; flex: 1 1 0; min-width: 0; height: 14px; border-radius: 999px; overflow: hidden;
        background: #1a1510; box-shadow: inset 0 0 0 1px #ffffff12, inset 0 1px 2px #0009; }
    .gwh-mbar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; transition: width .45s ease; }
    .gwh-mbar--hp i { background: linear-gradient(180deg, #ff6b6b 0%, #c1121f 55%, #8a0c15 100%); box-shadow: 0 0 8px #e5383b55; }
    .gwh-mbar--hp.is-low i { animation: gwh-hp-pulse 1.4s ease-in-out infinite; }
    .gwh-mbar--xp i { background: linear-gradient(180deg, #ffe7a0 0%, #d4af37 55%, #9c7a1c 100%); box-shadow: 0 0 8px #d4af3755; }
    .gwh-mbar span { position: relative; display: block; text-align: center; line-height: 14px; font-size: 9.5px; font-weight: 800;
        color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
    @keyframes gwh-hp-pulse { 50% { filter: brightness(1.35); } }
    .gw-main-content { padding-top: calc(var(--mud-appbar-height, 56px) + 28px) !important; }
    .gwh-iconbtn { width: 36px; height: 36px; margin-right: 4px; }
}
@media (max-width: 374.98px) {
    .gwh-iconbtn { width: 32px; }
}

/* ── Energi-snabbpanel (EnergyQuickUse) ── */
.gwh-stat--btn,.gw-mchip--btn{font:inherit;color:inherit;cursor:pointer;text-align:left}
.gwh-stat--btn:hover,.gw-mchip--btn:hover{filter:brightness(1.2)}
.eq-backdrop{position:fixed;inset:0;z-index:1390;background:rgba(0,0,0,.45)}
.eq-panel{position:fixed;z-index:1400;top:62px;right:16px;width:min(380px,calc(100vw - 16px));max-height:calc(100vh - 80px);overflow:auto;background:#101010;border:1px solid #d4af37;border-radius:14px;padding:14px;color:#f1ece0;box-shadow:0 10px 40px #000c,0 0 30px #d4af3722}
.eq-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;color:#f5d77a}
.eq-x{background:none;border:0;color:#aaa;font-size:16px;cursor:pointer}
.eq-energy{padding:10px 12px;border-radius:10px;background:#0a0a0a;border:1px solid #2a2415;margin-bottom:10px}
.eq-energy__num{font-size:22px;font-weight:900;color:#ffd54f}.eq-energy__num small{font-size:13px;color:#9a9486}
.eq-bar{height:6px;border-radius:4px;background:#222;overflow:hidden;margin:6px 0}.eq-bar i{display:block;height:100%;background:linear-gradient(90deg,#d29922,#ffd54f)}
.eq-fine{font-size:12px;color:#9a9486;margin:0}
.eq-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.eq-row{display:flex;gap:10px;align-items:center;padding:8px;border:1px solid #2a2415;border-radius:10px;background:#141414}
.eq-row img{width:40px;height:40px;object-fit:cover;border-radius:8px;flex:0 0 40px}
.eq-row__txt{flex:1;min-width:0;font-size:13px}.eq-qty{color:#9a9486;font-weight:600}
.eq-btn{appearance:none;border:1px solid #d4af37;border-radius:9px;padding:8px 14px;min-height:40px;font-weight:900;cursor:pointer;background:linear-gradient(180deg,#f5d77a,#d4af37);color:#1a1405;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.eq-btn:disabled{opacity:.5}.eq-btn--block{width:100%;margin-top:10px}
.eq-link{display:block;margin-top:10px;font-size:13px;color:#f5d77a;text-decoration:none}
.eq-msg{margin-top:10px;padding:8px 10px;border-radius:8px;font-size:13px}.eq-msg.ok{background:#0d1a10;color:#9be9a8}.eq-msg.err{background:#1e0c0b;color:#ffb3ad}
@media (max-width:960px){.eq-panel{top:auto;bottom:0;right:0;left:0;width:100%;max-height:75vh;border-radius:16px 16px 0 0;padding-bottom:calc(14px + env(safe-area-inset-bottom))}}

/* ── Död-panel (/hospital) ── */
.dth{max-width:860px;margin:0 auto;color:#f1ece0}
.dth-hero{text-align:center;padding:28px 18px;border-radius:16px;border:1px solid #6b1510;background:radial-gradient(120% 120% at 50% 0%,#3a0b09 0%,#120a09 60%,#0b0b0b 100%);box-shadow:0 0 40px #c51f1f33}
.dth-skull{font-size:64px;filter:drop-shadow(0 0 18px #f8514988)}
.dth-badge{display:inline-block;margin-top:6px;padding:4px 14px;border-radius:999px;background:#c51f1f;color:#fff;font-weight:900;letter-spacing:3px}
.dth-name{margin:10px 0 4px;font-size:26px;font-weight:900}
.dth-sub{color:#b8a9a0;margin:0 auto 12px;max-width:520px}
.dth-count{font-family:ui-monospace,monospace;font-size:clamp(34px,8vw,56px);font-weight:900;color:#f5d77a;letter-spacing:2px}
.dth-count--ready{color:#56d364;font-size:28px}
.dth-bar{height:8px;border-radius:5px;background:#2a1a18;overflow:hidden;max-width:420px;margin:8px auto}.dth-bar i{display:block;height:100%;background:linear-gradient(90deg,#c51f1f,#d4af37)}
.dth-fine{color:#9a9486;font-size:13px}.dth-center{text-align:center;margin-top:12px}
.dth-msg{margin:12px auto 0;max-width:420px;padding:8px 12px;border-radius:10px;font-size:14px}.dth-msg.ok{background:#0d1a10;color:#9be9a8}.dth-msg.err{background:#1e0c0b;color:#ffb3ad}
.dth-opts{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.dth-opt{display:flex;flex-direction:column;gap:8px;align-items:flex-start;padding:16px;border-radius:14px;border:1px solid #2a2415;background:linear-gradient(180deg,#151515,#0d0d0d)}
.dth-opt--dia{border-color:#d4af37}
.dth-opt__ico{font-size:30px}.dth-opt b{font-size:17px}.dth-opt p{margin:0;color:#b8b0a0;font-size:14px}
.dth-btn{appearance:none;margin-top:auto;width:100%;min-height:44px;border-radius:10px;border:1px solid #d4af37;font-weight:900;font-size:15px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.dth-hero .dth-btn{max-width:320px;margin-top:12px}
.dth-btn--gold{background:linear-gradient(180deg,#f5d77a,#d4af37);color:#1a1405}
.dth-btn--green{background:linear-gradient(180deg,#3fb950,#238636);border-color:#3fb950;color:#fff}
.dth-btn--ghost{background:transparent;color:#f5d77a}
.dth-btn:disabled{opacity:.5}
@media (max-width:600px){.dth-opts{grid-template-columns:1fr}}

/* snabbköp: fyll energin för diamanter */
.eq-refill{display:flex;align-items:center;gap:10px;margin:10px 0;padding:10px 12px;border-radius:12px;border:1px solid #d4af3766;background:linear-gradient(180deg,#221b0d,#0f0c07)}
.eq-refill__txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.eq-refill__txt b{color:#f5d77a}
.eq-dia{flex:0 0 auto;min-width:92px;min-height:40px;padding:8px 12px;border-radius:10px;border:0;background:linear-gradient(180deg,#f5d77a,#d4af37);color:#1a1405;font-weight:900;font-size:15px;cursor:pointer;box-shadow:0 4px 14px #d4af3744}
.eq-dia:hover:not(:disabled){filter:brightness(1.08)}
.eq-dia:disabled{opacity:.5;cursor:default}
.eq-dia--short{background:#15110a;color:#f5d77a;border:1px solid #d4af3799;box-shadow:none}

/* ── Spelare online: liten grön pulserande prick ── */
.gwh-online { display:inline-flex; align-items:center; gap:5px; padding:3px 8px; margin:0 6px; border-radius:999px;
  background:rgba(34,197,94,.08); border:1px solid rgba(34,197,94,.28); color:#bbf7d0; font-size:.78rem; font-weight:700;
  line-height:1; white-space:nowrap; cursor:default; font-variant-numeric:tabular-nums; flex-shrink:0; }
.gwh-online__dot { width:8px; height:8px; border-radius:50%; background:#22c55e; position:relative; display:inline-block; }
.gwh-online__dot::after { content:""; position:absolute; inset:0; border-radius:50%; background:#22c55e; animation:gwh-online-pulse 1.8s ease-out infinite; }
@keyframes gwh-online-pulse { 0% { transform:scale(1); opacity:.7; } 100% { transform:scale(2.6); opacity:0; } }
@media (max-width:959.98px) { .gwh-online { padding:2px 6px; margin:0 3px; font-size:.72rem; gap:4px; } .gwh-online__dot { width:7px; height:7px; } }
@media (prefers-reduced-motion:reduce) { .gwh-online__dot::after { animation:none; } }
