/* ================================================================
   bookmakers.css - redesign comparatore
   Focus: esperienza desktop più premium e leggibile
   ================================================================ */

.th-modal[hidden] { display: none !important; }

.th-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(8px);
  padding: 20px;
  --th-bg: var(--bg-base, #080b10);
  --th-card: var(--bg-card, #111722);
  --th-muted: var(--text-muted, #4a5578);
  --th-text: var(--text-primary, #f0f4ff);
  --th-brand-1: #38bdf8;
  --th-brand-2: #0f766e;
  --th-brand-3: #f97316;
  --th-star: var(--brand-amber, #f59e0b);
  --th-chip: var(--bg-elevated, #1a2233);
  --th-ring: rgba(255,255,255,0.10);
  --th-shadow: 0 28px 90px rgba(0,0,0,.6);
  color: var(--th-text);
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

.th-dialog {
  position: relative;
  width: min(1320px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 18px 18px 28px;
  border-radius: 28px;
  border: 1px solid var(--th-ring);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.16), transparent 28%),
    radial-gradient(circle at top left, rgba(249,115,22,.10), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)),
    var(--th-bg);
  box-shadow: var(--th-shadow);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.th-dialog::-webkit-scrollbar { width: 7px; height: 7px; }
.th-dialog::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14);
  border-radius: 999px;
}

.th-close {
  position: sticky;
  top: 8px;
  left: calc(100% - 38px);
  margin-left: auto;
  z-index: 10;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(17,23,34,.94);
  color: var(--th-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .2s ease;
}

.th-close:hover {
  background: rgba(27,35,50,.98);
  transform: translateY(-1px);
}

.th-dialog .th-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px;
  margin: 0 auto 20px;
  background: rgba(12,18,28,.88);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  backdrop-filter: blur(16px);
}

.th-dialog .th-tab {
  appearance: none;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--th-text);
  padding: .6rem .92rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: .55rem;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
  font-family: inherit;
}

.th-dialog .th-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
}

.th-dialog .th-tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(56,189,248,.14), rgba(249,115,22,.14));
  border-color: rgba(56,189,248,.24);
  color: #f7fbff;
  box-shadow: inset 0 -2px 0 rgba(56,189,248,.7);
}

.th-dialog .th-tab:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.th-dialog .th-flag {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
  background-size: cover;
  background-position: center;
}

.th-dialog .th-flag.it { background: linear-gradient(90deg,#009246 0 33.33%,#fff 33.33% 66.66%,#ce2b37 66.66% 100%); }
.th-dialog .th-flag.es { background: linear-gradient(#c60b1e 0 25%, #ffc400 25% 75%, #c60b1e 75% 100%); }
.th-dialog .th-flag.de { background: linear-gradient(#000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%); }
.th-dialog .th-flag.gb {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
  background-size: cover;
}

.th-compare { display: none; }
.th-compare:not([hidden]) { display: block; }

.th-wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 4px 2px 12px;
}

.th-wrap::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
}

.th-title {
  font-family: "Sora", sans-serif;
  font-size: clamp(1.7rem, 2vw, 2.8rem);
  line-height: .96;
  letter-spacing: -.05em;
  font-weight: 800;
  margin-bottom: 10px;
}

.th-disclaimer {
  max-width: 760px;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(240,244,255,.62);
  margin-bottom: 22px;
}

.th-panels {
  position: relative;
}

.th-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.th-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.01)),
    var(--th-chip);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color .24s ease, transform .24s ease, box-shadow .24s ease;
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
}

.th-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.045), transparent 24%, transparent 78%, rgba(255,255,255,.03));
}

.th-card:hover {
  border-color: rgba(148,163,184,.3);
  transform: translateY(-3px);
  box-shadow: 0 24px 48px rgba(0,0,0,.28);
}

.th-card:nth-child(1) {
  border-color: rgba(249,115,22,.24);
  background:
    radial-gradient(circle at top right, rgba(249,115,22,.1), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)),
    var(--th-chip);
}

.th-card-top {
  display: grid;
  grid-template-columns: 104px minmax(0, 1.2fr) minmax(250px, .95fr) 180px;
  gap: 18px;
  padding: 20px;
  align-items: stretch;
}

