/* ================= ROBIZARDS — shared styles ================= */
:root {
  --night: #454158;
  --night-deep: #37334a;
  --night-darker: #2b2839;
  --ink: #17141f;
  --green: #4fd15f;
  --green-bright: #6ee87d;
  --cream: #e8e6dc;
  --cream-dim: #b9b6ae;
  --purple: #6b4fb0;
  --purple-bright: #8a6ad4;
  --purple-dark: #4a3a7a;
  --cyan: #5ce0c8;
  --gold: #f5c542;
  --crimson: #c04a55;
  --pix-border: 4px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--cream);
  font-family: 'VT323', monospace;
  font-size: 22px;
  line-height: 1.5;
  overflow-x: hidden;
}

img.pix { image-rendering: pixelated; }

h1, h2, h3, .pixfont {
  font-family: 'Press Start 2P', monospace;
  line-height: 1.5;
}

a { color: var(--cyan); text-decoration: none; }

/* ---------- starfield ---------- */
#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--cream);
  animation: twinkle 3s infinite;
}
.star.g { background: var(--green); }
.star.y { background: var(--gold); width: 4px; height: 4px; }
@keyframes twinkle {
  0%, 100% { opacity: .15; }
  50% { opacity: 1; }
}

main, nav, footer { position: relative; z-index: 1; }

/* ---------- nav ---------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(43, 40, 57, .92);
  border-bottom: var(--pix-border) solid var(--ink);
  backdrop-filter: blur(4px);
}
nav .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
}
nav .logo img {
  width: 40px; height: 40px;
  border: 3px solid var(--ink);
}
nav .links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}
nav .links a {
  color: var(--cream);
  font-size: 20px;
  transition: color .15s;
}
nav .links a:hover { color: var(--green-bright); }

/* ---------- pixel button ---------- */
.btn {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  padding: 16px 26px;
  color: var(--ink);
  background: var(--green);
  border: var(--pix-border) solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .15s;
  text-align: center;
}
.btn:hover { background: var(--green-bright); transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn.purple { background: var(--purple); color: var(--cream); }
.btn.purple:hover { background: var(--purple-bright); }
.btn.ghost { background: transparent; color: var(--cream); }
.btn.ghost:hover { background: rgba(255,255,255,.08); }
.btn.small { font-size: 10px; padding: 12px 18px; }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 0;
  position: relative;
}
.hero h1 {
  font-size: clamp(30px, 7vw, 64px);
  color: var(--green);
  text-shadow: 5px 5px 0 var(--ink);
  animation: heroIn .8s ease both;
}
.hero .underline {
  width: min(520px, 70vw);
  height: 6px;
  background: var(--green);
  margin: 26px auto;
  box-shadow: 4px 4px 0 var(--ink);
  animation: growLine 1s .3s ease both;
}
@keyframes growLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero .sub {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(11px, 2.4vw, 18px);
  color: var(--cream);
  letter-spacing: 2px;
  animation: heroIn .8s .2s ease both;
}
.hero .cta-row {
  display: flex;
  gap: 20px;
  margin-top: 44px;
  flex-wrap: wrap;
  justify-content: center;
  animation: heroIn .8s .4s ease both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* wizard lineup standing on the ground */
.lineup {
  display: flex;
  gap: clamp(6px, 2vw, 26px);
  margin-top: auto;
  padding-top: 60px;
  align-items: flex-end;
}
.lineup img {
  width: clamp(64px, 9vw, 110px);
  animation: bob 2.4s ease-in-out infinite;
}
.lineup img:nth-child(2n) { animation-delay: .4s; }
.lineup img:nth-child(3n) { animation-delay: .8s; }
.lineup img:nth-child(5n) { animation-delay: 1.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.ground {
  width: 100%;
  height: 26px;
  background: var(--night-darker);
  border-top: var(--pix-border) solid var(--ink);
}

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  background: var(--night-darker);
  border-top: var(--pix-border) solid var(--ink);
  border-bottom: var(--pix-border) solid var(--ink);
  padding: 18px 0;
}
.marquee .track {
  display: flex;
  gap: 60px;
  width: max-content;
  animation: scroll 22s linear infinite;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--green);
  white-space: nowrap;
}
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { padding: 100px 24px; max-width: 1100px; margin: 0 auto; }
section .kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 3px;
  margin-bottom: 16px;
}
section h2 {
  font-size: clamp(20px, 4vw, 32px);
  color: var(--green);
  text-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 40px;
}
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s ease; }
.reveal.on { opacity: 1; transform: translateY(0); }

/* cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 26px;
}
.card {
  background: var(--night-deep);
  border: var(--pix-border) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 30px 26px;
  transition: transform .15s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--ink); }
.card .num {
  font-family: 'Press Start 2P', monospace;
  font-size: 26px;
  color: var(--gold);
  margin-bottom: 14px;
}
.card h3 { font-size: 13px; color: var(--cream); margin-bottom: 14px; }
.card p { color: var(--cream-dim); font-size: 21px; }

/* traits */
.traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.trait {
  background: var(--night-deep);
  border: var(--pix-border) solid var(--ink);
  padding: 20px;
  box-shadow: 6px 6px 0 var(--ink);
}
.trait .t-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--purple-bright);
  margin-bottom: 10px;
}
.trait .t-count { color: var(--cream-dim); font-size: 20px; }
.trait .bar {
  height: 10px;
  background: var(--night-darker);
  border: 2px solid var(--ink);
  margin-top: 12px;
}
.trait .bar > i {
  display: block;
  height: 100%;
  background: var(--cyan);
}

/* gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
}
.gallery img {
  width: 100%;
  border: var(--pix-border) solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
  background: var(--night-deep);
}
.gallery img:hover {
  transform: translate(-3px, -5px) rotate(-1deg);
  box-shadow: 9px 11px 0 var(--ink);
}

/* big CTA */
.big-cta {
  text-align: center;
  background: var(--night-deep);
  border: var(--pix-border) solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  padding: 70px 30px;
}
.big-cta h2 { margin-bottom: 20px; }
.big-cta p { color: var(--cream-dim); margin-bottom: 36px; }

/* footer */
footer {
  border-top: var(--pix-border) solid var(--ink);
  background: var(--night-darker);
  padding: 40px 24px;
  text-align: center;
  color: var(--cream-dim);
}
footer .f-title {
  font-family: 'Press Start 2P', monospace;
  color: var(--green);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ================= APPLY PAGE ================= */
.apply-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 150px 24px 100px;
}
.apply-head { text-align: center; margin-bottom: 50px; }
.apply-head img {
  width: 96px; height: 96px;
  border: var(--pix-border) solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  margin-bottom: 26px;
  animation: bob 2.4s ease-in-out infinite;
}
.apply-head h1 {
  font-size: clamp(18px, 4.5vw, 30px);
  color: var(--green);
  text-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 18px;
}
.apply-head p { color: var(--cream-dim); }

/* progress */
.progress {
  margin: 40px 0;
}
.progress .p-label {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--cream-dim);
  margin-bottom: 10px;
}
.progress .p-label b { color: var(--gold); }
.p-bar {
  height: 22px;
  background: var(--night-darker);
  border: var(--pix-border) solid var(--ink);
}
.p-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, var(--green-bright) 12px 24px);
  transition: width .4s ease;
}

/* task cards */
.task {
  background: var(--night-deep);
  border: var(--pix-border) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 28px;
  margin-bottom: 30px;
  transition: border-color .2s;
  position: relative;
}
.task.done { border-color: var(--green); }
.task.done::after {
  content: "✔";
  position: absolute;
  top: -16px; right: -14px;
  width: 36px; height: 36px;
  background: var(--green);
  color: var(--ink);
  border: 4px solid var(--ink);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.task .t-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.task .t-step {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  background: var(--purple);
  color: var(--cream);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  flex-shrink: 0;
}
.task h3 { font-size: 13px; color: var(--cream); }
.task p.desc { color: var(--cream-dim); margin-bottom: 18px; }
.task .row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: stretch;
}
.task input[type="text"] {
  flex: 1;
  min-width: 220px;
  background: var(--night-darker);
  border: var(--pix-border) solid var(--ink);
  color: var(--cream);
  font-family: 'VT323', monospace;
  font-size: 22px;
  padding: 12px 16px;
  outline: none;
}
.task input[type="text"]:focus { border-color: var(--cyan); }
.task input.ok { border-color: var(--green); }
.task input.bad { border-color: var(--crimson); }
.task .hint { font-size: 18px; color: var(--cream-dim); margin-top: 10px; }
.task .err { font-size: 18px; color: var(--crimson); margin-top: 10px; display: none; }
.task .err.show { display: block; animation: shake .3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* pixel checkbox */
.check {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  margin-top: 16px;
  user-select: none;
  font-size: 21px;
}
.check input { display: none; }
.check .box {
  width: 26px; height: 26px;
  background: var(--night-darker);
  border: var(--pix-border) solid var(--ink);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: bold;
  transition: background .15s;
}
.check input:checked + .box { background: var(--green); }
.check input:checked + .box::after { content: "✔"; }

.submit-zone { text-align: center; margin-top: 50px; }
.submit-zone .btn { font-size: 15px; padding: 20px 40px; }
.submit-zone .btn.locked {
  background: var(--night-deep);
  color: var(--cream-dim);
  cursor: not-allowed;
}
.submit-zone .btn.locked:hover { transform: none; box-shadow: 0 6px 0 var(--ink); }

/* success */
#success {
  display: none;
  text-align: center;
  padding: 60px 24px;
  background: var(--night-deep);
  border: var(--pix-border) solid var(--green);
  box-shadow: 8px 8px 0 var(--ink);
}
#success.show { display: block; animation: pop .4s ease; }
#success h2 {
  color: var(--green);
  font-size: clamp(16px, 4vw, 24px);
  text-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 20px;
}
#success p { color: var(--cream-dim); margin-bottom: 8px; }
#success .wallet-echo {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  background: var(--night-darker);
  border: 3px solid var(--ink);
  color: var(--cyan);
  word-break: break-all;
}

/* sparkles on success */
.spark {
  position: fixed;
  width: 8px; height: 8px;
  pointer-events: none;
  z-index: 99;
  animation: fall 1.6s linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

@media (max-width: 640px) {
  nav .links a:not(.btn) { display: none; }
  .lineup img:nth-child(n+6) { display: none; }
}
