/* =========================================================================
   WhoWon — Design System (versione sito statico)
   Mood: tribunale digitale premium · navy notturno + oro · glass · justice
   ========================================================================= */

:root {
  /* --- Superfici --- */
  --background: #08111f;
  --background-2: #060d18;
  --surface: #0f1b2e;
  --surface-2: #132339;
  --surface-3: #0b1626;

  /* --- Oro --- */
  --gold: #d4af37;
  --gold-bright: #f0d77b;
  --gold-soft: #b8963a;
  --gold-deep: #8a6f24;

  /* --- Testo --- */
  --foreground: #f5f0e6;
  --parchment: #f5f0e6;
  --muted: #aab6c6;
  --muted-2: #7d8699;
  --ink: #08111f;

  /* --- Accenti parti (barra delle colpe) --- */
  --accent-a: #e0665c;
  --accent-b: #5b8def;

  /* --- Bordi / linee --- */
  --hairline: rgba(212, 175, 55, 0.22);
  --line-soft: rgba(245, 240, 230, 0.08);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ------------------------------------------------------------------ Reset */

*, *::before, *::after { box-sizing: border-box; border-color: var(--line-soft); }
* { margin: 0; padding: 0; }
html { height: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
textarea, input { font: inherit; color: inherit; }

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Atmosfera d'aula: alone dorato dall'alto, freddo bagliore blu dal basso,
     vignettatura scura ai bordi. */
  background:
    radial-gradient(120% 75% at 50% -12%, rgba(212, 175, 55, 0.10), transparent 55%),
    radial-gradient(90% 55% at 50% 118%, rgba(91, 141, 239, 0.06), transparent 60%),
    radial-gradient(140% 120% at 50% 50%, transparent 60%, rgba(4, 8, 15, 0.9) 100%),
    var(--background);
  background-attachment: fixed;
}

/* Pattern quasi invisibile: griglia sottilissima da "carta processuale" */
.court-grid {
  background-image:
    linear-gradient(rgba(245, 240, 230, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 240, 230, 0.025) 1px, transparent 1px);
  background-size: 46px 46px;
}

::selection { background: rgba(212, 175, 55, 0.28); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: rgba(212, 175, 55, 0.35) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.3);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

/* ============================================================= Keyframes */

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes stamp-in {
  0%   { opacity: 0; transform: scale(0.92) rotate(-1deg); }
  60%  { opacity: 1; transform: scale(1.02) rotate(0.3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes seal-slam {
  0%   { opacity: 0; transform: scale(1.8) rotate(-18deg); }
  55%  { opacity: 1; transform: scale(0.9) rotate(-12deg); }
  70%  { transform: scale(1.06) rotate(-12deg); }
  100% { opacity: 1; transform: scale(1) rotate(-12deg); }
}
@keyframes sway {
  0%, 100% { transform: rotate(-3.2deg); }
  50%      { transform: rotate(3.2deg); }
}
@keyframes gavel {
  0%, 100% { transform: rotate(-14deg) translateY(0); }
  42%      { transform: rotate(15deg) translateY(-2px); }
  56%      { transform: rotate(19deg) translateY(2px); }
}
@keyframes shimmer {
  0%   { background-position: -150% 0; }
  100% { background-position: 250% 0; }
}
@keyframes fill-bar {
  from { width: 0; }
  to   { width: var(--w); }
}
@keyframes soft-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.08); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes drift {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================= Utility */

.animate-rise     { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-stamp-in { animation: stamp-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-seal     { animation: seal-slam 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both; }
.animate-gavel    { animation: gavel 1.1s ease-in-out infinite; transform-origin: 72% 26%; }
.animate-soft-pulse { animation: soft-pulse 1.6s ease-in-out infinite; }
.animate-float    { animation: float 6s ease-in-out infinite; }
.animate-sway     { animation: sway 5.5s ease-in-out infinite; transform-origin: 50% 8%; }
.animate-drift    { animation: drift 40s linear infinite; }

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.26s; }
.delay-4 { animation-delay: 0.36s; }
.delay-5 { animation-delay: 0.46s; }

.hidden { display: none !important; }

/* --- Scroll reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* barra colpe animata */
.fault-bar {
  width: var(--w);
  animation: fill-bar 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
  height: 100%;
}
.fault-bar.a { background: var(--accent-a); }
.fault-bar.b { background: var(--accent-b); }

/* --- Titolo dorato con riflesso che scorre --- */
.gold-shimmer {
  background: linear-gradient(100deg, var(--gold) 0%, #fff4c2 45%, var(--gold) 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}

.text-gold-gradient {
  background: linear-gradient(180deg, #f3e2a6 0%, var(--gold) 60%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Vetro: card premium con bordo hairline e luce interna --- */
.glass {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 40%),
    var(--surface);
  border: 1px solid rgba(245, 240, 230, 0.09);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.glass-hover {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease;
}
.glass-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 30px 70px -28px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(212, 175, 55, 0.12);
}

/* --- Linea sottile dorata --- */
.gold-hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5) 50%, transparent);
}
.gold-hairline-v {
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.45) 50%, transparent);
}

/* --- Bottone oro principale --- */
.btn-gold {
  position: relative;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-soft) 100%);
  color: var(--ink);
  border: 1px solid rgba(255, 244, 194, 0.5);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 10px 30px -10px rgba(212, 175, 55, 0.55),
    0 0 0 0 rgba(212, 175, 55, 0.4);
  transition: transform 0.18s ease, box-shadow 0.35s ease, filter 0.25s ease;
}
.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 14px 40px -12px rgba(212, 175, 55, 0.75),
    0 0 34px -6px rgba(212, 175, 55, 0.55);
}
.btn-gold:active:not(:disabled) { transform: scale(0.985); }
.btn-gold:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* --- Bottone fantasma con bordo oro --- */
.btn-ghost-gold {
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.04);
  border-radius: 12px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.18s ease, box-shadow 0.3s ease;
}
.btn-ghost-gold:hover:not(:disabled) {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 24px -10px rgba(212, 175, 55, 0.6);
}
.btn-ghost-gold:active:not(:disabled) { transform: scale(0.985); }
.btn-ghost-gold:disabled { opacity: 0.5; cursor: not-allowed; }

