:root {
  --paper: #ffffff;
  --ink: #141414;
  --muted: #6b6b6b;
  --red: #d7263d;
  --red-dark: #b01d31;
  --orange: #f4a261;
  --purple: #8d5bd0;
  --blue: #3a7ca5;
  --green: #1f8f6b;
  --hand: "Patrick Hand", "Segoe Print", "Comic Sans MS", cursive;
  --big: "Caveat", "Comic Sans MS", cursive;
  --marker: "Permanent Marker", "Comic Sans MS", cursive;
  --type: "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ================= NAVBAR ================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 2.5px solid var(--ink);
  backdrop-filter: blur(4px);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  transform: rotate(-3deg);
  border: 2px solid var(--ink);
  background: #fff;
}
.brand-name {
  font-family: var(--big);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.5px;
}
.nav-links { display: flex; gap: 26px; list-style: none; align-items: center; }
.nav-links a {
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding: 3px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 3px;
  background: var(--red);
  border-radius: 2px;
  transform: skewX(-14deg);
  transition: width 0.18s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* ================= HERO ================= */
.hero { text-align: center; padding: 8px 0 4px; }

.tomoe-wordmark {
  font-family: var(--big);
  font-size: 92px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: 2px;
  display: inline-block;
  position: relative;
  margin: 4px 0 10px;
}
.tomoe-wordmark .ch {
  display: inline-block;
  animation: wordmark-in 0.5s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}
@keyframes wordmark-in {
  from { opacity: 0; transform: translateY(30px) rotate(-9deg) scale(0.55); }
  to   { opacity: 1; transform: none; }
}
.tomoe-wordmark::after {
  content: "";
  position: absolute;
  left: 0; bottom: -12px;
  width: 100%; height: 7px;
  background: var(--red);
  border-radius: 4px;
  transform: skewX(-14deg);
  transform-origin: left center;
  animation: underline-draw 0.7s ease-out 0.85s both;
}
@keyframes underline-draw {
  from { transform: skewX(-14deg) scaleX(0); }
  to   { transform: skewX(-14deg) scaleX(1); }
}

.hero-logo {
  width: min(216px, 50vw);
  height: auto;
  display: block;
  margin: 2px auto 10px;
  transform: rotate(-2deg);
  filter: drop-shadow(3px 4px 0 rgba(20, 20, 20, 0.14));
}

.eyebrow { font-size: 16px; color: var(--muted); letter-spacing: 0.5px; }
.eyebrow .ch { display: inline-block; animation: write 0.4s ease both; }
@keyframes write {
  from { opacity: 0; transform: translateY(8px) rotate(-4deg); }
  to   { opacity: 1; transform: none; }
}

.hero-title {
  font-family: var(--big);
  font-size: 74px;
  font-weight: 700;
  line-height: 1;
  margin-top: 10px;
  letter-spacing: 0.5px;
}
.hero-title em {
  font-style: normal;
  color: var(--red);
  position: relative;
}
.hero-sub {
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 17px;
  color: var(--muted);
}

.hero-total { margin: 30px 0 4px; }
.big-number {
  font-family: var(--big);
  font-size: 96px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  text-shadow: 3px 3px 0 rgba(215, 38, 61, 0.16);
}
.hero-total-label {
  font-family: var(--type);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 8px;
}

/* ================= STATS ================= */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
  text-align: left;
}
.stat {
  border: 2px solid var(--ink);
  border-radius: 11px 4px 11px 4px / 4px 11px 4px 11px;
  padding: 13px 15px;
  background: #fff;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, 0.08);
}
.stat .s-val {
  font-family: var(--big);
  font-size: 31px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}
