:root {
  --bg: #D8E2A6;
  --ink: #24160F;
  --card: #F4F7E4;
  --accent: #EE8F8A;
  --doom: #B3201A;

  --border: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --blob: 28px 18px 32px 16px;
  --blob-alt: 18px 30px 14px 26px;

  --font-head: "Modak", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-doom: "Rubik Wet Paint", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }

h1, h2, h3 { margin: 0; line-height: 0.95; font-weight: 400; }

main {
  width: min(100% - 32px, 960px);
  margin-inline: auto;
  display: grid;
  gap: 48px;
}


/* ---------- shared bits ---------- */

.card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--blob);
  box-shadow: var(--shadow);
}

.section-title,
.logo,
.hero-name {
  font-family: var(--font-head);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  letter-spacing: 0.01em;
}

.section-title {
  font-size: clamp(2.6rem, 9vw, 3.75rem);
  color: var(--accent);
  margin-bottom: 8px;
}

.section-sub { margin: 0 0 20px; }

.btn {
  font: 700 1.0625rem/1 var(--font-body);
  color: var(--ink);
  background: var(--accent);
  border: var(--border);
  border-radius: 16px 22px 14px 20px;
  box-shadow: var(--shadow-sm);
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.6; cursor: wait; }

:focus-visible { outline: 3px dashed var(--doom); outline-offset: 3px; }

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  padding: 36px 16px 32px;
}

.logo {
  font-size: clamp(4.5rem, 22vw, 9rem);
  color: var(--accent);
  transform: rotate(-3deg);
  display: inline-block;
  text-shadow: 5px 5px 0 var(--ink);
}

.tagline {
  max-width: 28ch;
  margin: 12px auto 0;
  font-weight: 700;
  font-size: 1.15rem;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  overflow: visible;
  transform: rotate(-0.8deg);
}

.hero-photo {
  position: relative;
  margin: 14px 14px 0;
}
.hero-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: var(--border);
  border-radius: var(--blob-alt);
}

.sticker {
  position: absolute;
  top: -10px;
  right: -8px;
  background: var(--accent);
  border: var(--border);
  border-radius: 50% 45% 52% 48%;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  transform: rotate(12deg);
  box-shadow: var(--shadow-sm);
}

.hero-text { padding: 18px 20px 24px; }

.hero-num {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.hero-name {
  font-size: clamp(3rem, 13vw, 4.75rem);
  color: var(--card);
  margin: 4px 0 10px;
}

.hero-date {
  display: inline-block;
  margin: 0;
  background: var(--bg);
  border: var(--border);
  border-radius: 12px 18px 10px 16px;
  padding: 6px 12px;
  transform: rotate(1deg);
}

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .hero-photo { margin: 18px 0 18px 18px; }
  .hero-text { padding: 24px 28px; }
}

/* ---------- follow ---------- */

.follow {
  padding: 28px 20px 32px;
  border-radius: var(--blob-alt);
  transform: rotate(0.6deg);
  text-align: center;
}
.follow p { max-width: 40ch; margin: 0 auto 22px; }

.btn--big {
  display: inline-block;
  font-size: 1.25rem;
  padding: 18px 28px;
  text-decoration: none;
}

@media (min-width: 560px) {
  .follow { padding: 36px 32px 40px; }
}

/* ---------- grogdex ---------- */

.grogdex-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 12px;
}
@media (min-width: 480px) { .grogdex-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) { .grogdex-grid { grid-template-columns: repeat(6, 1fr); gap: 20px 16px; } }

.tile {
  position: relative;
  aspect-ratio: 1;
  border: var(--border);
  border-radius: var(--r, var(--blob));
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--card);
  overflow: hidden;
  transform: rotate(var(--tilt, 0deg));
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-num,
.tile-name {
  position: relative;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
}

.tile-num {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px 10px 7px 9px;
  padding: 3px 5px;
}

