/* ── Identità: notte di padel ─────────────────────────────────────────
   Turf blu sotto i fari, righe bianche del campo, pallina giallo fluo,
   pannelli come vetrate. Display: Anton · Corpo: Archivo · Tempi: mono */

:root {
  --court-900: #071B43;
  --court-700: #0E2E67;
  --court-500: #164189;
  --line: #F5F2E8;
  --line-60: rgba(245, 242, 232, .60);
  --line-25: rgba(245, 242, 232, .25);
  --line-12: rgba(245, 242, 232, .12);
  --muted: #9FB2D8;
  --ball: #E4F222;
  --ball-ink: #122052;
  --danger: #F26D4F;
  --glass: rgba(255, 255, 255, .05);
  --radius: 14px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Anton", "Archivo Black", system-ui, sans-serif;
  --body: "Archivo", -apple-system, system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: var(--body);
  color: var(--line);
  background: linear-gradient(175deg, var(--court-700) 0%, var(--court-900) 70%) fixed;
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Righe del campo, appena accennate sullo sfondo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--line) 0 0) 50% 0 / 2px 100% no-repeat,
    linear-gradient(var(--line) 0 0) 0 32% / 100% 2px no-repeat;
  opacity: .05;
}

/* ── Testate ── */
.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.05;
}

h2 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--line-60);
  margin: 4px 0 12px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line-25);
  margin-bottom: 16px;
}

.topbar a {
  color: var(--ball);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 4px;
}

.muted { color: var(--muted); font-size: .88rem; }

/* ── Pannelli (vetrate) ── */
.card {
  background: var(--glass);
  border: 1px solid var(--line-12);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Form ── */
label {
  display: block;
  font-family: var(--mono);
  font-size: .65rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 0 6px;
}

input, select {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  font-family: var(--body);
  color: var(--line);
  background: rgba(7, 27, 67, .55);
  border: 1px solid var(--line-25);
  border-radius: 10px;
  outline: none;
}

input:focus, select:focus { border-color: var(--ball); }
input::placeholder { color: rgba(159, 178, 216, .55); }
select option { color: #111; }

/* ── Bottoni ── */
.btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin-top: 14px;
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--ball-ink);
  background: var(--ball);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s ease;
}

.btn:active { transform: scale(.97); }

.btn.ghost {
  background: transparent;
  color: var(--line);
  border: 1px solid var(--line-25);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn.small {
  display: inline-block;
  width: auto;
  padding: 9px 16px;
  font-size: .78rem;
  margin: 8px 8px 0 0;
  border-radius: 9px;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* ── Tab login/registrati ── */
.tabs {
  display: flex;
  border: 1px solid var(--line-25);
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 4px;
}

.tabs button {
  flex: 1;
  padding: 11px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.tabs button.active {
  background: var(--line);
  color: var(--court-900);
  font-weight: 700;
}

/* ── Pallina HIGHLIGHT (firma) ── */
.ball-wrap { text-align: center; padding: 10px 0 4px; }

.ball-btn {
  position: relative;
  width: min(62vw, 230px);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 32% 28%, #F4FF6E 0%, var(--ball) 45%, #B8C712 100%);
  box-shadow:
    0 10px 40px rgba(228, 242, 34, .35),
    0 2px 0 rgba(0, 0, 0, .25) inset;
  transition: transform .08s ease;
}

.ball-btn:active { transform: scale(.93); }

/* le due cuciture della pallina */
.ball-btn::before, .ball-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 58%;
  aspect-ratio: 1;
  border: 2.5px solid rgba(18, 32, 82, .35);
  border-radius: 50%;
  transform: translateY(-50%);
}
.ball-btn::before { left: -26%; clip-path: inset(0 0 0 62%); }
.ball-btn::after  { right: -26%; clip-path: inset(0 62% 0 0); }

.ball-btn span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ball-ink);
}

.ball-btn.bump { animation: bump .35s ease; }
@keyframes bump {
  0% { transform: scale(.93); }
  55% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* contatore da tabellone */
.scorebox {
  text-align: center;
  margin-top: 14px;
}
.scorebox .num {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--ball);
  line-height: 1;
}
.scorebox .lbl {
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Stati / pill ── */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid var(--line-25);
  color: var(--muted);
  vertical-align: middle;
}
.pill.ok { border-color: var(--ball); color: var(--ball); }
.pill.warn { border-color: #F2B705; color: #F2B705; }
.pill.err { border-color: var(--danger); color: var(--danger); }

.error { color: var(--danger); font-size: .88rem; margin-top: 8px; min-height: 1.2em; }

/* ── Partite / marker ── */
.match-when {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--muted);
}

.match-court {
  font-family: var(--display);
  font-size: 1.3rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 2px 0 6px;
}

.marker-row {
  padding: 12px 0 4px;
  border-top: 1px solid var(--line-12);
  margin-top: 12px;
}

.marker-time {
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--ball);
}

.qr-img {
  width: 168px;
  height: 168px;
  image-rendering: pixelated;
  border-radius: 10px;
  border: 6px solid var(--line);
  margin-top: 10px;
  display: block;
}

.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--ball); outline-offset: 2px; }

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