/* ===== Mafia City - thème noir & or ===== */
:root {
  --bg: #0e0d0b; --panel: #1a1815; --panel2: #232019; --border: #3a3326;
  --gold: #c9a24b; --gold2: #e8c877; --text: #e6dfd0; --muted: #9a917f;
  --red: #b3342b; --green: #4f9a4a; --blue: #4a7fb3;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg) radial-gradient(ellipse at top, #231c12 0%, var(--bg) 60%) no-repeat; color: var(--text);
  font: 14px/1.5 Georgia, 'Times New Roman', serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--gold); font-weight: normal; letter-spacing: .5px; }
h1 { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-top: 0; }

.topbar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 20px;
  background: linear-gradient(#1f1b14, #120f0b); border-bottom: 2px solid var(--gold); }
.logo { font-size: 26px; color: var(--gold); font-variant: small-caps; letter-spacing: 3px; text-shadow: 0 0 8px rgba(201,162,75,.4); }
.logo:hover { text-decoration: none; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; font-size: 13px; }
.stats span { background: var(--panel2); padding: 3px 9px; border-radius: 3px; border: 1px solid var(--border); }
.userbox { display: flex; gap: 10px; align-items: center; }
.badge-link { position: relative; }
.badge { position: absolute; top: -8px; right: -10px; background: var(--red); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; }

.layout { display: flex; flex: 1; max-width: 1300px; width: 100%; margin: 0 auto; }
.layout.guest { justify-content: center; }
.sidebar { width: 200px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border); padding: 10px 0; }
.sidebar h4 { margin: 12px 14px 4px; color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
.sidebar a { display: block; padding: 5px 16px; color: var(--text); }
.sidebar a:hover { background: var(--panel2); color: var(--gold2); text-decoration: none; }
.admin-link { color: var(--red) !important; }
.content { flex: 1; padding: 20px 26px; min-width: 0; }

.box { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 14px 18px; margin-bottom: 18px; }
.box h2, .box h3 { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }

table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
th { background: var(--panel2); color: var(--gold); text-align: left; font-weight: normal; }
th, td { padding: 7px 9px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: rgba(201,162,75,.04); }

input, select, textarea { background: #0f0d0a; color: var(--text); border: 1px solid var(--border); padding: 6px 8px; border-radius: 3px; font: inherit; }
textarea { width: 100%; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--gold); }
button, .btn { background: linear-gradient(#b8923f, #8a6a26); color: #120f0b; border: 1px solid var(--gold2); padding: 6px 14px; border-radius: 3px;
  cursor: pointer; font: bold 13px Georgia, serif; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.15); text-decoration: none; }
button.red, .btn.red { background: linear-gradient(#c9453b, #8a221b); color: #fff; border-color: #e0685f; }
button.small, .btn.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }
.form-row { margin-bottom: 10px; }
.form-row label { display: block; color: var(--muted); margin-bottom: 3px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email], .form-row input[type=number] { width: 100%; max-width: 360px; }

.alert { padding: 10px 14px; border-radius: 3px; margin-bottom: 14px; border: 1px solid; }
.alert.success { background: #16261a; border-color: var(--green); color: #a9dba4; }
.alert.error { background: #2a1412; border-color: var(--red); color: #f0a49c; }
.alert.info { background: #131e29; border-color: var(--blue); color: #a8c8e8; }

.muted { color: var(--muted); }
.green { color: #7fcf78; } .red-t { color: #e8766c; } .gold { color: var(--gold2); }
.u-admin { color: #e8766c; font-weight: bold; } .u-modo { color: #7fb3e8; } .u-user { color: var(--gold2); }
.online { color: #7fcf78; font-size: 11px; }
.bar { background: #0f0d0a; border: 1px solid var(--border); height: 14px; border-radius: 7px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, #8a6a26, var(--gold2)); }
.bar.hp > div { background: linear-gradient(90deg, #8a221b, #d4574c); }
.tag { font-size: 11px; background: var(--panel2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; }
.pagination a, .pagination b { margin-right: 6px; }
.chat-box { max-height: 280px; overflow-y: auto; font-size: 13px; }
.chat-box p { margin: 3px 0; }
.post { border: 1px solid var(--border); margin-bottom: 10px; display: flex; }
.post .author { width: 150px; background: var(--panel2); padding: 10px; flex-shrink: 0; font-size: 13px; }
.post .body { padding: 10px; flex: 1; word-wrap: break-word; min-width: 0; }
.hero { text-align: center; padding: 30px 10px; }
.hero h1 { border: 0; font-size: 42px; font-variant: small-caps; letter-spacing: 4px; margin-bottom: 0; }
.footer { text-align: center; padding: 14px; color: var(--muted); border-top: 1px solid var(--border); font-size: 12px; margin-top: 20px; }
.patch { border-left: 3px solid var(--gold); }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar h4 { width: 100%; }
  .sidebar a { padding: 4px 10px; }
  .content { padding: 14px; }
  .post { flex-direction: column; } .post .author { width: 100%; }
  table { font-size: 12px; }
}

/* ===== Inventaire (v1.1.0) ===== */
.stats a { background: var(--panel2); padding: 3px 9px; border-radius: 3px; border: 1px solid var(--border); color: var(--text); }
.nowrap { white-space: nowrap; }
.inv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-top: 2px solid var(--gold); border-radius: 4px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat-card span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.stat-card b { font-size: 24px; color: var(--gold2); font-weight: normal; }
.inv-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.slot { display: flex; gap: 12px; background: #0f0d0a; border: 1px dashed var(--border); border-radius: 4px; padding: 12px; }
.slot.filled { border-style: solid; background: linear-gradient(135deg, #1f1a12, #120f0b); }
.slot-icon { font-size: 30px; width: 54px; height: 54px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px solid var(--gold); border-radius: 4px; }
.slot-body h4 { margin: 2px 0 6px; color: var(--text); font-weight: normal; font-size: 16px; }
.slot-body p { margin: 0 0 8px; }
.inv-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.item-card { background: #0f0d0a; border: 1px solid var(--border); border-radius: 4px; padding: 10px; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.item-card:hover { border-color: var(--gold); }
.item-icon { font-size: 34px; position: relative; }
.item-icon .qty { position: absolute; right: 4px; bottom: 0; font-size: 12px; background: var(--gold); color: #120f0b; border-radius: 8px; padding: 0 6px; font-weight: bold; }
.mini-equip { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mini-equip span { background: #0f0d0a; border: 1px solid var(--border); border-radius: 3px; padding: 2px 8px; font-size: 13px; }

/* ===== Maisons (v1.2.0) ===== */
.btn-ghost { background: var(--panel2); color: var(--gold2); border-color: var(--border); }
.house-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.house-card { background: linear-gradient(160deg, #1f1a12, #120f0b); border: 1px solid var(--border); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.house-card:hover { border-color: var(--gold); }
.house-card.locked { opacity: .5; }
.house-card h3 { margin: 0; font-size: 17px; }
.house-card p { margin: 0; }
.house-card table { font-size: 13px; margin: 4px 0; }
.house-card form { margin-top: auto; padding-top: 6px; }
.house-icon { font-size: 40px; }
.levels { display: flex; gap: 4px; }
.levels span { flex: 1; height: 6px; background: #0f0d0a; border: 1px solid var(--border); border-radius: 3px; }
.levels span.on { background: linear-gradient(90deg, #8a6a26, var(--gold2)); border-color: var(--gold); }

/* ===== Prêts (v1.3.0) ===== */
.loan-card { border: 1px solid var(--border); border-radius: 4px; padding: 12px; background: #0f0d0a; }
.loan-card.late { border-color: var(--red); background: #1c0f0d; animation: pulse-red 2s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 12px rgba(179,52,43,.5); } }

/* ===== Prison en direct (v1.3.1) ===== */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7fcf78; margin-right: 4px; animation: live 1.5s infinite; }
@keyframes live { 50% { opacity: .2; } }
.alert.freed { font-size: 16px; animation: freed-in .6s ease-out; }
@keyframes freed-in { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Délais qui se débloquent tout seuls (v1.3.4) ===== */
.cd-flash { animation: freed-in .5s ease-out; }
button.cd-ready { animation: cd-pulse 1s ease-out 3; }
@keyframes cd-pulse { 50% { box-shadow: 0 0 14px var(--gold2); } }

/* ===== Boîte à idées (v1.4.0) ===== */
.badge-inline { background: var(--red); color: #fff; font-size: 11px; border-radius: 8px; padding: 0 6px; }
.sugg { display: flex; gap: 14px; border-left: 3px solid var(--gold); }
.sugg-accepted, .sugg-done { border-left-color: var(--green); }
.sugg-refused { border-left-color: var(--red); opacity: .8; }
.sugg-votes form { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
.sugg-body { flex: 1; min-width: 0; }
.sugg-body h3 { margin-bottom: 2px; }
.sugg-body p { margin: 4px 0; word-wrap: break-word; }
.vote-btn { background: var(--panel2); color: var(--muted); border: 1px solid var(--border); padding: 2px 10px; font-size: 12px; }
.vote-btn.on { background: var(--gold); color: #120f0b; }
.sugg-reply { background: #0f0d0a; border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; margin: 8px 0; }
.sugg-admin { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.sugg-admin select { max-width: 100%; }

/* ===== Battle Pass (v1.5.0) ===== */
.bp-link { color: var(--gold2) !important; font-weight: bold; }
.bp-hero { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: center; margin-bottom: 18px; padding: 18px 22px;
  border: 1px solid var(--gold); border-radius: 6px; background: linear-gradient(120deg, #2a2112, #120f0b 60%); }
.bp-hero.is-premium { box-shadow: 0 0 18px rgba(232,200,119,.25); }
.bp-hero h2 { margin: 2px 0; }
.bp-hero p { margin: 0; }
.bp-level { text-align: center; background: #0f0d0a; border: 2px solid var(--gold); border-radius: 50%; width: 92px; height: 92px;
  display: flex; flex-direction: column; justify-content: center; }
.bp-level span { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 1px; }
.bp-level b { font-size: 30px; color: var(--gold2); line-height: 1; font-weight: normal; }
.bp-level small { color: var(--muted); }
.bp-prog { grid-column: 1 / -1; }
.bp-prog .bar { height: 16px; }
.bp-perks { padding-left: 18px; margin: 6px 0 12px; }
.bp-track-box { padding: 10px; }
.bp-track { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scroll-behavior: smooth; }
.bp-col { flex: 0 0 132px; display: flex; flex-direction: column; gap: 6px; }
.bp-labels { flex: 0 0 90px; position: sticky; left: 0; z-index: 2; background: var(--panel); }
.bp-lvl { text-align: center; font-weight: bold; color: var(--muted); border-bottom: 3px solid var(--border); padding: 4px; }
.bp-col.reached .bp-lvl { color: var(--gold2); border-bottom-color: var(--gold); }
.bp-col.next .bp-lvl { color: var(--text); border-bottom-color: var(--text); }
.bp-cell { min-height: 118px; background: #0f0d0a; border: 1px solid var(--border); border-radius: 4px; padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.bp-cell.prem { background: linear-gradient(160deg, #241c0e, #0f0d0a); border-color: #5a4a26; }
.bp-label { justify-content: center; align-items: center; font-weight: bold; color: var(--muted); }
.bp-label.prem { color: var(--gold2); }
.bp-reward { text-align: center; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bp-reward .ico { font-size: 26px; }
.bp-reward .lbl { line-height: 1.2; min-height: 30px; }
.bp-reward.done { opacity: .45; }
.bp-reward.can .ico { animation: cd-pulse 1.5s infinite; border-radius: 50%; }
@media (max-width: 800px) { .bp-hero { grid-template-columns: 1fr; } .bp-level { margin: 0 auto; } }

/* ===== Vols de voitures (v1.6.0) ===== */
.car-pool { background: #0f0d0a; border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; align-self: start; }
.car-pool summary { cursor: pointer; }
.car-pool table { margin-top: 8px; font-size: 13px; }

/* ===== Territoires & salle de sport (v1.7.0) ===== */
.turf { border-left: 3px solid var(--border); }
.turf-own { border-left-color: var(--green); box-shadow: inset 0 0 0 1px rgba(79,154,74,.35); }
.turf-enemy { border-left-color: var(--red); }
.turf p { font-size: 13px; }

/* ===== Wipe (v1.7.1) ===== */
.danger-zone { border-color: var(--red); background: #1c0f0d; }
.danger-zone h3 { color: #e8766c; }
.wipe-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 14px; }

/* ===== Bourse (v1.8.0) ===== */
.stock-head { display: grid; grid-template-columns: 1.4fr .8fr 1.2fr; gap: 14px; align-items: center; }
.stock-price { text-align: right; }
.stock-price b { font-size: 20px; }
.stock-chart { text-align: center; }
.spark { width: 100%; height: 50px; display: block; background: #0f0d0a; border: 1px solid var(--border); border-radius: 3px; }
.stock-actions { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.stock-actions > div { width: 100%; font-size: 13px; }
@media (max-width: 800px) { .stock-head { grid-template-columns: 1fr 1fr; } .stock-chart { grid-column: 1 / -1; } }

/* ===== Culture (v1.9.0) ===== */
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.plant { background: #0f0d0a; border: 1px solid var(--border); border-radius: 4px; padding: 6px; text-align: center; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.plant-ico { font-size: 28px; }
.plant.ready { border-color: var(--green); box-shadow: 0 0 8px rgba(79,154,74,.35); }
.plant.rotten { border-color: var(--red); opacity: .7; }
.plant.empty { border-style: dashed; opacity: .6; }
.plant .bar { height: 8px; }

/* ===== Anti-bot (v1.9.1) ===== */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.captcha-img { border: 1px solid var(--border); border-radius: 4px; vertical-align: middle; }
.captcha-refresh { font-size: 20px; vertical-align: middle; text-decoration: none; }

/* ===== Deal de rue (v2.0.0) ===== */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 18px; }
.client-card { background: linear-gradient(160deg, #1f1a12, #120f0b); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 4px; padding: 12px; animation: freed-in .4s ease-out; }
.client-card p { margin: 6px 0; }
.client-wholesale { border-left-color: var(--gold); }
.client-vip { border-left-color: var(--green); box-shadow: 0 0 10px rgba(79,154,74,.25); }
.client-card.suspicious { border-left-color: var(--red); }
.client-head { display: flex; gap: 10px; align-items: center; }
.client-ico { font-size: 34px; }
.client-line { font-style: italic; color: var(--muted); font-size: 13px; }
.client-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Deal de rue : cartes clients (v2.0.1) ===== */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.deal { display: flex; flex-direction: column; background: linear-gradient(170deg, #221c13 0%, #15120d 100%); border: 1px solid var(--border);
  border-top: 4px solid #6b5a3a; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.35); animation: freed-in .35s ease-out; }
.deal-wholesale { border-top-color: var(--gold); }
.deal-vip { border-top-color: #7fcf78; box-shadow: 0 0 16px rgba(127,207,120,.15), 0 4px 14px rgba(0,0,0,.35); }
.deal-sus { border-top-color: var(--red); }
.deal-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px 8px; }
.deal-avatar { width: 52px; height: 52px; flex-shrink: 0; border-radius: 50%; background: #0f0d0a; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 28px; }
.deal-vip .deal-avatar { border-color: #7fcf78; }
.deal-wholesale .deal-avatar { border-color: var(--gold); }
.deal-who { flex: 1; min-width: 0; }
.deal-name { font-size: 16px; color: var(--text); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-tags { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.deal-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; border: 1px solid var(--border); background: #0f0d0a; color: var(--muted); }
.badge-wholesale { color: var(--gold2); border-color: #6b5a3a; }
.badge-vip { color: #7fcf78; border-color: #3f6b3a; }
.badge-sus { color: #e8766c; border-color: #6b2a24; }
.deal-timer { font-size: 12px; white-space: nowrap; background: #0f0d0a; border: 1px solid var(--border); border-radius: 12px; padding: 3px 9px; color: var(--muted); }
.deal-timer.urgent { color: #e8766c; border-color: #6b2a24; }
.deal-quote { margin: 0 14px 10px; padding: 6px 10px; font-style: italic; font-size: 13px; color: #c9bfa9; border-left: 2px solid var(--border); background: rgba(0,0,0,.2); }
.deal-order { margin: 0 14px; padding: 10px 12px; background: #0f0d0a; border: 1px solid var(--border); border-radius: 6px; }
.deal-product { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.deal-qty { font-size: 22px; color: var(--gold2); font-weight: bold; }
.deal-drug { font-size: 18px; color: var(--text); }
.deal-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.deal-prices small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.deal-prices b { font-size: 16px; }
.deal-stock { margin: 10px 14px 0; font-size: 13px; padding: 6px 10px; border-radius: 6px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.deal-stock.ok { background: #16261a; color: #a9dba4; }
.deal-stock.partial { background: #2a2312; color: var(--gold2); }
.deal-stock.none { background: #2a1412; color: #f0a49c; }
.deal-gain { font-weight: bold; }
.deal-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px 14px 14px; margin-top: auto; }
.deal-btn { padding: 8px 4px; font-size: 12px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-btn.sell { background: linear-gradient(#5aa653, #3b7a35); border-color: #7fcf78; color: #fff; }
.deal-btn.haggle { background: linear-gradient(#b8923f, #8a6a26); }
.deal-btn.refuse { background: #2a2420; color: var(--muted); border-color: var(--border); }
.deal-btn.refuse:hover { color: #e8766c; border-color: #6b2a24; }
@media (max-width: 800px) { .client-grid { grid-template-columns: 1fr; } }
