/* Dreamers Beach Volley · colori e font del sito associazionesogni.com, in versione spiaggia. */
@font-face {
  font-family: "Baloo Tamma 2";
  src: url("fonts/baloo-tamma-2.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Mulish";
  src: url("fonts/mulish.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --lilla-chiaro: #cdb4db;
  --lilla: #b38dc8;
  --rosa-chiaro: #ffc3da;
  --rosa: #ffafcc;
  --azzurro: #a2d2ff;
  --azzurro-chiaro: #bde0fe;
  --verde-chiaro: #9bcec8;
  --verde: #53afa6;
  --nero: #1a1a1a;
  --sabbia: #f3e2bf;
  --sabbia-scura: #e2c98f;

  --bg: #ffffff;
  --fg: var(--nero);
  --muted: #5b5b66;
  --card: #ffffff;
  --border: #ece4f2;
  --shadow: 0 6px 18px rgba(83, 60, 110, .10);
  /* verde acqua scurito per il testo piccolo, leggibile sul bianco */
  --verde-testo: #2e7d76;
  --cielo: linear-gradient(180deg, #e6f3ff 0%, #ffffff 100%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151b;
    --fg: #f2eef6;
    --muted: #b4adbd;
    --card: #221f28;
    --border: #36313e;
    --shadow: 0 6px 18px rgba(0, 0, 0, .35);
    --verde-testo: var(--verde-chiaro);
    --sabbia: #6b5b3e;
    --sabbia-scura: #57492f;
    --cielo: linear-gradient(180deg, #1f2533 0%, #17151b 100%);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}
h1, h2, h3 {
  font-family: "Baloo Tamma 2", "Mulish", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0.7em 0 0.4em;
}
h1 { color: var(--lilla); font-size: 2.1rem; }
h2 { color: var(--verde); font-size: 1.5rem; }
a { color: inherit; text-decoration-color: var(--verde); text-underline-offset: 3px; }
p { margin: .5em 0; }

/* --- Testata --------------------------------------------------------------- */
/* Il logo SOGNI è nero: l'intestazione resta bianca anche in modalità scura. */
.top { background: #ffffff; padding: 14px 16px 8px; }
.top a { display: inline-block; text-decoration: none; color: var(--nero); }
.top img { display: block; width: 210px; max-width: 66vw; height: auto; margin: 0 auto; }
.app-name {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px;
  font-family: "Baloo Tamma 2", system-ui, sans-serif;
  font-weight: 700; font-size: 1.2rem; letter-spacing: .02em;
}
.app-name .ball-icon { width: 22px; height: 22px; animation: spin 6s linear infinite; }

/* Striscia con la palette, nell'ordine chiaro → scuro voluto per il sito. */
.palette-bar {
  height: 6px;
  background: linear-gradient(90deg,
    var(--azzurro-chiaro) 0 16.66%, var(--azzurro) 0 33.33%,
    var(--rosa-chiaro) 0 50%, var(--rosa) 0 66.66%,
    var(--verde-chiaro) 0 83.33%, var(--verde) 0 100%);
}

/* La rete: banda bianca in alto e maglie a rombi. */
.net {
  height: 22px;
  margin: 0 auto;
  max-width: 640px;
  border-top: 5px solid #ffffff;
  box-shadow: 0 -1px 0 #c9c3cf;
  background:
    repeating-linear-gradient(45deg, transparent 0 7px, rgba(90, 80, 100, .35) 7px 8px),
    repeating-linear-gradient(-45deg, transparent 0 7px, rgba(90, 80, 100, .35) 7px 8px);
  opacity: .8;
}

/* --- Navigazione ------------------------------------------------------------- */
.nav {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
  padding: 10px 12px;
}
.nav a, .nav .linklike {
  text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
}
.nav a[aria-current="page"] { background: var(--azzurro-chiaro); border-color: var(--azzurro); color: var(--nero); }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 0; }
.subnav a {
  text-decoration: none; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
}
.subnav a[aria-current="page"] { background: var(--lilla-chiaro); color: var(--nero); border-color: var(--lilla-chiaro); }
.badge {
  display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px;
  background: var(--rosa); color: var(--nero); font-size: .8rem;
}
.inline { display: inline; margin: 0; }
.linklike { background: none; font: inherit; color: inherit; cursor: pointer; }

main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; }

/* --- Riquadri ------------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 16px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* --- Pulsanti ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px;
  padding: 12px 24px; min-height: 48px; line-height: 1.2;
  font: 700 1rem "Mulish", system-ui, sans-serif;
  background: var(--verde); color: var(--nero);
  text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .12);
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(.96); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-secondary { background: var(--azzurro); }
.btn-danger { background: var(--rosa); }
.btn-small { min-height: 40px; padding: 8px 16px; font-size: .9rem; }
.btn:focus-visible, .ball-btn:focus-visible { outline: 3px solid var(--lilla); outline-offset: 3px; }

/* Il pulsante a forma di pallone: la palla gira, la scritta resta ferma. */
.ball-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 132px; height: 132px; margin: 8px auto;
  border: 0; border-radius: 50%; padding: 0;
  background: transparent; cursor: pointer; text-decoration: none; color: var(--nero);
  font: 800 1.05rem "Mulish", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.ball-btn::before {
  content: ""; position: absolute; inset: 0;
  background: url("img/ball.svg") center / contain no-repeat;
  filter: drop-shadow(0 8px 10px rgba(83, 60, 110, .25));
  transition: transform .6s cubic-bezier(.3, 1.6, .5, 1);
}
.ball-btn:hover::before { transform: rotate(180deg); }
.ball-btn:active::before { transform: rotate(240deg) scale(.92); }
.ball-btn span {
  position: relative;
  background: rgba(255, 255, 255, .93);
  border-radius: 999px; padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.ball-btn.is-small { width: 104px; height: 104px; font-size: .95rem; }
.ball-btn.bounce { animation: bounce 2.4s ease-in-out infinite; }
.ball-row { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; }
.actions form { margin: 0; }

/* --- Messaggi -------------------------------------------------------------------- */
.flash {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px; margin: 14px 0; border-radius: 18px;
  background: var(--azzurro-chiaro); color: var(--nero); font-weight: 600;
  animation: pop .35s ease-out;
}
.flash-error { background: var(--rosa-chiaro); }
.flash-success { background: var(--verde-chiaro); }
.flash-success::before {
  content: ""; width: 26px; height: 26px; flex: none;
  background: url("img/ball.svg") center / contain no-repeat;
  animation: hop .9s ease-out 2;
}

/* --- Testo ------------------------------------------------------------------------ */
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.notes, .quote { white-space: pre-line; }
.quote {
  display: inline-block; max-width: 100%;
  background: var(--sabbia); color: var(--nero);
  border-radius: 16px; padding: 8px 14px; font-style: italic;
}
.prose { text-align: left; }
.prose h2 { font-size: 1.2rem; margin-top: 1.2em; text-align: center; }

/* --- Moduli ----------------------------------------------------------------------- */
.form label { display: block; font-weight: 700; margin: 0 0 16px; }
.form input[type=email], .form input[type=password], .form input[type=text], .form input[type=tel],
.form input[type=search], .form input[type=number], .form input[type=datetime-local],
.form input[type=date], .form input[type=time],
.form select, .form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  font: 400 1rem "Mulish", system-ui, sans-serif; color: var(--fg);
  text-align: center;
  background: var(--bg); border: 2px solid var(--border); border-radius: 16px;
  transition: border-color .15s ease;
}
.form textarea { text-align: left; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--azzurro); }
.form label.check {
  display: flex; gap: 10px; align-items: center; justify-content: center; font-weight: 400;
}
.form label.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--verde); }
.form .btn { width: 100%; }
.danger-zone { border: 2px dashed var(--rosa); }

/* --- Spiaggia (pagina di benvenuto) ----------------------------------------------------- */
.beach {
  position: relative; overflow: hidden;
  margin: 14px 0; border-radius: 26px;
  background: var(--cielo);
  box-shadow: var(--shadow);
}
.beach svg { display: block; width: 100%; height: auto; }
.beach .sun { animation: glow 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.beach .ball-x { animation: rally-x 3.2s linear infinite alternate; }
.beach .ball-y { animation: rally-y 1.6s cubic-bezier(.33, 0, .67, 1) infinite alternate; }
.beach .ball-spin { animation: spin 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }
.beach .shadow-x { animation: rally-x 3.2s linear infinite alternate; }
.beach .shadow { animation: shadow 1.6s cubic-bezier(.33, 0, .67, 1) infinite alternate; transform-box: fill-box; transform-origin: center; }

/* --- Partite ----------------------------------------------------------------------- */
.game-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: inherit; position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--lilla-chiaro); }
.game-when { font-weight: 700; color: var(--verde-testo); margin: 0; }
.game-when::first-letter { text-transform: uppercase; }
.game-title { font-family: "Baloo Tamma 2", system-ui, sans-serif; font-weight: 700; font-size: 1.35rem; }
.game-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 6px; }
.is-cancelled .game-title { text-decoration: line-through; }
.is-past { opacity: .7; }
.seats { font-weight: 700; }


