/* ============================================================================
   SPONSOR MY NEURONS — interface layer
   La scena è WebGL a tutto schermo; qui c'è solo l'HUD che ci galleggia sopra.
   Palette: indaco profondo · viola elettrico · lime acido (azione e posti liberi)
            rosa solo per i nodi di pregio
   Type: Instrument Sans (interfaccia) · Share Tech Mono (numeri e timer)
   Tema unico e voluto: è una vetrina al neon, non un documento.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. TOKENS */
:root {
  --void:      #05040b;
  --panel:     rgba(22, 18, 40, 0.84);
  --panel-2:   rgba(38, 32, 66, 0.6);
  --edge:      rgba(150, 140, 255, 0.16);
  --edge-hi:   rgba(150, 140, 255, 0.38);

  --violet:    #7b5cff;
  --violet-hi: #9d86ff;
  --lime:      #d4ff00;
  --lime-hi:   #e6ff5c;
  --rose:      #ff4d6d;

  /* grigi con bias viola: mai neutri puri */
  --ink:       #efecff;
  --ink-dim:   #a9a2c8;
  --ink-faint: #6f6893;

  --on-lime:   #131a02;

  --ui:   "Instrument Sans", -apple-system, "Segoe UI", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, monospace;

  --pad: clamp(1rem, 2.4vw, 2rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------- 2. RESET/BASE */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;                /* una schermata sola, mai scroll */
  background: var(--void);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

h1, h2, h3, p, dl, dd, ol { margin: 0; }
ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Le classi con display esplicito (.cta, .brand) battono l'attributo hidden
   dello user-agent: senza questa riga un pulsante nascosto resta visibile. */
[hidden] { display: none !important; }
svg { display: block; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 4px; }

.linky {
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--edge-hi);
  padding: 0;
  transition: color 0.25s var(--ease);
}
.linky:hover { color: var(--ink); }

/* --------------------------------------------------------------- 3. LOADER */
#loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-content: center;
  gap: 1rem;
  background: var(--void);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-bar {
  width: min(240px, 50vw);
  height: 2px;
  background: rgba(150, 140, 255, 0.16);
  overflow: hidden;
}
.loader-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--lime);
  box-shadow: 0 0 14px var(--lime);
  transition: width 0.3s linear;
}
.loader-text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

/* -------------------------------------------------------------- 4. LA SCENA */
#stage { position: fixed; inset: 0; z-index: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* Lampo della transizione busto → cervello */
#flash {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 44%, #fff 0%, var(--violet) 42%, transparent 76%);
}

/* ------------------------------------------------------------------ 5. HUD */
.hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: var(--pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "tl    .   tr"
    "tools .   ."
    "bl    bc  br";
  gap: 1rem;
}
/* Solo i controlli catturano il puntatore: la scena resta trascinabile
   anche sotto i testi dell'HUD. */
.hud, .hud * { pointer-events: none; }
.hud button { pointer-events: auto; }

