/* Pixel Monde — plein écran */
body.pm { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: #070812; }

.pm-top {
  flex: none; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 16px;
  background: rgba(14, 15, 31, .95); border-bottom: 1px solid var(--line); z-index: 10;
}
.pm-top .logo { font-size: 20px; }
.pm-top .logo-mark { width: 32px; height: 32px; font-size: 17px; }
.pm-title { font-family: var(--font-title); font-size: 22px; margin: 0; color: var(--accent); white-space: nowrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--text); color: var(--bg); }
.pm-account { display: flex; align-items: center; gap: 8px; flex: none; }
.wallet {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 4px 4px 4px 12px; cursor: pointer; font: inherit;
}
.wallet span { color: var(--muted); font-size: 12px; }
.wallet b { font-variant-numeric: tabular-nums; }
.wallet i { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-weight: 800; display: grid; place-items: center; }
.wallet:hover { border-color: var(--accent); }
.pm-stats { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.pm-stats b { color: var(--text); }

.pm-main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; image-rendering: pixelated; }
#world.dragging { cursor: grabbing; }

.pm-panel {
  position: absolute; z-index: 5; background: rgba(20, 21, 43, .92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  font-size: 14px;
}
.pm-panel h3 { margin: 0 0 6px; font-size: 16px; }
.pm-panel .muted { color: var(--muted); margin: 0 0 10px; font-size: 13px; }
.pm-panel .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pm-panel .tools { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.only-mobile { display: none !important; }
.pm-panel .tools .btn:not(#btn-share):not(#btn-lists) { width: 36px; justify-content: center; padding: 6px 0; font-size: 18px; line-height: 1; }
.kv { display: flex; flex-direction: column; background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.kv span { color: var(--muted); font-size: 12px; }
.kv b { font-variant-numeric: tabular-nums; }

.pm-coords {
  position: absolute; z-index: 5; left: 12px; top: 12px; display: flex; gap: 4px;
  background: rgba(7, 8, 18, .8); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px;
}
.pm-coords div { display: flex; flex-direction: column; padding: 0 8px; }
.pm-coords div + div { border-left: 1px solid var(--line); }
.pm-coords span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.pm-coords b { font-variant-numeric: tabular-nums; white-space: nowrap; }

.pm-nav { left: 12px; top: 74px; width: 290px; }
.goto { display: flex; gap: 6px; align-items: end; }
.goto label { display: flex; flex-direction: column; color: var(--muted); font-size: 12px; font-weight: 700; flex: 1; min-width: 0; }
.goto input {
  width: 100%; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 0 8px; font: inherit; font-variant-numeric: tabular-nums;
}
.goto input:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; min-height: 1em; }
.hint.err { color: var(--pink); }

.pm-pixel { right: 12px; top: 12px; width: 300px; max-height: calc(100% - 24px); overflow: auto; }
.pm-pixel .close { position: absolute; right: 8px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }
.pm-pixel .xy { font-family: var(--font-title); font-size: 20px; font-variant-numeric: tabular-nums; margin: 0 0 8px; }
.status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; }
.status i { width: 22px; height: 22px; border-radius: 5px; border: 2px solid rgba(255, 255, 255, .5); flex: none; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; }
.facts div { background: var(--surface); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.facts span { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.facts b { font-variant-numeric: tabular-nums; font-size: 14px; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 8px 0; }
.swatches button { aspect-ratio: 1; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }
.color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.color-row input[type=color] { width: 44px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; }
.color-row input[type=text] {
  flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 0 10px; font: inherit; text-transform: uppercase;
}
.buy { width: 100%; justify-content: center; font-size: 16px; padding: 12px; }
.small-print { color: var(--muted); font-size: 11.5px; margin: 8px 0 0; }
.small-print a { color: var(--muted); }
.demo { background: rgba(255, 204, 51, .12); color: var(--accent); border-radius: 8px; padding: 6px 10px; font-size: 12px; margin-bottom: 10px; }

.pm-lists { left: 12px; bottom: 12px; width: 290px; padding: 8px; }
.tabs { display: flex; gap: 4px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px; border-radius: 8px; cursor: pointer; }
.tabs button.on { background: var(--surface2); color: var(--text); }
.tabs .collapse { flex: none; width: 30px; }
.pm-lists.closed .list { display: none; }
.pm-lists.closed .collapse { transform: rotate(180deg); }
.list { max-height: 190px; overflow: auto; margin-top: 6px; }
.list .item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; cursor: pointer; width: 100%; background: none; border: 0; color: inherit; text-align: left; font: inherit; }
.list .item:hover { background: var(--surface2); }
.list .item i { width: 16px; height: 16px; border-radius: 4px; flex: none; border: 1px solid rgba(255, 255, 255, .4); }
.list .item b { font-variant-numeric: tabular-nums; font-size: 13px; }
.list .item .dots { display: flex; gap: 2px; flex: none; }
.list .item .dots i { width: 10px; height: 16px; border-radius: 3px; }
.list .item small { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.list .empty-list { color: var(--muted); padding: 10px 6px; font-size: 13px; margin: 0; }

.toast {
  position: absolute; z-index: 40; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); font-weight: 700; padding: 10px 18px; border-radius: 14px; transition: .25s;
  width: max-content; max-width: min(620px, calc(100% - 32px)); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--pink); color: #fff; }

.pm-ad { flex: none; display: flex; justify-content: center; background: #0b0c1a; border-top: 1px solid var(--line); }
.pm-ad .ad { margin: 6px auto; min-height: 60px; }

@media (max-width: 760px) {
  .pm-top { gap: 8px; padding: 0 10px; }
  .pm-logo-txt, .pm-stats { display: none; }
  .pm-title { font-size: 18px; }
  .seg { margin-left: auto; }
  .seg button { padding: 5px 10px; font-size: 13px; }
  .pm-coords { left: 8px; right: 8px; top: 8px; justify-content: space-between; font-size: 12px; }
  .pm-coords div { padding: 0 4px; }
  .pm-nav { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; padding: 10px; }
  .pm-nav .muted { display: none; }
  .pm-nav h3 { display: none; }
  .pm-pixel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 62%; z-index: 7; }
  .pm-main:has(.pm-pixel:not([hidden])) .pm-nav { display: none; }
  .pm-lists { display: none; }
  .pm-lists.open { display: block; left: 8px; right: 8px; top: 64px; bottom: auto; width: auto; z-index: 8; }
  .only-mobile { display: inline-flex !important; }
  .pm-ad .ad { min-height: 50px; margin: 4px auto; }
}

/* --- porte-monnaie, protection, modales --- */
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.wallet-line { margin: 8px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.wallet-line b { color: var(--text); }
.protect { background: rgba(56, 189, 248, .12); color: #7dd3fc; border-radius: 8px; padding: 6px 10px; font-size: 12px; margin: 0 0 10px; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(4, 5, 12, .7); display: grid; place-items: center; padding: 16px; animation: fadein .15s ease; }
.modal[hidden] { display: none; }
.modal-box {
  position: relative; width: min(440px, 100%); max-height: 90vh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
}
.modal-box .close { position: absolute; right: 10px; top: 8px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-box h3 { margin: 0 0 6px; font-size: 20px; font-family: var(--font-title); }
.modal-box h4 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.modal-box .muted { color: var(--muted); font-size: 14px; }
.modal-box .tabs { margin-bottom: 12px; }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.form input[type=email], .form input[type=password] {
  height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit;
}
.form input:focus { outline: none; border-color: var(--accent); }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 12.5px; line-height: 1.4; }
.form .check input { margin-top: 2px; flex: none; accent-color: var(--accent); }
.form .check a { color: var(--text); }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts label { display: block; }
.amounts input { position: absolute; opacity: 0; pointer-events: none; }
.amounts span {
  display: block; text-align: center; padding: 12px 4px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 800; font-size: 16px; cursor: pointer;
}
.amounts input:checked + span { border-color: var(--accent); background: rgba(255, 204, 51, .12); }
.amounts input:focus-visible + span { outline: 2px solid var(--accent); }
.ledger { display: grid; gap: 2px; max-height: 240px; overflow: auto; margin-bottom: 12px; }
.ledger div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--surface); font-size: 13px; }
.ledger small { display: block; color: var(--muted); font-size: 11px; }
.ledger span small { display: inline; }
.ledger span small:last-child { display: block; }
.ledger b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger b.plus { color: var(--green); }

@media (max-width: 760px) {
  .wallet span { display: none; }
  .pm-account .me-chip { padding: 3px; }
  .pm-account .me-chip b { display: none; }
  .pm-account .soon-pill { display: none; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .toast { bottom: auto; top: 64px; font-size: 14px; }
}
@media (max-width: 480px) {
  .pm-title { display: none; }
  .pm-account .btn.small { padding: 6px 10px; font-size: 13px; }
}

/* TOCS : prix en euros sous le montant */
.facts small { display: block; color: var(--muted); font-size: 11px; }
.amounts span small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.form input[type=number] {
  height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 0 12px; font: inherit;
}
.form label small { font-weight: 400; color: var(--muted); }
.ledger .link { display: block; font-size: 12px; margin-top: 2px; }
.modal-box form[hidden] { display: none; }
.modal-box a { color: var(--accent); }

/* « Arrive bientôt » */
.soon { background: linear-gradient(135deg, rgba(255, 204, 51, .16), rgba(255, 92, 138, .16)); border: 1px solid rgba(255, 204, 51, .5);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #ffe9a8; line-height: 1.45; }
.soon b { color: var(--accent); display: block; font-size: 16px; margin-bottom: 2px; }
.soon-pill { border: 1px solid rgba(255, 204, 51, .6); background: rgba(255, 204, 51, .12); color: var(--accent); font: inherit; font-weight: 800;
  font-size: 13px; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
