* {
  box-sizing: border-box;
  font-family:
    "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
    "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.18), transparent 35%),
    linear-gradient(135deg, #111827, #064e3b);
  color: white;
}

/* HOME BUTTON */
.home-button {
  position: fixed;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dcfce7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  z-index: 1000;
}

.home-button:hover {
  background: #064e3b;
  transform: translateY(-1px);
  color: white;
}

.rules-button {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #dcfce7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
  z-index: 1000;
}

.rules-button:hover {
  background: #064e3b;
  transform: translateY(1px);
  color: white;
}

/* INTRO */
body > .my-3.text-center {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 18px;
  color: #dcfce7;
}

body > .my-3.text-center p {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* SELECTORS */
.stat-selector,
.league-selector,
.season-selector {
  margin-bottom: 20px;
  text-align: center;
  color: white;
}

.stat-selector {
  margin-top: 20px;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.stat-options input {
  display: none;
}

.stat-options label {
  padding: 8px 14px;
  border-radius: 12px;
  background: #022c22;
  color: #86efac;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.stat-options label:hover {
  background: #064e3b;
  transform: translateY(-1px);
}

.stat-options input:checked + label {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-weight: 700;
  transform: scale(1.05);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.28);
}

#stat-reminder {
  color: #dcfce7;
  margin: 18px 0;
}

#stat-reminder-value {
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}

/* LAYOUT */
.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
}

.game-card {
  width: 100%;
  max-width: 720px;
  padding: 32px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.game-title {
  margin: 0 0 28px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 1px;
}

.top-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.stat-box {
  padding: 18px 12px;
  border-radius: 18px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
}

.team-box,
.season-box {
  background: linear-gradient(135deg, #022c22, #064e3b);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.team-box {
  min-height: 100px;
}

.team-box .stat-value,
.season-box .stat-value {
  color: #22c55e;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.team-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

#teamLogoContainer {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: none;
}

/* PLAYER */
.player-section {
  margin-bottom: 22px;
  text-align: left;
}

.player-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

#players {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  outline: none;
  background: #f8fafc;
  color: #020617;
}

/* BUTTON */
.game-button {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.game-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.35);
}

.game-button:active {
  transform: scale(0.98);
}

/* SUMMARY */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.summary-box {
  text-align: left;
  padding: 10px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 160px;
}

.summary-box h2 {
  margin: 0 0 14px;
  font-size: 17px;
  color: #e5e7eb;
}

.summary-box ol {
  margin: 0;
  padding-left: 22px;
  max-height: 160px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.summary-box ol::-webkit-scrollbar {
  display: none;
}

.summary-box li {
  padding: 7px 0;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-box li:last-child {
  border-bottom: none;
}

.best-summary {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(
    135deg,
    rgba(2, 44, 34, 0.85),
    rgba(2, 6, 23, 0.85)
  );
}

.bps-note {
  margin: 16px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

#roundContainer::after {
  content: "/10";
}

.riepilogo-item {
  font-size: 11px;
}

/* END MODAL */
.end-modal {
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.2), transparent 40%),
    rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: white;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.end-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 26px 14px;
}

.end-modal-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #22c55e;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
}

.end-modal-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
}

.end-modal-body {
  padding: 24px 26px;
}

.final-percentage-box {
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #022c22, #064e3b);
  border: 1px solid rgba(34, 197, 94, 0.45);
  text-align: center;
}

#finalPercentageText {
  font-size: 42px;
  font-weight: 900;
  color: #22c55e;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.55);
}

.final-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.final-score-card {
  padding: 16px;
  border-radius: 18px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.final-score-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.final-score-card strong {
  font-size: 26px;
  color: white;
}

.final-score-card.best {
  border-color: rgba(34, 197, 94, 0.35);
}

.end-modal-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
}

.end-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 26px 24px;
}

.modal-game-button {
  margin: 0;
}

/* MOBILE */
@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at top, rgba(34, 197, 94, 0.14), transparent 32%),
      #052e25;
  }

  .home-button {
    top: 10px;
    left: 10px;
    padding: 5px 9px;
    font-size: 12px;
    border-radius: 9px;
  }

  body > .my-3.text-center {
    margin: 46px auto 12px;
    padding: 0 14px;
  }

  body > .my-3.text-center p {
    font-size: 13px;
    line-height: 1.45;
  }

  .stat-selector,
  .league-selector,
  .season-selector {
    margin-bottom: 12px;
    padding: 0 12px;
  }

  .stat-selector {
    margin-top: 12px;
  }

  .stat-label {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .stat-options {
    gap: 7px;
  }

  .stat-options label {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 10px;
  }

  .stat-options input:checked + label {
    transform: scale(1.03);
  }

  #stat-reminder {
    font-size: 1.2rem !important;
    margin: 10px 0;
  }

  .game-wrapper {
    padding: 12px;
    align-items: flex-start;
  }

  .game-card {
    padding: 16px;
    border-radius: 20px;
  }

  .game-title {
    font-size: 22px;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
  }

  .top-info {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .stat-box {
    padding: 10px 8px;
    border-radius: 14px;
  }

  .stat-value {
    font-size: 18px;
  }

  .team-box {
    min-height: auto;
  }

  .team-content {
    gap: 6px;
  }

  #teamLogoContainer {
    width: 32px;
    height: 32px;
  }

  .player-section {
    margin-bottom: 14px;
  }

  .player-section label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  #players {
    padding: 11px 12px;
    font-size: 14px;
    border-radius: 12px;
  }

  .game-button {
    padding: 12px;
    font-size: 15px;
    border-radius: 13px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
  }

  .summary-box {
    padding: 9px;
    border-radius: 14px;
    min-height: 130px;
  }

  .summary-box h2 {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .summary-box ol {
    padding-left: 16px;
    max-height: 130px;
  }

  .summary-box li {
    font-size: 10px;
    padding: 5px 0;
  }

  .riepilogo-item {
    font-size: 10px;
  }

  .bps-note {
    margin-top: 10px;
    font-size: 10px;
  }

  .end-modal {
    border-radius: 22px;
  }

  .end-modal-header {
    padding: 20px 18px 12px;
  }

  .end-modal-title {
    font-size: 22px;
  }

  .end-modal-body {
    padding: 18px;
  }

  .final-percentage-box {
    padding: 18px;
    border-radius: 18px;
  }

  #finalPercentageText {
    font-size: 34px;
  }

  .final-score-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .final-score-card {
    padding: 13px;
  }

  .final-score-card strong {
    font-size: 22px;
  }

  .end-modal-footer {
    padding: 14px 18px 18px;
  }
}

/* TELEFONI MOLTO PICCOLI */
@media (max-width: 380px) {
  .top-info {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    gap: 6px;
  }

  .stat-box {
    padding: 9px 6px;
  }

  .stat-value {
    font-size: 16px;
  }

  .game-title {
    font-size: 20px;
  }
}