/* micro-badge / chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.06);
  color: var(--gold);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
}

/* ============================================================= Layout */

.topbar { position: relative; z-index: 20; width: 100%; }
.topbar-inner {
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 64rem;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
}

.wordmark { display: inline-flex; align-items: center; gap: 8px; transition: opacity 0.2s; }
a.wordmark:hover { opacity: 0.8; }
.wordmark svg { color: var(--gold); }
.wordmark-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.025em;
  color: var(--parchment);
}
.wordmark-text b { color: var(--gold); font-weight: 700; }

.topbar-cta {
  display: none;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.05);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  transition: border-color 0.2s, background 0.2s;
}
.topbar-cta:hover { border-color: rgba(212, 175, 55, 0.6); background: rgba(212, 175, 55, 0.1); }
@media (min-width: 640px) { .topbar-cta { display: inline-flex; } }

/* FAB "Passa a Premium": pill oro fluttuante in basso a destra, sempre visibile.
   Il transform è gestito da app.js per sollevarlo sopra gli elementi importanti. */
.premium-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  top: auto;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  color: #08111f;
  background: linear-gradient(180deg, #f0d77b, #d4af37);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.4);
  text-decoration: none;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.premium-fab:hover {
  filter: brightness(1.06);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.65);
}
.premium-fab-star { font-size: 15px; line-height: 1; }
@media (max-width: 480px) {
  .premium-fab { padding: 11px 15px; font-size: 13px; right: 14px; bottom: 14px; }
}

