:root {
  --bg: #0b0410;
  --bg-2: #1a0612;
  --panel: rgba(24, 6, 16, 0.8);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3e9ec;
  --muted: #b39aa4;
  --pink: #ff2a4a;
  --cyan: #2de2e6;
  --yellow: #ffc23d;
  --purple: #b0183a;
  --green: #3dff8b;
  --red: #ff5d5d;
  --gold: #ffd319;
  --silver: #c9d6ff;
  --bronze: #ff9a5a;
  --pixel: "Press Start 2P", monospace;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- Effetti di sfondo ---------- */
.crt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.18) 2px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, #0b0410 0%, #2a0716 45%, #4a0a1e 58%, #0b0410 58%);
  overflow: hidden;
}
.sun {
  position: absolute;
  left: 50%;
  bottom: 42%; /* appoggiato all'orizzonte */
  width: min(60vw, 520px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--yellow), var(--pink) 65%, #8a0f2a);
  box-shadow: 0 0 120px rgba(255, 42, 74, .45);
  --stripes: linear-gradient(to bottom,
    #000 0 50%, transparent 50% 53%, #000 53% 61%, transparent 61% 65%,
    #000 65% 72%, transparent 72% 77%, #000 77% 83%, transparent 83% 89%, #000 89%);
  -webkit-mask: var(--stripes);
          mask: var(--stripes);
  opacity: .5;
}
.grid-floor {
  position: absolute;
  left: -50%;
  right: -50%;
  top: 58%;
  height: 80%;
  background-image:
    linear-gradient(var(--pink) 2px, transparent 2px),
    linear-gradient(90deg, var(--pink) 2px, transparent 2px);
  background-size: 60px 60px;
  transform: perspective(300px) rotateX(70deg);
  transform-origin: top;
  animation: grid 1.6s linear infinite;
  opacity: .5;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 30%);
          mask: linear-gradient(to bottom, transparent, #000 30%);
}
@keyframes grid { to { background-position: 0 60px; } }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 72px 16px 48px;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.blink {
  font-family: var(--pixel);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 2px;
  margin: 0;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.glitch {
  position: relative;
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(34px, 9vw, 96px);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 10px var(--pink), 0 0 30px var(--pink), 0 0 60px var(--purple);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.glitch::before { color: var(--cyan); transform: translate(-3px, 0); clip-path: inset(0 0 60% 0); animation: glitch 3s infinite steps(2); mix-blend-mode: screen; }
.glitch::after  { color: var(--pink); transform: translate(3px, 0);  clip-path: inset(55% 0 0 0); animation: glitch 2.4s infinite reverse steps(2); mix-blend-mode: screen; }
@keyframes glitch {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(-4px, 2px); }
  94% { transform: translate(4px, -2px); }
  97% { transform: translate(-2px, 1px); }
}

.tagline {
  margin: 0;
  max-width: 560px;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text);
  text-shadow: 0 1px 3px #000, 0 2px 14px rgba(0,0,0,.9);
}
.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.stat {
  min-width: 120px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  background: rgba(11, 4, 24, .6);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.stat span { font-family: var(--pixel); font-size: 22px; color: var(--yellow); text-shadow: 0 0 12px rgba(255, 194, 61, .6); }
.stat small { font-family: var(--pixel); font-size: 8px; color: var(--muted); letter-spacing: 1px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 16px 26px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #12021f;
  transition: transform .08s, box-shadow .15s, filter .15s;
}
.btn-primary {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 6px 0 #7a0c22, 0 0 30px rgba(255, 42, 74, .4);
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 6px 0 #7a0c22, 0 0 45px rgba(255, 42, 74, .65); }
.btn-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 #7a0c22; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-block { width: 100%; }

/* ---------- Demo banner ---------- */
.demo-banner {
  max-width: 1180px;
  margin: 0 auto 20px;
  padding: 10px 16px;
  font-size: 13px;
  border: 1px dashed var(--cyan);
  color: var(--cyan);
  background: rgba(45, 226, 230, .06);
  text-align: center;
}
.demo-banner code { color: var(--yellow); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 60px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 24px;
  position: relative;
}
.panel::before {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, var(--pink), transparent 30%, transparent 70%, var(--cyan)) 1;
}
.form-panel { position: sticky; top: 20px; }
@media (max-width: 900px) { .form-panel { position: static; } }

.panel h2 {
  font-family: var(--pixel);
  font-size: 14px;
  margin: 0 0 22px;
  letter-spacing: 1px;
}
.panel h2 .pixel { color: var(--pink); margin-right: 8px; }
.pixel { font-family: var(--pixel); }
.pixel.small { font-size: 8px; }

/* ---------- Form ---------- */
form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; position: relative; }
label > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.row { display: grid; grid-template-columns: 1fr 100px; gap: 12px; }
input, select, textarea {
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: rgba(0, 0, 0, .35);
  border: 2px solid var(--line);
  padding: 11px 12px;
  outline: none;
  border-radius: 0;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cyan) 50%), linear-gradient(135deg, var(--cyan) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select option { background: var(--bg-2); }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(45, 226, 230, .15), 0 0 18px rgba(45, 226, 230, .2); }
