/* SRI Ping Pong — base styles */
:root {
  --bg: #0b1020;
  --bg-2: #111936;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hi: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.10);
  --text: #e6e9f4;
  --text-dim: #9aa3c0;
  --accent: #f97316;
  --accent-2: #ef4444;
  --good: #22c55e;
  --bad: #ef4444;
  --warn: #eab308;
  --p1: #38bdf8;
  --p2: #f43f5e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }

/* Backdrop con glow morbido */
body.glow-bg {
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(249,115,22,0.18), transparent 60%),
    radial-gradient(50% 40% at 100% 100%, rgba(56,189,248,0.14), transparent 60%),
    var(--bg);
}

a { color: inherit; }
button { font: inherit; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--surface-hi); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}
.btn-ghost { background: transparent; }
.btn-lg { padding: 18px 26px; font-size: 18px; border-radius: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-dim);
}

.muted { color: var(--text-dim); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }

input[type="text"], input[type="number"], input[type="password"], select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

/* Avatar circle */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }
.avatar-xxl { width: 180px; height: 180px; font-size: 72px; }

/* Tabella ranking */
table.ranking { width: 100%; border-collapse: collapse; }
table.ranking th, table.ranking td { padding: 12px 14px; text-align: left; }
table.ranking th { font-size: 12px; text-transform: uppercase; color: var(--text-dim); letter-spacing: 0.05em; }
table.ranking tr { border-bottom: 1px solid var(--border); }
table.ranking tr:hover { background: var(--surface); }
.rank-1 { color: #fde047; font-weight: 800; }
.rank-2 { color: #e2e8f0; font-weight: 700; }
.rank-3 { color: #fb923c; font-weight: 700; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px; min-width: 320px; max-width: 90vw;
}

/* Util animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.5); }
  50% { box-shadow: 0 0 0 20px rgba(249,115,22,0); }
}
.pulse-glow { animation: pulse-glow 1.6s infinite; }

@keyframes flash {
  0% { background-color: rgba(255,255,255,0.0); }
  20% { background-color: rgba(255,255,255,0.18); }
  100% { background-color: rgba(255,255,255,0.0); }
}
.flash { animation: flash 0.5s ease-out; }

/* Confetti — simple particles */
.confetti {
  position: fixed; pointer-events: none; inset: 0; overflow: hidden; z-index: 200;
}
.confetti span {
  position: absolute; width: 10px; height: 16px; opacity: 0.9;
  animation: confetti-fall 2.6s linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0); }
  100% { transform: translateY(110vh) rotate(720deg); }
}