.hud-tl { grid-area: tl; max-width: 30ch; }
.hud-tl h1 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hud-sub { color: var(--ink-dim); font-size: 0.9375rem; }
.hud-sub em { font-style: normal; color: var(--lime); }
.hud-meta {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hud-meta .dot { opacity: 0.5; }

.hud-tr { grid-area: tr; }
.clock {
  display: flex;
  gap: clamp(0.5rem, 1.4vw, 1.1rem);
  font-family: var(--mono);
  color: var(--ink-dim);
  font-size: 0.8125rem;
}
.clock b {
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  color: var(--ink);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.hud-tools {
  grid-area: tools;
  align-self: start;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.25rem;
}
.rec {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 12px var(--rose);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.tool { color: var(--ink-faint); transition: color 0.25s var(--ease); }
.tool:hover { color: var(--ink); }
.tool svg {
  width: 19px; height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#tool-sound .wave { display: none; }
#tool-sound[aria-pressed="true"] { color: var(--lime); }
#tool-sound[aria-pressed="true"] .wave { display: block; }
#tool-sound[aria-pressed="true"] .mute { display: none; }

.hud-bl { grid-area: bl; align-self: end; }
.inv { font-size: 0.875rem; color: var(--ink-dim); }
.inv b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.inv-sub {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}

.hud-bc { grid-area: bc; justify-self: center; align-self: end; }
.hud-bc #cta-main { min-width: 210px; }
.bar-hint { margin-left: .45rem; padding-left: .65rem; border-left: 1px solid var(--edge); }


.hud-br {
  grid-area: br;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
/* Il blocco dell'autore è un link a X, quindi si comporta da link. */
.hud-br { text-decoration: none; transition: opacity 0.25s var(--ease); }
.hud-br:hover { opacity: 0.82; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #d9cbff, #7b5cff 55%, #2b1b5c);
  box-shadow: 0 0 0 1px var(--edge-hi);
  flex: none;
}
/* con la foto vera il gradiente sparisce */
.avatar.photo {
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px var(--edge-hi), 0 4px 16px rgba(0, 0, 0, 0.5);
}

.who b { display: inline-flex; align-items: center; gap: 0.2rem; }
.verified {
  width: 14px; height: 14px;
  fill: #1d9bf0;
  flex: none;
}
.who { display: grid; font-size: 0.8125rem; color: var(--ink-dim); }
.who b { color: var(--ink); font-weight: 500; }
.who em { font-style: normal; font-size: 0.6875rem; color: var(--ink-faint); }

/* ------------------------------------------------------------ 6. PULSANTI */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 2.2rem;
  border-radius: 10px;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 10px 40px rgba(212, 255, 0, 0.2);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.cta:hover {
  background: var(--lime-hi);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24) inset, 0 14px 48px rgba(212, 255, 0, 0.32);
}
.cta:active { transform: translateY(0); }
.cta.wide { width: 100%; padding-inline: 1rem; }
.cta.busy { background: var(--panel-2); color: var(--ink-dim); box-shadow: 0 0 0 1px var(--edge) inset; cursor: wait; }
.cta.ok { background: var(--violet); color: #fff; }

/* variante secondaria: salva il marchio, non compra niente */
.cta.ghost {
  background: transparent;
  color: var(--ink-dim);
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--edge) inset;
  padding-block: 0.6rem;
}
.cta.ghost:hover {
  background: transparent;
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--edge-hi) inset;
  transform: none;
}

/* --------------------------------------------------- 7. ETICHETTA AL PASSAGGIO */
#hint {
  position: fixed;
  z-index: 22;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  background: rgba(16, 12, 32, 0.94);
  box-shadow: 0 0 0 1px var(--edge);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: opacity 0.18s var(--ease);
}
#hint.on { opacity: 1; }
#hint b { font-weight: 500; }
#hint i {
  font-style: normal;
  font-family: var(--mono);
  color: var(--lime);
  margin-left: 0.5rem;
}

/* ------------------------------------------------------- 8. PANNELLO DEL POSTO */
#panel {
  position: fixed;
  z-index: 30;
  top: 50%;
  /* il modulo è lungo: se lo schermo è basso deve scorrere, non tagliarsi */
  scrollbar-width: thin;
  right: var(--pad);
  width: min(340px, calc(100vw - 2 * var(--pad)));
  max-height: calc(100svh - 2 * var(--pad));
  overflow-y: auto;
  translate: 0 -50%;
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--edge), 0 30px 90px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(14px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0.35s;
}
#panel.on { opacity: 1; visibility: visible; transform: none; }

#panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
#panel h2 {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
#panel h2 em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(212, 255, 0, 0.35);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}
#panel h2 em { color: var(--ink-faint); border-color: var(--edge); }
#panel h2 em.taken { color: var(--violet-hi); border-color: var(--edge-hi); }
#panel h2 em.lead  { color: var(--lime); border-color: rgba(212, 255, 0, 0.4); }

.x {
  color: var(--ink-faint);
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.25s var(--ease);
}
.x:hover { color: var(--ink); }

