/* agnt agents — mint + dashboard + admin */

:root {
  --bg: #000;
  --panel: #060606;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #f3f3f1;
  --muted: #8e8e8e;
  --dim: #565656;
  --green: #2fd53a;
  --green-hi: #e2ffe4;
  --green-lo: #138a1d;
  --green-a: rgba(47, 213, 58, 0.12);
  --green-b: rgba(47, 213, 58, 0.35);
  --red: #ff5f56;
  --amber: #c9a227;
  --sans: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--fg);
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
::selection { background: var(--green); color: #000; }

/* CRT */
.crt i { position: fixed; pointer-events: none; z-index: 100; }
.crt-grain {
  inset: -120px; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(5) infinite;
}
.crt-lines { inset: 0; background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px); }
.crt-vignette { inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(0,0,0,0.7) 100%); }
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-40px,25px)} 40%{transform:translate(30px,-45px)} 60%{transform:translate(-20px,50px)} 80%{transform:translate(45px,15px)} 100%{transform:translate(0,0)} }

.wrap { position: relative; width: 100%; max-width: 680px; margin: 0 auto; padding: 0 16px; padding-bottom: env(safe-area-inset-bottom); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.top-brand { font-family: var(--sans); font-weight: 700; font-size: 18px; text-decoration: none; display: inline-flex; align-items: center; }
.logo-word { color: #fff; text-shadow: -0.02em 0 rgba(255,50,90,0.45), 0.02em 0 rgba(50,160,255,0.45); }
.logo-cursor {
  display: inline-block; width: 0.62em; height: 0.82em; margin: 0 0.32em 0 0.14em; vertical-align: -0.08em;
  background: linear-gradient(90deg, var(--green-hi) 0 10%, var(--green) 40%, var(--green-lo) 100%);
  box-shadow: 0.05em 0 0.14em rgba(47,213,58,0.5); animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.wallet-btn, .btn-primary, .ghost-btn, .qty-btn {
  font-family: var(--mono); cursor: pointer; transition: border-color .2s, background .2s, color .2s, transform .1s;
}
.wallet-btn {
  padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: #101010; color: var(--fg); font: 500 12.5px/1 var(--mono);
}
.wallet-btn:hover { border-color: rgba(255,255,255,0.36); }
.wallet-btn.on { color: var(--green); border-color: var(--green-b); background: var(--green-a); }

/* banner */
.banner {
  margin: 4px 0 18px; padding: 11px 14px; border-radius: 10px; font-size: 12.5px;
  border: 1px solid var(--green-b); background: var(--green-a); color: var(--green-hi);
}
.banner.warn { border-color: rgba(201,162,39,0.5); background: rgba(201,162,39,0.1); color: var(--amber); }
.banner.err { border-color: rgba(255,95,86,0.5); background: rgba(255,95,86,0.1); color: #ffb4af; }
.banner button {
  margin-left: 8px; padding: 4px 9px; border: 1px solid currentColor; border-radius: 6px;
  background: transparent; color: inherit; font: 600 11.5px/1 var(--mono); cursor: pointer;
}

/* hero */
.hero { text-align: center; padding: 30px 0 26px; }
.hero h1 { font-family: var(--sans); font-weight: 700; font-size: clamp(28px, 7vw, 40px); letter-spacing: -0.02em; }
.hero-sub { margin-top: 10px; color: var(--muted); font-size: 13px; }

/* console / mint card */
.console {
  background: linear-gradient(180deg, #0a0a0a, var(--panel)); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px -40px rgba(47,213,58,0.18);
}
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.cmd-sigil { color: var(--green); }
.cmd-cursor { display: inline-block; width: 7px; height: 13px; margin-left: 4px; vertical-align: -2px; background: var(--green); animation: blink 1.1s steps(1) infinite; }
.supply b { color: var(--fg); font-weight: 500; }

.supply-bar { height: 3px; background: #141414; }
.supply-bar i { display: block; height: 100%; width: 0; background: var(--green); box-shadow: 0 0 10px var(--green-b); transition: width .6s cubic-bezier(.2,.8,.2,1); }

.mint-body { padding: 20px 18px 22px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.price-eth { font: 700 22px/1 var(--mono); letter-spacing: -0.01em; }
.price-usd { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.qty-btn { width: 40px; height: 42px; border: 0; background: #101010; color: var(--fg); font-size: 20px; }
.qty-btn:hover { background: #181818; }
.qty-input { width: 54px; height: 42px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: #030303; color: var(--fg); text-align: center; font: 500 16px var(--mono); outline: 0; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  padding: 16px; border: 0; border-radius: 11px; background: var(--green); color: #000;
  font: 700 15px/1 var(--sans); box-shadow: 0 0 0 1px rgba(47,213,58,0.5), 0 14px 40px -12px rgba(47,213,58,0.65);
}
.btn-primary:hover:not(:disabled) { background: #3ee649; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: #131313; color: #4d4d4d; box-shadow: inset 0 0 0 1px var(--line); cursor: not-allowed; }
.btn-primary .sq { width: 10px; height: 10px; background: currentColor; }
.btn-primary[data-loading] .sq { animation: blink .35s steps(1) infinite; }

.total { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--muted); }
.total:empty { display: none; }
.msg { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.msg.err { color: var(--red); } .msg.ok { color: var(--green); }

/* panels */
.panel { margin-top: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-head h2 { font: 700 16px/1 var(--sans); }
.panel-empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.dash-count { font: 400 12px var(--mono); color: var(--muted); }
.load-more { display: block; width: 100%; margin-top: 12px; padding: 12px; }

.ghost-btn { padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #101010; color: var(--fg); font: 500 12px/1 var(--mono); }
.ghost-btn:hover { border-color: rgba(255,255,255,0.36); }
.ghost-btn:disabled { opacity: .5; cursor: not-allowed; }
.ghost-btn.on { color: var(--green); border-color: var(--green-b); }

/* agents */
.agents { display: grid; gap: 12px; }
.agent { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #040404; }
.agent-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.agent-id { font: 700 18px/1 var(--mono); color: var(--green); }
.agent-bal { font-size: 13px; color: var(--muted); } .agent-bal b { color: var(--fg); font-weight: 500; }
.agent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #030303; }
.field:focus-within { border-color: var(--green-b); }
.field-sigil { color: var(--green); font-weight: 700; }
.field input { flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: 400 14px var(--mono); }
.field input::placeholder { color: var(--dim); }
.agent-msg { margin-top: 10px; font-size: 12px; color: var(--muted); } .agent-msg:empty { display: none; }
.agent-msg.err { color: var(--red); } .agent-msg.ok { color: var(--green); }

/* admin */
.admin { border-color: var(--green-b); box-shadow: 0 40px 100px -50px rgba(47,213,58,0.3); }
.admin-tag { padding: 4px 9px; border: 1px solid var(--green-b); border-radius: 999px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
.admin-note { margin-bottom: 16px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.admin-grid { display: grid; gap: 12px; }
.admin-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #040404; }
.admin-cell.wide { flex-direction: column; align-items: stretch; }
.admin-k { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); flex: none; }
.admin-k em { text-transform: none; letter-spacing: 0; color: var(--dim); }
.admin-v { font-size: 13px; color: var(--fg); margin-right: auto; }
.admin-v.mono { font-size: 12px; overflow-wrap: anywhere; }
.admin-set { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-input { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #030303; color: var(--fg); font: 400 13px var(--mono); outline: 0; min-width: 110px; }
.admin-input:focus { border-color: var(--green-b); }
.admin-cell.wide .admin-input { flex: 1; }

/* deploy page */
.dep-field { margin-bottom: 16px; }
.dep-field > label { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dep-field > label em { text-transform: none; letter-spacing: 0; color: var(--dim); }
.dep-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dep-row .field { flex: none; width: 140px; }
.dep-hint { font-size: 13px; color: var(--green); }
.dep-sub { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 11px; color: var(--dim); }
.dep-sub .admin-input { flex: 1; }

.deployed { margin-top: 18px; padding: 16px; border: 1px solid var(--green-b); border-radius: 12px; background: var(--green-a); }
.deployed-k { font-size: 12px; color: var(--green); margin-bottom: 10px; }
.deployed-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deployed-addr { flex: 1; min-width: 0; font: 500 13px var(--mono); color: var(--fg); overflow-wrap: anywhere; }
.deployed-note { margin-top: 12px; font-size: 12px; color: var(--muted); }
.deployed-note a { color: var(--green); text-decoration: none; }

/* footer */
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 36px 0 28px; font-size: 11.5px; color: var(--dim); }
.foot a, .foot #contract-link a { text-decoration: none; }
.foot a:hover { color: var(--fg); }

@media (max-width: 520px) {
  .mint-body, .panel { padding-left: 14px; padding-right: 14px; }
  .qty-input, .field input, .admin-input { font-size: 16px; } /* no iOS zoom */
  .price-row { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