.tile-name {
  margin-bottom: 6px;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 8px 10px 7px 9px;
  padding: 3px 6px;
  white-space: nowrap;
  max-width: calc(100% - 8px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the "transparent PNG" checkerboard, for guys that don't exist yet */
.tile--unknown {
  background:
    repeating-conic-gradient(#e6eac9 0 25%, #f8faee 0 50%) 0 0 / 16px 16px;
}

.tile-shadow {
  position: absolute;
  left: 50%;
  top: 52%;
  width: var(--w, 52%);
  height: var(--h, 60%);
  translate: -50% -50%;
  background: var(--ink);
  border-radius: var(--sr, 48% 52% 40% 60% / 60% 55% 45% 40%);
  filter: blur(5px);
  opacity: 0.75;
  rotate: var(--sr-tilt, 0deg);
}
.tile-shadow::before {
  /* lumpy head */
  content: "";
  position: absolute;
  left: var(--hx, 30%);
  top: -22%;
  width: 46%;
  height: 46%;
  background: inherit;
  border-radius: 50%;
}

.tile-q {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 6vw, 2rem);
  color: var(--card);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

/* ---------- how it works ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); gap: 24px; } }

.step {
  position: relative;
  padding: 22px 20px 20px 72px;
  transform: rotate(var(--tilt, 0deg));
}
.step:nth-child(even) { border-radius: var(--blob-alt); }

.step h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.15;
  margin-bottom: 6px;
}
.step p { margin: 0; }

.step-num {
  position: absolute;
  left: 14px;
  top: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--card);
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  background: var(--accent);
  border: var(--border);
  border-radius: 50% 44% 54% 46%;
}

.step--doom { border-color: var(--doom); box-shadow: 6px 6px 0 var(--doom); }
.step--doom .step-num { background: var(--doom); }

.destroyed {
  font-family: var(--font-doom);
  font-weight: 400;
  color: var(--doom);
  font-size: 1.35em;
  letter-spacing: 0.02em;
}

/* ---------- footer ---------- */

.footer {
  margin-top: 64px;
  padding: 28px 16px 40px;
  border-top: var(--border);
  text-align: center;
  font-weight: 700;
}
.footer p { margin: 4px 0; }

/* ---------- data-driven hero & tiles ---------- */

a.hero-photo { display: block; color: inherit; }
.hero-photo { overflow: hidden; }
.hero-photo .tile-shadow { position: relative; display: block; translate: none; left: auto; top: auto;
  width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--blob-alt); filter: blur(10px); }

.hero-status { display: grid; gap: 8px; justify-items: start; margin-bottom: 14px; }
.hero-status p { margin: 0; }
.hero-line { font-weight: 700; }
.hero-bar { color: var(--doom); }
.hero-date--doom { font-family: var(--font-doom); color: var(--doom); font-size: 1.3rem; }
.hero-countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.hero-link { font-weight: 700; }

.tile-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: var(--ink);
  text-decoration: none;
}
.tile:has(.tile-link:hover) { transform: rotate(0deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.tile-link:focus-visible { outline-offset: -6px; }

.tile--destroyed img { filter: grayscale(1) contrast(1.1) brightness(0.85); }

.tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--doom);
  color: var(--card);
  border: 2px solid var(--ink);
  border-radius: 8px 10px 7px 9px;
  padding: 3px 6px;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
}

.stamp-destroyed {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  rotate: -14deg;
  font-family: var(--font-doom);
  font-size: clamp(1.8rem, 9vw, 3.2rem);
  line-height: 1;
  color: var(--doom);
  background: rgb(244 247 228 / 0.88);
  border: 4px solid var(--doom);
  border-radius: 12px 18px 10px 16px;
  padding: 6px 14px 8px;
  white-space: nowrap;
  pointer-events: none;
}
.tile .stamp-destroyed { font-size: 0.85rem; border-width: 2px; padding: 2px 5px 3px; }

/* ---------- entry page (/g/001) ---------- */

.entry-loading { text-align: center; font-weight: 700; }

.entry { display: grid; gap: 28px; }
@media (min-width: 820px) { .entry { grid-template-columns: 1.1fr 1fr; align-items: start; } }

.entry-photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--blob-alt);
  transform: rotate(-0.8deg);
}
.entry-photo img { width: 100%; height: 100%; object-fit: cover; }
.entry-photo .tile-q { font-size: clamp(3rem, 16vw, 5rem); }
.entry-photo .tile-shadow { filter: blur(10px); }

.entry-thumbs {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.entry-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: var(--border);
  border-radius: 12px 16px 10px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }
.entry-thumb[aria-current="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }

.entry-side { display: grid; gap: 24px; }

.entry-info { padding: 20px 20px 22px; transform: rotate(0.5deg); }
.entry-name {
  font-family: var(--font-head);
  font-size: clamp(3rem, 13vw, 4.5rem);
  color: var(--accent);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  margin: 4px 0 12px;
}
.entry-lore { margin: 0 0 14px; }

.entry-details,
.auction-rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
}
.entry-details dt,
.auction-rows dt { font-weight: 700; }
.entry-details dd,
.auction-rows dd { margin: 0; }

.auction-box {
  padding: 20px 20px 22px;
  border-radius: var(--blob-alt);
  transform: rotate(-0.6deg);
}
.auction-box[data-status="live"] { box-shadow: 6px 6px 0 var(--accent), 9px 9px 0 var(--ink); }
.auction-box[data-status="destroyed"] { border-color: var(--doom); box-shadow: 6px 6px 0 var(--doom); }
.auction-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.auction-status { margin: 0 0 14px; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.auction-status .stamp-destroyed { position: static; translate: none; display: inline-block; margin: 8px 0 4px 6px; }
.auction-countdown { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25rem; }
.auction-bar { color: var(--doom); font-weight: 700; }

.entry-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.entry-nav [hidden] { display: inline !important; visibility: hidden; }

@media (min-width: 560px) {
  .entry-info, .auction-box { padding: 26px 28px 28px; }
}

/* ---------- forms & panels (sign-in, account) ---------- */

[hidden] { display: none !important; }

.masthead--small { padding: 20px 16px 24px; }
.masthead--small .logo { font-size: clamp(3rem, 14vw, 4.5rem); }
.logo-link { text-decoration: none; }

.panel {
  width: min(100%, 560px);
  margin-inline: auto;
  padding: 26px 20px 22px;
  transform: rotate(-0.4deg);
}
.panel p { margin: 0 0 16px; }
.panel-lead { font-weight: 700; }

.stack { display: grid; gap: 8px; }

.field-label { font-weight: 700; }

.field-row { display: grid; gap: 12px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr auto; } }

.field-row input {
  width: 100%;
  font: 1.0625rem var(--font-body);
  color: var(--ink);
  background: #fff;
  border: var(--border);
  border-radius: 14px 20px 12px 18px;
  padding: 13px 14px;
}
.field-row input::placeholder { color: #7d7266; }

.or { margin: 18px 0 10px !important; font-weight: 700; text-align: center; }

.btn--quiet { width: 100%; background: var(--card); }

.link-btn {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
a.btn { display: inline-block; text-decoration: none; }

.form-status { min-height: 1.5em; margin: 14px 0 0 !important; font-weight: 700; }
.form-status.is-error { color: var(--doom); }

@media (min-width: 560px) { .panel { padding: 34px 32px 28px; } }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