/* Lo slot è il cuore del pannello: vuoto finché non carichi un logo. */
.slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 21 / 9;
  margin: 0.75rem 0 0.6rem;
  border-radius: 12px;
  border: 1px dashed rgba(212, 255, 0, 0.4);
  background: repeating-linear-gradient(45deg,
    rgba(212, 255, 0, 0.045) 0 8px, transparent 8px 16px);
  overflow: hidden;
}
.slot.filled {
  border-style: solid;
  border-color: var(--lime);
  background: var(--lime);
}
.slot img {
  max-width: 78%;
  max-height: 78%;
  object-fit: contain;
}
.slot-hint {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  color: var(--lime);
}
.slot-mark { font-size: 1.5rem; line-height: 1; opacity: 0.75; }
.slot-hint span:last-child {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.p-id {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.p-desc { font-size: 0.8125rem; color: var(--ink-dim); margin-top: 0.3rem; }

.p-facts { display: grid; gap: 0; margin: 0.6rem 0 0.75rem; }
.p-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--edge);
  font-size: 0.8125rem;
}
.p-facts dt { color: var(--ink-faint); }
.p-facts dd {
  margin: 0;
  font-family: var(--mono);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------- 9. FORM DEL MARCHIO */
.brand { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }

.upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  border-radius: 9px;
  border: 1px dashed var(--edge-hi);
  color: var(--ink-dim);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.upload:hover {
  border-color: var(--lime);
  color: var(--lime);
  background: rgba(212, 255, 0, 0.05);
}
.upload svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
/* l'input resta raggiungibile da tastiera, ma invisibile */
.upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.brand input[type="text"],
.brand input[type="url"] {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: rgba(10, 8, 22, 0.6);
  color: var(--ink);
  font: inherit;
  font-size: 0.8125rem;
  transition: border-color 0.25s var(--ease);
}
.brand input::placeholder { color: var(--ink-faint); }
.brand input:focus { outline: none; border-color: var(--edge-hi); }

.p-note {
  min-height: 1.1em;
  margin-top: 0.6rem;
  font-size: 0.6875rem;
  color: var(--ink-faint);
  text-align: center;
}
.p-note.bad { color: var(--rose); }

.p-fine {
  margin-top: 0.6rem;
  font-size: 0.6875rem;
  color: var(--ink-faint);
  text-align: center;
}

.release {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  font-size: 0.6875rem;
  color: var(--ink-faint);
  transition: color 0.25s var(--ease);
}
.release:hover { color: var(--rose); }

/* ------------------------------------------------------------- 10. MODALE */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: var(--pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.modal.on { opacity: 1; visibility: visible; }
.veil { position: absolute; inset: 0; background: rgba(5, 4, 11, 0.8); backdrop-filter: blur(6px); }

.sheet {
  position: relative;
  width: min(460px, 100%);
  max-height: 84svh;
  overflow-y: auto;
  padding: 1.6rem;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--edge), 0 40px 120px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(18px);
  transform: translateY(12px);
  transition: transform 0.4s var(--ease);
}
.modal.on .sheet { transform: none; }
.sheet .x { position: absolute; top: 1rem; right: 1.1rem; }
.sheet h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1.1rem; }

.rules-list { display: grid; gap: 1.1rem; counter-reset: r; }
.rules-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0 0.75rem;
  counter-increment: r;
}
.rules-list li::before {
  content: counter(r);
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--lime);
  padding-top: 0.15rem;
}
.rules-list h3 { font-size: 0.9375rem; font-weight: 600; }
.rules-list p { font-size: 0.8125rem; color: var(--ink-dim); }
.rules-list b { color: var(--ink); font-weight: 500; }

.fine {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--edge);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ 11. RESPONSIVE */
@media (max-width: 860px) {
  /* Su schermo stretto l'intestazione mangiava il soggetto: si stringe. */
  .hud-tl h1 { font-size: 1.05rem; }
  .hud-sub { font-size: 0.8125rem; line-height: 1.35; }
  .hud-meta { font-size: 0.6875rem; }
  .mode-note { display: none; }
  .inv, .inv-sub { font-size: 0.75rem; }

  .hud {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "tl    tr"
      "tools ."
      "bl    br"
      "bc    bc";
    row-gap: 0.75rem;
  }
  .hud-bc { justify-self: stretch; }
  .hud-bc .cta { width: 100%; }
  .hud-tl { max-width: none; }
  .clock b { font-size: 1.1rem; }
  .who em { display: none; }

  /* su schermo stretto il pannello sale dal basso */
  #panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    translate: none;
    border-radius: 20px 20px 0 0;
    transform: translateY(18px);
    max-height: 78svh;
  }
  #panel.on { transform: none; }
}

/* ------------------------------------------------- 12. MOVIMENTO RIDOTTO */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


/* ============================================================================
   COMPONENTI D'ASTA
   Tutto quello che segue mostra numeri reali: se il dato non c'è, l'elemento
   sparisce invece di inventare una cifra.
   ========================================================================== */

