/* Dogtags — chihuahua.wtf brand theme (coral/cream/Fredoka) */
:root {
  --amber: #f0a841;
  --yellow: #fed62e;
  --coral: #fa7f5b;
  --coral-dark: #d9603e;
  --peach: #fed493;
  --cream: #fffedf;
  --charcoal: #373636;
  --white: #ffffff;
  --green: #7fae8a;

  --display: "Fredoka", "Trebuchet MS", Avenir, sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;

  --radius-card: 24px;
  --radius-pill: 999px;
  --shadow-card: 0 14px 34px rgba(55, 54, 54, 0.08);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--charcoal);
  background: var(--cream);
  background-image:
    radial-gradient(circle at 15% 12%, rgba(254, 212, 147, 0.5) 0, transparent 40%),
    radial-gradient(circle at 85% 8%, rgba(250, 127, 91, 0.18) 0, transparent 35%),
    radial-gradient(rgba(55, 54, 54, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 600; }
em { color: var(--coral); font-style: normal; }
a { color: var(--coral-dark); }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--coral);
  font-family: var(--display);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: rgba(255, 254, 223, 0.82);
  border-bottom: 1px solid rgba(55, 54, 54, 0.08);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.brand .paw { font-size: 1.4rem; }
.spacer { flex: 1; }

select.net {
  font-family: var(--body); font-weight: 600; color: var(--charcoal);
  background: var(--white); border: 2px solid rgba(55,54,54,0.12);
  border-radius: var(--radius-pill); padding: 8px 14px; cursor: pointer;
}

/* ---------- buttons ---------- */
.btn {
  font-family: var(--display); font-weight: 600; font-size: 1rem; text-decoration: none;
  display: inline-block; border: none; cursor: pointer; border-radius: var(--radius-pill);
  padding: 12px 22px; color: var(--white); background: var(--coral);
  box-shadow: 0 6px 0 var(--coral-dark);
  transition: transform 0.08s var(--ease-spring), box-shadow 0.08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--coral-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: 0 6px 0 var(--coral-dark); transform: none; }