.tag {
  display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .85rem;
  font-weight: 700; color: var(--nero); margin: 0;
}
.tag-verde { background: var(--verde-chiaro); }
.tag-azzurro { background: var(--azzurro-chiaro); }
.tag-rosa { background: var(--rosa-chiaro); }
.tag-lilla { background: var(--lilla-chiaro); }
.tag-sabbia { background: var(--sabbia); }
.names { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.names li {
  background: var(--sabbia); color: var(--nero);
  border-radius: 999px; padding: 6px 14px; font-weight: 600;
}
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wa { font-weight: 700; color: var(--verde-testo); }

.empty { padding: 26px 16px; }
.empty .ball-icon { width: 54px; height: 54px; animation: bounce 2.4s ease-in-out infinite; }

.filters { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .filters { grid-template-columns: 2fr 1fr; }
  .filters .btn { grid-column: 1 / -1; }
}

.push-banner { border: 2px solid var(--azzurro); background: var(--azzurro-chiaro); color: var(--nero); }

/* --- Il campo da beach volley (visto dall'alto) ----------------------------------------- */
.courts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; margin: 10px 0 4px; }
.court-wrap {
  flex: 1 1 220px; max-width: 300px;
  padding: 10px; border-radius: 16px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .5) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(160, 120, 60, .28) 0 1px, transparent 2px),
    var(--sabbia-scura);
  background-size: 13px 11px, 17px 15px, auto;
}
.court-wrap.is-big { flex-basis: 100%; max-width: 420px; }
.court-wrap.is-closed { opacity: .55; filter: saturate(.6); }
.court {
  position: relative;
  display: grid; grid-template-columns: 1fr 10px 1fr; align-items: stretch;
  aspect-ratio: 2 / 1;
  background: var(--sabbia);
  border: 3px solid #ffffff;
  border-radius: 4px;
}
.court-half {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  place-items: center; padding: 6%;
}
.court-net {
  position: relative;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(70, 60, 80, .45) 4px 5px),
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(70, 60, 80, .45) 4px 5px),
    rgba(255, 255, 255, .55);
  border-left: 2px solid #ffffff; border-right: 2px solid #ffffff;
}
.court-net::before, .court-net::after {
  /* i pali */
  content: ""; position: absolute; left: 50%; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: #6b5b66;
}
.court-net::before { top: -9px; }
.court-net::after { bottom: -9px; }
.spot {
  position: relative;
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px dashed rgba(140, 105, 50, .55);
  background: rgba(255, 255, 255, .25);
}
.spot.extra { border-style: dotted; opacity: .7; }
.spot.taken {
  border: 0; opacity: 1;
  background: url("img/ball.svg") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.spot.taken:hover { animation: hop .8s ease-out 1; }
.is-big .spot { width: 34px; height: 34px; }
.spot em {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  margin-top: 2px; white-space: nowrap;
  font-style: normal; font-size: .68rem; font-weight: 700; color: var(--nero);
  background: rgba(255, 255, 255, .85); border-radius: 6px; padding: 0 4px;
}
.court-label { margin: 6px 0 0; font-size: .85rem; font-weight: 700; color: var(--nero); }
@media (prefers-color-scheme: dark) { .court-label { color: var(--fg); } }

.hero-ball { width: 60px; height: 60px; margin: 10px auto 0; display: block; animation: bounce 2.4s ease-in-out infinite; }
.beach .sea { fill: #a2d2ff; opacity: .55; }
.beach .sea-foam { fill: none; stroke: #ffffff; stroke-width: 2; opacity: .8; }
.beach .sand { fill: var(--sabbia); }
.beach .sand-grain circle { fill: var(--sabbia-scura); }
.beach .post { fill: #6b5b66; }
.week-days { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 16px; }
.week-days label.check {
  margin: 0; padding: 8px 12px; border-radius: 999px;
  background: var(--sabbia); color: var(--nero); font-weight: 700;
}

/* --- Sabbia in fondo alla pagina ---------------------------------------------------- */
.foot {
  position: relative; margin-top: 24px; padding: 34px 16px 22px;
  color: var(--nero); font-size: .85rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .45) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(160, 120, 60, .30) 0 1px, transparent 2px),
    radial-gradient(circle at 45% 80%, rgba(255, 255, 255, .35) 0 1px, transparent 2px),
    var(--sabbia);
  background-size: 23px 19px, 31px 27px, 17px 23px, auto;
  animation: sand 40s linear infinite;
}
@media (prefers-color-scheme: dark) { .foot { color: var(--fg); } }
.foot::before {
  /* l'onda della battigia */
  content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 20px;
  background: radial-gradient(28px 20px at 28px 20px, var(--sabbia) 98%, transparent 100%) 0 0 / 56px 20px repeat-x;
}
.foot a { color: inherit; }

/* --- Animazioni ------------------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-14px); }
  60% { transform: translateY(-14px); }
}
@keyframes hop {
  0% { transform: translateY(0); }
  35% { transform: translateY(-9px) rotate(90deg); }
  70% { transform: translateY(0) rotate(160deg); }
  85% { transform: translateY(-3px) rotate(180deg); }
  100% { transform: translateY(0) rotate(180deg); }
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes sand { to { background-position: 230px 0, -310px 0, 170px 0, 0 0; } }
@keyframes glow { to { opacity: .75; transform: scale(1.06); } }
@keyframes rally-x { from { transform: translateX(0); } to { transform: translateX(240px); } }
@keyframes rally-y { from { transform: translateY(0); } to { transform: translateY(-78px); } }
@keyframes shadow { from { transform: scale(1); opacity: .35; } to { transform: scale(.45); opacity: .12; } }

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