:root {
  --clay: #b25a3a;
  --clay-dark: #7d3f27;
  --ball: #d4f13a;
  --ball-dark: #a8c22a;
  --ink: #1c1c1c;
  --paper: #fdf8ec;
  --card: #ffffff;
  --line: #e7ddc7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

.lang-switch {
  position: absolute;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 4;
  display: flex;
  gap: 0.3rem;
  background: rgba(0,0,0,0.18);
  padding: 0.25rem;
  border-radius: 999px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.75;
  transition: all 0.15s ease;
}

.lang-switch button:hover { opacity: 1; }

.lang-switch button.active {
  background: var(--ball);
  color: var(--ink);
  opacity: 1;
}

header {
  background: linear-gradient(135deg, var(--clay) 0%, var(--clay-dark) 100%);
  color: #fff;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--ball);
  opacity: 0.9;
  box-shadow: inset -10px -10px 0 rgba(0,0,0,0.15);
}

header::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    linear-gradient(transparent 48%, rgba(255,255,255,0.55) 49%, rgba(255,255,255,0.55) 51%, transparent 52%),
    linear-gradient(120deg, transparent 48%, rgba(255,255,255,0.55) 49%, rgba(255,255,255,0.55) 51%, transparent 52%);
  z-index: 1;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.hero-photo {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid var(--ball);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

header h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
}

header p.subtitle {
  margin: 0;
  font-size: 1.15rem;
  opacity: 0.92;
  position: relative;
  z-index: 2;
}

nav.filters {
  max-width: 960px;
  margin: -1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 3;
}

nav.filters button {
  border: 2px solid var(--clay);
  background: var(--card);
  color: var(--clay-dark);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

nav.filters button:hover { background: var(--ball); border-color: var(--ball-dark); color: var(--ink); }

nav.filters button.active {
  background: var(--clay);
  color: #fff;
}

main {
  max-width: 960px;
  margin: 3rem auto;
  padding: 0 1.5rem 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 1.6rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card .tag-cat {
  align-self: flex-start;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: #fff;
}

.tag-cat.colpo { background: var(--clay); }
.tag-cat.aneddoto { background: #3a6fb2; }
.tag-cat.vittoria { background: #2a9d5c; }

.card h3 { margin: 0; font-size: 1.15rem; }

.card p { margin: 0; color: #444; font-size: 0.95rem; }

.card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.card .tags span {
  font-size: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  color: #7a6a4a;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.card .dialogue {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card .dialogue p {
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
  color: #5a4c30;
  line-height: 1.4;
}

.card .dialogue .dialogue-it {
  color: #7a6a4a;
  font-style: normal;
}

.card .video-wrap {
  margin-top: 0.4rem;
  position: relative;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

.card .video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.card .video-missing {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #a08a5a;
  font-style: italic;
}

section.victories {
  margin-top: 3rem;
}

section.victories h2 {
  border-bottom: 3px solid var(--ball);
  display: inline-block;
  padding-bottom: 0.2rem;
}

section.suggest {
  margin-top: 3.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.8rem;
}

section.suggest h2 {
  margin: 0 0 0.4rem;
  border-bottom: 3px solid var(--ball);
  display: inline-block;
  padding-bottom: 0.2rem;
}

section.suggest > p {
  margin: 0 0 1.2rem;
  color: #6a5c3e;
  font-size: 0.95rem;
  max-width: 60ch;
}

#suggest-form { display: flex; flex-direction: column; gap: 0.8rem; }

.suggest-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.suggest-row input { flex: 1 1 200px; }

#suggest-form input,
#suggest-form textarea {
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}

#suggest-form textarea { resize: vertical; min-height: 90px; }

#suggest-form input:focus,
#suggest-form textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(178, 90, 58, 0.15);
}

/* honeypot anti-spam: nascosto agli umani */
#suggest-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#f-submit {
  align-self: flex-start;
  border: 0;
  background: var(--clay);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

#f-submit:hover { background: var(--clay-dark); }
#f-submit:disabled { opacity: 0.6; cursor: default; }

.form-status { margin: 0; font-size: 0.9rem; min-height: 1.2em; }
.form-status.ok { color: #2a9d5c; font-weight: 600; }
.form-status.err { color: #c0392b; font-weight: 600; }

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: #8a7a5a;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  header { padding: 2.6rem 1rem 2.4rem; }
  header::after, header::before {
    width: 150px; height: 150px; right: -45px; top: -45px;
  }
  .hero-row { gap: 0.9rem; }
  .hero-photo { width: 88px; height: 88px; border-width: 2px; }
  header h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  header p.subtitle { font-size: 1rem; }
  .lang-switch { top: 0.8rem; left: 0.8rem; }
  nav.filters { margin-top: -1rem; padding: 0 1rem; gap: 0.4rem; }
  nav.filters button { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
  main { margin: 2rem auto; padding: 0 1rem 1.5rem; }
  .grid { gap: 1.1rem; }
  .card { padding: 1.1rem; }
  section.victories { margin-top: 2rem; }
}

@media (prefers-color-scheme: dark) {
  body { background: #16130d; color: #f0e9d8; }
  .card { background: #221d14; border-color: #3a3222; }
  .card p { color: #cfc4a8; }
  .card .tags span { background: #16130d; border-color: #3a3222; color: #b8a878; }
  .card .dialogue { background: #16130d; border-color: #3a3222; }
  .card .dialogue p { color: #d8c9a0; }
  .card .dialogue .dialogue-it { color: #b8a878; }
  nav.filters button { background: #221d14; }
  section.suggest { background: #221d14; border-color: #3a3222; }
  section.suggest > p { color: #cfc4a8; }
  #suggest-form input, #suggest-form textarea { background: #16130d; border-color: #3a3222; color: #f0e9d8; }
}
