/* ClaimCraft design system. Dark, pixel headings, gold for land and money, grass for live/positive.
   One motion system: --ease for movement, --step for 8-bit flourishes, three durations. */
:root {
  --night: #0b0d11; --panel: #12171e; --panel2: #161c24; --line: #232b35; --text: #dde1e6; --muted: #9aa3ad;
  --gold: #f5c542; --gold-d: #c9971f; --grass: #7ed650; --warn: #ff9b5c; --red: #ff6b6b;
  --pix: "Pixelify Sans", "JetBrains Mono", ui-monospace, monospace;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1); --step: steps(4, end);
  --fast: 120ms; --mid: 220ms; --slow: 420ms;
  --cut: 6px; --maxw: 1160px; --gutter: 16px;
  color-scheme: dark;
}
@media (min-width: 760px) { :root { --gutter: 28px; } }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--text); font: 16px/1.55 var(--body); overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--pix); font-weight: 600; letter-spacing: .01em; line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(34px, 7.4vw, 76px); }
h2 { font-size: clamp(26px, 4.6vw, 44px); }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); }
.pix { font-family: var(--pix); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.green { color: var(--grass); }
.warn { color: var(--warn); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Cut-corner pixel panel shape */
.cut { clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 20px; position: relative; }

/* Buttons */
.btn { --bg: var(--panel2); --fg: var(--text); --bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; background: var(--bg); color: var(--fg); border: 1px solid var(--bd); font: 700 14px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; cursor: pointer; clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 0 calc(100% - 4px), 0 4px); transition: transform var(--fast) var(--ease), background var(--mid) var(--ease), box-shadow var(--mid) var(--ease), filter var(--mid); white-space: nowrap; user-select: none; }
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.gold { --bg: var(--gold); --fg: #1a1406; --bd: #ffe08a; box-shadow: inset 0 -3px 0 var(--gold-d), inset 0 2px 0 #ffe9a8; }
.btn.green { --bg: var(--grass); --fg: #0d1a06; --bd: #b4f08f; box-shadow: inset 0 -3px 0 #4f9a35; }
.btn.ghost { --bg: transparent; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.btn.lg { min-height: 54px; padding: 14px 26px; font-size: 16px; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--fg) transparent var(--fg) transparent; animation: spin .7s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border: 1px solid var(--line); background: var(--panel); font: 600 12px/1 var(--mono); text-decoration: none; color: var(--text); white-space: nowrap; }
.chip.gold { border-color: rgba(245,197,66,.45); color: var(--gold); }
.chip.green { border-color: rgba(126,214,80,.45); color: var(--grass); }
.tag { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); font: 600 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tag.mine { color: var(--grass); border-color: rgba(126,214,80,.5); }
.tag.owned { color: var(--gold); border-color: rgba(245,197,66,.5); }
.tag.edge { color: #cfe0f0; border-color: rgba(207,224,240,.5); }
.live-dot { width: 8px; height: 8px; background: var(--grass); box-shadow: 0 0 10px var(--grass); display: inline-block; animation: blink 1.6s var(--step) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.cc-bump { animation: bump var(--slow) var(--ease); }
@keyframes bump { 0% { color: var(--gold); text-shadow: 0 0 12px rgba(245,197,66,.6); } 100% { text-shadow: none; } }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(11,13,17,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color var(--mid), background var(--mid), transform var(--slow) var(--ease); }
.hdr.scrolled { border-bottom-color: var(--line); background: rgba(11,13,17,.9); }
.hdr.hide { transform: translateY(-100%); }
.hdr .wrap { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px/1 var(--pix); letter-spacing: .06em; }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.brand img.wm { width: auto; height: 14px; }
.ca { display: none; align-items: center; gap: 6px; font: 500 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); padding: 6px 8px; background: var(--panel); cursor: pointer; }
.ca b { color: var(--gold); font-weight: 700; }
.ca:hover { border-color: var(--gold); }
.nav { display: none; gap: 4px; margin: 0 auto; }
.nav a { position: relative; padding: 8px 12px; text-decoration: none; font: 600 15px/1 var(--pix); color: var(--muted); transition: color var(--fast); }
.nav a:hover, .nav a.on { color: var(--text); }
.nav a.on::after, .nav a:hover::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--gold); box-shadow: 0 0 10px rgba(245,197,66,.6); }
.hdr-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.hdr-right .btn { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.burger { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.burger span, .burger span::before, .burger span::after { display: block; width: 16px; height: 2px; background: var(--text); position: relative; }
.burger span::before, .burger span::after { content: ""; position: absolute; }
.burger span::before { top: -5px; } .burger span::after { top: 5px; }
.mnav { position: fixed; inset: 64px 0 auto 0; z-index: 49; background: var(--night); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; display: grid; gap: 2px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all var(--mid) var(--ease); }
.mnav.on { transform: none; opacity: 1; pointer-events: auto; }
.mnav a { padding: 12px 4px; font: 600 18px/1 var(--pix); text-decoration: none; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .nav { display: flex; } .burger { display: none; } .ca { display: inline-flex; } }
@media (max-width: 420px) { .hdr-right .buy { display: none; } }
.btn-connect.on { --bg: var(--panel); --fg: var(--gold); --bd: rgba(245,197,66,.4); font-family: var(--mono); font-weight: 600; font-size: 13px; }

/* Sections */
section { padding: 72px 0; position: relative; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 14px; }
.kicker::before { content: ""; width: 10px; height: 10px; background: var(--gold); }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 640px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 18px; min-width: 0; }
.stat .k { font: 600 11px/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.stat .v { font: 600 clamp(26px, 4vw, 38px)/1.05 var(--pix); color: var(--text); overflow-wrap: anywhere; }
.stat .v.gold { color: var(--gold); }
.stat .s { margin-top: 8px; color: var(--muted); font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: skel 1.4s linear infinite; color: transparent !important; min-height: 1em; display: inline-block; min-width: 4ch; }
@keyframes skel { to { background-position: -200% 0; } }

/* Tables / lists */
.list { border: 1px solid var(--line); background: var(--panel); }
.list .row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; transition: background var(--fast); }
.list .row:first-child { border-top: 0; }
.list .row .n { font: 600 14px/1 var(--pix); color: var(--muted); }
.list .row .w { font-family: var(--mono); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .row .val { font: 600 15px/1 var(--pix); text-align: right; }
.list .row.me { background: rgba(126,214,80,.08); box-shadow: inset 3px 0 0 var(--grass); }
.list .empty-row { padding: 22px 14px; color: var(--muted); text-align: center; font-family: var(--pix); }
.list-h { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-bottom: 1px solid var(--line); }
.list-h h3 { margin: 0; font-size: 18px; }

/* Sheet (wallet), toasts */
.cc-sheet { position: fixed; inset: 0; z-index: 200; background: rgba(5,6,8,.6); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity var(--mid); }
.cc-sheet.on { opacity: 1; }
.cc-sheet-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); padding: 20px; transform: translateY(20px); transition: transform var(--slow) var(--ease); max-height: 90vh; overflow: auto; }
.cc-sheet.on .cc-sheet-card { transform: none; }
@media (min-width: 600px) { .cc-sheet { align-items: center; } }
.cc-sheet-head { display: flex; justify-content: space-between; align-items: center; }
.cc-sheet-head h3 { margin: 0; }
.cc-x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.cc-trust { font-size: 14px; color: var(--muted); border-left: 3px solid var(--gold); padding: 6px 10px; background: rgba(245,197,66,.06); margin: 14px 0; }
.cc-trust b { color: var(--text); }
.cc-wallets { display: grid; gap: 8px; }
.cc-wallet { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; text-decoration: none; font: 600 15px/1 var(--body); text-align: left; transition: border-color var(--fast), transform var(--fast) var(--ease); }
.cc-wallet:hover { border-color: var(--gold); transform: translateX(2px); }
.cc-wallet img, .cc-wallet-dot { width: 28px; height: 28px; }
.cc-wallet-dot { background: var(--line); display: inline-block; }
.cc-wallet.busy { opacity: .6; }
.cc-err { color: var(--red); font-size: 14px; margin: 10px 0 0; }
.cc-muted { color: var(--muted); font-size: 14px; }
.cc-small { font-size: 12px; }
.cc-toasts { position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.cc-toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--muted); padding: 12px 14px; font-size: 14px; opacity: 0; transform: translateY(10px); transition: all var(--mid) var(--ease); }
.cc-toast.on { opacity: 1; transform: none; }
.cc-toast.ok { border-left-color: var(--grass); } .cc-toast.warn { border-left-color: var(--warn); }

/* Sticky claimable bar */
.claimbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; background: rgba(18,23,30,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); transform: translateY(110%); visibility: hidden; transition: transform var(--slow) var(--ease), visibility 0s linear var(--slow); padding-bottom: env(safe-area-inset-bottom); }
.claimbar.on { transform: none; visibility: visible; transition: transform var(--slow) var(--ease); }
.claimbar .wrap { display: flex; gap: 10px 18px; align-items: center; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.claimbar .it { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.claimbar .it .k { font: 600 10px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.claimbar .it .v { font: 600 16px/1 var(--pix); }
.claimbar .grow { flex: 1; }
@media (max-width: 640px) { .claimbar .hide-sm { display: none; } .claimbar .wrap { gap: 8px 14px; } }

/* Footer */
.ftr { border-top: 1px solid var(--line); padding: 36px 0 110px; color: var(--muted); font-size: 14px; }
.ftr .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.ftr nav { display: flex; gap: 18px; flex-wrap: wrap; }
.ftr a { text-decoration: none; } .ftr a:hover { color: var(--text); }

/* Map */
.cc-map { position: relative; overflow: hidden; background: var(--night); border: 1px solid var(--line); touch-action: none; user-select: none; }
.cc-map canvas { width: 100%; height: 100%; cursor: grab; image-rendering: pixelated; }
.cc-map canvas:active { cursor: grabbing; }
.cc-map-ui { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.cc-map-ui button { width: 38px; height: 38px; background: var(--panel); border: 1px solid var(--line); font: 600 20px/1 var(--pix); cursor: pointer; }
.cc-map-ui button:hover { border-color: var(--gold); }
.cc-map-ui button.on { background: var(--gold); color: #1a1406; border-color: var(--gold); }
.cc-map-card { position: absolute; left: 10px; bottom: 10px; right: 10px; max-width: 340px; background: rgba(18,23,30,.97); border: 1px solid var(--line); padding: 14px; animation: rise var(--mid) var(--ease); }
.cc-map-card .row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cc-map-card .row.gap { justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.cc-map-card .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.cc-map-card p { margin: 4px 0; font-size: 14px; }
.cc-map-legend { position: absolute; left: 10px; top: 10px; display: flex; gap: 10px; flex-wrap: wrap; font: 600 11px/1 var(--mono); color: var(--muted); background: rgba(11,13,17,.8); padding: 7px 9px; border: 1px solid var(--line); }
.cc-map-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.lg-mine { background: var(--grass); } .lg-gold { background: var(--gold); } .lg-rel { border: 1px dashed var(--gold); } .lg-free { background: #3f7d34; } .lg-sale { border: 2px dashed #fff; } .lg-edge { background: #dfe8f1; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.coin-pop { position: fixed; z-index: 400; pointer-events: none; font: 700 18px/1 var(--pix); color: var(--gold); text-shadow: 0 0 12px rgba(245,197,66,.7), 0 2px 0 #000; white-space: nowrap; }
.list .row .skel { border-radius: 0; }
