:root {
  --bg: #eef1f8;
  --panel: #ffffff;
  --ink: #17212e;          /* body text — 12:1 on white */
  --muted: #66717f;        /* 4.6:1 on white */
  --line: #e4e8f0;
  --red: #ee1515;          /* Poké red */
  --red-d: #c40d0d;
  --blue: #2a5fd0;         /* Poké blue */
  --yellow: #ffcb05;       /* Pikachu */
  --green: #1f9d55;
  --shadow: 0 1px 2px rgba(23,33,46,.06), 0 8px 24px rgba(23,33,46,.06);
  --shadow-h: 0 2px 6px rgba(23,33,46,.08), 0 16px 40px rgba(23,33,46,.12);
  --r: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(1100px 500px at 50% -8%, #ffffff, var(--bg) 60%);
  color: var(--ink);
  font: 15px/1.55 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand b, .k, .mine-btn, .price { font-family: Poppins, Inter, sans-serif; }
b { color: var(--ink); font-weight: 700; }
a { color: inherit; text-decoration: none; }
.pokeball { width: 26px; height: 26px; flex: none; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 22px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 19px; letter-spacing: -.01em; }
.pills { display: flex; gap: 8px; }
.pill { font-size: 12px; color: var(--muted); background: #f3f5fa; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.x-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); cursor: pointer; transition: color .15s, border-color .15s; }
.x-link:hover { color: var(--red); border-color: #d3dae6; }

main { max-width: 1000px; margin: 0 auto; padding: 24px 22px 8px; }
.hero { text-align: center; padding: 44px 0 18px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; margin: 0 0 12px; letter-spacing: -.02em; line-height: 1.05; }
.sub { color: var(--muted); max-width: 600px; margin: 0 auto 28px; }

.miner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.mine-btn {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  font-size: 19px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #ff3b3b, var(--red)); border: 0;
  border-radius: 999px; padding: 15px 32px 15px 22px;
  box-shadow: 0 8px 22px rgba(238,21,21,.35); transition: transform .15s, box-shadow .2s, filter .2s;
}
.mine-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(238,21,21,.42); }
.mine-btn:active { transform: translateY(0); }
.mine-btn.on { background: linear-gradient(180deg, #2f3a49, #1b2733); box-shadow: 0 8px 22px rgba(23,33,46,.3); }
.mine-btn.on .pokeball { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.device { font-size: 13px; color: var(--muted); }
.device b { color: var(--green); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 34px 0 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 14px; box-shadow: var(--shadow); border-top: 3px solid var(--line); }
.stat.accent-red { border-top-color: var(--red); }
.stat.accent-blue { border-top-color: var(--blue); }
.stat.accent-yellow { border-top-color: var(--yellow); }
.stat .k { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.mine-log { min-height: 22px; font-size: 13px; color: var(--muted); text-align: center; }
.mine-log .hit { color: var(--green); font-weight: 600; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin: 20px 0; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 18px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; transition: transform .18s, box-shadow .18s, border-color .18s; }
.item:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); border-color: #d3dae6; }
.cardimg { aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #f5f7fb, #e9edf5); display: grid; place-items: center; margin-bottom: 10px; }
.cardimg img { width: 100%; height: 100%; object-fit: contain; }
.item .name { font-family: Poppins; font-weight: 600; font-size: 14px; }
.item .rar { font-size: 11px; color: var(--muted); margin-top: 1px; }
.item .price { color: var(--red); font-weight: 700; font-size: 17px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.item .usd { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.item .btn { width: 100%; }

.btn {
  cursor: pointer; font-family: Inter; font-weight: 600; font-size: 14px;
  background: var(--red); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px;
  transition: background .15s, transform .12s, box-shadow .2s;
}
.btn:hover { background: var(--red-d); box-shadow: 0 6px 16px rgba(238,21,21,.28); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #cfd6e0; color: #fff; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f5f7fb; box-shadow: none; }

.row { display: flex; gap: 10px; }
.row.end { justify-content: flex-end; margin-top: 6px; }
input { font: inherit; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 11px 13px; flex: 1; transition: border-color .15s, box-shadow .15s; }
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42,95,208,.18); }
input::placeholder { color: #9aa4b2; }
.result { font-size: 13px; margin-top: 12px; color: var(--muted); word-break: break-all; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; word-break: break-all; }

.tre { width: 100%; border-collapse: collapse; }
.tre td { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.tre tr:last-child td { border-bottom: 0; }
.tre td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.live { color: var(--green); font-size: 11px; font-weight: 600; }

footer { max-width: 1000px; margin: 0 auto; padding: 8px 22px 40px; }
footer .muted { font-size: 12px; }

.modal { position: fixed; inset: 0; background: rgba(23,33,46,.5); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 20px; }
.modal .card { background: #fff; border-radius: 18px; padding: 26px; width: min(430px, 100%); display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-h); }
.modal h3 { margin: 0; font-size: 20px; }
.order { background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 9px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.order .st { color: var(--blue); font-weight: 600; }

:focus-visible { outline: 3px solid rgba(42,95,208,.5); outline-offset: 2px; border-radius: 6px; }

@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .stats, .grid { grid-template-columns: repeat(2, 1fr); }
  .panel.two { grid-template-columns: 1fr; }
}
@media (max-width: 400px) { .stats { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
