/* SnapWre / Echowave palette — dark terminal aesthetic */
:root {
  --slate:      #0e1116; /* deep slate background */
  --slate-2:    #151a22; /* panel */
  --slate-3:    #1c232e; /* border */
  --gold:       #e1a730; /* meskel gold accent */
  --gold-dim:   #a67a1f;
  --green:      #3fb27f; /* highland green — success */
  --red:        #e06c5b;
  --text:       #c9d1d9;
  --muted:      #6b7684;
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", ui-monospace,
          Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--slate);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.2rem 4rem;
  /* soft gold vignette from the top */
  background:
    radial-gradient(1100px 480px at 50% -8%, rgba(225,167,48,0.10), transparent 60%),
    var(--slate);
}

.wrap { width: 100%; max-width: 720px; position: relative; z-index: 1; }

/* --- CRT scanlines + faint flicker ------------------------------------------ */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.020) 0px,
    rgba(255, 255, 255, 0.020) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,100% { opacity: 0.5; } 48% { opacity: 0.65; } 50% { opacity: 0.4; } }

/* --- boot reveal (staggered fade + slide) ----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reveal { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none; opacity: 1; transform: none; }
  .scanlines { animation: none; }
}

.brand {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dim { color: var(--muted); }
.cursor { color: var(--gold); animation: blink 1.05s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

h1 {
  font-size: 1.7rem;
  line-height: 1.25;
  margin: 0.4rem 0 1rem;
  color: #f0f3f6;
}
/* gold text-glow that gently breathes */
.glow { text-shadow: 0 0 0 rgba(225,167,48,0); animation: glow 3.6s ease-in-out infinite; }
@keyframes glow {
  0%,100% { text-shadow: 0 0 8px rgba(225,167,48,0.10); }
  50%     { text-shadow: 0 0 20px rgba(225,167,48,0.28); }
}

.tag { color: var(--muted); font-size: 0.85rem; }

.lede { color: var(--text); margin: 0 0 1.6rem; }
.lede em { color: var(--gold); font-style: normal; }

.cta {
  display: inline-block;
  margin: 0.2rem 0 0;
  color: var(--gold);
  border-bottom: 1px solid transparent;
  transition: letter-spacing 0.25s ease, color 0.2s ease;
}
.cta:hover { color: #f2c45c; letter-spacing: 0.03em; border-bottom-color: var(--gold-dim); }
.muted { color: var(--muted); }

.panel {
  background: var(--slate-2);
  border: 1px solid var(--slate-3);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
}
.panel h2 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 0.7rem;
}

.prompt::before { content: "$ "; color: var(--green); }
code, .mono { font-family: var(--mono); }
.k { color: var(--gold); }

a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); }
a:hover { color: #f2c45c; }

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  margin-top: 0.4rem;
}
.stat {
  background: var(--slate);
  border: 1px solid var(--slate-3);
  border-radius: 6px;
  padding: 0.7rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: var(--gold-dim);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.stat .num { font-size: 1.6rem; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.stat.green .num { color: var(--green); }
/* "slots left" quietly pulses to drive urgency */
.stat.green { animation: slotpulse 2.4s ease-in-out infinite; }
@keyframes slotpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(63,178,127,0.0); }
  50%     { box-shadow: 0 0 0 3px rgba(63,178,127,0.10); }
}

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.9rem; }
th, td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--slate-3); }
th { color: var(--muted); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
td .rank { color: var(--gold); font-weight: 700; }
/* leaderboard rows slide in as they load */
.lb-row {
  opacity: 0;
  animation: reveal 0.4s ease forwards;
  animation-delay: calc(1.1s + var(--i, 0) * 0.08s);
}

.hint { color: var(--muted); font-size: 0.8rem; margin-top: 1.4rem; }
.foot { color: var(--muted); font-size: 0.75rem; margin-top: 2.5rem; text-align: center; }

/* form */
label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.8rem; color: var(--muted); }
label .req { color: var(--gold); }
input, textarea {
  width: 100%;
  background: var(--slate);
  border: 1px solid var(--slate-3);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.6rem 0.7rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); }
textarea { min-height: 110px; resize: vertical; }

button {
  margin-top: 1.2rem;
  background: var(--gold);
  color: #1a1204;
  border: none;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
}
button:hover { background: #f2c45c; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.result { margin-top: 1.2rem; padding: 0.9rem 1.1rem; border-radius: 6px; display: none; }
.result.show { display: block; }
.result.ok  { background: rgba(63,178,127,0.12); border: 1px solid var(--green); color: var(--green); }
.result.err { background: rgba(224,108,91,0.12); border: 1px solid var(--red); color: var(--red); }
.result pre { white-space: pre-wrap; word-break: break-word; margin: 0.4rem 0 0; color: var(--text); font-size: 0.82rem; }