/* ------------------------------------------- striscia del capofila d'asta */
#leader {
  position: fixed;
  z-index: 24;
  top: var(--pad);
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: min(560px, calc(100vw - 2 * var(--pad)));
  padding: 0.5rem 0.9rem 0.5rem 0.6rem;
  border-radius: 999px;
  background: rgba(20, 16, 38, 0.86);
  box-shadow: 0 0 0 1px var(--edge), 0 14px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
}
#leader.bump { animation: bump 0.7s var(--ease); }
@keyframes bump {
  0%   { box-shadow: 0 0 0 1px var(--lime), 0 14px 44px rgba(212, 255, 0, 0.35); }
  100% { box-shadow: 0 0 0 1px var(--edge), 0 14px 44px rgba(0, 0, 0, 0.5); }
}
.lead-tag {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
  border: 1px solid rgba(212, 255, 0, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  flex: none;
}
#lead-logo {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: contain;
  background: var(--lime);
  padding: 2px;
  flex: none;
}
#leader b {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lead-lot { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; }
.lead-by { color: var(--ink-faint); }
.lead-by em { font-style: normal; color: var(--ink); }

/* ----------------------------------------------- chi sta guardando adesso */
.watching {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--ink-dim);
}
.watching i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: pulse 2s var(--ease) infinite;
}
.watching b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- ultime offerte */
.feed {
  display: grid;
  gap: 0.15rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}
.feed li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
  animation: slideIn 0.4s var(--ease);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } }
.feed b {
  font-family: var(--mono);
  color: var(--lime);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  min-width: 4.5ch;
}
.feed em { font-style: normal; color: var(--ink-dim); }

.mode-note {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* il timer si accende quando manca poco: è quando l'anti-sniping è attivo */
.clock.hot b { color: var(--lime); }

/* ------------------------------------------------------------------ toast */
#toast {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: calc(var(--pad) + 4.5rem);
  translate: -50% 0;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(40, 12, 24, 0.94);
  box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.4), 0 14px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  font-size: 0.8125rem;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  pointer-events: none;
}
#toast.on { opacity: 1; visibility: visible; transform: none; }

/* ------------------------------------------------------ modulo dell'offerta */
.bid { display: grid; gap: 0.55rem; margin-bottom: 0.75rem; }

.field { display: grid; gap: 0.25rem; }
.field > span {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: rgba(10, 8, 22, 0.6);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color 0.25s var(--ease);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus { outline: none; border-color: var(--edge-hi); }

/* il simbolo di valuta vive dentro il campo, così l'importo resta allineato */
.amount { position: relative; }
.amount i {
  position: absolute;
  left: 0.7rem; top: 50%;
  translate: 0 -50%;
  font-style: normal;
  font-family: var(--mono);
  color: var(--ink-faint);
  pointer-events: none;
}
.amount input {
  padding-left: 1.6rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
/* via le frecce del number input: rubano spazio e non servono */
.amount input::-webkit-outer-spin-button,
.amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount input { -moz-appearance: textfield; }

.brand-title {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 0.15rem;
}

/* --------------------------------------------------- responsive dell'asta */
@media (max-width: 860px) {
  #leader {
    top: auto;
    bottom: calc(var(--pad) + 3.6rem);
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem 0.4rem 0.5rem;
    gap: 0.5rem;
  }
  .lead-lot, .lead-by { display: none; }
  .watching { justify-content: flex-start; }
  .feed { display: none; }
  #toast { bottom: calc(var(--pad) + 8rem); white-space: normal; text-align: center; max-width: 80vw; }
}

/* ============================================================================
   ACCESSO, IDENTITÀ, CONDIVISIONE
   ========================================================================== */

.auth {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* pulsante X: il nero del marchio, non il viola del sito */
.x-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #0b0b0f;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
  transition: box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.x-btn:hover { background: #17171f; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.x-btn svg { width: 12px; height: 12px; fill: currentColor; }

.me {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--ink-dim);
}
.me img {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--edge-hi);
}
.me b { color: var(--ink); font-weight: 500; }

/* --------------------------------------------- chi detiene, nelle schede */
.p-facts dd.holder {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
  font-family: var(--ui);
  flex-wrap: wrap;
}
.p-facts dd.holder img {
  width: 20px; height: 20px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--edge-hi);
}
.p-facts dd.holder a { color: var(--violet-hi); }
.p-facts dd.holder a:hover { text-decoration: underline; }

