@font-face {
  font-family: "Monocraft";
  src: url("/fonts/Monocraft.ttf") format("truetype");
  font-display: swap;
}

:root {
  --text: #ffffff;
  --text-shadow: #3f3f3f;
  --gray: #aaaaaa;
  --dark-gray: #555555;
  --yellow: #ffff55;
  --gold: #ffaa00;
  --green: #55ff55;
  --aqua: #55ffff;
  --red: #ff5555;
  --purple: #ff55ff;
  --panel: #c6c6c6;
  --panel-text: #404040;
  --slot: #8b8b8b;
  --slot-dark: #373737;
  --tooltip: rgba(16, 0, 16, 0.94);
  --px: 2px; /* one Minecraft GUI pixel */
  --icon: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Always reserve the scrollbar's space so switching to a short tab doesn't
   widen the viewport and shift the whole page sideways. */
html { background: #1d140d; scrollbar-gutter: stable; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Monocraft", ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.62)),
    url("/ui/dirt.png") 0 0 / 64px 64px repeat;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  padding: 0 16px 48px;
}

.shadow, h1, h2, h3, .mc-btn, .hud-value, .tooltip-text { text-shadow: var(--px) var(--px) 0 var(--text-shadow); }

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

/* ------------------------------------------------------ token banner -- */
.token-banner {
  margin: 0 -16px;
  padding: 10px 16px;
  /* An oak-plank board, like a sign hung over the page. */
  background:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.28)),
    url("/ui/planks.png") 0 0 / 64px 64px repeat;
  image-rendering: pixelated;
  box-shadow:
    inset 0 var(--px) 0 rgba(255, 255, 255, 0.18),
    inset 0 calc(-1 * var(--px)) 0 #2b1d0e,
    0 calc(2 * var(--px)) 0 rgba(0, 0, 0, 0.45);
}
.token-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.token-name { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.token-name p { margin: 0; }
.token-icon { --icon: 40px; flex: none; }
.token-ticker { color: var(--yellow); font-size: 20px; text-shadow: var(--px) var(--px) 0 #3f3f00; }
.token-sub { color: #fff; font-size: 13px; text-shadow: var(--px) var(--px) 0 #3f3f3f; }
/* CA and trade button sit together on the right, same height, lined up with
   the Connect Wallet button below. */
.token-actions { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
/* The CA box is a Minecraft text field, the copy action a stone button. */
.token-banner .token-ca {
  min-width: 0;
  max-width: 470px;
  min-height: 32px;
  padding: 0 4px 0 8px;
  font-size: 13px;
  color: #e0e0e0;
  background: #000;
  border: var(--px) solid transparent;
  border-image: url("/ui/text_field.png") 1 fill / var(--px) / 0 stretch;
}
.token-banner .token-ca > span { color: #a0a0a0; }
.token-banner .token-ca .copy {
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
  border: 4px solid transparent;
  border-image: url("/ui/button.png") 3 fill / 4px / 0 repeat;
  text-shadow: 1px 1px 0 #3f3f3f;
}
.token-banner .token-ca .copy:hover { border-image-source: url("/ui/button_highlighted.png"); color: var(--yellow); }
.token-banner .token-ca code { min-width: 0; color: #e0e0e0; }
#token-trade[aria-disabled="true"] { pointer-events: none; }

/* ------------------------------------------------------------ header -- */
.topbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 0 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 28px;
}
.brand { position: relative; }
.logo {
  margin: 0;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #d9d9d9;
  background: linear-gradient(#ffffff 0 18%, #d0d0d0 18% 55%, #9c9c9c 55% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 4px 0 #4a4a4a) drop-shadow(4px 0 0 #2a2a2a) drop-shadow(0 4px 0 #111);
}
.splash {
  position: absolute;
  right: -40px;
  bottom: -6px;
  color: var(--yellow);
  text-shadow: var(--px) var(--px) 0 #3f3f00;
  font-size: 16px;
  white-space: nowrap;
  transform: rotate(-18deg);
  transform-origin: center;
  animation: splash 0.5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes splash { from { scale: 1; } to { scale: 1.08; } }
@media (prefers-reduced-motion: reduce) { .splash { animation: none; } }
.tagline { margin: 0; color: var(--gray); padding-left: 40px; }

/* ------------------------------------------------------------ widgets -- */
.mc-btn {
  font: inherit;
  color: var(--text);
  min-height: 40px;
  padding: 4px 16px;
  cursor: pointer;
  background: transparent;
  border: 6px solid transparent;
  border-image: url("/ui/button.png") 3 fill / 6px / 0 repeat;
  image-rendering: pixelated;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}
.mc-btn:hover, .mc-btn:focus-visible, .mc-btn[aria-selected="true"] {
  border-image-source: url("/ui/button_highlighted.png");
  color: var(--yellow);
  outline: none;
}
.mc-btn:disabled, .mc-btn[aria-disabled="true"] {
  border-image-source: url("/ui/button_disabled.png");
  color: #a0a0a0;
  text-shadow: none;
  cursor: default;
}
.mc-btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.mc-btn.wide { width: 100%; }
.mc-btn.icon-btn { min-height: 32px; width: 32px; padding: 0; font-size: 20px; }

.mc-input {
  font: inherit;
  color: #e0e0e0;
  background: #000;
  border: var(--px) solid transparent;
  border-image: url("/ui/text_field.png") 1 fill / var(--px) / 0 stretch;
  padding: 8px 10px;
  min-height: 40px;
  outline: none;
}
.mc-input:focus { border-image-source: url("/ui/text_field_highlighted.png"); color: #fff; }
.mc-input::placeholder { color: #707070; }
select.mc-input { cursor: pointer; }

.slot {
  width: calc(var(--icon) + 8px);
  height: calc(var(--icon) + 8px);
  flex: none;
  display: grid;
  place-items: center;
  background: var(--slot);
  box-shadow: inset var(--px) var(--px) 0 var(--slot-dark), inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 #fff;
}
.icon {
  width: var(--icon);
  height: var(--icon);
  background-image: url("/atlas.png");
  background-repeat: no-repeat;
  background-size: calc(var(--cols) * var(--icon)) auto;
  background-position: calc(var(--x) * var(--icon) * -1) calc(var(--y) * var(--icon) * -1);
  image-rendering: pixelated;
}

.xp {
  position: relative;
  height: 10px;
  background: url("/ui/xp_bar.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
}
.xp-fill {
  height: 100%;
  width: 0;
  background: url("/ui/xp_bar_progress.png") 0 0 / auto 100%;
  image-rendering: pixelated;
  transition: width 0.6s steps(12);
}

/* ---------------------------------------------------------------- hud -- */
.hud {
  max-width: 1400px;
  margin: 8px auto 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  align-items: end;
}
.hud-stat { display: flex; flex-direction: column; }
.hud-label { color: var(--gray); font-size: 13px; }
.hud-value { font-size: 24px; color: var(--green); font-variant-numeric: tabular-nums; }
.hud .xp { grid-column: 1 / -1; margin-top: 22px; }
.xp-level {
  position: absolute;
  left: 50%;
  top: -18px;
  translate: -50% 0;
  color: #80ff20;
  font-size: 15px;
  text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000;
}

/* ----------------------------------------------------------- controls -- */
.controls {
  max-width: 1400px;
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search { flex: 1 1 260px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--gray); }

/* -------------------------------------------------------------- panel -- */
.panel {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 16px 18px;
  background: var(--panel);
  color: var(--panel-text);
  border: var(--px) solid #000;
  border-radius: 6px;
  box-shadow: inset 4px 4px 0 #fff, inset -4px -4px 0 #555;
  min-height: 70vh;
}
.panel-title { margin: 0 0 12px; font-size: 16px; color: var(--panel-text); text-shadow: none; font-weight: 400; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  gap: 8px;
}
.empty { text-align: center; padding: 40px 0; margin: 0; }

/* -------------------------------------------------------------- cards -- */
.card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
  padding: 10px;
  min-height: 94px;
  background: var(--panel);
  box-shadow: inset var(--px) var(--px) 0 #fff, inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 #7a7a7a;
  outline: var(--px) solid #8b8b8b;
  content-visibility: auto;
  contain-intrinsic-size: auto 94px;
  cursor: pointer;
}
.card:hover .slot, .card:focus-visible .slot { background: #a8a8a8; }
.card:focus-visible { outline: var(--px) solid #fff; }
.card-name { margin: 0; font-size: 14px; font-weight: 400; color: var(--panel-text); text-shadow: none; overflow-wrap: anywhere; }
.card-sub { margin: 2px 0 0; font-size: 12px; color: #6b6b6b; }
.card .claim-btn { grid-column: 1 / -1; }

.card.pending { cursor: default; }
.card.pending .card-sub { color: #7a4f00; }
.card.pending .xp { grid-column: 1 / -1; }

.card.launched {
  grid-template-columns: auto 1fr;
  background: var(--tooltip);
  color: #fff;
  outline: var(--px) solid #1a0a2e;
  box-shadow: inset 0 0 0 var(--px) #150015, inset 0 0 0 calc(var(--px) * 2) #5000ff;
  cursor: default;
  contain-intrinsic-size: auto 250px;
}
.card.launched .slot { box-shadow: inset var(--px) var(--px) 0 #1b1b1b, inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 #6d6d6d; background: #3b3b3b; }
.card.launched .card-name { color: var(--gold); text-shadow: var(--px) var(--px) 0 #2a1a00; }
.card.launched .card-sub { color: var(--aqua); }
.card.mine { box-shadow: inset 0 0 0 var(--px) #150015, inset 0 0 0 calc(var(--px) * 2) #00c060; }

.lore { grid-column: 1 / -1; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.lore dt { color: var(--gray); }
.lore dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lore .v-green { color: var(--green); }
.lore .v-gold { color: var(--yellow); }
.ca {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--purple);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 6px;
  border: 1px solid #2d1450;
}
.ca code { font-family: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.copy {
  font: inherit;
  font-size: 11px;
  color: var(--gray);
  background: none;
  border: 1px solid #555;
  padding: 1px 6px;
  cursor: pointer;
}
.copy:hover { color: #fff; border-color: #aaa; }
.card .trade { grid-column: 1 / -1; }
.creator { grid-column: 1 / -1; margin: 0; font-size: 11px; color: #8a8a8a; }
.creator a { color: #8a8a8a; }

/* ------------------------------------------------------------ dialogs -- */
.window {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 18px 20px 20px;
  color: var(--panel-text);
  background: var(--panel);
  border: var(--px) solid #000;
  border-radius: 6px;
  box-shadow: inset 4px 4px 0 #fff, inset -4px -4px 0 #555, 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow-x: hidden;
  overflow-y: auto;
}
.window::backdrop { background: rgba(10, 6, 2, 0.7); }
.window-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.window-title { margin: 0 44px 14px 0; font-size: 20px; color: var(--panel-text); text-shadow: none; font-weight: 400; }
.claim { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; }
.slot-big { --icon: 160px; }
.slot-big img { width: 160px; height: 160px; image-rendering: pixelated; }
.claim-rarity { text-align: center; margin: 8px 0 0; font-size: 13px; }
.claim-form { display: grid; gap: 10px; }
.field { display: grid; gap: 4px; }
.field .mc-input { width: 100%; min-width: 0; }
.field > span { font-size: 13px; }
.socials summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.socials .field { margin-top: 6px; }
.fine { margin: 0; font-size: 12px; color: #5a5a5a; }
.steps { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.steps li { padding: 6px 10px; background: #b0b0b0; color: #6b6b6b; }
.steps li::before { content: "\25A1  "; }
.steps li.active { background: #fff8c8; color: #3a3000; }
.steps li.active::before { content: "\25B6  "; }
.steps li.done { background: #c8f0c8; color: #1f5a1f; }
.steps li.done::before { content: "\2714  "; }
.countdown { float: right; }
.error { margin: 10px 0 0; padding: 8px 10px; background: #3a0000; color: var(--red); text-shadow: 1px 1px 0 #200; }
.claim-done { margin-top: 12px; display: grid; gap: 10px; }
.claim-done .ca { background: #2a1640; }
.claim-done .lore { font-size: 14px; }
.claim-done .lore dt { color: #5a5a5a; }

.wallet-area { display: flex; gap: 8px; align-items: center; }

.about { width: min(600px, calc(100vw - 32px)); }
.about-lead { margin: 0 0 14px; }
.about-steps { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: step; }
.about-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
}
.about-steps li::before {
  content: counter(step);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  text-shadow: var(--px) var(--px) 0 var(--text-shadow);
  background: var(--slot);
  box-shadow: inset var(--px) var(--px) 0 var(--slot-dark), inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 #fff;
}
.about-steps b { color: #202020; font-weight: 400; }
.about-note { margin: 0 0 14px; padding: 8px 10px; background: #b0b0b0; font-size: 13px; }
.about .fine { margin-bottom: 14px; }

.wallet-list { display: grid; gap: 8px; }
.wallet-list .mc-btn { justify-content: flex-start; }
.wallet-list img { width: 24px; height: 24px; image-rendering: auto; }
.wallet-list p { margin: 0; }

/* ------------------------------------------------------------- toasts -- */
.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
.toast {
  width: 320px;
  height: 64px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 14px;
  background: url("/ui/toast.png") 0 0 / 100% 100%;
  image-rendering: pixelated;
  animation: toast-in 0.4s ease-out, toast-out 0.4s ease-in 5.6s forwards;
  --icon: 48px;
}
.toast .t-title { color: var(--yellow); font-size: 13px; text-shadow: var(--px) var(--px) 0 #3f3f00; }
.toast .t-body { color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes toast-in { from { translate: 110% 0; } }
@keyframes toast-out { to { translate: 110% 0; } }

/* ------------------------------------------------------------- footer -- */
.footer { max-width: 1400px; margin: 28px auto 0; color: #8a8a8a; font-size: 12px; text-align: center; }
.footer p { margin: 4px 0; }

/* ------------------------------------------------------------- mobile -- */
@media (max-width: 800px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding-top: 20px; }
  .logo { font-size: clamp(30px, 9vw, 60px); }
  .tagline { grid-column: 1 / -1; grid-row: 2; padding-left: 0; margin-top: 6px; }
  .splash { right: auto; left: 45%; bottom: -16px; font-size: 12px; }
  .wallet-area .mc-btn { padding: 2px 10px; font-size: 13px; }
  .search { flex-basis: 100%; min-width: 0; width: 100%; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .claim { grid-template-columns: 1fr; justify-items: center; }
  .claim-main { width: 100%; }
}
@media (max-width: 480px) {
  .logo { font-size: 8vw; }
  .topbar { gap: 8px; }
  .wallet-area { gap: 6px; }
  .wallet-area .mc-btn { font-size: 12px; padding: 2px 8px; }
  .wallet-area .icon-btn { width: 32px; padding: 0; }
  .token-sub { display: none; }
  .token-actions { flex: 1 1 100%; flex-direction: column; }
  body { font-size: 14px; }
  .grid { grid-template-columns: 1fr; }
  .sort { width: 100%; }
  .sort select { flex: 1; }
  .toast { width: calc(100vw - 32px); }
}