:root {
  --bg-main: #04070d;
  --bg-panel: #0b111a;
  --bg-panel-soft: #101b2a;
  --text-main: #f6f7fb;
  --text-soft: #b1bdcf;
  --red: #e20c1f;
  --green: #1db954;
  --blue: #0d6adf;
  --border-soft: #1d2738;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 15% 0%, #101a2a, #04070d 55%);
  color: var(--text-main);
  font-family: "Titillium Web", sans-serif;
}

.top-header {
  background: #070b12;
  border-bottom: 1px solid #111a28;
}

.brand-shield {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(145deg, #d90a1c, #870612);
  display: grid;
  place-items: center;
  font-size: 15px;
}

.brand-name {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.8px;
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
}

.nav-links .nav-link {
  color: #d5dceb;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.nav-links .nav-link.active,
.nav-links .nav-link:hover {
  color: var(--red);
}

.auth-buttons .btn {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.6px;
}

header .header-actions {
  gap: 14px;
}

.lang-switcher .btn,
.lang-switcher .dropdown-item {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.4px;
  min-width: 40px;
}

.lang-switcher .dropdown-menu {
  background: #0c1320;
  border: 1px solid var(--border-soft);
  min-width: 160px;
}

.lang-switcher .dropdown-item {
  color: var(--text-main);
}

.lang-switcher .dropdown-item:hover {
  background: rgba(29, 185, 84, 0.16);
  color: #ffffff;
}

.lang-switcher .dropdown-item.active,
.lang-switcher .dropdown-item:active {
  background: rgba(29, 185, 84, 0.28);
  color: #ffffff;
}

.hero-section {
  min-height: 480px;
  border-bottom: 1px solid #161f2f;
  background: linear-gradient(120deg, rgba(3, 6, 12, 0.94), rgba(6, 8, 15, 0.45)),
    url("../images/background/b_f1.png") center/cover no-repeat;
  display: flex;
  align-items: center;
}

.hero-content {
  padding: 48px 12px;
}

.hero-text h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 0.95;
  margin: 0 0 12px;
}

.hero-text p {
  font-size: clamp(1rem, 2vw, 1.6rem);
  color: #e5e9f4;
  margin: 0;
}

.games-section {
  margin-top: -70px;
  position: relative;
  z-index: 3;
}

.game-card {
  border: 2px solid transparent;
  border-radius: 16px;
  min-height: 360px;
  background: var(--bg-panel);
  padding: 26px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.game-card:hover {
  transform: translateY(-5px);
}

.card-football {
  background: linear-gradient(155deg, #05210f, #081b13);
  border-color: #1e7a45;
}

.card-f1 {
  background: linear-gradient(155deg, #120a12, #13050c);
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(226, 12, 31, 0.28);
}

.card-tennis {
  background: linear-gradient(155deg, #071a2f, #071225);
  border-color: #1a4f8f;
}

.game-icon {
  font-size: 3.2rem;
  margin-bottom: 10px;
}

.sport-logo {
  width: 102px;
  height: 102px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.f1-logo {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 3.4rem;
  color: var(--red);
  font-weight: 800;
  letter-spacing: 1px;
}

.game-card h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  margin-bottom: 10px;
}

.game-card p {
  color: #d8deeb;
  font-size: 1rem;
  line-height: 1.45;
}

.play-btn {
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  border-radius: 10px;
  padding: 10px 18px;
  border: none;
}

.card-football .play-btn {
  background: var(--green);
}

.card-f1 .play-btn {
  background: var(--red);
}

.card-tennis .play-btn {
  background: var(--blue);
}

.why-section,
.news-section,
.tournament-area {
  margin-top: 34px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 18px;
}

.why-section.sovrapposizione,
.tournament-area.sovrapposizione {
  margin-top: -20px;
  position: relative;
  z-index: 10;
}

.why-section h3,
.news-section h3,
.tournament-panel h3 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  margin-bottom: 18px;
}

.accordion-button .bi-chevron-right {
  transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed) .bi-chevron-right {
  transform: rotate(90deg);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.why-item {
  text-align: center;
  padding: 14px 10px;
  border-right: 1px solid #162236;
}

.why-item:last-child {
  border-right: none;
}

.why-item i {
  color: var(--red);
  font-size: 2rem;
}

.why-item h4 {
  font-family: "Barlow Condensed", sans-serif;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.why-item p {
  color: var(--text-soft);
  margin: 0;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-item {
  background: linear-gradient(180deg, #0d141f, #09131f);
  border: 1px solid #1a2436;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 12px;
  align-items: center;
}

.news-item img {
  width: 100%;
  height: 85px;
  object-fit: cover;
  border-radius: 7px;
}

.news-content h4 {
  font-size: 1.35rem;
  margin: 4px 0;
}

.news-content p {
  margin: 0;
  color: var(--text-soft);
}

.tag {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.tag-f1,
.selected {
  color: var(--red);
}

.tag-football {
  color: #5add79;
}

.tag-tennis {
  color: #62b4ff;
}

.news-item time {
  color: #c8d1df;
  font-weight: 600;
  font-size: 0.95rem;
}

.tournament-panel {
  border: 1px solid #2c1a20;
  background: #0c0b12;
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.tournament-panel p {
  margin: 0;
  color: var(--text-soft);
}

.site-footer {
  border-top: 2px solid #8f111e;
  background: #05080e;
}

.site-footer h5,
.footer-brand {
  font-family: "Barlow Condensed", sans-serif;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  color: #c6cedd;
  margin-bottom: 3px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

body.football-theme .js-matchday-link {
  color: var(--green);
  text-decoration: none;
}

body.football-theme .js-matchday-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

body.football-theme .js-match-score {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.football-theme .js-match-score:hover {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.25);
  transform: translateY(-1px);
}

body.football-theme #calendarPanel tbody tr.is-selected {
  background: rgba(29, 185, 84, 0.18);
}

body.football-theme #calendarPanel tbody tr.is-selected td {
  background: rgba(29, 185, 84, 0.18);
}

body.football-theme #standingsPanel th.col-pts,
body.football-theme #standingsPanel td.col-pts {
  background: rgba(29, 185, 84, 0.10);
}

body.football-theme #standingsPanel .text-pts {
  color: var(--green);
}

body.football-theme #standingsPanel th.col-wdl,
body.football-theme #standingsPanel td.col-wdl {
  background: rgba(13, 106, 223, 0.10);
}

body.football-theme #standingsPanel th.col-goals,
body.football-theme #standingsPanel td.col-goals {
  background: rgba(226, 12, 31, 0.10);
}

@media (min-width: 992px) {
  body.football-theme .calendar-card-right-sticky {
    position: sticky;
    top: 110px;
  }
}

.socials {
  display: flex;
  gap: 10px;
}

.socials span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #2a374f;
  display: grid;
  place-items: center;
}

.copyright {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #11192a;
  text-align: center;
  color: #9ca7ba;
}

@media (max-width: 991px) {
  .lang-switcher {
    margin-bottom: 10px;
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-item {
    border-right: none;
    border-bottom: 1px solid #162236;
  }

  .news-item {
    grid-template-columns: 100px 1fr;
  }

  .news-item time {
    grid-column: 2;
  }
}

@media (max-width: 575px) {
  .hero-section {
    min-height: 260px;
  }

  .game-card {
    min-height: 335px;
  }

  .news-item {
    grid-template-columns: 1fr;
  }

  .news-item img {
    height: 145px;
  }

  .news-item time {
    grid-column: 1;
  }
}

.fanta-pitch {
  position: relative;
  width: 100%;
  height: 580px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.55)),
    radial-gradient(circle at 30% 20%, rgba(0, 255, 160, 0.10), transparent 55%),
    url("../images/football-background.jpg");
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-position: center, center, center;
  background-size: cover, cover, cover;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fanta-pitch-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
}

.fanta-pitch-lines::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.fanta-pitch-lines::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.fanta-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
}

.fanta-slot-card {
  width: 86px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.fanta-pitch-compact .fanta-slot-card {
  width: 76px;
  padding: 6px;
  gap: 5px;
}

.fanta-slot:hover .fanta-slot-card {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.22);
}

.fanta-slot.is-active .fanta-slot-card {
  border-color: rgba(0, 255, 160, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.20);
}

.fanta-slot-role {
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0.9;
}

.role-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.role-badge.role-g,
.role-badge.role_g {
  background: rgba(231, 76, 60, 0.20);
  border-color: rgba(231, 76, 60, 0.60);
}

.role-badge.role-d,
.role-badge.role_d {
  background: rgba(241, 196, 15, 0.20);
  border-color: rgba(241, 196, 15, 0.60);
}

.role-badge.role-m,
.role-badge.role_m {
  background: rgba(46, 204, 113, 0.20);
  border-color: rgba(46, 204, 113, 0.55);
}

.role-badge.role-f,
.role-badge.role_f {
  background: rgba(0, 148, 255, 0.22);
  border-color: rgba(0, 148, 255, 0.55);
}

.fanta-slot-shirt {
  position: relative;
  width: 54px;
  height: 54px;
}

.fanta-pitch-compact .fanta-slot-shirt {
  width: 48px;
  height: 48px;
}

.fanta-slot-shirt-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

.fanta-pitch-compact .fanta-slot-shirt-img {
  width: 48px;
  height: 48px;
}

.fanta-slot-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
}

.fanta-slot-number {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

.fanta-pitch-compact .fanta-slot-number {
  font-size: 14px;
}

.fanta-slot-name {
  font-size: 11px;
  text-align: center;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.fanta-pitch-compact .fanta-slot-name {
  font-size: 10px;
  max-width: 70px;
}

.fanta-slot.is-filled .fanta-slot-card {
  border-color: rgba(0, 255, 160, 0.35);
  box-shadow: 0 8px 18px rgba(0, 255, 160, 0.08);
}

.fanta-bench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fanta-bench-slot {
  cursor: pointer;
  user-select: none;
}

.fanta-bench-slot.is-active .fanta-bench-circle {
  border-color: rgba(0, 255, 160, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.18);
}

 .fanta-bench-slot.is-active .fanta-bench-card {
  border-color: rgba(0, 255, 160, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(29, 185, 84, 0.18);
 }

.fanta-bench-circle,
.fanta-bench-card {
  min-height: 56px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.fanta-bench-card {
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fanta-bench-slot:hover .fanta-bench-circle {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

 .fanta-bench-slot:hover .fanta-bench-card {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
 }

.fanta-bench-card .fanta-slot-shirt {
  width: 48px;
  height: 48px;
}

.fanta-bench-card .fanta-slot-shirt-img {
  width: 48px;
  height: 48px;
}

.fanta-bench-card .fanta-slot-icon {
  font-size: 18px;
}

.fanta-bench-card .fanta-slot-number {
  position: static;
  transform: none;
  left: auto;
  top: auto;
  pointer-events: auto;
  text-shadow: none;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}


.fanta-bench-card .fanta-slot-role {
  opacity: 1;
}

.fanta-bench-circle .fanta-slot-name,
.fanta-bench-card .fanta-slot-name {
  max-width: 100%;
  font-size: 12px;
}

@media (max-width: 576px) {
  .fanta-pitch {
    height: 520px;
  }
  .fanta-slot-card {
    width: 78px;
  }
  .fanta-slot-shirt,
  .fanta-slot-shirt-img {
    width: 48px;
    height: 48px;
  }
}

.fantagiochi-bg {
  background-color: #0b0f14;
  background-image: url('../images/background/fantagiochi_mini.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

.fantagiochi-hero {
  position: relative;
  background-color: #0b0f14;
  background-image: url('../images/background/fantagiochi_mini.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.fantagiochi-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 15, 20, 0.70) 0%, rgba(11, 15, 20, 0.55) 50%, rgba(11, 15, 20, 0.75) 100%);
}

.tournament-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tournament-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tournament-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.tournament-logo-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 20px;
}

.fantagiochi-hero > .container {
  position: relative;
  z-index: 1;
}