/* ------------------------------------------------------- la condizione */
/* Non è una nota a piè di pagina: è la cosa che la gente deve leggere prima
   di pagare, quindi sta sotto al pulsante e non si mimetizza. */
.terms {
  margin-top: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 77, 109, 0.28);
  background: rgba(255, 77, 109, 0.06);
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--ink-dim);
}
.terms b { color: var(--rose); font-weight: 600; }

/* ------------------------------------------------- il blocco di chi possiede */
.mine { display: grid; gap: 0.7rem; margin-bottom: 0.6rem; }

.cta.share {
  background: #0b0b0f;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset, 0 8px 30px rgba(0, 0, 0, 0.5);
}
.cta.share:hover { background: #17171f; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.34) inset; }
.cta.share svg { width: 14px; height: 14px; fill: currentColor; }

.upload.small { padding: 0.5rem; font-size: 0.75rem; }
#p-identity { display: grid; gap: 0.5rem; }

/* ------------------------------------------------------ regole sui contenuti */
.content-rules {
  display: grid;
  gap: 0.3rem;
  margin: 0.5rem 0;
  padding-left: 1rem;
  list-style: disc;
}
.content-rules li { font-size: 0.8125rem; color: var(--ink-dim); }

/* ------------------------------------------------- passaggi di mano nel feed */
.feed li img {
  width: 16px; height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.feed u { text-decoration: none; color: var(--ink-faint); opacity: 0.7; }
.feed li.sys span { color: var(--rose); }

.p-fine .dot { opacity: 0.4; margin-inline: 0.3rem; }

/* ============================================================================
   LA FINESTRA UNICA E LA BARRA DELLA MAPPA
   ========================================================================== */

/* ---------------------------------------------------- il modulo, tutto qui */
.one { display: grid; gap: 0.45rem; margin-bottom: 0.5rem; }

/* due campi affiancati: uno di testo e il suo caricamento immagine */
.pair {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
}

/* separatore parlante fra "chi sei" e "cosa ci metti" */
.sect {
  margin-top: 0.35rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field > span i {
  float: right;
  font-style: normal;
  opacity: 0.7;
  letter-spacing: 0.06em;
}

/* il caricamento affiancato è quadrato: deve stare in linea con il campo */
.upload.small {
  position: relative;
  width: 5.6rem;
  height: 2.55rem;
  padding: 0;
  gap: 0.3rem;
  font-size: 0.6875rem;
  overflow: hidden;
}
.upload.small img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
/* con l'immagine caricata l'etichetta sparisce: si vede il risultato */
.upload.small img:not([hidden]) ~ svg,
.upload.small img:not([hidden]) ~ span { display: none; }

.x-btn.wide { justify-content: center; width: 100%; padding: 0.6rem; }

/* il messaggio scritto da chi compra, sotto l'anteprima */
.slot-msg {
  margin: -0.4rem 0 0.6rem;
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
}

#p-price-tag { color: var(--lime); letter-spacing: 0.06em; }

/* la striscia in alto e le righe del feed portano da qualche parte */
#leader { cursor: pointer; }
#leader:hover { box-shadow: 0 0 0 1px var(--edge-hi), 0 14px 44px rgba(0, 0, 0, 0.55); }
.feed li[data-lot] { cursor: pointer; }
.feed li[data-lot]:hover em { color: var(--lime); }

/* ------------------------------------------------------ barra della mappa */
#brainbar {
  position: fixed;
  z-index: 23;
  left: 50%;
  bottom: calc(var(--pad) + 4.9rem);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  background: rgba(20, 16, 38, 0.86);
  box-shadow: 0 0 0 1px var(--edge), 0 12px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  max-width: calc(100vw - 2 * var(--pad));
  overflow-x: auto;
  scrollbar-width: none;
}
#brainbar::-webkit-scrollbar { display: none; }

.bar-label, .bar-hint {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  padding-inline: 0.2rem;
}
.bar-sep {
  width: 1px;
  height: 16px;
  background: var(--edge);
  margin-inline: 0.25rem;
  flex: none;
}

.chip {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--ink-dim);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { background: rgba(150, 140, 255, 0.12); color: var(--ink); }
.chip.on { background: var(--lime); color: var(--on-lime); font-weight: 600; }
.chip.go { color: var(--lime); }
.chip.go:hover { background: rgba(212, 255, 0, 0.12); }

/* l'etichetta al passaggio ha una terza riga: il messaggio */
#hint u {
  display: block;
  text-decoration: none;
  font-size: 0.6875rem;
  color: var(--ink-faint);
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 860px) {
  #brainbar { bottom: calc(var(--pad) + 8.2rem); }
  .bar-hint { display: none; }
  .pair { grid-template-columns: 1fr; }
  .upload.small { width: 100%; }
}


/* ============================================================================
   BRAIN INTELLIGENCE / OIL MARKET TERMINAL
   ========================================================================== */
#brain-terminal {
  position: fixed;
  z-index: 35;
  top: clamp(4.8rem, 9vh, 6.5rem);
  right: var(--pad);
  width: min(390px, calc(100vw - 2 * var(--pad)));
  padding: 1rem;
  border: 1px solid var(--edge-hi);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(22,18,40,.96), rgba(7,6,15,.94));
  box-shadow: 0 24px 70px rgba(0,0,0,.58), 0 0 45px rgba(123,92,255,.11);
  backdrop-filter: blur(22px);
  pointer-events: auto;
  animation: brain-terminal-in .35s var(--ease) both;
}
#brain-terminal[hidden] { display: none !important; }
@keyframes brain-terminal-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.brain-terminal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:.85rem; }
.brain-terminal-head h2 { font-size:1.02rem; letter-spacing:.08em; font-weight:600; }
.brain-kicker { display:flex; align-items:center; gap:.4rem; color:var(--ink-faint); font: .58rem var(--mono); letter-spacing:.14em; text-transform:uppercase; margin-bottom:.2rem; }
.brain-kicker i { width:6px; height:6px; border-radius:50%; background:var(--lime); box-shadow:0 0 10px var(--lime); }
.brain-status-grid { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--edge); border-bottom:1px solid var(--edge); }
.brain-status-grid > div { padding:.55rem .65rem; min-width:0; }
.brain-status-grid > div:nth-child(odd) { border-right:1px solid var(--edge); }
.brain-status-grid > div:nth-child(-n+2) { border-bottom:1px solid var(--edge); }
.brain-status-grid span, .brain-price-row span { display:block; color:var(--ink-faint); font: .56rem var(--mono); letter-spacing:.1em; text-transform:uppercase; }
.brain-status-grid b { display:block; margin-top:.12rem; color:var(--ink); font: .78rem var(--mono); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.brain-status-grid b.live { color:var(--lime); }
.brain-price-row { display:grid; grid-template-columns:1fr auto; align-items:end; gap:1rem; padding:.85rem 0 .65rem; }
#brain-oil-price { display:inline-block; margin-top:.05rem; font:1.65rem var(--mono); letter-spacing:.01em; }
#brain-oil-change { display:inline-block; margin-left:.35rem; font-size:.65rem; color:var(--ink-dim); }
.brain-decision { text-align:right; }
.brain-decision b { display:block; color:var(--lime); font: .82rem var(--mono); letter-spacing:.08em; margin-top:.08rem; }
.brain-decision small { display:block; color:var(--ink-faint); font: .6rem var(--mono); margin-top:.1rem; }
.brain-chart-wrap { height:145px; border:1px solid var(--edge); border-radius:10px; background:rgba(0,0,0,.16); overflow:hidden; }
#brain-oil-chart { display:block; width:100%; height:100%; }
.brain-log { margin-top:.65rem; display:grid; gap:.35rem; max-height:75px; overflow:hidden; }
.brain-log div { display:grid; grid-template-columns:3.1rem 1fr; gap:.55rem; font-size:.67rem; color:var(--ink-dim); }
.brain-log time { color:var(--violet-hi); font: .58rem var(--mono); }
.brain-disclaimer { margin-top:.7rem; color:var(--ink-faint); font-size:.58rem; line-height:1.35; }
.brain-tool { color:var(--lime); }
.brain-tool[aria-pressed="true"] { background:rgba(212,255,0,.12); box-shadow:0 0 0 1px rgba(212,255,0,.22) inset; }

@media (max-width: 600px) {
  #brain-terminal { top:auto; bottom:calc(var(--pad) + 5rem); right:var(--pad); width:calc(100vw - 2 * var(--pad)); }
  .brain-chart-wrap { height:125px; }
}

/* ========================= VIRAL / GAME LAYER ========================= */
.stats-link { margin-top: .45rem; font-size: .72rem; letter-spacing: .04em; }
.history-link { color: var(--ink-faint); font-size: .72rem; text-decoration: underline; margin: .55rem 0 .8rem; }
.history-link:hover { color: var(--ink); }
.neuron-war { border: 1px solid rgba(255,77,109,.32); background: rgba(255,77,109,.08); padding: .65rem .75rem; border-radius: 12px; margin: .55rem 0 .8rem; font-family: var(--mono); font-size: .72rem; }
.neuron-war b { color: var(--rose); }
#war-banner { position: fixed; left: 50%; top: 5.2rem; transform: translateX(-50%); z-index: 32; padding: .65rem 1rem; border: 1px solid rgba(255,77,109,.35); background: rgba(22,18,40,.9); backdrop-filter: blur(14px); border-radius: 999px; box-shadow: 0 0 35px rgba(255,77,109,.12); font-family: var(--mono); font-size: .72rem; color: var(--ink-dim); }
#war-banner strong { color: var(--rose); }
.modal-kicker { font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--lime); margin-bottom: .45rem; }
.modal-sub { color: var(--ink-dim); margin-bottom: 1.1rem; }
.leaderboard-sheet { width: min(740px, calc(100vw - 2rem)); }
.lb-row { display:grid; grid-template-columns: 32px 1fr auto; gap:.75rem; align-items:center; padding:.75rem 0; border-bottom:1px solid var(--edge); }
.lb-rank { color:var(--lime); font: 12px var(--mono); }
.lb-name { display:flex; align-items:center; gap:.55rem; min-width:0; }
.lb-name img, .lb-avatar { width:30px;height:30px;border-radius:50%;object-fit:cover;background:radial-gradient(circle,#9d86ff,#34216e); }
.lb-name span { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.lb-main { font-weight:600; }
.lb-meta { color:var(--ink-faint);font:10px var(--mono); }
.lb-value { font: 15px var(--mono); color:var(--ink); text-align:right; }
.hof-grid { display:grid;grid-template-columns:repeat(2,1fr);gap:.8rem;margin-top:1.2rem; }
.hof-card { padding:.8rem;border:1px solid var(--edge);border-radius:12px;background:rgba(38,32,66,.25); }
.hof-card span { display:block;color:var(--ink-faint);font:9px var(--mono);text-transform:uppercase;letter-spacing:.12em; }
.hof-card b { display:block;margin-top:.25rem;font-size:1rem; }
.hof-card small { color:var(--ink-dim); }
.profile-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:.6rem;margin:1rem 0; }
.profile-stat { border:1px solid var(--edge);border-radius:12px;padding:.65rem .55rem; }
.profile-stat span{display:block;color:var(--ink-faint);font:9px var(--mono);text-transform:uppercase;}
.profile-stat b{font:18px var(--mono);display:block;margin-top:.2rem;}
.badges{display:flex;flex-wrap:wrap;gap:.45rem;}
.badge{border:1px solid rgba(212,255,0,.25);background:rgba(212,255,0,.07);color:var(--lime);border-radius:999px;padding:.35rem .55rem;font:10px var(--mono);}
@media (max-width:700px){.hof-grid,.profile-grid{grid-template-columns:1fr 1fr}.lb-row{grid-template-columns:24px 1fr auto}.lb-value{font-size:13px}}

.hud-links{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.panel-actions{display:flex;gap:1rem;align-items:center}.activity-ticker{position:fixed;left:50%;top:1.2rem;transform:translateX(-50%);z-index:31;font:10px var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-dim);padding:.45rem .7rem;border:1px solid var(--edge);border-radius:999px;background:rgba(22,18,40,.62);backdrop-filter:blur(10px);opacity:0;transition:opacity .3s}.activity-ticker.on{opacity:1}.history-row{display:grid;grid-template-columns:1fr auto;gap:.75rem;padding:.7rem 0;border-bottom:1px solid var(--edge)}.history-row b{font-size:.84rem}.history-row span{display:block;color:var(--ink-faint);font:10px var(--mono)}.history-row em{font-style:normal;color:var(--lime);font:13px var(--mono)}.stat-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:.55rem;margin:1rem 0}.stat-box{border:1px solid var(--edge);border-radius:11px;padding:.6rem}.stat-box span{display:block;color:var(--ink-faint);font:9px var(--mono);text-transform:uppercase}.stat-box b{display:block;font:15px var(--mono);margin-top:.2rem}@media(max-width:650px){.stat-strip{grid-template-columns:1fr 1fr}}