::placeholder { color: #6b5f8f; }
.counter { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--muted); }

.dupe-hint {
  margin-top: -6px;
  padding: 10px 12px;
  font-size: 13px;
  border-left: 3px solid var(--yellow);
  background: rgba(255, 194, 61, .08);
}
.link { background: none; border: none; color: var(--yellow); font: inherit; font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }
.link:disabled { color: var(--green); text-decoration: none; cursor: default; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input { flex: 1 1 200px; }
.toolbar select { flex: 0 1 210px; }
.seg { display: flex; border: 2px solid var(--line); }
.seg-btn {
  font-family: var(--pixel);
  font-size: 10px;
  padding: 0 14px;
  min-height: 44px;
  background: transparent;
  color: var(--muted);
  border: none;
  cursor: pointer;
}
.seg-btn.active { background: var(--pink); color: #fff; box-shadow: 0 0 18px rgba(255, 42, 74, .5); }

/* ---------- Lista ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .3);
  border: 2px solid var(--line);
  transition: transform .15s, border-color .15s, box-shadow .15s;
  animation: slideIn .4s both;
}
.card:hover { transform: translateX(4px); border-color: rgba(45, 226, 230, .4); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } }
.card.flash { animation: flash 1.4s; }
@keyframes flash { 0%, 50% { border-color: var(--yellow); box-shadow: 0 0 30px rgba(255, 194, 61, .5); } }

.rank { font-family: var(--pixel); font-size: 18px; color: var(--muted); text-align: center; }
.podium-1 { border-color: rgba(255, 194, 61, .55); background: linear-gradient(90deg, rgba(255, 194, 61, .12), rgba(0,0,0,.3) 50%); }
.podium-1 .rank { color: var(--gold); text-shadow: 0 0 14px var(--gold); font-size: 22px; }
.podium-1 .rank::before { content: "★"; display: block; font-size: 14px; margin-bottom: 4px; }
.podium-2 { border-color: rgba(201, 214, 255, .4); }
.podium-2 .rank { color: var(--silver); text-shadow: 0 0 10px var(--silver); }
.podium-3 { border-color: rgba(255, 154, 90, .4); }
.podium-3 .rank { color: var(--bronze); text-shadow: 0 0 10px var(--bronze); }

.body { min-width: 0; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title { margin: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.status { font-family: var(--pixel); font-size: 7px; padding: 5px 7px; letter-spacing: .5px; border: 1px solid currentColor; }
.s-pending { color: var(--muted); }
.s-reviewing { color: var(--cyan); }
.s-progress { color: var(--yellow); animation: pulse 1.8s infinite; }
.s-revived { color: #0b0418; background: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(61, 255, 139, .6); }
.s-rejected { color: var(--red); text-decoration: line-through; }
@keyframes pulse { 50% { box-shadow: 0 0 12px rgba(255, 194, 61, .6); } }

.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 12px; padding: 2px 8px; background: rgba(255, 42, 74, .14); color: #ffc2cc; }
.chip-files { background: rgba(61, 255, 139, .12); color: var(--green); font-weight: 700; }
.reason { margin: 10px 0 0; color: #cfc6ea; font-size: 14px; overflow-wrap: anywhere; }
.author { margin: 6px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }

.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 82px;
  padding: 10px 8px;
  background: transparent;
  border: 2px solid var(--cyan);
  color: var(--cyan);
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.vote:hover:not(:disabled) { background: rgba(45, 226, 230, .12); box-shadow: 0 0 20px rgba(45, 226, 230, .4); }
.vote:active:not(:disabled) { transform: scale(.95); }
.vote .arrow { font-size: 14px; }
.vote .count { font-family: var(--pixel); font-size: 16px; color: #fff; }
.vote .label { font-family: var(--pixel); font-size: 7px; }
.vote.voted { border-color: var(--pink); color: var(--pink); cursor: default; background: rgba(255, 42, 74, .1); }
.vote.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.18); box-shadow: 0 0 30px var(--pink); } }

@media (max-width: 560px) {
  .card { grid-template-columns: 36px 1fr; gap: 12px; }
  .rank { font-size: 13px; }
  .vote { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; min-height: 44px; }
  .row { grid-template-columns: 1fr 90px; }
}

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty .pixel { color: var(--pink); font-size: 20px; text-shadow: 0 0 14px var(--pink); }

/* ---------- Footer / toast ---------- */
.footer { text-align: center; padding: 30px 16px 50px; color: var(--muted); font-size: 13px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1.6;
  padding: 14px 18px;
  max-width: calc(100vw - 32px);
  background: var(--bg-2);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 24px rgba(45, 226, 230, .4);
  animation: toastIn .25s;
}
.toast.ok { border-color: var(--green); box-shadow: 0 0 24px rgba(61, 255, 139, .4); }
.toast.err { border-color: var(--red); box-shadow: 0 0 24px rgba(255, 93, 93, .4); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(11, 4, 16, .7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 13px; color: #fff; text-decoration: none; letter-spacing: 1px; }
.brand span { color: var(--pink); text-shadow: 0 0 10px var(--pink); }
.nav-links { display: flex; gap: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: #fff; }
@media (max-width: 560px) {
  .nav { padding: 12px 16px; }
  .brand { font-size: 10px; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
}
.hero { min-height: calc(86vh - 50px); }
.tagline strong { color: var(--yellow); }

/* ---------- Revived gallery ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: 20px 16px 50px; }
.section-title { font-family: var(--pixel); font-size: 16px; margin: 0 0 8px; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.section-title .pixel { color: var(--pink); margin-right: 8px; }
.section-sub { margin: 0 0 22px; color: var(--muted); }
.revived-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .revived-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
@media (max-width: 560px) {
  .rv-info { left: 8px; right: 8px; bottom: 7px; }
  .rv-info h3 { font-size: 13px; margin: 4px 0 0; }
  .rv-info p { display: none; }
  .rv-info .status { font-size: 6px; padding: 3px 5px; }
  .rv-cta { display: none; }
}
.rv {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 2px solid var(--line);
  color: #fff;
  text-decoration: none;
  background: var(--bg-2);
  animation: slideIn .5s both;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.rv img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s, filter .3s; filter: saturate(.9); }
.rv::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 4, 16, .95) 0%, rgba(11, 4, 16, .35) 45%, transparent 70%);
}
.rv-info { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; }
.rv-info h3 { margin: 6px 0 2px; font-size: 17px; line-height: 1.2; text-shadow: 0 2px 8px #000; }
.rv-info p { margin: 0; font-size: 12px; color: var(--muted); }
.rv-cta {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  font-size: 8px;
  padding: 7px 9px;
  background: var(--pink);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s;
}
.rv:hover, .rv:focus-visible { border-color: var(--pink); box-shadow: 0 0 28px rgba(255, 42, 74, .45); transform: translateY(-3px); outline: none; }
.rv:hover img, .rv:focus-visible img { transform: scale(1.06); filter: saturate(1.15); }
.rv:hover .rv-cta, .rv:focus-visible .rv-cta { opacity: 1; transform: none; }
@media (hover: none) { .rv-cta { opacity: 1; transform: none; } }

/* ---------- Form extras ---------- */
label.check { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
label.check span { color: var(--text); font-size: 14px; }
.fine { margin: 0; font-size: 12px; color: var(--muted); }
.dupe-hint.ok { border-left-color: var(--green); background: rgba(61, 255, 139, .08); }
.dupe-hint.ok .link { color: var(--green); }

/* ---------- Support ---------- */
.support {
  max-width: 760px;
  margin: 0 auto 20px;
  padding: 28px 24px;
  text-align: center;
  background: var(--panel);
  border: 2px dashed rgba(255, 42, 74, .35);
}
.support h2 { font-size: 13px; margin: 0 0 14px; }
.support p { margin: 0 0 14px; color: #dccbd1; }
.addr {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, .4);
  border: 2px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}
.addr:hover { border-color: var(--cyan); }
.addr code { font-size: 13px; overflow-wrap: anywhere; text-align: left; }
.addr .pixel { font-size: 8px; color: var(--cyan); flex: none; }
.support .warn { margin: 14px 0 0; font-size: 12px; color: var(--yellow); }
.disclaimer { max-width: 640px; margin: 8px auto; font-size: 11px; opacity: .8; }

/* ---------- Report ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.foot .author { margin: 0; }
.report {
  flex: none;
  background: none;
  border: none;
  padding: 4px 0;
  min-height: 32px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  opacity: .55;
  cursor: pointer;
  transition: opacity .15s, color .15s;
}
.card:hover .report, .report:focus-visible { opacity: 1; }
.report:hover:not(:disabled) { color: var(--red); }
.report.done { opacity: .8; color: var(--red); cursor: default; }
@media (hover: none) { .report { opacity: .8; } }
