:root {
  --paper: #ffffff;
  --ink: #2b2b2b;
  --muted: #6f6f6f;
  --gold: #eeaa09;
  --gold-ink: #c98a00;
  --red: #e0533f;
  --blue: #3f7fc4;
  --green: #4a9e5a;
  --purple: #8a5bd0;
  --orange: #ef9a3c;
  --hand: "Patrick Hand", "Comic Sans MS", "Segoe Print", cursive;
  --big: "Gochi Hand", "Comic Sans MS", "Segoe Print", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--paper); color: var(--ink); font-family: var(--hand); font-size: 19px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }
.mono { font-family: var(--hand); }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.97); border-bottom: 2.5px solid var(--ink); }
.bar { max-width: 1080px; margin: 0 auto; padding: 0 22px; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; animation: brand-float 3.5s ease-in-out infinite; }
.brand img { height: 36px; display: block; }
.brand-text { font-family: var(--big); font-size: 30px; color: var(--ink); letter-spacing: 0.05em; text-transform: uppercase; line-height: 1; }
@keyframes brand-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-1deg); }
}
.bar nav { display: flex; align-items: center; gap: 4px; }
.bar nav a { font-family: var(--big); font-size: 18px; color: var(--ink); padding: 6px 12px; border-radius: 10px; border: 2.5px solid transparent; white-space: nowrap; }
.bar nav a:hover, .bar nav a.active { border-color: var(--ink); text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 34px 22px 80px; }

h1 { font-family: var(--big); font-size: 50px; font-weight: 400; line-height: 1.05; margin: 0 0 8px; }
h2 { font-family: var(--big); font-size: 26px; font-weight: 400; margin: 0 0 14px; }
.eyebrow { font-family: var(--big); font-size: 18px; color: var(--muted); margin: 0 0 10px; }
.lede { color: var(--muted); max-width: 680px; margin: 0 0 22px; font-size: 19px; }
.muted { color: var(--muted); }