.stat .s-lbl {
  font-family: var(--type);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ================= DIE CARDS ================= */
.die-strip { margin-top: 42px; }
.section-title {
  font-family: var(--big);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  margin-bottom: 16px;
}
.die-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.die-card {
  border: 2.5px solid var(--ink);
  border-radius: 12px 5px 12px 5px / 5px 12px 5px 12px;
  padding: 16px 16px 18px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.die-card:hover { transform: translateY(-3px) rotate(-0.4deg); box-shadow: 5px 7px 0 rgba(20, 20, 20, 0.12); }
.die-card b {
  display: block;
  font-family: var(--marker);
  font-size: 22px;
  letter-spacing: 1px;
}
.die-card span { display: block; margin-top: 6px; font-size: 15px; color: var(--muted); }
.die-card.burn b { color: var(--red); }
.die-card.lost b { color: var(--orange); }
.die-card.missing b { color: var(--purple); }

/* ================= LAYOUT ================= */
.layout {
  display: grid;
  grid-template-columns: 1fr 1.28fr;
  gap: 22px;
  align-items: start;
  margin-top: 40px;
}
.col { display: flex; flex-direction: column; gap: 22px; }

/* ================= PANELS ================= */
.panel {
  background: #fff;
  padding: 20px 22px;
  position: relative;
  border: 2.5px solid var(--ink);
  border-radius: 16px 7px 16px 7px / 7px 16px 7px 16px;
  box-shadow: 5px 5px 0 rgba(20, 20, 20, 0.12);
  animation: panel-in 0.5s ease both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px) rotate(-0.5deg); }
  to   { opacity: 1; transform: none; }
}

.hand-label {
  position: relative;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.hand-label .stroke {
  position: absolute;
  left: 0; bottom: -5px;
  width: 46%;
  height: 5px;
  background: var(--red);
  border-radius: 3px;
  transform: skewX(-14deg);
  opacity: 0.9;
  animation: stroke-in 0.7s ease-out 0.4s both;
}
@keyframes stroke-in {
  from { width: 0; opacity: 0; }
  to   { width: 46%; opacity: 0.9; }
}

.more-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 15px;
  color: var(--blue);
  text-decoration: none;
}
.more-link:hover { text-decoration: underline; }

/* ================= TOKENS ================= */
.tokens { display: flex; flex-direction: column; gap: 10px; }
.token {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 10px 4px 10px 4px / 4px 10px 4px 10px;
  border: 2px dashed rgba(20, 20, 20, 0.28);
  background: #fff;
  animation: panel-in 0.4s ease both;
}
.token .sym { font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.token .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: 0 0 auto; border: 1.5px solid var(--ink); }
.lp-badge {
  background: var(--purple); color: #fff;
  font-family: var(--marker); font-size: 10px; letter-spacing: 1px;
  border-radius: 5px; padding: 1px 6px; flex: 0 0 auto;
  transform: rotate(-4deg);
}
.token-name { font-size: 12px; color: var(--muted); font-family: var(--type); }
.token .amt { font-size: 18px; font-weight: 700; color: var(--ink); font-family: var(--big); }
.token .usd { font-size: 13px; color: var(--muted); font-family: var(--type); }

/* ================= LEGEND ================= */
.legend { list-style: none; }
.legend li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px dotted rgba(20, 20, 20, 0.22);
}
.legend li:last-child { border-bottom: none; }
.legend .lbl { color: var(--ink); }
.legend .val { color: var(--muted); font-family: var(--big); font-size: 18px; }

/* ================= LIVE FEED ================= */
.feed-panel { display: flex; flex-direction: column; }
.live-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--ink);
  display: inline-block;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }

.feed {
  display: flex; flex-direction: column; gap: 9px;
  max-height: 620px; overflow-y: auto; margin-top: 4px;
  padding-right: 2px;
}
.feed-empty { color: var(--muted); font-size: 15px; padding: 18px 4px; }

