/* ==========================================================================
   GameBox — design system
   Estetica: cyberpunk/arcade futuristico, scuro, neon, dinamico.
   ========================================================================== */

:root {
  --bg-deep: #05060f;
  --bg-panel: rgba(255, 255, 255, 0.045);
  --bg-panel-strong: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(139, 92, 246, 0.55);

  --neon-violet: #8b5cf6;
  --neon-violet-strong: #a78bfa;
  --neon-cyan: #22d3ee;
  --neon-pink: #ec4899;
  --neon-amber: #fbbf24;
  --neon-green: #34d399;
  --neon-red: #f87171;

  --text-primary: #f4f4ff;
  --text-secondary: #a5adc6;
  --text-muted: #6b7394;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --font-display: 'Orbitron', 'Segoe UI', sans-serif;
  --font-body: 'Rajdhani', 'Segoe UI', sans-serif;

  --shadow-glow-violet: 0 0 24px rgba(139, 92, 246, 0.35), 0 0 2px rgba(139, 92, 246, 0.6);
  --shadow-glow-cyan: 0 0 24px rgba(34, 211, 238, 0.3), 0 0 2px rgba(34, 211, 238, 0.6);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.6em;
  line-height: 1.25;
}

h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 {
  font-size: 1.4rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}
h3 { font-size: 1.1rem; color: var(--text-primary); }

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
a:hover {
  color: var(--neon-violet-strong);
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

p { color: var(--text-secondary); }

pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.8em 1em;
  color: var(--neon-green);
  font-size: 0.85em;
  overflow-x: auto;
}

/* --- Sfondo animato: griglia cyberpunk + bagliori fluttuanti --- */

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.25), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(236, 72, 153, 0.2), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(34, 211, 238, 0.18), transparent 45%),
    linear-gradient(180deg, #05060f 0%, #090b1a 100%);
}

.bg-fx::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(60deg);
  transform-origin: top;
  opacity: 0.35;
  animation: grid-drift 14s linear infinite;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to { background-position: 0 96px; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* --- Layout --- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: rgba(5, 6, 15, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--neon-violet-strong), var(--neon-cyan), var(--neon-pink));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brand-shine 6s linear infinite;
  white-space: nowrap;
}
.brand:hover { text-shadow: none; }

@keyframes brand-shine {
  to { background-position: 200% center; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-links a { color: var(--text-secondary); }
.nav-links a.active { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(34, 211, 238, 0.5); }

.nav-account {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-account a { color: var(--text-secondary); }

/* --- Menu a tendina (Giochi, Account, Admin) --- */

.nav-dropdown {
  position: relative;
}
.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after {
  content: ' ▾';
  font-size: 0.7em;
}
.nav-dropdown summary:hover,
.nav-dropdown[open] summary,
.nav-dropdown summary.active {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.6rem;
  background: rgba(8, 9, 20, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 170px;
  box-shadow: var(--shadow-glow-violet);
  z-index: 30;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.nav-links .dropdown-menu { left: 0; right: auto; }
.dropdown-menu a, .dropdown-menu button {
  text-align: left;
  padding: 0.4em 0.6em;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: var(--bg-panel-strong);
  color: var(--neon-cyan);
}

.footer-links a { margin: 0 0.3em; }

/* --- Modal di accesso/registrazione --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 2, 8, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  animation: float 0s;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--neon-pink); }

.modal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.tab-btn {
  flex: 1;
  padding: 0.6em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.tab-btn.active {
  border-color: var(--border-glow);
  color: var(--neon-cyan);
  background: var(--bg-panel-strong);
}

.page-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.4rem 1.5rem 4rem;
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Hero --- */

.hero {
  position: relative;
  text-align: center;
  padding: 3.5rem 1rem 3rem;
  margin-bottom: 2rem;
}

.hero-title {
  background: linear-gradient(100deg, var(--neon-cyan), var(--neon-violet-strong) 50%, var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

.hero-orb {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.55;
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}
.hero-orb.o1 { background: var(--neon-violet); top: -20px; left: 8%; }
.hero-orb.o2 { background: var(--neon-cyan); top: 20px; right: 10%; animation-delay: -3s; }

/* --- Cards --- */

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.4rem;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card + .card { margin-top: 1rem; }

.card-glow:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-violet);
}

.section {
  margin: 2.6rem 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

/* --- Game / team cards --- */

.game-card {
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), transparent 60%);
  pointer-events: none;
}
.game-card h3 { font-family: var(--font-display); margin-bottom: 0.3rem; }
.game-card .meta { color: var(--text-muted); font-size: 0.85rem; }

/* --- Badge di stato --- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25em 0.75em;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse-glow 1.8s ease-in-out infinite;
}
.badge-attivo { color: var(--neon-green); background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.4); }
.badge-manutenzione { color: var(--neon-amber); background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.4); }
.badge-nascosto { color: var(--text-muted); background: rgba(255, 255, 255, 0.05); border-color: var(--border-soft); }

/* --- Bottoni --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.65em 1.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-panel-strong);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-glow); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(100deg, var(--neon-violet), var(--neon-cyan));
  border: none;
  color: #05060f;
  font-weight: 700;
}
.btn-primary:hover { box-shadow: var(--shadow-glow-violet); }

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--neon-red);
}
.btn-danger:hover { box-shadow: 0 0 20px rgba(248, 113, 113, 0.3); }

.btn-sm { padding: 0.4em 0.9em; font-size: 0.72rem; }

/* --- Form --- */

form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

input, select, textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 0.6em 0.9em;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
textarea { width: 100%; font-family: var(--font-body); }

label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Tabelle (pannelli admin) --- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--border-soft);
}
th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
}
tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* --- Liste feed / achievement --- */

.feed-list, .plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.feed-item {
  padding: 0.7em 1em;
  border-left: 3px solid var(--neon-violet);
  background: var(--bg-panel);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}
.feed-item .when { color: var(--text-muted); font-size: 0.78rem; display: block; margin-top: 0.2em; }

/* --- Avatar / logo --- */

.avatar-img, .logo-img {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-glow);
  box-shadow: var(--shadow-glow-violet);
}
.logo-img { border-radius: var(--radius-sm); }

/* --- Chat --- */

.chat-log {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  padding: 0.8em;
  height: 240px;
  overflow-y: auto;
  font-size: 0.92rem;
}
.chat-log p { color: var(--text-primary); margin: 0.3em 0; }
.chat-log .notice { color: var(--neon-red); }

/* --- Alert / disclaimer --- */

.notice-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.9em 1.1em;
  color: var(--neon-amber);
  font-size: 0.9rem;
}

.denied-box {
  text-align: center;
  padding: 3rem 1rem;
}

/* --- Utility --- */

.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 1rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

@media (max-width: 640px) {
  .page-content { padding: 1.6rem 1rem 3rem; }
  .navbar { padding: 0.8rem 1rem; }
}