/* --- Consenso cookie (GDPR) --- */
.consent-bar {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 1100;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(15, 27, 46, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}
.consent-text { margin: 0; flex: 1 1 260px; font-size: 13px; line-height: 1.45; color: var(--parchment); }
.consent-text a { color: var(--gold); }
.consent-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.consent-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent;
}
.consent-reject { background: transparent; border-color: rgba(255, 255, 255, 0.2); color: var(--muted); }
.consent-reject:hover { color: var(--parchment); border-color: rgba(255, 255, 255, 0.4); }
.consent-accept { background: linear-gradient(180deg, #f0d77b, #d4af37); color: #08111f; }
.consent-accept:hover { filter: brightness(1.06); }

/* --- Spazio annuncio (nascosto finché non c'è consenso + codice AdSense) --- */
.ad-slot { display: block; margin: 24px auto; max-width: 100%; text-align: center; }
.ad-slot[hidden] { display: none; }
.ad-slot-label { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

.topbar-home {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}
.topbar-home:hover { color: var(--parchment); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.auth-slot { display: flex; align-items: center; min-height: 32px; }
.auth-btn-mount { display: flex; align-items: center; }

/* Richiamo visivo al login (es. CTA Premium premuta da anonimi) */
#auth-slot.auth-attention .auth-btn-mount {
  border-radius: 999px;
  animation: auth-pulse 1.1s ease-in-out 3;
}
@keyframes auth-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 0 0 7px rgba(212, 175, 55, 0.45); }
}

.auth-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 6px 4px 4px;
  font-size: 12px;
}
.auth-avatar { width: 24px; height: 24px; border-radius: 999px; display: block; }
.auth-name {
  color: var(--parchment);
  font-weight: 500;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-quota { color: var(--muted); white-space: nowrap; }

/* Link "Passa a Premium" mostrato in coda a un errore di quota esaurita. */
.premium-inline-link {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  color: #08111f;
  background: linear-gradient(180deg, #f0d77b, #d4af37);
  text-decoration: none;
}
.premium-inline-link:hover { filter: brightness(1.06); }
.auth-logout {
  color: var(--muted);
  font-size: 12px;
  padding: 2px 6px;
  transition: color 0.2s;
}
.auth-logout:hover { color: var(--parchment); }

.auth-error {
  max-width: 16rem;
  border-radius: 10px;
  border: 1px solid rgba(224, 102, 92, 0.4);
  background: rgba(224, 102, 92, 0.1);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--accent-a);
}

main.page {
  position: relative;
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 64px;
}

/* ============================================================= Hero */

.hero { margin: 0 auto; width: 100%; max-width: 42rem; padding-top: 24px; text-align: center; }
@media (min-width: 640px) { .hero { padding-top: 40px; } }
.hero-chip-row { display: flex; justify-content: center; }
.hero-scale { margin: 28px auto 0; height: 144px; width: 144px; position: relative; }
@media (min-width: 640px) { .hero-scale { height: 176px; width: 176px; } }
.hero-scale-aura {
  pointer-events: none;
  position: absolute;
  left: 50%; top: 50%;
  height: 224px; width: 224px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 62%);
  filter: blur(6px);
  z-index: -1;
}
.hero h1 {
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: 60px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.025em;
}
@media (min-width: 640px) { .hero h1 { font-size: 72px; } }
.hero-tagline {
  margin: 20px auto 0;
  max-width: 36rem;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  font-style: italic;
  color: var(--parchment);
}
@media (min-width: 640px) { .hero-tagline { font-size: 30px; } }
.hero-sub {
  margin: 16px auto 0;
  max-width: 32rem;
  font-size: 15px;
  line-height: 1.625;
  color: var(--muted);
}

/* ---- Hero pagina sfida / caso ---- */
.page-hero { margin: 0 auto; width: 100%; max-width: 32rem; padding-top: 32px; text-align: center; }
@media (min-width: 640px) { .page-hero { padding-top: 48px; } }
.page-hero h1 {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 900;
  color: var(--parchment);
}
@media (min-width: 640px) { .page-hero h1 { font-size: 48px; } }
.page-hero p {
  margin: 16px auto 0;
  max-width: 28rem;
  font-size: 15px;
  line-height: 1.625;
  color: var(--muted);
}
.page-hero p strong { color: var(--parchment); }

/* ============================================================= Sezioni */

.interactive-area { margin: 40px auto 0; width: 100%; max-width: 36rem; }
.interactive-area-sfida { margin: 36px auto 0; width: 100%; max-width: 36rem; }

.loading-panel { border-radius: 24px; padding: 24px; }

