/* KingPepe Mempool — live mining visualization. Uses the shared tokens from style.css. */
.mp { --accent: var(--green); }
.mp .small { font-size: 12px; }
.mp .accent-red { color: var(--red); }
.mp .glass { background: linear-gradient(160deg, rgba(33,41,54,.92), rgba(27,33,43,.82)); backdrop-filter: blur(6px); }
.btn { background: var(--card2); border: 1px solid var(--border); color: var(--text); padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.btn:hover { border-color: var(--green-dim); }

.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 16px; flex-wrap: wrap; }
.mp-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.mp-head-r { display: flex; align-items: center; gap: 12px; }
.mp-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--green); letter-spacing: 1px; padding: 2px 9px; border: 1px solid rgba(78,201,90,.4); border-radius: 20px; background: rgba(78,201,90,.1); }
.mp-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }

/* ---- hero ---- */
.mp-hero { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: stretch; }
.mp-timeline { display: flex; gap: 12px; align-items: stretch; overflow-x: auto; padding: 8px 2px 12px; scrollbar-width: thin; }
.blk { flex: 0 0 auto; width: 150px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 3px; transition: transform .35s ease, box-shadow .35s ease; }
.blk:hover { text-decoration: none; transform: translateY(-3px); }
.blk-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; }
.blk-h { font-size: 20px; font-weight: 700; }
.blk-m { font-size: 11.5px; color: var(--text); opacity: .92; }
.blk.confirmed { opacity: .85; }
.blk.tip { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(245,197,24,.35), 0 0 24px rgba(245,197,24,.12); background: linear-gradient(165deg, rgba(245,197,24,.08), var(--card)); }
.blk.tip .blk-h { color: var(--gold); }
.blk.proj { border-style: dashed; border-color: rgba(78,201,90,.5); background: linear-gradient(165deg, rgba(78,201,90,.07), var(--card)); animation: breathe 3.5s ease-in-out infinite; }
.blk.proj .blk-tag { color: var(--green); }
.blk.empty { align-items: center; justify-content: center; color: var(--muted); }
.blk.confirm-flash { animation: flash 1.4s ease; }
.fullbar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; margin: 4px 0 2px; }
.fullbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-dim), var(--green)); transition: width .6s ease; }

/* mining gap between tip and projected */
.mine-gap { flex: 0 0 auto; width: 64px; position: relative; display: flex; align-items: center; justify-content: center; }
.mine-gap .pick { font-size: 26px; animation: swing 1.8s ease-in-out infinite; transform-origin: 70% 30%; z-index: 1; }
.mine-gap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---- mining panel ---- */
.mp-mining { border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.mine-status { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.mine-status.on { color: var(--green); }
.mine-status.off { color: var(--muted); }
.mine-status .chip { display: inline-flex; font-size: 18px; animation: spin 4s linear infinite; }
.nonce-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.nonce { font-size: 16px; letter-spacing: 2px; color: var(--green); }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 1px 0; }
.mrow > span:last-child { font-weight: 600; text-align: right; }
.est-note { margin-top: 4px; border-top: 1px dashed var(--border); padding-top: 6px; }

/* ---- incoming tx tiles ---- */
.mp-txwrap { display: flex; flex-wrap: wrap; gap: 8px; min-height: 92px; }
.txtile { flex: 0 0 auto; width: 150px; background: var(--bg2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; text-decoration: none; color: var(--text); }
.txtile:hover { text-decoration: none; border-color: var(--green-dim); }
.txt-fr { color: var(--green); font-weight: 700; font-size: 13px; margin: 2px 0; }
.txtile.enter { animation: tileIn .6s ease; }
.empty-state { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; color: var(--muted); }
.empty-emoji { font-size: 40px; animation: bob 2.6s ease-in-out infinite; }

/* ---- projected detail row ---- */
.projrow { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.projblock { flex: 0 0 auto; min-width: 150px; background: linear-gradient(165deg, rgba(78,201,90,.08), var(--card)); border: 1px dashed rgba(78,201,90,.5); border-radius: 10px; padding: 12px; }
.projblock .fr { font-size: 17px; font-weight: 700; color: var(--green); }

/* ---- histogram ---- */
.mp-hist { padding: 16px; }
.histbars { display: flex; align-items: flex-end; gap: 5px; height: 140px; }
.hbar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 8px; }
.hbar > span { width: 100%; background: linear-gradient(180deg, var(--green), var(--green-dim)); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .6s cubic-bezier(.4,0,.2,1); }
.hbar > label { font-size: 9px; color: var(--muted); margin-top: 4px; transform: rotate(-40deg); white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rowlink { color: var(--blue); }
.hchart { width: 100%; display: block; }

/* ---- toast ---- */
.mp-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s; z-index: 50; }
.mp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-in { background: linear-gradient(160deg, #1f2b1f, #17211a); border: 1px solid var(--green-dim); box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 20px rgba(78,201,90,.2); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; }

/* ---- animations ---- */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 1px rgba(78,201,90,.2); } 50% { box-shadow: 0 0 18px rgba(78,201,90,.18); } }
@keyframes swing { 0%,100% { transform: rotate(-18deg); } 50% { transform: rotate(16deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flash { 0% { box-shadow: 0 0 0 1px var(--gold), 0 0 40px rgba(245,197,24,.6); } 100% { box-shadow: 0 0 0 1px rgba(245,197,24,.35), 0 0 24px rgba(245,197,24,.12); } }
@keyframes tileIn { from { opacity: 0; transform: translateX(30px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- responsive ---- */
@media (max-width: 820px) {
  .mp-hero { grid-template-columns: 1fr; }
  .mp-mining { order: -1; }
  .two-col { grid-template-columns: 1fr; }
}

/* ---- RTL ---- */
.mp[dir="rtl"] .mrow > span:last-child { text-align: left; }
.mp[dir="rtl"] .hbar > label { transform: rotate(40deg); }

/* ---- reduced motion: stop all looping/entrance animation, keep data live ---- */
@media (prefers-reduced-motion: reduce) {
  .mp *, .mp *::before, .mp *::after { animation: none !important; transition: none !important; }
  .mine-gap canvas { display: none; }
}