.btn.ghost { background: var(--white); color: var(--charcoal); box-shadow: 0 6px 0 rgba(55,54,54,0.15); }
.btn.ghost:active { box-shadow: 0 1px 0 rgba(55,54,54,0.15); }
.btn.small { padding: 8px 16px; font-size: 0.9rem; box-shadow: 0 4px 0 var(--coral-dark); }
.btn.small:active { box-shadow: 0 1px 0 var(--coral-dark); }
.btn.danger { background: var(--coral-dark); color: var(--white); box-shadow: 0 4px 0 #a8441f; }
.btn.danger:active { box-shadow: 0 1px 0 #a8441f; }
/* compact square icon button (Transfer →, Release ✕) */
.btn.icon { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 8px 14px; font-size: 1.25rem; line-height: 1; }
.release-cell { display: flex; align-items: center; height: 100%; }
/* release button: ✕ + label, in the destructive colour */
.release-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--coral-dark); box-shadow: 0 4px 0 #a8441f; }
.release-btn:active { box-shadow: 0 1px 0 #a8441f; }
.release-btn .x { font-size: 1.05em; line-height: 1; }

.wallet-pill {
  display: none; align-items: center; gap: 8px;
  background: var(--white); border: 2px solid rgba(55,54,54,0.12);
  border-radius: var(--radius-pill); padding: 6px 14px; font-weight: 600; font-size: 0.9rem;
}
.wallet-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.wallet-pill { min-width: 0; white-space: nowrap; }
#walletAddr { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wallet-pill .addr-short { display: none; }
@media (max-width: 520px) {
  .topbar .wrap { gap: 8px; }
  .wallet-pill { padding: 6px 12px; font-size: 0.85rem; }
  .wallet-pill .addr-long { display: none; }
  .wallet-pill .addr-short { display: inline; }
}

/* ---------- hero ---------- */
.hero { padding: 54px 0 24px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center; }
.hero p.lead { font-size: 1.12rem; max-width: 46ch; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- mascot (chihuahua.wtf rig) ---------- */
#dogSvg { width: min(100%, 420px); height: auto; overflow: visible; display: block; margin-inline: auto; cursor: grab; -webkit-user-select: none; user-select: none; }
#dogSvg:active { cursor: grabbing; }
#dogSvg .st0 { fill: #F0A841; }
#dogSvg .st1 { fill: #FED62E; }
#dogSvg .st2 { fill: #373636; }
#dogSvg .st3 { fill: #FFFBEA; }
#dogSvg .st4 { fill: #FFFFFF; }
#dogSvg .st5 { fill: #FA7F5B; }
.dog-bob { animation: bob 4.5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.tag-plate { transform-origin: 400px 700px; }
@keyframes swing {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(8deg); }
  55% { transform: rotate(-5deg); }
  80% { transform: rotate(3deg); }
  100% { transform: rotate(0deg); }
}
#tagText { font-family: var(--display); font-weight: 700; fill: var(--charcoal); }

/* sparkle: only shown when the displayed tag is confirmed on-chain */
.spark {
  fill: #FFFFFF; stroke: #d9603e; stroke-width: 3.5; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 3px rgba(250, 127, 91, 0.7));
}
/* always shining while shown: never fully fades, just shimmers */
.tag-plate.sparkle .spark { animation: twinkle 1.8s ease-in-out infinite; }
.tag-plate.sparkle .sparkles g:nth-child(2) .spark { animation-delay: .45s; }
.tag-plate.sparkle .sparkles g:nth-child(3) .spark { animation-delay: .9s; }
.tag-plate.sparkle .sparkles g:nth-child(4) .spark { animation-delay: 1.35s; }
@keyframes twinkle {
  0%, 100% { opacity: .7; transform: scale(1.05) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.45) rotate(22deg); }
}
/* confirm burst: the sparkles pop big, then settle into the shimmer */
.tag-plate.sparkle.burst .spark { animation: sparkBurst .6s ease-out; }
@keyframes sparkBurst {
  0% { opacity: 0; transform: scale(.2) rotate(0deg); }
  40% { opacity: 1; transform: scale(1.9) rotate(30deg); }
  100% { opacity: 1; transform: scale(1) rotate(22deg); }
}

/* burn animation overlay (shown while a registration tx is pending) */
.burn-fx {
  position: absolute; inset: 0; z-index: 6; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  border-radius: var(--radius-card); overflow: hidden;
  background: radial-gradient(130% 100% at 50% 100%, rgba(228,83,42,.25), rgba(255,254,223,.96) 72%);
}
.burn-fx.active { display: flex; }
.burn-fx .flames { display: flex; align-items: flex-end; gap: 8px; line-height: 1; z-index: 2; }
.burn-fx .flames span { animation: flick 1.05s ease-in-out infinite; transform-origin: bottom center; filter: drop-shadow(0 4px 14px rgba(250,127,91,.6)); }
.burn-fx .flames span:nth-child(1) { font-size: 34px; animation-delay: .05s; }
.burn-fx .flames span:nth-child(2) { font-size: 48px; animation-delay: .22s; }
.burn-fx .flames span:nth-child(3) { font-size: 62px; animation-delay: .38s; }
.burn-fx .flames span:nth-child(4) { font-size: 48px; animation-delay: .52s; }
.burn-fx .flames span:nth-child(5) { font-size: 34px; animation-delay: .7s; }
@keyframes flick { 0%, 100% { transform: translateY(0) scale(1) rotate(-3deg); } 50% { transform: translateY(-7px) scale(1.13) rotate(3deg); } }
.burn-fx .burn-label { font-family: var(--display); font-weight: 600; color: var(--coral-dark); z-index: 2; }
.burn-fx .embers { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.burn-fx .embers i { position: absolute; bottom: -12px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: emberRise 2.6s linear infinite; }
.burn-fx .embers i:nth-child(1) { left: 16%; animation-delay: 0s; }
.burn-fx .embers i:nth-child(2) { left: 30%; animation-delay: .6s; background: var(--yellow); width: 6px; height: 6px; }
.burn-fx .embers i:nth-child(3) { left: 46%; animation-delay: 1.1s; background: var(--coral); }
.burn-fx .embers i:nth-child(4) { left: 60%; animation-delay: .3s; width: 6px; height: 6px; }
.burn-fx .embers i:nth-child(5) { left: 74%; animation-delay: 1.5s; background: var(--yellow); }
.burn-fx .embers i:nth-child(6) { left: 86%; animation-delay: .9s; background: var(--coral); width: 6px; height: 6px; }
@keyframes emberRise { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-200px) translateX(12px) scale(.3); opacity: 0; } }

/* ---------- cards ---------- */
.card {
  background: var(--white); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 26px; margin: 18px 0;
  position: relative;
  display: flex; flex-direction: column;
}
/* equal-height cards, so the two lookup panels line up */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
/* the result box fills the leftover height, aligning both cards' bottoms */
.card .result.show { flex: 1; }

label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 6px; }
.field {
  display: flex; gap: 8px; align-items: stretch;
}
input.text {
  flex: 1; font-family: var(--body); font-size: 1rem; color: var(--charcoal);
  background: var(--cream); border: 2px solid rgba(55,54,54,0.12);
  border-radius: 14px; padding: 12px 14px; min-width: 0;
}
input.text:focus { outline: none; border-color: var(--coral); }
.result {
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--cream); font-size: 0.95rem; word-break: break-all; display: none;
}
.result.show { display: block; }
.result.ok { border-left: 4px solid var(--green); }
.result.bad { border-left: 4px solid var(--coral); }
.copy {
  font-family: var(--body); font-weight: 600; font-size: 0.78rem; cursor: pointer;
  border: none; border-radius: var(--radius-pill); padding: 3px 11px; margin-left: 6px;
  background: var(--coral); color: var(--white); white-space: nowrap; vertical-align: middle;
}
.copy:hover { background: var(--coral-dark); }
.hint { font-size: 0.85rem; color: rgba(55,54,54,0.65); margin-top: 6px; }
.avail { font-weight: 700; font-size: 0.9rem; margin-top: 8px; min-height: 1.2em; }
.avail.free { color: var(--green); }
.avail.taken { color: var(--coral-dark); }
.avail.checking { opacity: 0.75; }
.avail.checking::before {
  content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-right: 6px; vertical-align: -0.1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.owned { font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
.owned strong { color: var(--coral); }
#acctConnect p { margin-top: 0; font-size: 1.02rem; }

.price {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--peach); border-radius: 14px; padding: 12px 14px; margin: 14px 0; font-weight: 600;
}
.price .fire { font-size: 1.1rem; }
.price a { color: var(--charcoal); font-weight: 700; }

/* ---------- faq ---------- */
.faq details {
  background: var(--white); border-radius: 16px; box-shadow: var(--shadow-card);
  padding: 4px 18px; margin: 10px 0;
}
.faq summary {
  font-family: var(--display); font-weight: 600; cursor: pointer; padding: 12px 0; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--coral); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 14px; font-size: 0.96rem; }

