:root {
  --bg: #0a0a0c;
  --bg2: #121216;
  --bg3: #1a1a20;
  --line: #26262e;
  --text: #f2f0ea;
  --muted: #8d8b95;
  --orange: #f7931a;
  --orange2: #ffb347;
  --volt: #ffe14d;
  --red: #ff4d5e;
  --green: #3ddc84;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --pixel: "Silkscreen", var(--mono);
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --top: 64px;
  --foot: 38px; /* bandeau du bas (compte X) */
  --left: 0px;
  --right: 310px;
}
body.light {
  --bg: #f6f4ef;
  --bg2: #ffffff;
  --bg3: #eceae4;
  --line: #dedbd3;
  --text: #16151a;
  --muted: #6b6974;
}
body.light .topbar { background: rgba(255, 255, 255, .92); }
body.light .hud { background: rgba(255,255,255,.95); }
body.light .btn.bomb { background: #fff0f1; color: #8a1020; border-color: #f2b8bf; }
body.light .editor-frame { background-color: #e9e7e1; background-image: linear-gradient(45deg, #dedbd3 25%, transparent 25%, transparent 75%, #dedbd3 75%), linear-gradient(45deg, #dedbd3 25%, transparent 25%, transparent 75%, #dedbd3 75%); }
body.light .bomb-ctl { background: #fff5f6; border-color: #f2b8bf; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px;
  padding: 0 18px; background: rgba(10, 10, 12, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: auto; height: 44px; flex: none; image-rendering: auto; filter: drop-shadow(0 0 10px rgba(247,147,26,.35)); }
.brand h1 { font-family: var(--pixel); font-weight: 700; font-size: 17px; letter-spacing: .5px; margin: 0; white-space: nowrap; text-transform: uppercase; }
.tagline { margin: 2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.actions { display: flex; gap: 10px; align-items: center; justify-self: end; }
.lang { background: none; border: 1px solid var(--line); color: var(--muted); padding: 7px 9px; font-family: var(--mono); font-size: 11px; cursor: pointer; }
.lang:hover { color: var(--text); border-color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--bg3); color: var(--text);
  padding: 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #140b00; box-shadow: 0 0 0 0 rgba(247,147,26,.0); }
.btn.primary:hover { background: var(--orange2); box-shadow: 0 0 24px rgba(247,147,26,.35); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn.big { width: 100%; padding: 14px; font-size: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.zap { filter: saturate(0) brightness(.2); }

/* ---------- Stage ---------- */
main#stage { position: fixed; top: var(--top); bottom: 0; left: var(--left); right: var(--right); background: #050506; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#view.dragging { cursor: grabbing; }
#view.selecting { cursor: crosshair; }
#view.link { cursor: pointer; }

.select-hint {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 12px; align-items: center; padding: 8px 10px 8px 14px;
  background: var(--orange); color: #140b00; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: calc(100% - 24px);
}
.select-hint .btn { color: #140b00; border-color: rgba(0,0,0,.35); }


.close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.close:hover { color: var(--text); }

.hud {
  position: absolute; left: 14px; bottom: calc(var(--foot) + 10px); z-index: 5; display: flex; align-items: center; gap: 4px;
  background: rgba(18,18,22,.9); border: 1px solid var(--line); padding: 4px; font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.hud button { width: 30px; height: 30px; background: var(--bg3); border: 0; cursor: pointer; font-size: 16px; }
.hud button:hover { background: var(--line); }
.hud span { padding: 0 6px; white-space: nowrap; }
.hint-help { font-size: 11px; color: var(--muted); font-family: var(--mono); pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Panel ---------- */
.panel {
  position: fixed; top: var(--top); right: 0; bottom: 0; width: 380px; z-index: 15;
  background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto; padding: 18px 20px 28px;
  box-shadow: -20px 0 60px rgba(0,0,0,.45);
}
.panel-head { position: relative; margin-bottom: 14px; }
.panel h2 { font-family: var(--pixel); font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: .5px; }
.panel .close { top: -4px; right: -4px; }
.rect-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rect-inputs label { font-family: var(--mono); font-size: 10px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rect-inputs input { width: 100%; }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); padding: 8px; min-width: 0; outline: none; color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
.rect-inputs input { font-family: var(--mono); font-size: 13px; padding: 7px 6px; }
.price { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 4px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); }
.price b { font-family: var(--mono); font-size: 26px; color: var(--orange); }
.price span { color: var(--muted); font-size: 13px; }
.price small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.error { color: var(--red); font-size: 12px; margin: 6px 0; }

.editor { margin: 14px 0; }
.editor-frame {
  display: flex; align-items: center; justify-content: center; height: 230px; padding: 10px;
  background-color: #0e0e12;
  background-image: linear-gradient(45deg, #15151a 25%, transparent 25%, transparent 75%, #15151a 75%), linear-gradient(45deg, #15151a 25%, transparent 25%, transparent 75%, #15151a 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px; border: 1px solid var(--line);
}
#edCanvas { image-rendering: pixelated; image-rendering: crisp-edges; cursor: crosshair; touch-action: none; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.tools { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tools select { padding: 6px 8px; font-size: 12px; }
input[type="color"] { width: 38px; height: 32px; padding: 2px; cursor: pointer; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatches button { width: 20px; height: 20px; border: 1px solid rgba(255,255,255,.12); cursor: pointer; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg-btn { background: transparent; border: 0; padding: 6px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg-btn.active { background: var(--bg3); color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.brush { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 12px; color: var(--muted); }
.field input { font-size: 14px; color: var(--text); }
.fineprint { color: var(--muted); font-size: 11px; line-height: 1.45; margin: 10px 0 0; }
#payBtn { margin-top: 8px; }

/* ---------- Payment ---------- */
.paytabs { display: flex; border: 1px solid var(--line); margin-bottom: 14px; }
.paytabs .seg-btn { flex: 1; padding: 10px; font-size: 13px; }
.pay-amount { text-align: center; font-family: var(--mono); color: var(--muted); }
.pay-amount b { font-size: 28px; color: var(--orange); }
.qr { background: #fff; padding: 0; margin: 12px auto; width: 100%; max-width: 300px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.empty { background: var(--bg); border: 1px dashed var(--line); color: var(--muted); font-size: 13px; padding: 20px; text-align: center; flex-direction: column; gap: 12px; }
.pay-info { font-size: 12px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.pay-info.warn { color: var(--volt); }
.pay-row { display: flex; gap: 6px; margin-bottom: 10px; }
.pay-row input { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--muted); }
#walletLink { width: 100%; }
.pay-status { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0 4px; font-size: 13px; }
.spinner { width: 12px; height: 12px; background: var(--orange); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { background: var(--volt); transform: scale(.6); } }
.countdown { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 14px; }
#restartBtn { display: block; margin: 0 auto; }

.done { text-align: center; padding: 30px 6px; }
.done-burst { font-size: 54px; animation: pop .6s ease-out; filter: drop-shadow(0 0 20px rgba(255,225,77,.7)); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } 70% { transform: scale(1.2); } to { transform: scale(1); } }
.done h3 { font-family: var(--pixel); font-size: 16px; text-transform: uppercase; }
.done p { color: var(--muted); font-size: 13px; line-height: 1.5; }

.toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 40;
  background: var(--bg3); border: 1px solid var(--line); padding: 10px 16px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.err { border-color: var(--red); color: #ffd6da; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .topbar { gap: 14px; padding: 0 14px; }
  .brand h1 { font-size: 14px; }
  .actions { gap: 6px; }
}
@media (max-width: 720px) {
  :root { --top: 96px; }
  .logo { height: 34px; }
  .topbar { grid-template-columns: 1fr; grid-template-rows: 44px 48px; gap: 0; padding: 0 10px; }
  .brand { grid-row: 1; grid-column: 1; }
  .brand h1 { max-width: none; font-size: 14px; }
  .actions { grid-row: 2; grid-column: 1; display: flex; gap: 6px; width: 100%; }
  .actions .btn { flex: 1; padding: 8px 6px; font-size: 13px; }
  .actions select.lang { width: 58px; }
  .hint-help { display: none; }
  .panel { width: 100%; top: auto; height: 78vh; border-left: 0; border-top: 1px solid var(--line); }
  .editor-frame { height: 180px; }
}

body.panel-open .hint-help { display: none; }

/* ---------- Bombes ---------- */
.btn.bomb { background: #1d0f10; border-color: #5a1f26; color: #ffd6da; }
.btn.bomb:hover { background: #2a1215; border-color: var(--red); box-shadow: 0 0 22px rgba(255,77,94,.35); }
.select-hint.bomb-mode { background: var(--red); color: #1a0306; }
.select-hint.bomb-mode .btn { color: #1a0306; }
.sizes { display: flex; gap: 4px; flex-wrap: wrap; }
.sizes button { border: 1px solid rgba(0,0,0,.3); background: rgba(255,255,255,.18); color: inherit; font-family: var(--mono); font-size: 11px; padding: 4px 7px; cursor: pointer; }
.sizes button.active { background: #1a0306; color: #fff; border-color: #1a0306; }
.panel .sizes button { border-color: var(--line); background: var(--bg); color: var(--muted); }
.panel .sizes button.active { background: var(--red); color: #1a0306; border-color: var(--red); }
.bomb-ctl { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; padding: 10px 12px; border: 1px solid #5a1f26; background: #160b0c; }
.bomb-ctl small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.bomb-ctl .btn { align-self: flex-start; }
.ed-wrap { position: relative; line-height: 0; }
#edMask { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.panel.bomb-mode #edCanvas { opacity: .28; }
.panel.bomb-mode .zone-only { display: none; }
.panel.bomb-mode .rect-inputs { grid-template-columns: repeat(2, 1fr); }
.panel.bomb-mode .price b { color: var(--red); }
.panel.bomb-mode #payBtn, .panel.bomb-mode #drawBtn { background: var(--red); border-color: var(--red); color: #1a0306; }
.select-hint .sizes { flex-wrap: nowrap; }
@media (max-width: 720px) { .select-hint { flex-wrap: wrap; justify-content: center; } }

/* ---------- Pixel War : colonnes latérales ---------- */
.sidebar { position: fixed; top: var(--top); bottom: 0; z-index: 12; display: flex; flex-direction: column; background: var(--bg2); border-color: var(--line); }
.sidebar.right { right: 0; width: var(--right); border-left: 1px solid var(--line); }
.side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0; font-family: var(--pixel); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.side-head small { color: var(--muted); font-size: 11px; }

.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { font-size: 13px; line-height: 1.4; word-break: break-word; position: relative; }
.msg .n { font-weight: 700; margin-right: 6px; }
.msg .x { color: var(--orange); font-weight: 700; margin-right: 6px; text-decoration: underline dotted; text-underline-offset: 3px; }
.msg .x:hover { text-decoration-style: solid; }
.msg .tm { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.msg .del { position: absolute; right: 0; top: 0; background: none; border: 0; color: var(--red); cursor: pointer; }
.chat-form { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-id { display: grid; gap: 3px; }
.chat-hint { color: var(--muted); font-size: 11px; line-height: 1.3; }
.chat-form input, .chat-form textarea { font-size: 13px; resize: none; color: var(--text); }
.chat-actions { display: flex; justify-content: flex-end; gap: 6px; }


.share-box { margin: 18px 0 14px; padding: 14px; border: 1px solid var(--orange); background: linear-gradient(135deg, rgba(247,147,26,.14), rgba(255,225,77,.05)); }
.share-lbl { margin: 0 0 10px !important; color: var(--text) !important; font-weight: 700; font-size: 14px !important; }
.btn.share-x { display: flex; justify-content: center; width: 100%; padding: 14px; font-size: 16px; background: #000; color: #fff; border-color: #000; }
.btn.share-x b { font-size: 18px; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.share-row .btn { justify-content: center; font-size: 13px; }
.btn.share-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.btn.share-fb b { font-family: Georgia, serif; font-size: 16px; }
.btn.share-wa { background: #25d366; border-color: #25d366; color: #052e16; }
.btn.share-tg { background: #229ed9; border-color: #229ed9; color: #fff; }
#shareMore { margin-top: 8px; }
.hud .tab { display: none; width: auto; padding: 0 10px; font-size: 12px; }

body.panel-open .sidebar.right { visibility: hidden; }

@media (max-width: 1100px) {
  :root { --left: 0px; --right: 0px; }
  .sidebar { display: none; width: min(340px, 88vw) !important; box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .sidebar.open { display: flex; }
  .hud .tab { display: inline-block; }
  body.panel-open .sidebar.right { visibility: visible; }
}
.side-close { display: none; float: right; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
@media (max-width: 1100px) { .side-close { display: block; } }
.chat-form textarea { font-family: var(--sans); }

/* ---------- Achat : tailles rapides, URL d'image, panneau mobile ---------- */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 2px; }
.presets button { border: 1px solid var(--line); background: var(--bg); color: var(--muted); padding: 7px 4px; cursor: pointer; font-family: var(--mono); font-size: 10px; line-height: 1.3; }
.presets button b { display: block; color: var(--text); font-size: 12px; }
.presets button.active { border-color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.img-url { display: flex; gap: 6px; flex: 1 1 100%; }
.img-url input { flex: 1; font-size: 12px; padding: 6px 8px; }
.head-price { font-family: var(--mono); font-size: 12px; color: var(--orange); text-transform: none; margin-left: 6px; }
.grip { display: none; }
#view { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (pointer: coarse) {
  .hud button { width: 42px; height: 42px; font-size: 20px; }
  .hud #coords { display: none; }
}
@media (max-width: 720px) {
  .panel { height: 58vh; padding-top: 10px; transition: height .2s ease; }
  .panel.collapsed { height: 64px; overflow: hidden; }
  .panel .grip { display: block; width: 100%; height: 18px; margin: -6px 0 4px; background: none; border: 0; cursor: pointer; position: relative; }
  .panel .grip::before { content: ""; position: absolute; left: 50%; top: 6px; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--line); }
  .select-hint { display: none !important; }
  .actions .zap { display: none; }
  .presets button { padding: 9px 4px; }
}
body.light .swatches button { border-color: rgba(0,0,0,.25); }

/* ---------- Mobile : 2 temps bien séparés ----------
   1) placer : la toile est libre, une barre compacte en bas (taille, prix, « Dessiner »)
   2) dessiner : l'éditeur recouvre la toile ; « Déplacer la zone » ramène à l'étape 1 */
.place-only, .draw-only { display: none; }
@media (max-width: 720px) {
  .panel { transition: none; }
  .panel:not(.collapsed) { top: var(--top); height: auto; bottom: 0; z-index: 30; }
  .panel.collapsed { height: auto; max-height: 52vh; overflow-y: auto; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .panel.collapsed .place-only { display: block; }
  .panel:not(.collapsed) .draw-only { display: inline-flex; margin-bottom: 10px; }
  .panel.collapsed #stepEdit > :not(.place-only):not(.place-keep) { display: none !important; }
  .panel.collapsed .coords, .panel.collapsed .step-title { display: none; }
  .panel.collapsed .step { border-top: 0; padding-top: 0; margin-top: 0; }
  .panel.collapsed #bombExplain, .panel.collapsed #rerollBtn { display: none; }
  .panel.collapsed .bomb-ctl { margin: 6px 0; padding: 8px; }
  .panel.collapsed #drawBtn { width: 100%; margin-top: 10px; }
  .place-hint { margin: 0 0 6px; font-size: 12px; color: var(--muted); line-height: 1.35; }
  body.panel-open:not(.placing) .hud { visibility: hidden; }
}

[hidden] { display: none !important; }

/* ---------- Bonus ×10 : au-dessus de la grille (hors de l'en-tête), barre qui se vide ---------- */
.promo { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 7; width: min(520px, calc(100% - 16px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 5px; padding: 6px 12px 7px; border: 1px solid var(--orange);
  background: linear-gradient(135deg, rgba(40,24,6,.94), rgba(20,16,8,.94)); box-shadow: 0 8px 24px rgba(0,0,0,.45); pointer-events: none; }
body.light .promo { background: linear-gradient(135deg, rgba(255,244,228,.96), rgba(255,250,238,.96)); }
.bonus-top { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; font-size: 12px; overflow: hidden; }
.bonus-x { color: var(--orange); font-family: var(--mono); font-size: 13px; letter-spacing: .03em; }
.bonus-deal { font-weight: 700; color: var(--text); }
.bonus-normal { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.bonus-row { display: flex; align-items: center; gap: 10px; }
.bonus-bar { flex: 1; height: 8px; background: var(--bg3); border: 1px solid var(--line); overflow: hidden; position: relative; }
.bonus-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f7931a, #ffe14d);
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px), linear-gradient(90deg, #f7931a, #ffe14d);
  background-size: 24px 24px, 100% 100%; animation: bonusflow 1.2s linear infinite; transition: width 1s linear; }
@keyframes bonusflow { to { background-position: 24px 0, 0 0; } }
.bonus-left { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bonus-left b { font-family: var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.price-old { color: var(--muted); font-size: 14px; margin-right: 4px; }
.price-bonus { margin-left: 6px; padding: 2px 6px; background: var(--orange); color: #140b00; font: 700 11px var(--mono); vertical-align: middle; }
@media (min-width: 721px) { body.panel-open .promo { left: calc((100% - 380px) / 2); max-width: calc(100% - 396px); } }
@media (max-width: 720px) {
  .promo { top: 6px; padding: 5px 9px 6px; gap: 4px; }
  .bonus-top { font-size: 11px; gap: 6px; }
  .bonus-normal { display: none; }
  .bonus-ends { display: none; }
  .bonus-bar { height: 6px; }
}
@media (max-width: 400px) { .brand h1 { font-size: 12px; } .logo { height: 30px; } .brand { gap: 8px; } }

/* Bouton « Partager mes pixels » : reste visible après l'achat, jusqu'à ce qu'on le ferme */
.share-chip { position: absolute; right: 14px; bottom: calc(var(--foot) + 10px); z-index: 8; display: flex; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .5s ease-out; }
.share-chip button { border: 0; cursor: pointer; font: 700 14px Inter, system-ui, sans-serif; }
#shareChipBtn { background: var(--orange); color: #140b00; padding: 11px 16px; }
#shareChipBtn:hover { filter: brightness(1.08); }
#shareChipClose { background: #140b00; color: var(--orange); padding: 0 12px; font-size: 18px; }
body.panel-open .share-chip { display: none; }
@media (max-width: 720px) { .share-chip { bottom: calc(var(--foot) + 62px); right: 10px; } }

/* ---------- Bandeau du bas : compte X officiel ---------- */
.site-foot { position: absolute; left: 0; right: 0; bottom: 0; height: var(--foot); z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 14px; background: rgba(10,10,12,.88); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
body.light .site-foot { background: rgba(255,255,255,.92); }
.follow { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; margin-left: auto; }
.follow b { font-size: 15px; }
.follow-btn { background: var(--text); color: var(--bg); font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: 12px; }
.follow:hover .follow-btn { background: var(--orange); color: #140b00; }
.wall-link { color: var(--orange); font-weight: 700; font-size: 12px; text-decoration: none; white-space: nowrap; }
.wall-link:hover { text-decoration: underline; }
.follow-short { display: none; font-weight: 700; }
.follow-done { justify-content: center; width: 100%; margin-top: 12px; font-size: 12px; white-space: normal; }
@media (max-width: 720px) {
  .site-foot { justify-content: space-between; padding: 0 10px; }
  .follow { margin: 0; font-size: 13px; gap: 8px; }
  .site-foot .follow-long { display: none; }
  .site-foot .follow-short { display: inline; }
}
@media (max-width: 380px) { .follow { font-size: 11px; } .follow-btn { padding: 3px 9px; } .site-foot .follow-short { display: none; } .wall-link { font-size: 11px; } }

/* ---------- Visiteurs en ligne + son ---------- */
.online { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; height: 32px; border: 1px solid var(--line); font: 600 12px var(--mono); color: var(--muted); white-space: nowrap; }
.online i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: onlinepulse 2s infinite; }
.online b { color: var(--text); }
@keyframes onlinepulse { 70% { box-shadow: 0 0 0 7px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
#soundBtn.off { opacity: .45; }
@media (max-width: 720px) {
  .online { height: auto; align-self: stretch; padding: 0 8px; }
}

/* ---------- Post X : aperçu clair de ce qui sera publié ---------- */
.tweet-card { text-align: left; background: var(--bg); border: 1px solid var(--line); padding: 10px; margin: 6px 0 10px; }
.tweet-head { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tweet-head b { color: var(--text); font-size: 14px; margin-right: 4px; }
#tweetText { width: 100%; box-sizing: border-box; resize: vertical; min-height: 64px; background: transparent; color: var(--text); border: 1px dashed var(--line); padding: 6px 8px; font: 14px/1.4 Inter, system-ui, sans-serif; }
#tweetText:focus { outline: none; border-color: var(--orange); }
.tweet-img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; margin-top: 8px; border: 1px solid var(--line); background: #0a0a0c; }
.tweet-link { font: 11px var(--mono); color: var(--muted); margin-top: 4px; }
.btn.share-x { animation: xpulse 1.6s ease-in-out infinite; }
@keyframes xpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(247,147,26,.0); } 50% { box-shadow: 0 0 0 6px rgba(247,147,26,.35); } }
.tweet-hint { margin: 6px 0 4px !important; font-size: 11px !important; }
#stepDone .done { padding-top: 12px; }
#stepDone .done-burst { font-size: 40px; }

/* ---------- Panneau d'achat : 3 étapes claires + barre de paiement fixe ---------- */
.panel-hint { margin: 0 0 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.step { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; padding-top: 4px; margin-top: 4px; }
.step-title { margin: 0 0 8px; font: 700 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.coords { margin-top: 8px; }
.coords summary { cursor: pointer; font-size: 12px; color: var(--muted); list-style: none; user-select: none; }
.coords summary::-webkit-details-marker { display: none; }
.coords summary::before { content: "▸ "; }
.coords[open] summary::before { content: "▾ "; }
.coords .rect-inputs { margin-top: 8px; }
.editor { margin: 0; }
.ed-tabs { display: flex; width: 100%; margin-top: 10px; }
.ed-tabs .seg-btn { flex: 1; padding: 10px 6px; font-size: 13px; }
.ed-pane { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.ed-pane.hidden { display: none; }
.ed-pane .file-btn { justify-content: center; width: 100%; padding: 10px; }
.ed-pane .img-url input { padding: 8px; }
.fit { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.fit select { flex: 1; padding: 6px 8px; font-size: 12px; }
.swatch-row { display: flex; gap: 8px; align-items: center; }
.swatch-row #colorIn { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line); background: none; flex: none; }
.swatch-row .swatches button { width: 24px; height: 24px; }
.draw-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#stepLink .field { margin: 6px 0; }
.paybar { position: sticky; bottom: -28px; z-index: 3; margin: 14px -20px 0; padding: 10px 20px 12px; background: var(--bg2); border-top: 1px solid var(--line); box-shadow: 0 -12px 24px rgba(0,0,0,.25); }
.paybar .price { margin: 0 0 8px; padding: 8px 12px; }
.paybar .price b { font-size: 22px; }
.paybar #payBtn { width: 100%; }
#stepEdit > .fineprint { margin-top: 10px; }
@media (max-width: 720px) {
  .paybar { bottom: calc(-28px - env(safe-area-inset-bottom)); }
  .swatch-row .swatches button { width: 28px; height: 28px; }
}

.price .price-bonus { color: #140b00; }
@media (min-width: 721px) { body.panel-open .site-foot .follow { visibility: hidden; } }

/* ---------- Dessin : couleur, curseur de taille, bouton « remplir toute la zone » ---------- */
.draw-hint { margin: 0; font-size: 12px; color: var(--muted); }
.tool-block { display: flex; flex-direction: column; gap: 6px; }
.tool-lbl { font-size: 12px; color: var(--muted); }
.tool-lbl b { color: var(--text); font-family: var(--mono); margin-left: 4px; }
.brush-row { display: flex; align-items: center; gap: 12px; }
#brushSize { flex: 1; accent-color: var(--orange); height: 28px; }
.brush-dot { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--bg); }
.brush-dot::after { content: ""; display: block; width: var(--d, 4px); height: var(--d, 4px); border-radius: 50%; background: var(--c, #f7931a); }
.fill-btn { justify-content: center; gap: 8px; width: 100%; padding: 11px; font-weight: 600; }
.fill-chip { width: 16px; height: 16px; border: 1px solid rgba(255,255,255,.3); background: #f7931a; flex: none; }
.fill-btn.flash { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(247,147,26,.3); }
.actions .btn { white-space: nowrap; }
@media (max-width: 400px) { .actions .btn { font-size: 12px; padding: 8px 4px; } .actions { gap: 5px; } }
@media (max-width: 960px) { #bombBtn [data-i18n="bomb"] { display: none; } }
