/* ============================================================
   HASH UNIPUPPET — theme: puppet theatre / toy box
   dark indigo stage + coral puppet + cream stitching
   ============================================================ */
:root {
  --ink: #150c26;
  --plum: #1d1033;
  --plum2: #271545;
  --line: rgba(255, 244, 230, .10);
  --cream: #fff4e6;
  --mute: #b9a9d6;
  --coral: #ff7a5c;
  --coral-d: #e05a3c;
  --gold: #ffc857;
  --mint: #6ee7b7;
  --err: #ff6b81;
  --r: 18px;
  --display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255,122,92,.16), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(110,231,183,.10), transparent 55%),
    var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--coral); text-decoration: none; }
h1, h2, h3, .bname { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4.6vw, 54px); line-height: 1.04; margin: 10px 0 14px; }
h2 { font-size: 26px; margin: 0 0 4px; }
h3 { font-size: 17px; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.fine { color: var(--mute); font-size: 12px; margin: 10px 0 0; }
.empty-note { color: var(--mute); font-size: 13px; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; background: var(--ink); display: flex; gap: 12px; align-items: center; justify-content: center; z-index: 60; font-family: var(--display); font-size: 20px; color: var(--mute); transition: opacity .4s; }
#loading.gone { opacity: 0; pointer-events: none; }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--coral); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; padding: 12px 22px; background: rgba(21,12,38,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 34px; height: 34px; }
.bname { font-size: 19px; color: var(--cream); }
.bname em { font-style: normal; color: var(--coral); }
.tabs { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.tab { background: none; border: 0; color: var(--mute); font: 600 12px/1 var(--body); letter-spacing: .08em; padding: 10px 13px; border-radius: 999px; cursor: pointer; transition: .18s; }
.tab:hover { color: var(--cream); background: rgba(255,244,230,.05); }
.tab.active { color: var(--ink); background: var(--gold); }

/* ---------- buttons ---------- */
.btn { font: 700 12px/1 var(--body); letter-spacing: .09em; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,244,230,.05); color: var(--cream); cursor: pointer; transition: .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--coral); border-color: var(--coral); color: #2a0f08; }
.btn.primary:hover { background: var(--coral-d); }
.btn.primary.running { background: var(--err); border-color: var(--err); color: #2a0f08; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a2005; }
.btn.ghost:hover { border-color: var(--coral); color: var(--coral); }
.btn.big { padding: 15px 24px; font-size: 13px; }
.btn.small { padding: 8px 12px; font-size: 11px; }
.btn.wide { width: 100%; margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
#walletBtn.connected { background: var(--mint); border-color: var(--mint); color: #062a1d; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,122,92,.10), transparent); }
#artTrack { display: flex; gap: 14px; padding: 12px 0; width: max-content; animation: slide 60s linear infinite; }
#artTrack img { width: 54px; height: 54px; border-radius: 14px; border: 2px solid rgba(255,244,230,.14); image-rendering: pixelated; background: var(--plum2); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- hero ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; padding: 26px 0 40px; }
.kicker { display: inline-block; font: 700 11px/1 var(--body); letter-spacing: .16em; color: var(--gold); border: 1px dashed rgba(255,200,87,.5); padding: 8px 12px; border-radius: 999px; }
.grad { background: linear-gradient(92deg, var(--coral), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--mute); font-size: 16px; max-width: 56ch; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 22px; }
.facts { list-style: none; display: flex; gap: 26px; padding: 0; margin: 0; flex-wrap: wrap; }
.facts li { display: flex; flex-direction: column; }
.facts b { font-family: var(--display); font-size: 20px; color: var(--cream); }
.facts span { font-size: 11px; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; }

/* ---------- stage ---------- */
.stage { position: relative; }
.stage-frame { position: relative; border-radius: 26px; padding: 16px; background: linear-gradient(160deg, rgba(255,122,92,.16), rgba(110,231,183,.08)); border: 2px dashed rgba(255,244,230,.22); }
.stage-art { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stage-art img { width: 100%; border-radius: 16px; image-rendering: pixelated; background: var(--plum2); border: 1px solid var(--line); }
.stitch { position: absolute; inset: 8px; border: 1px dashed rgba(255,244,230,.12); border-radius: 20px; pointer-events: none; }
.progress { height: 10px; border-radius: 999px; background: rgba(255,244,230,.08); margin: 14px 0 0; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), var(--gold)); transition: width .5s; }
.stage-stats { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.stage-stats div { display: flex; flex-direction: column; }
.stage-stats span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.stage-stats b { font-family: var(--display); font-size: 16px; }

/* ---------- panels & cards ---------- */
.panel { display: none; padding: 10px 0 40px; }
.panel.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.panel-head { margin-bottom: 18px; }
.panel-head p { color: var(--mute); max-width: 78ch; }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.card { background: rgba(39,21,69,.55); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card h3 { color: var(--gold); }

/* console */
.console { padding: 0; overflow: hidden; background: #100a1f; }
.console-head { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: rgba(255,244,230,.04); border-bottom: 1px solid var(--line); }
.console-head em { font-style: normal; font-size: 11px; color: var(--mute); margin-left: 6px; letter-spacing: .08em; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,244,230,.2); }
.dot:first-child { background: var(--coral); }
.console-body { height: 430px; overflow-y: auto; padding: 12px 14px; font-family: var(--mono); font-size: 12px; }
.logline { padding: 3px 0; color: var(--mute); border-bottom: 1px dotted rgba(255,244,230,.06); word-break: break-word; }
.logline .lt { color: rgba(255,244,230,.35); margin-right: 8px; }
.logline.ok { color: var(--mint); }
.logline.err { color: var(--err); }
.logline.warn { color: var(--gold); }
.logline.info { color: var(--cream); }

/* kv + meters */
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted rgba(255,244,230,.10); }
.kv dt { color: var(--mute); font-size: 12px; letter-spacing: .04em; }
.kv dd { margin: 0; text-align: right; font-size: 13px; }
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.meter { background: rgba(255,244,230,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.meter span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.meter b { font-family: var(--display); font-size: 18px; }
.gauge { height: 8px; background: rgba(255,244,230,.08); border-radius: 999px; overflow: hidden; }
.gauge-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--gold)); transition: width .3s; }
.slotbar { height: 6px; background: rgba(255,244,230,.08); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.slotbar-fill { height: 100%; width: 0; background: var(--coral); transition: width .9s linear; }
.solution.empty { border-style: dashed; }
.solution:not(.empty) { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,200,87,.25); }
.plain { margin: 0 0 12px; padding-left: 18px; color: var(--mute); }
.plain b, .plain li b { color: var(--cream); }
.code { background: #100a1f; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: var(--mono); font-size: 12px; color: var(--mint); overflow-x: auto; }

/* kennel */
.kennel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kcard { background: rgba(16,10,31,.7); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcard img { width: 100%; aspect-ratio: 1; border-radius: 10px; image-rendering: pixelated; background: var(--plum2); }
.kmeta { display: flex; flex-direction: column; }
.kmeta b { font-family: var(--display); }
.kmeta span { font-size: 11px; color: var(--mute); }

/* collection */
.collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.card.t4 { border-color: rgba(255,200,87,.5); }
.card.t3 { border-color: rgba(255,122,92,.45); }
.card.t2 { border-color: rgba(110,231,183,.35); }
.collection .card { padding: 10px; }
.thumb { position: relative; }
.thumb img { width: 100%; aspect-ratio: 1; border-radius: 12px; image-rendering: pixelated; background: var(--plum2); }
.tier { position: absolute; left: 8px; top: 8px; font: 700 10px/1 var(--body); letter-spacing: .06em; padding: 5px 8px; border-radius: 999px; background: rgba(21,12,38,.82); border: 1px solid var(--line); color: var(--cream); }
.lock { position: absolute; right: 8px; top: 8px; font: 700 9px/1 var(--body); letter-spacing: .08em; padding: 5px 7px; border-radius: 999px; background: var(--mint); color: #062a1d; }
.collection .meta { display: flex; justify-content: space-between; align-items: center; margin: 9px 2px 8px; }
.collection .meta b { font-family: var(--display); font-size: 15px; }
.collection .own { font-size: 11px; color: var(--mute); font-family: var(--mono); }
.pager { display: flex; gap: 8px; }
.con-card.locked { border-style: dashed; }

/* footer */
footer { border-top: 1px solid var(--line); background: rgba(16,10,31,.6); }
.foot { max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; gap: 20px; color: var(--mute); font-size: 12px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 900px) {
  .hero, .grid2 { grid-template-columns: 1fr; }
  .tabs { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .topbar { flex-wrap: wrap; }
  .hero { padding-top: 8px; }
}