.feed-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px 5px 11px 5px / 5px 11px 5px 11px;
  border: 2px solid rgba(20, 20, 20, 0.85);
  background: #fff;
  animation: pop 0.34s cubic-bezier(0.22, 1.4, 0.36, 1);
  flex-wrap: wrap;
}
@keyframes pop {
  from { transform: translateY(-8px) scale(0.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.feed-item .tag {
  font-family: var(--marker);
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  border-radius: 5px;
  padding: 2px 8px;
  flex: 0 0 auto;
  transform: rotate(-3deg);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(20, 20, 20, 0.25);
}
.tag.burn { background: var(--red); }
.tag.lost { background: var(--orange); }
.tag.missing { background: var(--purple); }

.feed-item .f-amt { font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--big); }
.feed-item .f-to { font-size: 13px; color: var(--muted); font-family: var(--type); }
.feed-item .f-to a { color: var(--blue); text-decoration: none; }
.feed-item .f-to a:hover { text-decoration: underline; }
.feed-item .f-time { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--type); }

/* ================= PROSE (how / about) ================= */
.prose { max-width: 760px; margin: 0 auto; }
.prose .panel { margin-bottom: 22px; }
.prose h2.hand-label { font-size: 20px; }
.prose p { font-size: 16.5px; color: var(--ink); margin-bottom: 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin: 6px 0 12px 22px; }
.prose li { margin-bottom: 8px; font-size: 16px; }
.prose code {
  font-family: var(--type);
  font-size: 13px;
  background: #f4f4f4;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  padding: 1px 6px;
  word-break: break-all;
}
.prose .q { margin-bottom: 16px; }
.prose .q b { font-family: var(--big); font-size: 20px; display: block; margin-bottom: 4px; }

/* ================= ADDRESSES PAGE ================= */
.addr-card {
  border: 2.5px solid var(--ink);
  border-radius: 13px 6px 13px 6px / 6px 13px 6px 13px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, 0.08);
}
.addr-card .a-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.addr-card .a-label { font-family: var(--big); font-size: 24px; font-weight: 700; }
.addr-card .a-addr { font-family: var(--type); font-size: 13px; color: var(--muted); word-break: break-all; }
.addr-card .a-eth { font-family: var(--big); font-size: 22px; font-weight: 700; color: var(--red); white-space: nowrap; }
.addr-card .a-rows { display: flex; flex-direction: column; gap: 6px; }
.addr-card .a-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  border-bottom: 1px dotted rgba(20,20,20,0.18);
  padding: 4px 0;
}
.addr-card .a-row:last-child { border-bottom: none; }
.addr-card .a-row .k { color: var(--muted); }
.addr-card .a-row .v { font-family: var(--type); font-size: 13.5px; }
.addr-card .a-link { font-size: 14px; color: var(--blue); text-decoration: none; }
.addr-card .a-link:hover { text-decoration: underline; }