section { padding: 10px 0; }
.section-head { margin: 26px 0 6px; }

footer {
  margin-top: 40px; background: var(--charcoal); color: var(--cream);
  padding: 28px 0;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
footer a { color: var(--cream); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--yellow); }
.badge { background: rgba(255,255,255,0.12); border-radius: var(--radius-pill); padding: 4px 12px; font-size: 0.8rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(140%);
  background: var(--charcoal); color: var(--cream); padding: 14px 20px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); font-weight: 600; z-index: 50; max-width: 90vw;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s, visibility 0.3s;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.toast.bad { background: var(--coral-dark); }

/* release confirmation modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(55,54,54,0.45); backdrop-filter: blur(3px);
  animation: modalFade 0.18s ease;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius-card); padding: 26px 26px 20px;
  max-width: 420px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: modalPop 0.22s var(--ease-spring);
}
.modal h3 { font-family: var(--display); font-weight: 700; color: var(--charcoal); margin: 0 0 10px; font-size: 1.35rem; }
.modal h3 span { color: var(--coral-dark); }
.modal p { color: var(--charcoal); line-height: 1.5; margin: 0 0 20px; font-size: 0.95rem; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { transform: translateY(12px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 760px) {
  .hero .wrap, .grid2 { grid-template-columns: 1fr; }
  #dogSvg { max-width: 300px; }
  .brand span.full { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