.alt-flow-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.alt-flow-row .gold-hairline { display: none; width: 48px; }
@media (min-width: 640px) { .alt-flow-row .gold-hairline { display: block; } }
.alt-flow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(212, 175, 55, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(212, 175, 55, 0.3);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.alt-flow-link:hover { text-decoration-color: var(--gold); }

.error-box {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(224, 102, 92, 0.4);
  background: rgba(224, 102, 92, 0.1);
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--accent-a);
}

.closing-quote { margin: 0 auto; max-width: 28rem; text-align: center; }
.closing-quote .gold-hairline { margin: 0 auto 16px; width: 96px; }
.closing-quote p {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.025em;
  color: var(--muted-2);
}

/* ============================================================= Fascicolo (input) */

.dispute-input { width: 100%; }

.dossier {
  overflow: hidden;
  border-radius: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.dossier:focus-within {
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14), 0 0 40px -12px rgba(212, 175, 55, 0.5);
}
.dossier.dragging {
  border-color: rgba(212, 175, 55, 0.7);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.dossier-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 240, 230, 0.07);
  padding: 10px 16px;
}
.dossier-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.dossier-label .dot {
  height: 6px; width: 6px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.7);
}
.dossier-tab-right { display: flex; align-items: center; gap: 8px; }

.mic-btn {
  display: inline-flex;
  height: 32px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.05);
  color: var(--gold);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.mic-btn:hover:not(:disabled) { border-color: rgba(212, 175, 55, 0.6); background: rgba(212, 175, 55, 0.1); }
.mic-btn.listening {
  border-color: rgba(224, 102, 92, 0.6);
  background: rgba(224, 102, 92, 0.12);
  color: var(--accent-a);
  box-shadow: 0 0 18px -8px rgba(224, 102, 92, 0.9);
}
.mic-btn:disabled { cursor: not-allowed; opacity: 0.4; }

.char-count { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted-2); }
.char-count.near-limit { color: var(--gold); }

.dossier textarea {
  display: block;
  width: 100%;
  resize: none;
  border: 0;
  background: transparent;
  padding: 16px;
  font-size: 15px;
  line-height: 1.625;
  color: var(--parchment);
}
.dossier textarea::placeholder { color: var(--muted-2); }
.dossier textarea:focus { outline: none; }
.dossier textarea:disabled { opacity: 0.6; }

.dossier-drop-hint {
  pointer-events: none;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.06);
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
}
.dossier-listening-hint {
  border-top: 1px solid rgba(224, 102, 92, 0.25);
  background: rgba(224, 102, 92, 0.07);
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-a);
}

/* --- Allega prove --- */
.attach-row { margin-top: 12px; }
.attach-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px dashed rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.03);
  padding: 14px 12px;
  font-size: 14px;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.1s;
}
.attach-btn:hover:not(:disabled) {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(212, 175, 55, 0.07);
  color: var(--parchment);
}
.attach-btn:active:not(:disabled) { transform: scale(0.99); }
.attach-btn .attach-note { color: var(--muted-2); }
.attach-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.attach-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 10px;
}
.attach-preview img {
  height: 56px; width: 56px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.3);
}
.attach-preview .attach-caption { flex: 1; font-size: 12px; color: var(--muted); }
.attach-preview .attach-caption strong { font-weight: 600; color: var(--parchment); }
.attach-remove {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-a);
  transition: background 0.2s;
}
.attach-remove:hover { background: rgba(224, 102, 92, 0.1); }

.input-error {
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(224, 102, 92, 0.3);
  background: rgba(224, 102, 92, 0.08);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--accent-a);
}

.submit-btn {
  margin-top: 16px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

/* ============================================================= Caricamento (Corte) */

.jury-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 32px 0;
}
.jury-ring {
  position: relative;
  display: flex;
  height: 96px; width: 96px;
  align-items: center;
  justify-content: center;
}
.jury-ring .ring-static, .jury-ring .ring-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}
.jury-ring .ring-static { border: 1px solid rgba(212, 175, 55, 0.3); }
.jury-ring .ring-pulse { border: 1px solid rgba(212, 175, 55, 0.5); }
.jury-ring .ring-glow {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.14), transparent 65%);
}
.jury-ring svg { position: relative; color: var(--gold); }
.jury-message {
  min-height: 2.5rem;
  max-width: 288px;
  text-align: center;
  font-size: 14px;
  line-height: 1.625;
  color: rgba(245, 240, 230, 0.85);
}
.jury-dots { display: flex; gap: 6px; }
.jury-dots span {
  height: 6px; width: 6px;
  border-radius: 999px;
  background: var(--gold);
}

