/* ════════════════════════════════════════════════════════════
   BELLOCCO — Herbruikbare UI-componenten
   (los van style.css zodat het overal inzetbaar is)
   ════════════════════════════════════════════════════════════ */

/* ── Reward-popup ─────────────────────────────────────────── */
.cmp-reward-ov {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.cmp-reward-ov.show { opacity: 1; }
.cmp-reward {
  position: relative; width: 100%; max-width: 340px; text-align: center; overflow: hidden;
  padding: 28px 22px 22px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), var(--surface));
  border: 1px solid var(--border-h); box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.95); transition: transform .28s cubic-bezier(.2,.85,.25,1);
}
.cmp-reward-ov.show .cmp-reward { transform: none; }
.cmp-reward.is-ok   { border-color: rgba(243,156,18,.45); }
.cmp-reward.is-fail { border-color: rgba(192,57,43,.45); }

.cmp-reward-burst {
  position: absolute; top: -55%; left: 50%; width: 220%; height: 200%; transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle at 50% 0, rgba(243,156,18,.28), transparent 58%);
}
.cmp-reward.is-fail .cmp-reward-burst { background: radial-gradient(circle at 50% 0, rgba(192,57,43,.28), transparent 58%); }

.cmp-reward-badge {
  position: relative; width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.85rem; color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--accent));
  box-shadow: 0 10px 28px rgba(243,156,18,.4);
  animation: cmp-pop .45s cubic-bezier(.2,.85,.25,1);
}
.cmp-reward.is-fail .cmp-reward-badge { background: linear-gradient(135deg, #7a1c12, var(--accent)); box-shadow: 0 10px 28px rgba(192,57,43,.4); }
@keyframes cmp-pop { 0% { transform: scale(0) rotate(-12deg); } 65% { transform: scale(1.18) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }

.cmp-reward-title { position: relative; font-size: 1.25rem; font-weight: 900; color: #fff; letter-spacing: -.3px; }
.cmp-reward-sub { position: relative; font-size: .78rem; color: var(--muted); margin-top: 4px; }

.cmp-reward-items { position: relative; display: flex; justify-content: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.cmp-reward-item {
  flex: 1; min-width: 100px; background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 13px; padding: 13px 8px; animation: cmp-rise .4s ease backwards;
}
.cmp-reward-item:nth-child(2) { animation-delay: .08s; }
.cmp-reward-item:nth-child(3) { animation-delay: .16s; }
@keyframes cmp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cmp-reward-ico { font-size: 1.15rem; }
.cmp-reward-val { display: block; font-size: 1.05rem; font-weight: 900; color: #fff; margin-top: 5px; font-variant-numeric: tabular-nums; }
.cmp-reward-lab { display: block; font-size: .58rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-top: 2px; }

.cmp-reward-note { position: relative; font-size: .74rem; color: var(--muted); margin-bottom: 16px; }
.cmp-reward-ok { position: relative; width: 100%; justify-content: center; }

/* ── Gevangenis (herbruikbaar) ───────────────────────────── */
/* Split-layout: hoofdinhoud + zijbalk */
.cmp-split { display: grid; grid-template-columns: 1fr 320px; gap: 10px; align-items: start; }
.cmp-split.rev { grid-template-columns: 340px 1fr; }   /* smalle linkerkant, brede rechterkant */
.cmp-split-side { display: flex; flex-direction: column; gap: 10px; }

/* Lijst met rijen (gevangene/positie/waarde/actie) */
.cmp-list { padding: 6px 8px 8px; }
.cmp-list-head, .cmp-list-row { display: grid; grid-template-columns: 1fr 70px 56px 120px; align-items: center; gap: 10px; }
.cmp-list-head { padding: 6px 10px; font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted2); }
.cmp-list-row { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.02); margin-top: 6px; }
.cmp-list-row:hover { background: rgba(255,255,255,.04); }
.cmp-list-row.is-self { border-color: rgba(241,196,15,.4); background: rgba(241,196,15,.06); }
.cmp-list-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cmp-list-name { font-weight: 700; font-size: .8rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-list-time { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-list-chance { font-size: .82rem; font-weight: 800; color: var(--gold); }
.cmp-list-act { text-align: right; }
.cmp-list-act .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Generieke avatar-cirkel met initialen */
.cmp-ava { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .64rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #555, #2a2a33); border: 1px solid var(--border); }
.cmp-ava.sm { width: 26px; height: 26px; font-size: .56rem; }
.cmp-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Intro-tekst boven een paneel */
.cmp-intro { padding: 14px 16px; font-size: .76rem; color: var(--muted); border-bottom: 1px solid var(--border); line-height: 1.45; }
.cmp-intro strong { color: var(--gold); }

/* Stat-tegel (icoon | label+sub | waarde) */
.cmp-stat { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid rgba(255,255,255,.05); }
.cmp-stat:last-child { border-bottom: none; }
.cmp-stat-ico { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); border: 1px solid var(--border); font-size: .85rem; }
.cmp-stat-body { flex: 1; min-width: 0; }
.cmp-stat-label { display: block; font-weight: 800; font-size: .8rem; color: #fff; }
.cmp-stat-sub { display: block; font-size: .62rem; color: var(--muted); }
.cmp-stat-val { font-size: 1.05rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }

/* Ranglijst / leaderboard */
.cmp-leader { padding: 6px 8px 10px; }
.cmp-leader-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; }
.cmp-leader-row:hover { background: rgba(255,255,255,.03); }
.cmp-leader-rank { font-size: .72rem; font-weight: 900; color: var(--gold); width: 22px; }
.cmp-leader-name { flex: 1; font-weight: 700; font-size: .78rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-leader-count { font-size: .78rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: .78rem; }

/* ── DRUGS: compacte tabellen ── */
/* Wrapper telt niet mee in de layout: tabel staat direct in de kaart (overal). */
.dtable-wrap { display: contents; }
/* Rijen als losse balkjes met gaps ertussen (zoals .boxnew-stat). */
.dtable { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.dtable thead th { text-align: left; padding: 8px 14px; font-size: .58rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; white-space: nowrap;
  color: #b4b9c0;
  /* graniet-balkje als achtergrond op de kop (lichter) */
  background:
    radial-gradient(120% 180% at 50% 0%, rgba(255,255,255,.06), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); }
.dtable thead th:first-child { border-radius: 4px 0 0 4px; }
.dtable thead th:last-child  { border-radius: 0 4px 4px 0; }
.dtable td { padding: 5px 12px; border: none; font-size: .72rem; vertical-align: middle; background: rgba(255,255,255,.022); }
.dtable tbody td:first-child { border-radius: 4px 0 0 4px; }
.dtable tbody td:last-child  { border-radius: 0 4px 4px 0; }
.dtable tbody tr:hover td { background: rgba(255,255,255,.045); }
.dt-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.dt-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem; flex-shrink: 0; }
.dt-ava { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .72rem; flex-shrink: 0; }
.dt-strong { font-weight: 800; }
.dt-sub { display: block; font-size: .64rem; color: var(--muted); font-weight: 500; }
.dt-sub.vibe { font-style: italic; color: var(--muted2); }
/* Een <td class="dt-sub"> moet een tabelcel blijven, niet display:block (anders breekt de rij-uitlijning). */
.dtable td.dt-sub { display: table-cell; }
.dt-right { text-align: right; }
.dt-price { font-weight: 900; color: var(--gold); white-space: nowrap; }
.dt-delta { font-weight: 800; }
.dt-actions { display: flex; gap: 6px; justify-content: flex-end; }
.dt-actions .btn { padding: 6px 10px; }

/* ── ONLINE: spelers-grid (naast elkaar) ── */
.online-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 6px; padding: 12px 14px; }
.online-chip { display: flex; align-items: center; gap: 7px; padding: 4px 4px; text-decoration: none; color: inherit; min-width: 0; }
.online-chip:hover .oc-name { color: #2ecc71; }
.oc-ava { position: relative; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .56rem; font-weight: 800; color: #fff; }
.oc-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.oc-ava .oc-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: #2ecc71; border: 2px solid #15151b; }
.oc-name { min-width: 0; font-weight: 700; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 560px) { .online-grid { grid-template-columns: 1fr 1fr; padding: 10px; } }

@media (max-width: 900px) { .cmp-split, .cmp-split.rev { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .cmp-list-head { display: none; }
  .cmp-list-row { grid-template-columns: 1fr auto auto; }
  .cmp-list-time { display: none; }
  .dtable td, .dtable thead th { padding: 8px 10px; }
  /* hoge specificiteit zodat dit wint van .dtable td.dt-sub (table-cell) */
  .dtable td.dt-sub.hide-sm, .dtable .hide-sm { display: none; }
}