.th-logo {
  display: flex;
  align-items: center;
  width: 104px;
}

.th-logo img {
  width: 104px;
  height: 74px;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px;
}

.th-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.th-info h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 800;
  font-size: 1.28rem;
  line-height: 1.05;
  margin-bottom: 10px;
  color: var(--th-text);
}

.th-card:nth-child(1) .th-info h3 {
  font-size: 1.42rem;
}

.th-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.th-chip {
  padding: 7px 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(240,244,255,.72);
}

.th-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: linear-gradient(135deg, rgba(249,115,22,.16), rgba(245,158,11,.08));
  color: #ffb979;
  border: 1px solid rgba(249,115,22,.26);
  border-radius: 999px;
}

.th-bonus {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: stretch;
  padding: 16px 18px;
  background:
    linear-gradient(160deg, rgba(56,189,248,.08), rgba(249,115,22,.06)),
    rgba(8,12,20,.44);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  color: rgba(240,244,255,.78);
}

.th-bonus strong {
  color: var(--th-text);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.th-bonus small {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.55;
  color: rgba(240,244,255,.54);
}

.th-rating-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.th-score {
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
}

.th-stars {
  position: relative;
  display: inline-block;
}

.th-stars-track,
.th-stars-fill {
  display: flex;
  gap: 1px;
}

.th-stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: calc(var(--rating, 0) / 5 * 100%);
}

.th-stars-track svg { color: rgba(255,255,255,.10); }
.th-stars-fill svg { color: var(--th-star); }

.th-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--th-text);
  margin-top: 8px;
}

.th-votes {
  font-size: 11px;
  color: rgba(240,244,255,.54);
  margin-top: 3px;
}

.th-cta {
  display: flex;
  align-items: stretch;
}

.th-cta .th-btn,
a.th-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #17b26a, #12824a);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .08em;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s ease;
  box-shadow: 0 14px 28px rgba(18,130,74,.28);
}

.th-cta .th-btn:hover,
a.th-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.th-card details {
  border-top: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,0));
}

.th-card details summary {
  padding: 14px 20px;
  list-style: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(240,244,255,.56);
  transition: color .2s ease;
}

.th-card details summary:hover {
  color: var(--th-text);
}

.th-more {
  padding: 0 20px 20px;
}

.th-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.th-kblock {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
}

.th-kblock h4 {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(240,244,255,.46);
  margin-bottom: 8px;
}

.th-kblock ul { list-style: none; }

.th-kblock li {
  font-size: 12px;
  color: rgba(240,244,255,.72);
  padding: 4px 0;
  line-height: 1.45;
}

.th-kblock li::before {
  content: "• ";
  color: var(--th-brand-3);
}

.th-term {
  font-size: 11px;
  line-height: 1.55;
  color: rgba(240,244,255,.56);
}

@media (max-width: 960px) {
  .th-dialog {
    width: min(1160px, 98vw);
    padding: 14px 14px 22px;
    border-radius: 24px;
  }

  .th-wrap {
    max-width: 920px;
  }

  .th-card-top {
    grid-template-columns: 88px 1fr;
    gap: 14px;
  }

  .th-bonus,
  .th-rating-cta {
    grid-column: 1 / -1;
  }

  .th-rating-cta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .th-modal {
    padding: 10px;
  }

  .th-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 22px;
    padding: 12px 12px 18px;
  }

  .th-wrap::before {
    display: none;
  }

  .th-title {
    font-size: 1.55rem;
  }

  .th-disclaimer {
    margin-bottom: 16px;
  }

  .th-list {
    gap: 12px;
  }

  .th-card {
    border-radius: 20px;
  }

  .th-card-top {
    padding: 14px;
    gap: 10px;
  }

  .th-logo {
    width: 64px;
  }

  .th-logo img {
    width: 64px;
    height: 42px;
    border-radius: 12px;
    padding: 6px;
  }

  .th-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .th-bonus,
  .th-score {
    padding: 12px 13px;
  }

  .th-rating-cta {
    grid-template-columns: 1fr;
  }

  .th-cta .th-btn,
  a.th-btn {
    min-height: 48px;
    border-radius: 14px;
  }

  .th-more {
    padding: 0 14px 14px;
  }

  .th-cols {
    grid-template-columns: 1fr;
  }
}
