/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

/* ─── VARIABILI ──────────────────────────────────────────────── */
:root {
  --sun:   #FF6B35;
  --sun2:  #FF9500;
  --sky:   #00B4D8;
  --deep:  #03045E;
  --wave:  #90E0EF;
  --sand:  #FFF8E7;
  --hot:   #FF4D6D;
  --lime:  #80ED99;
  --bk:    #0A0A1A;
  --w:     #FAFCFF;
  --g:     #F0F4FF;
  --red:   #F87171;
  --green: #4ADE80;
  --card:  #ffffff;
  --border:#E2E8F0;
  --text2: #64748B;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--g);
  color: var(--bk);
  min-height: 100vh;
}
#root { min-height: 100vh; }

/* ─── BOOT SCREEN ────────────────────────────────────────────── */
#boot-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100vh; gap: 12px;
  background: linear-gradient(160deg, #03045E 0%, #0077B6 60%, #00B4D8 100%);
}
.boot-logo {
  font-family: 'Righteous', sans-serif;
  font-size: 3.5rem; color: var(--sun); letter-spacing: 3px;
  text-shadow: 3px 3px 0 rgba(0,0,0,.3);
}
.boot-logo span { color: var(--wave); }
.boot-sub {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem; color: var(--wave); letter-spacing: 6px;
}
.boot-spinner {
  width: 36px; height: 36px; margin-top: 8px;
  border: 3px solid rgba(144,224,239,.25);
  border-top-color: var(--sun); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── HEADER ─────────────────────────────────────────────────── */
.header {
  background: var(--deep);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 0 rgba(0,180,216,.4), 0 4px 20px rgba(3,4,94,.3);
  gap: 10px;
}
.logo {
  font-family: 'Righteous', sans-serif;
  font-size: 1.5rem; letter-spacing: 2px; color: var(--sun);
  animation: logoPulse 4s ease-in-out infinite;
  text-shadow: 2px 2px 0 rgba(0,0,0,.4); cursor: pointer;
}
.logo span { color: var(--wave); }
@keyframes logoPulse {
  0%,100% { text-shadow: 2px 2px 0 rgba(0,0,0,.4); }
  50%     { text-shadow: 0 0 18px rgba(255,107,53,.6), 2px 2px 0 rgba(0,0,0,.4); }
}
.hdr-r { display:flex; gap:6px; align-items:center; }

/* ─── BOTTONI ────────────────────────────────────────────────── */
.btn {
  cursor: pointer; border: none;
  font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: .8rem; padding: 8px 16px;
  text-transform: uppercase; letter-spacing: 1px;
  transition: transform .1s, box-shadow .1s, opacity .1s;
  display: inline-block; border-radius: 4px;
}
.btn:active { transform: translate(2px,2px) !important; box-shadow: none !important; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-sun    { background: var(--sun);  color: #fff; box-shadow: 0 4px 0 #b84400; }
.btn-sun:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #b84400; }
.btn-sky    { background: var(--sky);  color: var(--deep); box-shadow: 0 4px 0 #006d8a; }
.btn-sky:hover { transform: translateY(-1px); }
.btn-ghost  { background: transparent; color: var(--wave); border: 2px solid rgba(144,224,239,.5); }
.btn-ghost:hover { background: rgba(144,224,239,.1); border-color: var(--wave); }
.btn-red    { background: var(--red);  color: #fff; box-shadow: 0 4px 0 #900; }
.btn-red:hover { transform: translateY(-1px); }
.btn-green  { background: var(--green); color: #111; box-shadow: 0 4px 0 #1a5c2a; }
.btn-sa     { background: linear-gradient(135deg,#7c3aed,#a855f7); color: #fff; }
.btn-sa:hover { opacity:.9; }

.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-sm { padding: 4px 10px; font-size: .72rem; }

/* ─── LAYOUT PAGE ────────────────────────────────────────────── */
.page {
  padding: 20px 16px 40px; max-width: 860px;
  margin: 0 auto; animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:none; }
}
.pg-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4rem; letter-spacing: 2px; line-height: 1; margin-bottom: 6px;
}
.pg-title span { background: var(--sun); color: #fff; padding: 0 8px; }
.subtitle { font-size: .85rem; color: var(--text2); font-weight: 700; margin-bottom: 20px; }
.sec-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; letter-spacing: 1px;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 3px solid var(--sun); color: var(--deep);
  display: flex; align-items: center; gap: 8px;
}
.back-link {
  cursor: pointer; font-weight: 800; font-size: .75rem;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 14px; display: inline-flex; align-items: center; gap: 4px;
  color: var(--text2); transition: color .15s;
}
.back-link:hover { color: var(--sun); }

/* ─── CARD BASE ──────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px;
  box-shadow: 0 2px 8px rgba(3,4,94,.07);
}

/* ─── FORM ───────────────────────────────────────────────────── */
.fg { margin-bottom: 12px; }
.fg label {
  display: block; font-weight: 800; font-size: .68rem;
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px;
  color: var(--text2);
}
.fs-inp {
  width: 100%; padding: 10px 13px;
  border: 2px solid var(--border); background: #fff;
  font-family: 'Nunito', sans-serif; font-size: .9rem; outline: none;
  transition: border-color .15s, box-shadow .15s; border-radius: 6px;
}
.fs-inp:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(0,180,216,.15); }

.err-box {
  background: #fee2e2; border: 2px solid var(--red); border-radius: 6px;
  color: #b91c1c; padding: 9px 12px;
  font-size: .82rem; font-weight: 700; margin-bottom: 12px;
}

/* ─── BADGE ──────────────────────────────────────────────────── */
.badge { font-size: .67rem; font-weight: 800; padding: 2px 8px; text-transform: uppercase;
  letter-spacing: .5px; display: inline-block; border-radius: 4px; }
.badge-sun { background: var(--sun); color: #fff; }
.badge-sky { background: var(--sky); color: var(--deep); }
.badge-green { background: var(--green); color: #111; }

/* ─── AUTH ───────────────────────────────────────────────────── */
.auth-bg {
  min-height: calc(100vh - 56px);
  background: linear-gradient(160deg, #03045E 0%, #0077B6 50%, #00B4D8 80%, #ADE8F4 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 28px 14px; position: relative; overflow: hidden;
}
.auth-bg::before {
  content: '🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊';
  position: absolute; bottom: 30px; left: -20px; right: -20px;
  font-size: 2.5rem; letter-spacing: -6px; opacity: .2;
  animation: waveDrift 6s ease-in-out infinite alternate;
}
.auth-bg::after {
  content: '☀️'; position: absolute; top: 60px; right: 80px;
  font-size: 4rem; opacity: .5;
  animation: sunFloat 8s ease-in-out infinite alternate;
}
@keyframes waveDrift { from{transform:translateX(-10px)} to{transform:translateX(10px)} }
@keyframes sunFloat  { from{transform:translateY(0) rotate(0deg)} to{transform:translateY(-15px) rotate(20deg)} }

.auth-card {
  background: rgba(255,253,245,.97); border-radius: 16px;
  border: 2px solid rgba(255,107,53,.3);
  box-shadow: 0 20px 60px rgba(3,4,94,.4), 0 0 0 1px rgba(255,255,255,.2);
  padding: 36px 30px; width: 100%; max-width: 400px;
  animation: cardPop .4s cubic-bezier(.34,1.56,.64,1) both;
  position: relative; z-index: 2;
}
@keyframes cardPop {
  from { transform: scale(.88) translateY(24px); opacity:0; }
  to   { transform: none; opacity:1; }
}
.auth-logo {
  font-family: 'Righteous', sans-serif;
  font-size: 2.4rem; letter-spacing: 2px; color: var(--sun);
  text-align: center; margin-bottom: 2px;
}
.auth-logo span { color: var(--sky); }
.auth-year {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .95rem; letter-spacing: 6px; color: #bbb;
  text-align: center; margin-bottom: 22px;
}
.auth-sw { margin-top: 14px; text-align: center; font-size: .84rem; color: #888; }
.auth-sw a { font-weight: 800; text-decoration: underline; cursor: pointer; color: var(--sun); }
.auth-hint {
  text-align: center; font-size: .75rem; font-weight: 700;
  color: #aaa; margin-bottom: 16px; letter-spacing: .3px;
}

/* ─── RULES ──────────────────────────────────────────────────── */
.rules-bg {
  min-height: calc(100vh - 56px);
  background: linear-gradient(150deg, #03045E 0%, #0077B6 60%, #00B4D8 100%);
  padding: 36px 16px;
}
.rules-wrap { max-width: 680px; margin: 0 auto; }
.rules-title {
  font-family: 'Righteous', sans-serif;
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  color: var(--sun); letter-spacing: 3px; text-align: center;
  text-shadow: 3px 3px 0 rgba(0,0,0,.3); line-height: .9; margin-bottom: 6px;
}
.rules-title span { color: var(--wave); }
.rules-title small { font-size: .45em; display: block; color: var(--wave); opacity: .7; letter-spacing: 8px; margin-top: 6px; }
.rules-sub { text-align: center; color: var(--wave); font-weight: 700; font-size: .85rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 28px; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
@media (max-width: 500px) { .rules-grid { grid-template-columns: 1fr; } }

.rules-card {
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(144,224,239,.2);
  border-radius: 10px; padding: 18px; transition: border-color .2s;
}
.rules-card:hover { border-color: rgba(144,224,239,.5); }
.rules-card.wide { grid-column: 1 / -1; }
.rules-ic { font-size: 1.8rem; margin-bottom: 8px; }
.rules-ct { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--wave); letter-spacing: 1px; margin-bottom: 5px; }
.rules-cb { color: #b0d0e0; font-size: .82rem; font-weight: 600; line-height: 1.6; }
.rules-cb strong { color: #fff; }
.rules-ev-title { font-family:'Bebas Neue',sans-serif; font-size:1.1rem; color:var(--wave); letter-spacing:1px; margin:12px 0 8px; }
.rules-ev-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px,1fr)); gap:6px; margin-bottom:8px; }
.rules-ev {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; font-size: .78rem; font-weight: 700; border-radius: 6px;
}
.rules-ev.bon { background: rgba(74,222,128,.15); border-left: 3px solid var(--green); color: #d0f0d8; }
.rules-ev.bon strong { color: var(--green); }
.rules-ev.mal { background: rgba(248,113,113,.12); border-left: 3px solid var(--red); color: #f0d0d0; }
.rules-ev.mal strong { color: var(--red); }

/* ─── HOME ───────────────────────────────────────────────────── */
.home-banner {
  background: linear-gradient(135deg, var(--deep) 0%, #0055a5 60%, #00B4D8 100%);
  padding: 28px 24px; margin-bottom: 20px;
  border-radius: 14px; text-align: center;
  box-shadow: 0 8px 24px rgba(3,4,94,.2);
  position: relative; overflow: hidden;
}
.home-banner::after {
  content: '🌊'; position: absolute; right: -10px; bottom: -10px;
  font-size: 5rem; opacity: .12;
}
.home-banner-title {
  font-family: 'Righteous', sans-serif;
  font-size: 2.4rem; color: var(--sun); letter-spacing: 3px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.home-banner-title span { color: var(--wave); }
.home-banner-sub { color: rgba(255,255,255,.6); font-size: .82rem; font-weight: 700; margin-top: 4px; letter-spacing: 1px; }

.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.home-action-btn {
  background: var(--card); border: 2px solid var(--border); border-radius: 12px;
  padding: 18px 12px; text-align: center; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}
.home-action-btn:hover { border-color: var(--sun); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,107,53,.15); }
.ha-icon { font-size: 1.8rem; margin-bottom: 6px; }
.ha-label { font-weight: 900; font-size: .78rem; text-transform: uppercase; letter-spacing: 1px; color: var(--deep); }

.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.lc {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 2px 8px rgba(3,4,94,.07);
}
.lc:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(3,4,94,.13); border-color: var(--sky); }
.lc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lc-name { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: 1px; color: var(--deep); }
.lc-owner { font-size: .75rem; font-weight: 700; color: var(--text2); margin-bottom: 14px; }
.lc-stats { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.lc-stat { flex: 1; text-align: center; padding: 8px 4px; }
.lc-stat span { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: var(--deep); line-height: 1; }
.lc-stat small { font-size: .6rem; font-weight: 800; text-transform: uppercase; color: var(--text2); letter-spacing: .5px; }
.lc-stat.pos span { color: var(--green); }
.lc-stat.neg span { color: var(--red); }
.lc-stat-sep { width: 1.5px; background: var(--border); align-self: stretch; }

/* ─── LEAGUE HEADER ──────────────────────────────────────────── */
.lg-hdr {
  background: linear-gradient(135deg, var(--deep) 0%, #0055a5 100%);
  border-radius: 14px; padding: 20px 22px; margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(3,4,94,.2);
}
.lg-hdr-name {
  font-family: 'Bebas Neue', sans-serif; font-size: 2rem;
  letter-spacing: 2px; color: #fff; margin-bottom: 10px;
}
.lg-hdr-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-hdr-chip {
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.85);
  font-size: .72rem; font-weight: 800; padding: 4px 10px;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.15);
}
.lg-hdr-code { background: rgba(255,107,53,.25); border-color: rgba(255,107,53,.4); color: #ffb89a; font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; }

/* ─── TABS ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; font-weight: 800; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .5px;
  cursor: pointer; border: 2px solid var(--border); background: var(--card);
  font-family: 'Nunito', sans-serif; color: var(--text2);
  border-radius: 8px; transition: all .15s;
}
.tab:hover { border-color: var(--sky); color: var(--sky); }
.tab.active { background: var(--deep); color: #fff; border-color: var(--deep); }

/* ─── LEADERBOARD ────────────────────────────────────────────── */
.leaderboard { display: flex; flex-direction: column; gap: 6px; }
.lb-row {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s; flex-wrap: wrap;
}
.lb-row:hover { box-shadow: 0 4px 12px rgba(0,180,216,.15); border-color: var(--sky); }
.lb-row.mine  { border-color: var(--sun); border-width: 2px; background: #fff9f7; }
.lb-rank {
  font-family: 'Bebas Neue', sans-serif;
  width: 34px; height: 34px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; font-size: .95rem; border-radius: 8px;
}
.r1 { background: linear-gradient(135deg,#FFD700,#FF9500); color: #fff; font-size: 1.1rem !important; }
.r2 { background: #C0C0C0; color: #444; }
.r3 { background: #CD7F32; color: #fff; }
.rx { background: #f0f0f0; color: #999; }
.lb-av { font-size: 1.5rem; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 900; font-size: .92rem; }
.lb-evts { font-size: .7rem; color: var(--text2); font-weight: 700; margin-top: 2px; }
.lb-pts  { text-align: right; flex-shrink: 0; }
.lb-pts-n { font-family: 'Bebas Neue', sans-serif; font-size: 1.9rem; line-height: 1; }
.lb-pts-l { font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text2); }
.lb-pts.pos .lb-pts-n { color: var(--green); }
.lb-pts.neg .lb-pts-n { color: var(--red); }
.lb-pts.zero .lb-pts-n { color: #bbb; }

.lb-detail {
  background: var(--g); border: 1.5px solid var(--border); border-radius: 0 0 10px 10px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 4px;
  animation: fadeUp .2s ease both; margin-top: -6px;
}
.lb-no-evts { font-size: .8rem; color: #aaa; font-style: italic; font-weight: 700; }
.lb-ev-row {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.lb-ev-row:last-child { border: none; }
.lb-ev-label { flex: 1; }
.lb-ev-pts { font-family: 'Bebas Neue', sans-serif; font-size: .95rem; }
.lb-ev-pts.pos { color: var(--green); }
.lb-ev-pts.neg { color: var(--red); }

/* ─── EVENTI ─────────────────────────────────────────────────── */
.ev-box {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.ev-log { display: flex; flex-direction: column; gap: 6px; }
.ev-log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--card);
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .8rem; font-weight: 700; flex-wrap: wrap;
  transition: box-shadow .1s;
}
.ev-log-row:hover { box-shadow: 0 2px 8px rgba(0,180,216,.12); }
.ev-log-who   { font-weight: 900; color: var(--deep); min-width: 70px; }
.ev-log-label { flex: 1; }
.ev-log-pts   { font-family: 'Bebas Neue', sans-serif; font-size: .95rem; }
.ev-log-pts.pos { color: var(--green); }
.ev-log-pts.neg { color: var(--red); }
.ev-log-date  { font-size: .68rem; color: #bbb; font-weight: 600; }

/* ─── NEWS ───────────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); transition: box-shadow .15s;
}
.news-card:hover { box-shadow: 0 4px 16px rgba(3,4,94,.1); }
.news-card.pinned { border-left: 4px solid var(--sun); }
.news-pin   { display: inline-block; background: var(--sun); color: #fff; font-size: .68rem; font-weight: 800; padding: 2px 8px; text-transform: uppercase; letter-spacing: .5px; border-radius: 4px; margin-bottom: 8px; }
.news-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: 1px; margin-bottom: 8px; color: var(--deep); }
.news-body  { font-size: .87rem; font-weight: 600; color: #444; line-height: 1.6; margin-bottom: 10px; }
.news-meta  { font-size: .68rem; font-weight: 700; color: #bbb; text-transform: uppercase; letter-spacing: .5px; }

/* ─── ADMIN ──────────────────────────────────────────────────── */
.admin-box {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.danger-box { border-color: rgba(248,113,113,.4); background: #fff8f8; }
.code-display {
  font-family: 'Bebas Neue', sans-serif; font-size: 2.8rem;
  letter-spacing: 10px; color: var(--sun); text-align: center;
  background: var(--deep); border-radius: 10px; padding: 16px; margin-bottom: 8px;
}
.code-hint { font-size: .8rem; color: var(--text2); font-weight: 600; text-align: center; }
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--g); margin-bottom: 6px; gap: 8px; flex-wrap: wrap;
}
.member-info { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.member-name { font-weight: 900; font-size: .9rem; }
.member-pts  { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--sun); }

/* ─── PROFILE ────────────────────────────────────────────────── */
.prof-hero {
  background: linear-gradient(135deg, var(--deep) 0%, #0055a5 60%, #0096c7 100%);
  border-radius: 16px; padding: 28px 24px; text-align: center;
  margin-bottom: 20px; box-shadow: 0 8px 28px rgba(3,4,94,.2);
  position: relative; overflow: hidden;
}
.prof-hero::after {
  content:'🌊'; position:absolute; right:-10px; bottom:-10px;
  font-size:5rem; opacity:.1;
}
.prof-hero-av {
  font-size: 3.8rem; width: 76px; height: 76px;
  background: rgba(255,255,255,.15); border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; backdrop-filter: blur(4px);
}
.prof-hero-name {
  font-family: 'Righteous', sans-serif; font-size: 1.8rem;
  letter-spacing: 2px; color: #fff; margin-bottom: 4px;
}
.prof-hero-bio { color: rgba(255,255,255,.65); font-size: .85rem; font-weight: 600; margin-top: 6px; min-height: 20px; }
.prof-hero-since { color: rgba(255,255,255,.35); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 8px; }

.prof-edit-box {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 20px; margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.prof-label { font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text2); margin-bottom: 8px; }
.prof-av-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 6px; margin-bottom: 16px;
}
.prof-av-btn {
  font-size: 1.35rem; padding: 7px 4px; border-radius: 8px;
  border: 2px solid var(--border); background: var(--g);
  cursor: pointer; transition: all .12s; text-align: center;
}
.prof-av-btn:hover { border-color: var(--sky); transform: scale(1.1); }
.prof-av-btn.active { border-color: var(--sun); background: #fff9f5; box-shadow: 0 0 0 3px rgba(255,107,53,.2); transform: scale(1.1); }
.prof-pw-box {
  background: var(--g); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 16px; margin-top: 4px;
}
.prof-pw-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem;
  letter-spacing: 1px; color: var(--deep); margin-bottom: 12px;
}

.profile-leagues { display: flex; flex-direction: column; gap: 8px; }
.profile-lg-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card);
  border: 1.5px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
.profile-lg-row:hover { box-shadow: 0 4px 12px rgba(0,180,216,.12); border-color: var(--sky); }
.profile-lg-name { font-weight: 900; }
.profile-lg-stats { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--sun); }

/* ─── SUPERADMIN ─────────────────────────────────────────────── */
.sa-page { background: #080818; color: #e0e0e0; min-height: calc(100vh - 56px); padding: 22px 16px; }
.sa-hdr { background: #12122a; border: 2px solid #7c3aed; border-radius: 12px; padding: 20px 24px; margin-bottom: 24px; }
.sa-hdr-title { font-family: 'Righteous', sans-serif; font-size: 1.8rem; color: #a78bfa; letter-spacing: 2px; }
.sa-hdr-sub { color: #555; font-size: .8rem; font-weight: 700; margin-top: 4px; }
.sa-sec { color: var(--wave) !important; border-color: var(--sky) !important; }
.sa-lg-row { background: #111; border: 1.5px solid #222; border-radius: 8px; padding: 14px 16px; margin-bottom: 6px; display: flex; flex-direction: column; gap: 4px; }
.sa-lg-name { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: #e0e0e0; letter-spacing: 1px; }
.sa-lg-info { font-size: .75rem; color: #555; font-weight: 700; }
.sa-user-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid #222; border-radius: 8px; background: #111; margin-bottom: 5px; flex-wrap: wrap; }
.sa-user-name { font-weight: 900; color: #ddd; flex: 1; }
.sa-user-date { font-size: .72rem; color: #555; font-weight: 700; }
.sa-inp { background: #1a1a30 !important; color: #e0e0e0 !important; border-color: #333 !important; }
.sa-inp:focus { border-color: var(--sky) !important; }
.sa-user-list { display: flex; flex-direction: column; gap: 5px; }
.sa-create-box { background: #0e0e28; border: 1.5px solid var(--sky); border-radius: 8px; padding: 18px; margin-bottom: 18px; }
.sa-create-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--wave); letter-spacing: 1px; margin-bottom: 14px; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(3,4,94,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 14px; backdrop-filter: blur(4px);
}
.modal {
  background: var(--w); border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow: 0 24px 64px rgba(3,4,94,.3);
  padding: 28px 24px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .3s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes modalIn {
  from { transform: scale(.9) translateY(20px); opacity:0; }
  to   { transform: none; opacity:1; }
}
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; letter-spacing: 1px; margin-bottom: 18px; color: var(--deep); }
.modal-acts  { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ─── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; right: 22px;
  background: var(--deep); color: var(--wave);
  padding: 12px 20px; font-weight: 800; font-size: .87rem;
  border: 2px solid var(--sky); border-radius: 10px;
  z-index: 999; max-width: 300px;
  box-shadow: 0 8px 24px rgba(3,4,94,.3);
  animation: toastIn .4s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes toastIn {
  from { transform: translateY(60px) scale(.8); opacity:0; }
  to   { transform: none; opacity:1; }
}

/* ─── ANN BANNER ─────────────────────────────────────────────── */
.ann-ban {
  background: linear-gradient(135deg,#011830,#012a50);
  border: 1.5px solid rgba(0,180,216,.3); border-radius: 10px;
  border-left: 4px solid var(--sun); padding: 12px 16px;
  margin-bottom: 16px;
}
.ann-bt { font-weight: 900; font-size: .85rem; color: var(--sun); }
.ann-bb { font-size: .76rem; color: #7ab; font-weight: 600; margin-top: 3px; }

/* ─── BAN ────────────────────────────────────────────────────── */
.ban-page {
  min-height: 100vh; background: var(--deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px;
}
.ban-logo { font-family: 'Righteous', sans-serif; font-size: 2.5rem; color: var(--sun); margin-bottom: 8px; }
.ban-logo span { color: var(--wave); }
.ban-title { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; color: var(--red); margin-bottom: 8px; }
.ban-sub { color: #888; font-weight: 700; font-size: .9rem; }

/* ─── CONFETTI / SPARK ───────────────────────────────────────── */
.spark {
  position: fixed; pointer-events: none; z-index: 9999;
  animation: sparkUp 1.1s ease-out forwards;
}
@keyframes sparkUp {
  0%   { opacity:1; transform:translateY(0) scale(1); }
  100% { opacity:0; transform:translateY(-100px) scale(1.4); }
}

/* ─── DELETE BUTTON ──────────────────────────────────────────── */
.btn-del {
  background: none; border: 1.5px solid rgba(248,113,113,.4); border-radius: 4px;
  color: var(--red); font-size: .72rem; font-weight: 800; cursor: pointer; padding: 2px 7px;
  transition: background .15s;
}
.btn-del:hover { background: rgba(248,113,113,.1); }

/* ─── EMPTY ──────────────────────────────────────────────────── */
.empty { text-align: center; padding: 44px 14px; color: #bbb; }
.empty-ic { font-size: 2.8rem; margin-bottom: 10px; }
.empty p { font-weight: 700; font-size: .87rem; }

/* ─── UTILITIES ──────────────────────────────────────────────── */
.pos { color: var(--green) !important; }
.neg { color: var(--red)   !important; }
.zero { color: #bbb !important; }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 500px) {
  .header { padding: 0 10px; height: 48px; }
  .logo { font-size: 1.1rem; letter-spacing: 1px; }
  .hdr-r { gap: 3px; flex-wrap: nowrap; overflow: hidden; }
  .btn-sm { padding: 3px 6px; font-size: .62rem; }
  .auth-card { padding: 24px 16px; }
  .modal     { padding: 22px 14px; }
  .prof-av-grid { grid-template-columns: repeat(6,1fr); }
  .home-actions { grid-template-columns: 1fr 1fr; }
  .code-display { font-size: 2rem; letter-spacing: 6px; }
  .lg-hdr-name { font-size: 1.6rem; }
  .lc-stats { flex-direction: column; gap: 0; }
  .lc-stat-sep { width: auto; height: 1.5px; }
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 28px 16px 20px;
  font-size: .7rem; font-weight: 700;
  color: rgba(0,0,0,.16); letter-spacing: 1px; text-transform: uppercase;
  user-select: none;
}
.footer strong { color: rgba(0,0,0,.22); }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
:root.dark {
  --w:     #0D1117;
  --g:     #161B22;
  --card:  #1C2128;
  --border:#30363D;
  --bk:    #E6EDF3;
  --text2: #8B949E;
  --deep:  #58A6FF;
  --sun:   #FF7B45;
  --sky:   #39D0F0;
  --wave:  #79C0FF;
  --green: #56D364;
  --red:   #FF7B72;
}

/* Header in dark */
html.dark .header {
  background: #010409;
  box-shadow: 0 2px 0 rgba(57,208,240,.3), 0 4px 20px rgba(0,0,0,.5);
}

/* Card shadows in dark */
html.dark .lc,
html.dark .card,
html.dark .admin-box,
html.dark .ev-box,
html.dark .news-card,
html.dark .prof-edit-box {
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

html.dark .lc:hover {
  box-shadow: 0 10px 28px rgba(57,208,240,.15);
}

/* Auth in dark */
html.dark .auth-card {
  background: #1C2128;
  border-color: rgba(255,123,69,.3);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
html.dark .fs-inp {
  background: #0D1117;
  color: #E6EDF3;
  border-color: var(--border);
}
html.dark .fg label { color: var(--text2); }
html.dark .modal    { background: #1C2128; }
html.dark .modal-title { color: var(--bk); }
html.dark .admin-box   { background: #161B22; }
html.dark .prof-edit-box { background: #1C2128; }
html.dark .prof-pw-box   { background: #161B22; }
html.dark .prof-av-btn   { background: #161B22; border-color: var(--border); }
html.dark .prof-av-btn:hover { border-color: var(--sky); }
html.dark .prof-av-btn.active { background: #2d1f0f; border-color: var(--sun); }
html.dark .lb-row   { background: var(--card); }
html.dark .lb-row.mine { background: #1f1008; }
html.dark .lb-detail { background: #161B22; }
html.dark .ev-log-row { background: var(--card); }
html.dark .news-card  { background: var(--card); }
html.dark .member-row { background: #161B22; }
html.dark .profile-lg-row { background: var(--card); }
html.dark .sec-title  { color: var(--bk); border-color: var(--sun); }
html.dark .back-link  { color: var(--text2); }
html.dark .back-link:hover { color: var(--sun); }
html.dark .tab        { background: var(--card); border-color: var(--border); color: var(--text2); }
html.dark .tab.active { background: var(--deep); color: #fff; border-color: var(--deep); }
html.dark .ann-ban    { background: linear-gradient(135deg,#0a1620,#0c1f35); }
html.dark .home-action-btn { background: var(--card); border-color: var(--border); }
html.dark .home-action-btn:hover { border-color: var(--sun); }
html.dark .ha-label   { color: var(--bk); }
html.dark .rx         { background: #252a30; color: #888; }
html.dark .lc-stat    span { color: var(--bk); }
html.dark .lc-stat small   { color: var(--text2); }
html.dark .lc-stat-sep { background: var(--border); }
html.dark body        { background: var(--g); color: var(--bk); }
html.dark .footer     { color: rgba(255,255,255,.12); }
html.dark .footer strong { color: rgba(255,255,255,.18); }

/* ─── TOGGLE TEMA ────────────────────────────────────────────── */
.btn-theme {
  background: transparent;
  border: 2px solid rgba(144,224,239,.35);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  line-height: 1;
}
.btn-theme:hover { border-color: var(--wave); background: rgba(144,224,239,.1); }

/* ═══════════════════════════════════════════════════════════════
   SPECIAL PAGES (manutenzione + estate)
   ═══════════════════════════════════════════════════════════════ */
.special-page {
  min-height: calc(100vh - 56px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 32px 20px;
  background: linear-gradient(160deg, #03045E 0%, #0077B6 50%, #00B4D8 85%, #90E0EF 100%);
  position: relative; overflow: hidden;
}
.special-page::before {
  content: '🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊🌊';
  position: absolute; bottom: 0; left: -20px; right: -20px;
  font-size: 3rem; letter-spacing: -8px; opacity: .2;
  animation: waveDrift 7s ease-in-out infinite alternate;
}
.special-logo {
  font-family: 'Righteous', sans-serif;
  font-size: clamp(2.2rem, 8vw, 3.5rem); color: var(--sun);
  letter-spacing: 3px; text-shadow: 3px 3px 0 rgba(0,0,0,.3);
  margin-bottom: 8px;
}
.special-logo span { color: #90E0EF; }
.special-icon { font-size: 4rem; margin: 12px 0; animation: floatIcon 3s ease-in-out infinite alternate; }
@keyframes floatIcon { from{transform:translateY(0)} to{transform:translateY(-12px)} }

.special-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem); color: #fff;
  letter-spacing: 2px; margin-bottom: 10px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.special-sub {
  color: rgba(255,255,255,.7); font-weight: 700;
  font-size: .95rem; max-width: 440px; line-height: 1.6;
  margin-bottom: 16px;
}

/* Manutenzione — pallini animati */
.special-dots { display: flex; gap: 10px; margin-top: 12px; }
.special-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.5);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.special-dots span:nth-child(2) { animation-delay: .2s; }
.special-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse {
  0%,80%,100% { transform: scale(.8); opacity: .4; }
  40%         { transform: scale(1.2); opacity: 1; }
}

/* Estate — avatar e countdown */
.estate-page { gap: 4px; }
.estate-av {
  font-size: 3.2rem; width: 72px; height: 72px;
  background: rgba(255,255,255,.15); border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 8px auto 6px; backdrop-filter: blur(6px);
  animation: floatIcon 4s ease-in-out infinite alternate;
}
.estate-countdown {
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2);
  border-radius: 12px; padding: 12px 24px;
  color: rgba(255,255,255,.85); font-weight: 800; font-size: .88rem;
  letter-spacing: .5px; backdrop-filter: blur(4px);
  margin-top: 8px;
}
