:root {
  --blu: #1746a2;
  --blu-scuro: #0f3278;
  --blu-chiaro: #eaf0fb;
  --verde: #16a34a;
  --verde-scuro: #12833c;
  --testo: #18202e;
  --grigio: #5a6475;
  --bordo: #dde3ee;
  --sfondo: #f5f7fb;
  --raggio: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--testo);
  background: var(--sfondo);
}
img, svg { max-width: 100%; }
a { color: var(--blu); }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }

.wrap { width: min(100% - 32px, 960px); margin-inline: auto; }

/* Header + menu */
.top { background: var(--blu); color: #fff; position: sticky; top: 0; z-index: 20; }
.top__bar { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.marchio { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .01em; }
.marchio svg { width: 30px; height: 30px; flex: none; }
.marchio small { font-weight: 600; opacity: .8; font-size: .95rem; }
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -8px;
  background: none; border: 0; border-radius: 8px; color: #fff; cursor: pointer;
}
.menu-btn svg { width: 26px; height: 26px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.nav a { display: block; color: #fff; text-decoration: none; font-weight: 600; }

/* Mobile + tablet: hamburger, menu drops down under the logo */
@media (max-width: 1023px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; border-top: 1px solid rgba(255, 255, 255, .2); padding: 8px 0 14px; }
  .nav.aperto { display: block; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 12px; font-size: 1rem; border-radius: 8px; }
  .nav a:hover, .nav a[aria-current="page"] { background: var(--blu-scuro); }
}

/* Desktop: logo row, then the menu as a full-width strip on one line */
@media (min-width: 1024px) {
  .top__bar { min-height: 58px; }
  .nav {
    background: var(--blu-scuro);
    box-shadow: 0 0 0 100vmax var(--blu-scuro);
    clip-path: inset(0 -100vmax);
  }
  .nav ul { justify-content: space-between; }
  .nav a {
    padding: 12px 10px; font-size: .9rem; white-space: nowrap;
    box-shadow: inset 0 -3px 0 transparent;
  }
  .nav a:hover { box-shadow: inset 0 -3px 0 rgba(255, 255, 255, .45); }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 #fff; }
}

/* Intro */
.intro { background: #fff; border-bottom: 1px solid var(--bordo); padding: 28px 0 24px; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 10px; color: var(--blu-scuro); }
.intro p { margin: 0; max-width: 62ch; color: var(--grigio); }

/* List */
.classifica { padding: 24px 0 8px; }
.classifica h2 { font-size: 1.3rem; margin: 0 0 16px; }
.stato { padding: 24px; text-align: center; color: var(--grigio); background: #fff; border: 1px dashed var(--bordo); border-radius: var(--raggio); }

.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.carta { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); overflow: hidden; }
.carta:first-child { border-color: var(--blu); box-shadow: 0 0 0 1px var(--blu); }
.carta__riga {
  display: grid;
  grid-template-columns: 150px 1fr 1.3fr 180px;
  align-items: center; gap: 16px; padding: 16px;
}
.carta__logo {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 84px; border-radius: 10px; background: var(--blu);
}
.carta__logo img { width: 132px; height: auto; }
.carta__pos {
  position: absolute; top: -8px; left: -8px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--blu); border: 2px solid var(--blu);
  font-weight: 800; font-size: .85rem;
}
.carta__nome { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.25; }
.voto { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--grigio); }
.voto b { color: var(--testo); font-size: 1rem; }
.stelle { position: relative; display: inline-block; width: 90px; height: 16px; background: var(--bordo); border-radius: 3px; overflow: hidden; }
.stelle i { position: absolute; inset: 0 auto 0 0; background: var(--blu); }
.stelle::after {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 16'%3E%3Cpath fill='%23fff' fill-rule='evenodd' d='M0 0h90v16H0zm9 1.5l1.9 4.3 4.6.4-3.5 3 1.1 4.6L9 11.4l-4.1 2.4L6 9.2l-3.5-3 4.6-.4zm18 0l1.9 4.3 4.6.4-3.5 3 1.1 4.6L27 11.4l-4.1 2.4L24 9.2l-3.5-3 4.6-.4zm18 0l1.9 4.3 4.6.4-3.5 3 1.1 4.6L45 11.4l-4.1 2.4L42 9.2l-3.5-3 4.6-.4zm18 0l1.9 4.3 4.6.4-3.5 3 1.1 4.6L63 11.4l-4.1 2.4L60 9.2l-3.5-3 4.6-.4zm18 0l1.9 4.3 4.6.4-3.5 3 1.1 4.6L81 11.4l-4.1 2.4L78 9.2l-3.5-3 4.6-.4z'/%3E%3C/svg%3E") no-repeat;
}
.bonus { display: block; color: inherit; text-decoration: none; padding: 10px 12px; background: var(--blu-chiaro); border-radius: 10px; }
.bonus span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blu); font-weight: 700; }
.bonus strong { display: block; font-size: 1.15rem; line-height: 1.3; }
.bonus em { display: block; font-style: normal; font-size: .9rem; color: var(--grigio); }
.azioni { display: grid; gap: 6px; text-align: center; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 16px; border-radius: 10px;
  background: var(--verde); color: #fff; text-decoration: none;
  font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 2px 0 var(--verde-scuro);
}
.cta:hover { background: var(--verde-scuro); }
.cta svg { width: 18px; height: 18px; }
.info-btn {
  min-height: 40px; padding: 6px 10px; border: 1px solid var(--bordo); border-radius: 10px;
  background: #fff; color: var(--blu); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.info-btn[aria-expanded="true"] { background: var(--blu-chiaro); border-color: var(--blu); }

.dettagli { border-top: 1px solid var(--bordo); padding: 16px; background: #fbfcfe; }
.dettagli[hidden] { display: none; }
.griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 20px; }
.griglia .tit { margin: 0 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--blu); }
.griglia p { margin: 0 0 6px; font-size: .92rem; }
.loghi { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.loghi li {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; padding: 4px 8px; background: #fff;
  border: 1px solid var(--bordo); border-radius: 6px; font-size: .8rem;
}
.loghi img, .loghi svg { display: block; height: auto; max-height: 20px; width: auto; }
.nota { margin: 14px 0 0; font-size: .82rem; color: var(--grigio); }

@media (max-width: 899px) {
  .carta__riga { grid-template-columns: 120px 1fr; gap: 12px 14px; }
  .carta__logo { height: 72px; }
  .carta__logo img { width: 110px; }
  .bonus, .azioni { grid-column: 1 / -1; }
  .griglia { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .carta__riga { grid-template-columns: 104px 1fr; padding: 14px; }
  .carta__logo { height: 64px; }
  .carta__logo img { width: 96px; }
  .carta__nome { font-size: 1.05rem; }
  .stelle { width: 76px; height: 14px; }
  .stelle::after { background-size: 76px 14px; }
  .griglia { grid-template-columns: 1fr; }
}

/* Text */
.testo { padding: 16px 0 32px; }
.testo section { background: #fff; border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 18px 20px; margin-bottom: 12px; }
.testo h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 8px; color: var(--blu-scuro); }
.testo h3 { font-size: 1.05rem; line-height: 1.35; margin: 14px 0 6px; color: var(--testo); }
.testo p { margin: 0 0 8px; }
.testo p:last-child { margin-bottom: 0; }

/* Footer */
.piede { background: var(--blu-scuro); color: #dfe7f7; font-size: .88rem; padding: 22px 0; }
.piede p { margin: 0 0 6px; }
.piede a { color: #fff; }
.piede .diciotto {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-right: 8px; border: 2px solid #fff; border-radius: 50%;
  font-weight: 800; font-size: .85rem; vertical-align: middle;
}

/* H1: page title + flag + domain */
h1 .dominio { display: inline-flex; align-items: center; gap: .3em; white-space: nowrap; font-weight: 700; }
h1 .bandiera { width: 1.2em; height: .8em; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
