:root {
  --bg: #0d1117;
  --panel: #151b24;
  --panel-soft: #1b2330;
  --text: #f7f7f2;
  --muted: #adb7c4;
  --accent: #ff7a1a;
  --accent-2: #ffd166;
  --border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.65)),
    url("../images/montereale-bg.jpeg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 6vw;
  background: #000;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.25rem;
}

nav {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.94rem;
}

nav a:hover { color: var(--text); }

main {
  width: min(1120px, 88vw);
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  
  background: transparent;
  backdrop-filter: none;
  color: white;
}

.card {
  padding: 72px 0 48px;
  max-width: 820px;
  background: rgba(21,25,36,0.75);
  backdrop-filter: blur(3px);
  color: white;
}

.eyebrow {
  color: var(--accent-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
}

h1 {
  font-size: clamp(2.3rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.07em;
  margin: 10px 0 20px;
}

.hero-text,
.page-title p,
.auth-box p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #19140b;
}

.btn.secondary {
  background: rgba(27,35,48,0.85);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.full {
  width: 100%;
  margin-top: 14px;
}

.cards-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
}

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

.card,
.auth-box,
.profile-card,
.mission-card,
.leaderboard {
  background: rgba(21,27,36,0.62);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
}

.card h2,
.mission-card h2 {
  margin-top: 0;
}

.card p,
.mission-card p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.auth-box {
  width: min(440px, 100%);
}

.auth-box h1,
.page-title h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

label {
  display: block;
  margin: 16px 0 7px;
  color: var(--muted);
  font-weight: 800;
}

input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0d1117;
  color: var(--text);
  font-size: 1rem;
}

.small {
  font-size: 0.95rem !important;
}

.small a {
  color: var(--accent-2);
  font-weight: 800;
}

.message {
  min-height: 24px;
  color: var(--accent-2) !important;
}

.profile-card {
  text-align: center;
}

.profile-card h1 {
  margin-bottom: 8px;
}

.points {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-2);
}

.page-title {
  max-width: 760px;
}

.mission-list {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,122,26,0.18);
  color: var(--accent-2);
  font-weight: 900;
  font-size: 0.78rem;
}

.mission-card strong {
  color: var(--accent-2);
}

.leaderboard {
  margin-top: 28px;
  padding: 0;
  overflow: hidden;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row.header {
  color: var(--accent-2);
  font-weight: 900;
  background: rgba(255,255,255,0.04);
}

footer {
  width: min(1120px, 88vw);
  margin: 0 auto;
  padding: 30px 0 48px;
  color: white;
  background: transparent;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding-top: 32px;
  }

  .cards-grid,
  .cards-grid.two,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-row {
    grid-template-columns: 44px 1fr 70px;
    padding: 16px;
  }
}
.classifica-page {
  background:
    linear-gradient(rgba(0,0,0,0.45), rgba(0, 0, 0, 0)),
    url("../images/classifica-bg.jpeg");

  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.classifica-page .leaderboard {
  padding: 12px !important;
}

.classifica-page .leaderboard {
  width: 90%;
  max-width: 1000px;
  margin:20px auto;
  padding: 8px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
}

.classifica-page .leaderboard-row {
  width: 90%;
  max-width: 1000px;
  margin:20px auto;
  padding: 10px 16px;
}
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 15px;
  margin: 30px 0;
}

.podium-place {
  width: 130px;
  text-align: center;
  border-radius: 20px 20px 0 0;
  background: rgba(10,15,25,0.85);
  border: 1px solid rgba(255,255,255,0.1);
}

.first {
  height: 220px;
  border-color: gold;
}

.second {
  height: 170px;
  border-color: silver;
}

.third {
  height: 140px;
  border-color: #cd7f32;
}

.medal {
  font-size: 2rem;
  margin-top: 15px;
}

.podium-name {
  font-weight: 800;
  margin-top: 10px;
}