/* ============================================================= Card verdetto */

.verdict-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; }

.verdict-card {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 360px;
  /* min-height, non aspect-ratio: con larghezza fissa aspect-ratio calcola
     un'altezza rigida che il browser non adegua al contenuto, quindi i
     verdetti lunghi uscivano dal bordo della card. min-height dà la stessa
     forma verticale ai verdetti brevi ma lascia crescere la card quando
     motivazione e prove non ci stanno. */
  min-height: calc(min(88vw, 320px) * 16 / 9);
  flex-direction: column;
  overflow: visible;
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.8);
  background: linear-gradient(180deg, #16273f, #0f1b2e, #08111f);
  padding: 20px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.verdict-card.sensitive {
  border-color: rgba(100, 116, 139, 0.7);
  background: linear-gradient(180deg, #1e293b, #0f172a);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.verdict-halo {
  pointer-events: none;
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 110px;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  background: radial-gradient(60% 100% at 50% 0%, rgba(212, 175, 55, 0.22), transparent);
}
.verdict-frame {
  pointer-events: none;
  position: absolute;
  inset: 10px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.35);
}
.verdict-card.sensitive .verdict-frame { border-color: #475569; }

.verdict-seal {
  pointer-events: none;
  position: absolute;
  right: 14px; top: 14px;
  z-index: 20;
  display: flex;
  height: 64px; width: 64px;
  transform: rotate(-12deg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid rgba(212, 175, 55, 0.7);
  background: rgba(212, 175, 55, 0.06);
  text-align: center;
}
.verdict-seal .seal-word {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: 0.1em;
  color: rgba(212, 175, 55, 0.9);
}
.verdict-seal .seal-emoji { font-size: 18px; line-height: 1; }

.verdict-header { position: relative; z-index: 10; text-align: center; }
.verdict-header .verdict-emoji { font-size: 30px; line-height: 1; }
.verdict-header h2 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.verdict-card.sensitive .verdict-header h2 { color: #e2e8f0; }
.verdict-header .verdict-court {
  margin-top: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: rgba(245, 240, 230, 0.5);
}

.sensitive-note {
  position: relative;
  z-index: 10;
  margin-top: 16px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: rgba(30, 41, 59, 0.6);
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #e2e8f0;
}

.verdict-body { position: relative; z-index: 10; margin-top: 16px; }
.verdict-headline {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--parchment);
}
.fault-scale { margin-top: 12px; }
.fault-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.fault-labels .side-a { color: var(--accent-a); }
.fault-labels .side-b { color: var(--accent-b); }
.fault-track {
  margin-top: 4px;
  display: flex;
  height: 12px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.fault-caption {
  margin-top: 4px;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 240, 230, 0.4);
}

.verdict-sentence-zone {
  position: relative;
  z-index: 10;
  margin-top: 20px;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}
.verdict-sentence {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.375;
  color: var(--parchment);
}
.verdict-card.sensitive .verdict-sentence { color: #f1f5f9; }

.verdict-details { position: relative; z-index: 10; margin-top: 16px; }
.verdict-motivation {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.625;
  color: rgba(245, 240, 230, 0.8);
}
.verdict-proofs { margin-top: 12px; list-style: none; display: grid; gap: 6px; }
.verdict-proofs li {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.375;
  color: rgba(245, 240, 230, 0.65);
}
.verdict-proofs .bullet { color: var(--gold); }
.verdict-card.sensitive .verdict-proofs .bullet { color: #94a3b8; }
.verdict-proofs .proof-text { font-family: var(--font-serif); font-style: italic; }

.verdict-footer {
  position: relative;
  z-index: 10;
  margin-top: 16px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  padding-top: 10px;
  text-align: center;
}
.verdict-card.sensitive .verdict-footer { border-top-color: #475569; }
.verdict-footer .brand {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold);
}
.verdict-card.sensitive .verdict-footer .brand { color: #cbd5e1; }
.verdict-footer .brand-note { margin-left: 8px; font-size: 10px; color: rgba(245, 240, 230, 0.4); }

/* ============================================================= Azioni card */

.card-actions { margin-top: 20px; width: 100%; max-width: 360px; }
.card-actions-row { display: flex; gap: 10px; }
.card-actions-row button { flex: 1; padding: 12px; font-size: 14px; font-weight: 600; }
.card-actions-row .btn-gold { font-weight: 700; }
.challenge-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(224, 102, 92, 0.5);
  background: rgba(224, 102, 92, 0.06);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-a);
  transition: background 0.2s, transform 0.1s;
}
.challenge-btn:hover { background: rgba(224, 102, 92, 0.12); }
.challenge-btn:active { transform: scale(0.95); }
.card-actions-feedback { margin-top: 10px; text-align: center; font-size: 12px; color: var(--muted); }

.new-case-btn {
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s;
}
.new-case-btn:hover { color: var(--parchment); }

.case-caption { margin-top: 16px; text-align: center; font-size: 11px; color: var(--muted-2); }

/* ============================================================= Feature cards */

.features-section { margin: 64px auto 0; width: 100%; max-width: 64rem; }
.features-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { height: 100%; border-radius: 16px; padding: 20px; text-align: center; }
@media (min-width: 640px) { .feature-card { text-align: left; } }
.feature-icon {
  margin: 0 auto 12px;
  display: flex;
  height: 44px; width: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.07);
  font-size: 20px;
}
@media (min-width: 640px) { .feature-icon { margin-left: 0; margin-right: 0; } }
.feature-card h3 { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: var(--parchment); }
.feature-card p { margin-top: 6px; font-size: 14px; line-height: 1.625; color: var(--muted); }

/* ============================================================= Showcase */

.showcase-section { margin: 64px auto; width: 100%; max-width: 56rem; }
.showcase-head { text-align: center; }
.showcase-kicker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: rgba(212, 175, 55, 0.7);
}
.showcase-head h2 {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--parchment);
}
@media (min-width: 640px) { .showcase-head h2 { font-size: 36px; } }
.showcase-head p { margin: 12px auto 0; max-width: 28rem; font-size: 14px; color: var(--muted); }

.showcase-grid {
  margin-top: 36px;
  display: grid;
  align-items: stretch;
  gap: 20px;
}
@media (min-width: 1024px) { .showcase-grid { grid-template-columns: 1fr auto 1fr; } }

.showcase-panel { display: flex; height: 100%; flex-direction: column; border-radius: 16px; padding: 20px; }
.showcase-panel-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.showcase-panel-head .icon { font-size: 16px; }
.showcase-panel-head .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.showcase-panel-head .label.gold { color: var(--gold); }

.chat-bubbles { display: grid; gap: 10px; }
.bubble {
  max-width: 85%;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 14px;
  color: rgba(245, 240, 230, 0.9);
}
.bubble .who {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.bubble.left {
  border-top-left-radius: 4px;
  background: rgba(224, 102, 92, 0.12);
  box-shadow: 0 0 0 1px rgba(224, 102, 92, 0.25);
}
.bubble.left .who { color: rgba(224, 102, 92, 0.8); }
.bubble.right {
  margin-left: auto;
  border-top-right-radius: 4px;
  background: rgba(91, 141, 239, 0.12);
  box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.25);
}
.bubble.right .who { text-align: right; color: rgba(91, 141, 239, 0.8); }

.showcase-connector { display: none; align-items: center; justify-content: center; }
@media (min-width: 1024px) { .showcase-connector { display: flex; } }
.showcase-connector .stack { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.showcase-connector .gold-hairline-v { height: 56px; }
.showcase-connector .arrow {
  display: flex;
  height: 36px; width: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
}

.showcase-verdict {
  position: relative;
  overflow: hidden;
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(212, 175, 55, 0.18);
}
.showcase-verdict .halo {
  pointer-events: none;
  position: absolute;
  left: 0; right: 0; top: -64px;
  height: 128px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(212, 175, 55, 0.16), transparent);
}
.showcase-verdict .headline {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.375;
  color: var(--parchment);
}
.showcase-verdict .headline .pct { color: var(--gold); }
.showcase-verdict .fault-scale { margin-top: 16px; }
.showcase-verdict .fault-track { height: 10px; margin-top: 6px; }
.showcase-verdict .bar-a { height: 100%; background: var(--accent-a); }
.showcase-verdict .bar-b { height: 100%; background: var(--accent-b); }
.showcase-verdict .quote {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.625;
  color: rgba(245, 240, 230, 0.8);
}

/* ============================================================= Sfida — condivisione */

.share-panel {
  width: 100%;
  border-radius: 24px;
  border-color: rgba(212, 175, 55, 0.3);
  padding: 24px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(212, 175, 55, 0.15);
}
.share-panel .share-emoji { font-size: 36px; }
.share-panel h2 {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--parchment);
}
.share-panel p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.share-url {
  margin-top: 16px;
  word-break: break-all;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  font-size: 12px;
  color: var(--gold);
}
.share-stack { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.wa-btn {
  display: block;
  width: 100%;
  border-radius: 12px;
  background: #25d366;
  padding: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 12px 30px -12px rgba(37, 211, 102, 0.6);
  transition: filter 0.2s, transform 0.1s;
}
.wa-btn:hover { filter: brightness(1.05); }
.wa-btn:active { transform: scale(0.98); }
.copy-btn { width: 100%; padding: 12px 16px; font-size: 14px; font-weight: 600; }
.goto-case-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s;
}
.goto-case-link:hover { color: var(--parchment); }
.draft-note { margin-bottom: 8px; font-size: 12px; color: var(--muted); }