/* ================= FOOTER ================= */
.footer {
  margin-top: 52px;
  border-top: 2.5px solid var(--ink);
  background: #fff;
  text-align: center;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: var(--ink);
}
.footer-brand .brand-logo { width: 56px; height: 56px; }
.footer-name {
  position: relative;
  display: inline-block;
  font-family: var(--big);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.foot-underline {
  position: absolute;
  left: 0; bottom: -7px;
  width: 100%; height: 4px;
  background: var(--red);
  border-radius: 2px;
  transform: skewX(-14deg);
  opacity: 0.85;
}
.footer-tag { font-size: 15px; color: var(--muted); }

.footer-cols {
  display: flex;
  gap: 56px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.fcol { display: flex; flex-direction: column; gap: 7px; min-width: 120px; }
.fcol h4 {
  font-family: var(--marker);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 4px;
}
.fcol a, .fcol span { font-size: 14px; color: var(--muted); text-decoration: none; }
.fcol a:hover { color: var(--ink); text-decoration: underline; }

.footer-rule {
  max-width: 620px;
  margin: 2px auto 0;
  padding: 0 22px;
  opacity: 0.5;
}
.footer-rule svg { width: 100%; height: 16px; display: block; }

.footer-bottom {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 22px 28px;
  font-family: var(--type);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.footer-bottom b { font-family: var(--big); font-size: 16px; color: var(--ink); }

/* ================= RESPONSIVE ================= */
@media (max-width: 820px) {
  .hero-title { font-size: 54px; }
  .big-number { font-size: 70px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .die-cards { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .feed { max-height: 400px; }
  .page { padding: 26px 16px 42px; }
  .nav-inner { flex-direction: column; align-items: center; gap: 10px; padding: 10px 14px; }
  .nav-links { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .nav-links a { font-size: 14.5px; }
  .footer-cols { gap: 28px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 42px; }
  .hero-sub { font-size: 15px; }
  .big-number { font-size: 55px; }
  .tomoe-wordmark { font-size: 58px; }
  .hero-logo { width: min(168px, 54vw); }
  .stat { padding: 11px 12px; }
  .stat .s-val { font-size: 25px; }
  .stat .s-lbl { font-size: 10px; }
  .token { flex-wrap: wrap; }
  .brand-name { font-size: 27px; }
  .brand-logo { width: 36px; height: 36px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13.5px; }
  .footer-name { font-size: 30px; }
  .trait-btn { font-size: 13px; padding: 6px 11px; }
  .feed-item { gap: 7px; padding: 9px 10px; }
  .addr-card .a-label { font-size: 20px; }
}

/* ================= COOKIE CONSENT ================= */
#cookie-consent {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(580px, calc(100vw - 32px));
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 13px 6px 13px 6px / 6px 13px 6px 13px;
  box-shadow: 7px 7px 0 rgba(20, 20, 20, 0.16);
  padding: 16px 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-family: var(--hand);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#cookie-consent.cc-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(24px);
}
#cookie-consent .cc-text { font-size: 14px; color: var(--ink); line-height: 1.4; }
#cookie-consent .cc-text b {
  display: block;
  font-family: var(--big);
  font-size: 20px;
  margin-bottom: 4px;
}
#cookie-consent .cc-text a { color: var(--blue); }
#cookie-consent .cc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cc-btn {
  font-family: var(--marker);
  font-size: 13px;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  box-shadow: 2px 2px 0 rgba(20, 20, 20, 0.2);
  transition: transform 0.1s ease;
}
.cc-btn:hover { transform: translateY(-1px); }
.cc-accept { background: var(--ink); color: #fff; }

/* ================= COLLECTION / TRAIT BUILDER ================= */
.builder {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 28px;
  align-items: start;
  margin-top: 30px;
}
.builder-preview {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.char-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2.5px solid var(--ink);
  border-radius: 18px 8px 18px 8px / 8px 18px 8px 18px;
  box-shadow: 8px 8px 0 rgba(20, 20, 20, 0.12);
  background: #fff;
  overflow: hidden;
  animation: panel-in 0.5s ease both;
}
.trait-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.shuffle-btn {
  font-family: var(--marker);
  font-size: 15px;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(20, 20, 20, 0.2);
  transition: transform 0.1s ease;
}
.shuffle-btn:hover { transform: translateY(-2px); }

.builder-controls { display: flex; flex-direction: column; }
.trait-group { margin-bottom: 16px; }
.trait-label {
  font-family: var(--big);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  display: inline-block;
}
.trait-options { display: flex; flex-wrap: wrap; gap: 8px; }
.trait-btn {
  font-family: var(--hand);
  font-size: 14px;
  padding: 7px 13px;
  border: 2px solid var(--ink);
  border-radius: 9px 4px 9px 4px / 4px 9px 4px 9px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.08s ease;
}
.trait-btn:hover { transform: translateY(-1px); background: #f7f7f7; }
.trait-btn.active { background: var(--ink); color: #fff; }

@media (max-width: 820px) {
  .builder { grid-template-columns: 1fr; }
  .builder-preview { position: static; }
}