.btn { display: inline-block; padding: 11px 20px; border-radius: 14px 6px 14px 6px / 6px 14px 6px 14px; font-family: var(--big); font-size: 18px; color: var(--ink); cursor: pointer; text-align: center; border: 2.5px solid var(--ink); background: var(--gold); box-shadow: 3px 3px 0 rgba(43,43,43,0.25); }
.btn:hover { background: var(--gold-ink); color: #fff; text-decoration: none; transform: rotate(-1deg); }
.btn.ghost { background: #fff; }
.btn.ghost:hover { background: #fff6c9; color: var(--ink); }
.btn.sm { padding: 7px 14px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.panel { background: #fff; border: 2.5px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 5px 5px 0 rgba(43,43,43,0.13); padding: 22px; margin-bottom: 22px; }
.panel:nth-child(2n) { transform: rotate(-0.4deg); }

label { display: block; margin-bottom: 16px; }
label span { display: block; font-family: var(--big); font-size: 17px; color: var(--ink); margin-bottom: 5px; }
input, input[type=file] { width: 100%; padding: 11px 13px; font-size: 18px; font-family: var(--hand); border: 2.5px solid var(--ink); border-radius: 10px 4px 10px 4px / 4px 10px 4px 10px; background: #fff; color: var(--ink); }
input:focus { outline: none; background: #fffdf0; }
input[type=file] { cursor: pointer; padding: 9px; }
.img-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.img-preview img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 2px solid var(--ink); }
.img-preview .none { width: 56px; height: 56px; border-radius: 12px; border: 2px dashed var(--muted); display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--big); font-size: 26px; }
.form-error { color: var(--red); font-size: 16px; margin: 10px 0 0; }

/* coin list */
.coins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.coin { background: #fff; border: 2.5px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 5px 5px 0 rgba(43,43,43,0.13); padding: 18px 18px 20px; cursor: pointer; color: var(--ink); }
.coin:hover { transform: rotate(-0.5deg) scale(1.01); text-decoration: none; }
.coin:nth-child(2n) { transform: rotate(0.5deg); }
.coin:nth-child(2n):hover { transform: rotate(0.5deg) scale(1.01); }
.coin .top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.coin .avatar { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; border: 2px solid var(--ink); background: #fff6c9; flex-shrink: 0; }
.coin .avatar.letter { display: flex; align-items: center; justify-content: center; font-family: var(--big); font-size: 22px; color: var(--ink); }
.coin .t { font-family: var(--big); font-size: 26px; font-weight: 400; letter-spacing: 1px; }
.coin .p { color: var(--muted); font-size: 15px; margin-top: 1px; }
.coin .mc { font-size: 15px; color: var(--muted); margin-top: 10px; }
.coin .bar { height: 9px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; margin: 12px 0 10px; }
.coin .fill { height: 100%; background: var(--gold); }
.coin .row { display: flex; justify-content: space-between; font-size: 16px; color: var(--muted); margin-top: 4px; }
.coin .row b { color: var(--ink); }
.coin .tag { display: inline-block; font-family: var(--big); font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 2px solid var(--ink); margin-left: 8px; vertical-align: middle; transform: rotate(-3deg); }
.tag.pending { background: #fff6c9; color: var(--gold-ink); }
.tag.live { background: #e5f6e9; color: var(--green); }

/* coin detail */
.coin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.coin-head .avatar-lg { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 2.5px solid var(--ink); background: #fff6c9; }
.coin-head .avatar-lg.letter { display: flex; align-items: center; justify-content: center; font-family: var(--big); font-size: 30px; color: var(--ink); }
.coin-head .meta { color: var(--muted); font-size: 15px; }
.sale-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.sale-grid .cell { background: #fffdf5; border: 2px solid var(--ink); border-radius: 12px 4px 12px 4px / 4px 12px 4px 12px; padding: 12px; transform: rotate(-0.4deg); }
.sale-grid .cell:nth-child(2n) { transform: rotate(0.4deg); }
.sale-grid .k { font-family: var(--big); font-size: 14px; color: var(--muted); }
.sale-grid .v { font-family: var(--big); font-size: 22px; color: var(--ink); }

.tabs { display: flex; gap: 8px; margin: 16px 0; }
.tab { padding: 7px 16px; font-family: var(--big); font-size: 17px; color: var(--muted); border: 2px solid transparent; border-radius: 10px; cursor: pointer; background: transparent; }
.tab:hover { border-color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.address-box { border: 2.5px dashed var(--ink); border-radius: 12px; padding: 16px; margin: 16px 0; background: #fffdf5; }
.address-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.address-row code { flex: 1; font-size: 15px; word-break: break-all; color: var(--ink); }
.qr-wrap { text-align: center; margin: 10px 0; }
.qr-wrap img { width: 170px; height: 170px; border-radius: 8px; border: 2px solid var(--ink); }
.watch-note { font-size: 16px; color: var(--muted); margin: 12px 0; }
.watch-note.paid { color: var(--green); font-weight: 700; }
.noir-note { font-size: 15px; color: var(--muted); margin-top: 12px; border-top: 2px dotted var(--muted); padding-top: 12px; }
.noir-note a { color: var(--blue); font-weight: 700; }

/* holders + activity */
.list { list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1.5px dotted rgba(43,43,43,0.3); }
.list li:last-child { border-bottom: none; }
.list .who { font-size: 15px; }
.list .amt { font-family: var(--big); font-size: 19px; }

/* ledger */
.ledger { font-size: 15px; }
.ledger .ev { display: grid; grid-template-columns: 90px 90px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1.5px dotted rgba(43,43,43,0.3); }
.ledger .ev .typ { font-family: var(--big); color: var(--gold-ink); text-transform: uppercase; }
.ledger .ev .tkr { font-family: var(--big); color: var(--ink); }

/* key */
.key-hex { word-break: break-all; background: #fffdf5; border: 2.5px dashed var(--ink); border-radius: 12px; padding: 14px; font-size: 16px; }

.footer { border-top: 2.5px solid var(--ink); padding: 48px 0 0; background: #fff; }
.footer-cols { max-width: 1080px; margin: 0 auto; padding: 0 22px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.fcol { display: flex; flex-direction: column; gap: 8px; }
.f-brand .tag { color: var(--muted); font-size: 15px; margin-top: 4px; line-height: 1.4; }
.fcol h4 { font-family: var(--big); font-size: 17px; font-weight: 400; margin: 0 0 2px; color: var(--ink); }
.fcol a { font-size: 16px; color: var(--muted); }
.fcol a:hover { color: var(--blue); text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }
.footer-bottom { max-width: 1080px; margin: 30px auto 0; padding: 16px 22px 24px; text-align: center; border-top: 2px dotted rgba(43,43,43,0.35); }
.footer-bottom span { color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .coins { grid-template-columns: 1fr; }
  .sale-grid { grid-template-columns: repeat(2, 1fr); }
  .bar { flex-direction: column; height: auto; padding: 12px 16px 14px; gap: 8px; }
  .bar nav { flex-wrap: wrap; justify-content: center; gap: 2px; }
  .bar nav a { font-size: 16px; padding: 5px 10px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .f-brand { grid-column: 1 / -1; }
}