.podium-points {
  color: #ffd166;
  margin-top: 5px;
}
.classifica-page .leaderboard {
  width: 95% !important;
  max-width: none !important;
}
@media (max-width: 760px) {
  body,
  .classifica-page {
    background-attachment: scroll !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-color: #000 !important;
  }
}
.page-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 6vw 60px;
}

.hero-card,
.info-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.hero-card h1,
.info-card h2,
.info-card h3 {
  margin-top: 0;
}

.info-card ul {
  padding-left: 20px;
}

.center {
  text-align: center;
  margin: 30px 0;
}
.tower-game {
  display: flex;
  justify-content: center;
}

.tower-scene {
  position: relative;
  width: 360px;
  height: 520px;
  margin: 30px auto;
}

.tower-img {
  position: absolute;
  left: 45px;
  bottom: 0;
  height: 500px;
  max-width: none;
  z-index: 1;
}

.score-ladder {
  position: absolute;
  right: 0;
  top: 65px;
  width: 85px;
  height: 390px;
  z-index: 3;
  border: 3px solid var(--accent);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,.35);
}

.score-ladder div {
  height: calc(100% / 7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  border-bottom: 1px solid rgba(255,255,255,.25);
}

.bird {
  position: absolute;
  top: -35px;
  left: 20px;
  font-size: 42px;
  z-index: 5;
}

.bird.crash {
  transform: rotate(35deg) scale(1.2);
}

.bird {
  position: absolute;
  left: 10%;
  bottom: 0;
  font-size: 42px;
  z-index: 2;
}
.tower-page {
  padding: 30px 5vw;
}

.tower-card {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.tower-game {
  position: relative;
  width: min(100%, 900px);
  aspect-ratio: 16 / 9;
  margin: 25px auto;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

.tower-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Scala punti */
.score-ladder {
  position: absolute;
  right: 5%;
  top: 13%;
  width: 95px;
  height: 74%;
  border: 3px solid var(--accent);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,0.45);
  z-index: 3;
}

.score-ladder div {
  height: calc(100% / 7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.score-ladder div:nth-child(1) { background: rgba(25, 120, 45, 0.75); }
.score-ladder div:nth-child(2) { background: rgba(80, 135, 45, 0.75); }
.score-ladder div:nth-child(3) { background: rgba(150, 145, 35, 0.75); }
.score-ladder div:nth-child(4) { background: rgba(205, 145, 35, 0.75); }
.score-ladder div:nth-child(5) { background: rgba(210, 105, 30, 0.75); }
.score-ladder div:nth-child(6) { background: rgba(190, 75, 35, 0.75); }
.score-ladder div:nth-child(7) { background: rgba(165, 50, 35, 0.75); }

/* Uccellino */
.tower-bird {
  position: absolute;
  top: -10px;
  left: 18%;
  font-size: clamp(32px, 5vw, 58px);
  z-index: 5;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.45));
}

.tower-bird.crashed::before {
  content: "💥💥";
  position: absolute;
  left: -15px;
  top: -15px;
  font-size: 35px;
}

.tower-result {
  margin-top: 16px;
  font-weight: 900;
  font-size: 1.2rem;
}

/* Mobile */
@media (max-width: 700px) {
  .tower-game {
    aspect-ratio: 9 / 14;
  }

  .tower-bg {
    object-fit: cover;
    object-position: center;
  }

  .score-ladder {
    right: 3%;
    top: 15%;
    width: 75px;
    height: 70%;
    font-size: 0.85rem;
  }
}
.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 30px auto;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid white;
  background: conic-gradient(
    red 0deg 60deg,
    orange 60deg 120deg,
    yellow 120deg 180deg,
    green 180deg 240deg,
    blue 240deg 300deg,
    purple 300deg 360deg
  );
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  transition: transform 5s cubic-bezier(.15,.8,.2,1);
  transform: rotate(0deg);

}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: white;
  border: 4px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  font-weight: 900;
}

.pointer {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid white;
}