/* ============================================================
   FUCK YOU (name) — brutalist hacker-meme stylesheet
   ============================================================ */

:root {
  --bg:        #0a0a0b;
  --bg-2:      #101013;
  --panel:     #131316;
  --panel-2:   #17171c;
  --border:    rgba(57, 255, 20, 0.14);
  --border-2:  rgba(255, 255, 255, 0.08);
  --text:      #ececec;
  --muted:     #8b8b93;
  --red:       #ff2d2d;
  --red-glow:  rgba(255, 45, 45, 0.55);
  --green:     #39ff14;
  --green-2:   #22c55e;
  --yellow:    #ffd21e;
  --blue:      #2f7bff;

  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --body: "Epilogue", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Anton", "Arial Narrow", sans-serif;

  --r: 4px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1100px 600px at 50% -10%, rgba(255, 45, 45, 0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 120%, rgba(57, 255, 20, 0.06), transparent 60%);
  background-attachment: fixed;
}

/* ── CRT + noise overlays ─────────────────────────────────────── */
.crt, .noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}
.crt {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.5;
}
.noise {
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── layout ───────────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 28px) clamp(14px, 4vw, 32px) 64px;
}

/* ── terminal top bar ─────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.prompt .tilde { color: var(--muted); }
.cursor {
  display: inline-block;
  color: var(--green);
  animation: blink 1.05s steps(1) infinite;
  margin-left: 1px;
}
@keyframes blink { 50% { opacity: 0; } }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--red);
  border: 1px solid var(--red-glow);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.status-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

.db-warn {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--yellow);
  border-radius: var(--r);
  background: rgba(255, 210, 30, 0.08);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 13px;
}
.db-warn code { color: #fff; }

/* ── hero ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: clamp(28px, 7vw, 72px) 0 clamp(16px, 3vw, 28px);
}
.kicker {
  font-family: var(--mono);
  color: var(--green);
  letter-spacing: 0.32em;
  font-size: clamp(11px, 2.4vw, 14px);
  margin: 0 0 clamp(10px, 2vw, 18px);
  text-transform: uppercase;
}
.shout {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.shout .fu {
  display: block;
  color: var(--red);
  font-size: clamp(58px, 17vw, 200px);
  text-shadow: 0 0 28px var(--red-glow);
}
.shout .target {
  display: block;
  color: #fff;
  font-size: clamp(40px, 12vw, 150px);
  word-break: break-word;
  overflow-wrap: anywhere;
  margin-top: clamp(4px, 1vw, 10px);
  text-shadow: 0 0 26px rgba(57, 255, 20, 0.35);
  -webkit-text-stroke: 1px rgba(57, 255, 20, 0.25);
}
.subline {
  color: var(--muted);
  font-family: var(--mono);
  font-size: clamp(11px, 2.2vw, 14px);
  margin: clamp(14px, 3vw, 22px) 0 0;
}
.hero-actions {
  margin-top: clamp(16px, 3vw, 24px);
  display: flex;
  justify-content: center;
}
.btn-share {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  box-shadow: none;
  letter-spacing: 0.12em;
}
.btn-share:hover {
  background: rgba(57, 255, 20, 0.12);
  box-shadow: 0 6px 22px rgba(57, 255, 20, 0.25);
}

/* glitch */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 0);
}
.glitch::before { color: var(--red); left: 2px; text-shadow: -2px 0 var(--red); animation: glitch-a 2.6s infinite steps(2, end); }
.glitch::after  { color: var(--blue); left: -2px; text-shadow: 2px 0 var(--green); animation: glitch-b 3.1s infinite steps(2, end); }
@keyframes glitch-a {
  0%,92%,100% { clip-path: inset(0 0 100% 0); opacity: 0; }
  93% { clip-path: inset(8% 0 62% 0); opacity: .8; transform: translateX(-3px); }
  96% { clip-path: inset(50% 0 20% 0); opacity: .8; transform: translateX(3px); }
}
@keyframes glitch-b {
  0%,90%,100% { clip-path: inset(0 0 100% 0); opacity: 0; }
  91% { clip-path: inset(30% 0 40% 0); opacity: .7; transform: translateX(3px); }
  95% { clip-path: inset(70% 0 5% 0); opacity: .7; transform: translateX(-3px); }
}
.target.slam { animation: slam .5s cubic-bezier(.2,1.4,.3,1) both; }
@keyframes slam {
  0% { transform: scale(2.2) rotate(-4deg); opacity: 0; filter: blur(6px); }
  60% { transform: scale(.94); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}

/* ── countdown ────────────────────────────────────────────────── */
.clock {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: clamp(18px, 3vw, 26px);
}
.clock-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.clock-label {
  font-family: var(--mono);
  letter-spacing: 0.16em;
  font-size: clamp(11px, 2.2vw, 13px);
  color: var(--muted);
}
.clock-time {
  font-family: var(--display);
  font-size: clamp(28px, 8vw, 46px);
  color: var(--green);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(57, 255, 20, 0.4);
  letter-spacing: 0.02em;
}
.clock-time.ending { color: var(--red); text-shadow: 0 0 16px var(--red-glow); }
.bar {
  margin-top: 10px;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-2));
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
  transition: width 1s linear;
}

