:root {
  --lav: #F1ECFF;
  --ink: #221A4E;
  --sun: #FFC933;
  --pink: #FF5C9A;
  --mint: #37D9A5;
  --white: #fff;
  --shadow: 5px 5px 0 var(--ink);
  --display: "Bagel Fat One", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--lav); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1.9rem/1 var(--display); }
.top nav { display: flex; gap: 6px; }
.top nav a { text-decoration: none; font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.top nav a:hover { background: var(--sun); }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); letter-spacing: .005em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h3 { font-size: 1.4rem; }

/* hero */
.hero { padding: 18px 0 56px; }
.hero-copy { max-width: 640px; margin-bottom: 26px; }
.hero-copy p { font-size: 1.15rem; margin: 14px 0 0; max-width: 56ch; }
.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 28px; align-items: start; }
.stage { background: var(--sun); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 8px 8px 0 var(--ink); padding: 14px; }
canvas { width: 100%; height: auto; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; background: #fff; display: block; }

.controls, .post { background: #fff; border: 3px solid var(--ink); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 800; margin-bottom: 8px; padding: 0; }
label { display: grid; gap: 6px; font-weight: 800; font-size: .95rem; }
input[type=text], input:not([type]), input[type=search] {
  font: inherit; font-weight: 600; color: var(--ink); background: var(--lav);
  border: 3px solid var(--ink); border-radius: 12px; padding: 10px 12px; width: 100%;
}
input::placeholder { color: #7a70a8; font-weight: 400; }
input[type=range] { width: 100%; accent-color: var(--pink); }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumb { padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: #fff; cursor: pointer; overflow: hidden; aspect-ratio: 1; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-pressed=true] { outline: 4px solid var(--pink); outline-offset: 1px; }
.thumb.upload { display: grid; place-items: center; font-weight: 800; font-size: .8rem; text-align: center; background: var(--mint); line-height: 1.15; padding: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

.btn {
  font: 800 1rem/1 var(--body); color: var(--ink); background: var(--pink);
  border: 3px solid var(--ink); border-radius: 999px; padding: 13px 20px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink); text-decoration: none; display: inline-block;
}
.btn:hover { background: #ff77ac; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn.ghost { background: #fff; }
.btn.ghost:hover { background: var(--sun); }
.btn:disabled { opacity: .55; cursor: wait; }
.post { margin-top: 26px; max-width: 520px; }
.post[hidden] { display: none; }

/* board */
.board { padding: 24px 0 56px; }
.board-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sub { margin: 8px 0 0; font-weight: 600; }
.tabs { display: flex; gap: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 4px; }
.tab { font: 800 .95rem var(--body); color: var(--ink); background: none; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.tab.on { background: var(--sun); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.card { background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-bottom: 3px solid var(--ink); background: var(--lav); }
.card-body { padding: 12px 14px 14px; display: grid; gap: 8px; }
.card-title { font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.card-by { font-size: .9rem; opacity: .8; }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.rank { font: 400 1.25rem var(--display); background: var(--sun); border: 3px solid var(--ink); border-radius: 999px; min-width: 40px; text-align: center; padding: 1px 8px; }
.vote { font: 800 .95rem var(--body); color: var(--ink); background: var(--lav); border: 3px solid var(--ink); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.vote:hover { background: var(--mint); }
.vote[aria-pressed=true] { background: var(--mint); cursor: default; }
.empty { font-weight: 800; font-size: 1.15rem; background: #fff; border: 3px dashed var(--ink); border-radius: 18px; padding: 28px; text-align: center; }
#winnersWrap { margin-top: 42px; }
.winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 14px; }
.winner { background: var(--mint); border: 3px solid var(--ink); border-radius: 16px; padding: 10px; font-weight: 800; font-size: .9rem; }
.winner img { border: 3px solid var(--ink); border-radius: 10px; margin-bottom: 8px; aspect-ratio: 1; object-fit: cover; width: 100%; }

/* token */
.token { background: var(--sun); border: 4px solid var(--ink); border-radius: 26px; padding: clamp(20px, 4vw, 40px); box-shadow: 8px 8px 0 var(--ink); }
.token-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 26px; margin-top: 22px; }
.facts { margin: 0; display: grid; gap: 0; background: #fff; border: 3px solid var(--ink); border-radius: 18px; overflow: hidden; }
.facts div { display: flex; justify-content: space-between; gap: 14px; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
.facts div:last-child { border-bottom: 0; }
dt { font-weight: 800; }
dd { margin: 0; text-align: right; }
.ca-box { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 18px; display: grid; gap: 12px; align-content: start; }
.ca { font: 600 1rem/1.4 ui-monospace, Menlo, monospace; background: var(--lav); border: 3px solid var(--ink); border-radius: 12px; padding: 12px; overflow-wrap: anywhere; }
.note { margin: 0; font-size: .9rem; }
.disclaimer { margin: 22px 0 0; font-weight: 600; font-size: .95rem; max-width: 80ch; }

footer { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 20px 40px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 800; transition: transform .25s; max-width: calc(100vw - 32px); z-index: 20; }
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: #b3123f; }

@media (max-width: 860px) {
  .maker { grid-template-columns: 1fr; }
  .stage { box-shadow: 5px 5px 0 var(--ink); }
}
@media (max-width: 480px) {
  .top nav a { padding: 8px 10px; }
  .brand { font-size: 1.6rem; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { transition: none; }
}

.btn[aria-disabled="true"] { background: #fff; opacity: .85; cursor: not-allowed; }
.howto { margin-top: 24px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 18px 22px; max-width: 760px; }
.howto ol { margin: 10px 0 0; padding-left: 1.3em; display: grid; gap: 6px; }
@media (max-width: 380px) {
  .top { flex-wrap: wrap; gap: 4px 8px; padding: 10px 14px; }
  .top nav a { padding: 6px 8px; font-size: .95rem; }
  main { padding-left: 14px; padding-right: 14px; }
  .token { padding: 16px; }
}
.facts div { flex-wrap: wrap; }
.facts dd { text-align: right; overflow-wrap: anywhere; }
