/* ============================================================
   RHODENSE CALCIO - Tema Arancione & Nero
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Roboto:wght@300;400;500&display=swap');

:root {
  --primary: #E85C00;
  --primary-dark: #C44F00;
  --primary-light: #FF7A20;
  --accent: #000000;
  --accent2: #1a1a1a;
  --bg: #111111;
  --bg2: #1c1c1c;
  --card: #222222;
  --card2: #2a2a2a;
  --text: #ffffff;
  --text2: #cccccc;
  --text3: #888888;
  --border: #333333;
  --win: #E85C00;
  --draw: #888888;
  --lose: #cc2222;
  --qualify: rgba(232,92,0,0.15);
  --qualify-border: #E85C00;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* LOADING */
#loading-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #000 0%, #1a1a1a 50%, #0d0d0d 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.loading-logo {
  text-align: center;
  animation: fadeInUp 0.6s ease;
}
.loading-logo img {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 0 30px rgba(232,92,0,0.5);
  margin-bottom: 16px;
}
.loading-text {
  color: var(--primary);
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* HEADER */
header {
  background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
  border-bottom: 3px solid var(--primary);
  padding: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(232,92,0,0.3);
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left img {
  border: 2px solid var(--primary) !important;
  box-shadow: 0 0 10px rgba(232,92,0,0.4);
}
.h-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.h-date { font-size: 11px; color: var(--primary); font-weight: 500; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 10px; }

.live-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  animation: pulse 2s infinite;
  font-family: 'Oswald', sans-serif;
}

.admin-toggle {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
}
.admin-toggle:hover, .admin-toggle.active {
  background: var(--primary);
  color: #fff;
}

/* NAV */
nav {
  background: var(--accent2);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; overflow-x: auto;
  padding: 0 8px;
  scrollbar-width: none;
}
.nav-btn {
  background: none; border: none;
  color: var(--text3);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-btn:hover { color: var(--primary); }
.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.nav-exit { color: #cc2222; margin-left: auto; }
.nav-exit:hover { color: #ff4444; }

/* TORNEO BAR */
.torneo-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
}

/* CAT BAR */
.cat-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 16px;
  background: var(--bg);
  scrollbar-width: none;
  max-width: 900px; margin: 0 auto;
}
.cat-btn {
  background: var(--card);
  border: 2px solid var(--border);
  color: var(--text2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* MAIN */
main { max-width: 900px; margin: 0 auto; padding: 16px; }
.sec { display: none; }
.sec.active { display: block; }

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 20px 0 8px;
}

/* CLASSIFICA TABLE */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: var(--accent2);
  color: var(--primary);
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: center;
  border-bottom: 2px solid var(--primary);
}
thead th:first-child { text-align: left; }
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:hover { background: var(--card2); }
tbody td { padding: 10px 10px; text-align: center; color: var(--text2); }
tbody td:first-child { text-align: left; }
.team-name { font-weight: 600; color: var(--text); font-size: 14px; }
.pts { font-weight: 700; color: var(--primary); font-size: 15px; }
.qualify-row { background: var(--qualify) !important; border-left: 3px solid var(--qualify-border); }
.pos-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  font-family: 'Oswald', sans-serif;
}
.pos-1 { background: var(--primary); color: #fff; }
.pos-2 { background: var(--accent2); color: var(--text2); border: 1px solid var(--primary); }
.pos-other { background: transparent; color: var(--text3); }

/* RISULTATI */
.match-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}
.match-card:hover { border-color: var(--primary); }
.match-teams {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.match-team { font-size: 14px; font-weight: 600; flex: 1; }
.match-team.home { text-align: right; }
.match-team.away { text-align: left; }
.match-score {
  font-family: 'Oswald', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--primary);
  min-width: 60px; text-align: center;
  letter-spacing: 2px;
}
.match-score.pending { color: var(--text3); font-size: 16px; }
.match-info { font-size: 11px; color: var(--text3); text-align: center; margin-top: 4px; }

/* INPUTS */
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  width: 100%;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(232,92,0,0.2);
}

/* BUTTONS */
.btn {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-p {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-p:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { border-color: #cc2222; color: #cc2222; }
.btn-danger:hover { background: #cc2222; color: #fff; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 28px;
  width: 90%; max-width: 360px;
  box-shadow: 0 0 40px rgba(232,92,0,0.3);
}
.modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
  text-align: center;
}
.modal-input { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }

/* GIRONE HEADER */
.girone-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.girone-title {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* TABELLONE */
.bracket-round { margin-bottom: 24px; }
.bracket-round-title {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* SCORE INPUT */
.score-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.score-input {
  width: 60px !important;
  text-align: center;
  font-size: 18px !important;
  font-weight: 700;
  color: var(--primary) !important;
}

/* NOTIFICATION */
.result-notification {
  position: fixed;
  top: 80px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 16px 28px;
  border-radius: 12px;
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 8px 32px rgba(232,92,0,0.5);
  z-index: 9999;
  text-align: center;
  animation: notifIn 0.4s ease;
}

/* ANIMATIONS */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes notifIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* TV MODE */
#tv-overlay .tv-score { color: var(--primary) !important; }
#tv-overlay { background: #000 !important; }
#tv-overlay .tv-header { background: linear-gradient(135deg, #000, #1a1a1a) !important; border-bottom: 3px solid var(--primary) !important; }

/* RESPONSIVE */
@media (max-width: 480px) {
  .h-title { font-size: 15px; }
  main { padding: 10px; }
  .match-score { font-size: 18px; min-width: 48px; }
}