/* ── arena ────────────────────────────────────────────────────── */
.arena {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2.4vw, 20px);
}
@media (min-width: 860px) {
  .arena { grid-template-columns: 1fr 1.15fr; align-items: start; }
}

.panel {
  border: 1px solid var(--border-2);
  background: var(--panel);
  border-radius: var(--r);
  padding: clamp(16px, 2.6vw, 22px);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(13px, 2.4vw, 15px);
  letter-spacing: 0.08em;
  color: var(--text);
}
.slots {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-variant-numeric: tabular-nums;
}
.slots.full { color: var(--red); border-color: var(--red-glow); }
.hint { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* nominate form */
.nom { display: flex; flex-direction: column; gap: 12px; }
.nom-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.nom-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.18);
}
.nom-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255, 45, 45, 0.12);
  color: var(--red);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-right: 1px solid var(--border-2);
}
#nameInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-family: var(--mono);
  font-size: 16px; /* >=16px avoids iOS zoom */
  padding: 14px 12px;
  text-transform: uppercase;
}
#nameInput::placeholder { color: #55555c; text-transform: none; }

.btn {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 13px 18px;
  cursor: pointer;
  min-height: 46px;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
  color: #0a0a0b;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 0 0 var(--red-glow);
}
.btn-primary:hover { background: #ff4a4a; box-shadow: 0 6px 22px var(--red-glow); }
.btn-primary:disabled,
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.help { margin: 4px 0 0; color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* leaderboard */
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--panel-2);
  transition: transform .25s cubic-bezier(.2,.9,.3,1), border-color .2s, background .2s;
}
.row.leader {
  border-color: var(--green);
  background: linear-gradient(90deg, rgba(57,255,20,0.08), var(--panel-2));
  box-shadow: 0 0 0 1px rgba(57,255,20,0.2) inset;
}
.row.enter { animation: rowIn .35s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rank {
  font-family: var(--display);
  font-size: 20px;
  color: var(--muted);
  text-align: center;
}
.row.leader .rank { color: var(--green); }
.rname {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(14px, 3.2vw, 17px);
  text-transform: uppercase;
  color: #fff;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rname .you {
  font-size: 10px;
  color: var(--green);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: .06em;
}
.vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 700;
  border: 1px solid var(--border-2);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--r);
  padding: 8px 12px;
  min-height: 44px;
  min-width: 64px;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, border-color .2s, background .2s, color .2s;
}
.vote:hover { border-color: var(--green); }
.vote:active { transform: scale(.94); }
.vote:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.vote .arrow { color: var(--muted); transition: transform .15s ease, color .2s; }
.vote .count { font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.vote.voted {
  border-color: var(--green);
  background: rgba(57, 255, 20, 0.12);
  color: var(--green);
}
.vote.voted .arrow { color: var(--green); transform: translateY(-1px); }
.vote.bump .count { animation: bump .3s ease; }
@keyframes bump { 40% { transform: scale(1.5); color: var(--green); } }

.empty {
  text-align: center;
  padding: 26px 10px;
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
  color: var(--muted);
  font-family: var(--mono);
}
.empty p { margin: 0; font-size: 15px; color: var(--text); }
.empty .empty-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ── hall of shame ────────────────────────────────────────────── */
.hall { margin-top: clamp(26px, 5vw, 44px); }
.hall h2 {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  color: var(--text);
  margin: 0 0 14px;
}
.hall-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hall-list li {
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--panel);
}
.hall-list li b { color: var(--red); font-weight: 700; }
.hall-list li .ago { color: #55555c; margin-left: 6px; font-size: 11px; }
.hall-empty { color: var(--muted); font-family: var(--mono); font-size: 13px; }

/* ── footer ───────────────────────────────────────────────────── */
.foot {
  margin-top: clamp(30px, 6vw, 56px);
  padding-top: 18px;
  border-top: 1px solid var(--border-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}
.foot strong { color: var(--green); }

.donate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.donate-line {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}
.donate-btn {
  display: block;
  height: 57px;
  width: 229px;
  border-radius: 10px;
  transition: transform .15s ease, box-shadow .2s ease;
}
.donate a:hover .donate-btn {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 30px rgba(57, 255, 20, 0.28);
}
.donate a:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 10px; }

/* ── toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 30px);
  z-index: 80;
  background: #17171c;
  border: 1px solid var(--red-glow);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
  border-radius: var(--r);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: transform .3s cubic-bezier(.2,1.2,.3,1), opacity .3s;
  max-width: min(90vw, 460px);
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.good { border-color: var(--green); }

/* ── utilities ────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.no-js #board { display: none; }

/* ── reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .cursor, .glitch::before, .glitch::after, .status-pill .dot { animation: none !important; }
  .glitch::before, .glitch::after { display: none; }
}