/* ============================================================= Caso condiviso */

.case-container {
  margin-top: 24px;
  display: flex;
  width: 100%;
  max-width: 36rem;
  flex-direction: column;
  align-items: center;
}
.case-panel { margin-top: 24px; width: 100%; border-radius: 24px; padding: 24px; }

.not-found { margin-top: 40px; text-align: center; }
.not-found .nf-emoji { font-size: 48px; }
.not-found h1 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--parchment);
}
.not-found p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.not-found .btn-gold {
  margin-top: 24px;
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
}

.blind-intro {
  border-radius: 24px;
  border-color: rgba(91, 141, 239, 0.3);
  padding: 20px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(91, 141, 239, 0.18);
}
.blind-intro .bi-emoji { font-size: 36px; }
.blind-intro h1 {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--parchment);
}
.blind-intro p { margin-top: 8px; font-size: 14px; line-height: 1.625; color: var(--muted); }
.blind-intro p strong { color: var(--parchment); }
.blind-form-input { margin-top: 16px; }

.waiting-panel {
  width: 100%;
  border-radius: 24px;
  border-color: rgba(212, 175, 55, 0.25);
  padding: 28px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 60px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(212, 175, 55, 0.12);
}
.waiting-panel .wp-emoji { display: inline-block; font-size: 48px; }
.waiting-panel h1 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--parchment);
}
.waiting-panel p { margin-top: 8px; font-size: 14px; line-height: 1.625; color: var(--muted); }
.waiting-panel .copy-btn { margin-top: 20px; }

/* ============================================================= Footer */

.site-footer {
  margin-top: auto;
  width: 100%;
  border-top: 1px solid rgba(245, 240, 230, 0.07);
  padding: 32px 16px;
}
.site-footer-inner {
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: 64rem;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (min-width: 640px) { .site-footer-inner { flex-direction: row; } }
.site-footer-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (min-width: 640px) { .site-footer-brand { align-items: flex-start; } }
.site-footer-copy { font-size: 11px; color: var(--muted-2); }
.site-footer nav { display: flex; align-items: center; gap: 20px; font-size: 12px; color: var(--muted); }
.site-footer nav a { transition: color 0.2s; }
.site-footer nav a:hover { color: var(--parchment); }
.site-footer nav .sep { color: rgba(125, 134, 153, 0.5); }

/* ---------- Accessibilità: riduci il movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  .animate-rise, .animate-stamp-in, .animate-seal, .animate-gavel,
  .animate-soft-pulse, .animate-float, .animate-sway,
  .animate-drift, .fault-bar, .gold-shimmer {
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none; transition: none; }
  .gold-shimmer { color: var(--gold); }
}
