/* =========================================================
   Toplist Widget – BBSA-style layout (desktop + mobile)
   Matches https://web.bestbettingsiteadvisor.com/ card design
   ========================================================= */

.tw-root {
  --tw-accent: #22c55e;
  --tw-accent-hover: #16a34a;
  --tw-card: #ffffff;
  --tw-text: #0f172a;
  --tw-muted: #64748b;
  --tw-line: #e2e8f0;
  --tw-radius: 12px;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tw-text);
  line-height: 1.4;
  box-sizing: border-box;
}

.tw-root *,
.tw-root *::before,
.tw-root *::after {
  box-sizing: border-box;
}

.tw-loading,
.tw-error,
.tw-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #cbd5e1;
  font-size: 1rem;
}
.tw-error { color: #fca5a5; }

/* ---------- Titles (readable on dark hero) ---------- */
.tw-titles {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 1.35rem;
  padding: 1rem 1rem 0.25rem;
}
.tw-site-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4);
}
.tw-site-text {
  margin: 0 0 0.5rem;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e2e8f0;
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}
.tw-features {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
  color: #f1f5f9;
  text-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.tw-features li::before {
  content: "✓ ";
  color: #4ade80;
  font-weight: 700;
}
.tw-intro-wrap { margin-top: 0.4rem; }
.tw-intro {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
  font-size: 0.85rem;
  color: #cbd5e1;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.tw-intro.is-expanded {
  -webkit-line-clamp: unset;
  display: block;
}
.tw-read-more {
  background: none;
  border: none;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0;
  margin-top: 0.15rem;
}
.tw-read-more:hover { color: #bfdbfe; text-decoration: underline; }
.tw-disclaimer {
  margin: 0.75rem auto 0;
  max-width: 620px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #94a3b8;
  text-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tw-disclaimer strong { color: #cbd5e1; }

/* ---------- List ---------- */
.tw-toplist {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 0.75rem 2rem;
}
.tw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* ---------- Card ---------- */
.tw-offer {
  position: relative;
  background: var(--tw-card);
  border-radius: var(--tw-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.tw-offer:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.tw-full-click {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Rank ribbon – angled left badge like BBSA */
.tw-flag {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  background: linear-gradient(135deg, var(--flag-bg, #2563eb), var(--flag-bg-dark, #1d4ed8));
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.4rem 1.1rem 0.4rem 0.75rem;
  border-radius: 0 0 12px 0;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
  min-width: 120px;
  text-align: center;
}

/* Main row: logo | bonus | CTA */
.tw-offer-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 170px 1px minmax(0, 1fr) 1px 200px;
  align-items: center;
  gap: 0;
  min-height: 130px;
  padding: 1.35rem 1.25rem 1.15rem;
  pointer-events: none;
}
.tw-offer-inner a { pointer-events: auto; }

.tw-divider {
  width: 1px;
  align-self: stretch;
  background: var(--tw-line);
  margin: 0.35rem 0;
}

/* Logo + score under it */
.tw-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
}
.tw-logo {
  max-width: 140px;
  max-height: 58px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.tw-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.tw-score-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tw-text);
  line-height: 1;
}
.tw-stars {
  display: flex;
  gap: 2px;
}
.tw-star {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.tw-star.star-full {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}
.tw-star.star-half {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='h'%3E%3Cstop offset='50%25' stop-color='%23f59e0b'/%3E%3Cstop offset='50%25' stop-color='%23e2e8f0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23h)' d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}
.tw-star.star-empty {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e2e8f0'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
}

/* Centre bonus */
.tw-bonus-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.35rem 1.25rem;
  min-width: 0;
}
.tw-new-player {
  display: inline-block;
  background: #f59e0b;
  color: #1c1917;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
  line-height: 1.2;
}
.tw-bonus-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.tw-bonus-primary {
  font-size: clamp(1.15rem, 2.2vw, 1.85rem);
  font-weight: 800;
  color: var(--tw-text);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.tw-bonus-secondary {
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 700;
  color: #334155;
  line-height: 1.25;
  text-transform: uppercase;
}

/* CTA column */
.tw-cta-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.25rem 0.5rem 0.25rem 0.85rem;
}
.tw-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  background: linear-gradient(180deg, #34d399 0%, #22c55e 45%, #16a34a 100%);
  color: #fff !important;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none !important;
  padding: 0.85rem 1.35rem;
  border-radius: 10px;
  box-shadow: 0 3px 0 #15803d, 0 4px 12px rgba(22, 163, 74, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.tw-cta:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #15803d, 0 6px 14px rgba(22, 163, 74, 0.4);
}
.tw-cta:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #15803d, 0 2px 6px rgba(22, 163, 74, 0.3);
}
.tw-review-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
  line-height: 1.2;
}

/* Terms strip */
.tw-terms {
  position: relative;
  z-index: 2;
  padding: 0.55rem 1.15rem 0.7rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.65rem;
  line-height: 1.4;
  color: #94a3b8;
  background: #fafbfc;
  pointer-events: auto;
}
.tw-terms a {
  color: #64748b;
  text-decoration: underline;
}
.tw-terms a:hover { color: #334155; }

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 900px) {
  .tw-offer-inner {
    grid-template-columns: 140px 1px minmax(0, 1fr) 1px 170px;
    min-height: 120px;
    padding: 1.2rem 1rem 1rem;
  }
  .tw-logo { max-width: 120px; max-height: 50px; }
  .tw-bonus-primary { font-size: 1.2rem; }
  .tw-cta { min-width: 130px; padding: 0.75rem 1.1rem; font-size: 0.92rem; }
}

/* =========================================================
   MOBILE – stacked BBSA-style
   ========================================================= */
@media (max-width: 680px) {
  .tw-titles {
    padding: 0.75rem 0.75rem 0.15rem;
    margin-bottom: 1rem;
  }
  .tw-site-title {
    font-size: 1.2rem;
    letter-spacing: 0.03em;
  }
  .tw-site-text {
    font-size: 0.85rem;
  }

  .tw-list { gap: 0.9rem; }

  .tw-flag {
    font-size: 0.6rem;
    padding: 0.32rem 0.85rem 0.32rem 0.55rem;
    min-width: 100px;
  }

  .tw-offer-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 0;
    min-height: 0;
    padding: 1.35rem 0.9rem 0.95rem;
  }

  .tw-divider { display: none; }

  /* Logo + score on one row */
  .tw-logo-col {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.85rem;
    padding: 0.15rem 0 0.65rem;
    border-bottom: 1px solid var(--tw-line);
  }
  .tw-logo {
    max-width: 110px;
    max-height: 48px;
  }
  .tw-score-block {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
  }
  .tw-score-num { font-size: 1.2rem; }

  /* Bonus centred */
  .tw-bonus-col {
    padding: 0.85rem 0.25rem;
  }
  .tw-bonus-primary {
    font-size: 1.85rem;
  }
  .tw-bonus-secondary {
    font-size: 0.88rem;
  }

  /* Full-width CTA */
  .tw-cta-col {
    padding: 0.15rem 0 0.25rem;
    gap: 1.4rem;
  }
  .tw-cta {
    width: 100%;
    min-width: 0;
    padding: 0.9rem 1rem;
    font-size: 1rem;
  }
  .tw-review-link {
    font-size: 0.75rem;
  }

  .tw-terms {
    padding: 0.5rem 0.9rem 0.65rem;
    font-size: 0.62rem;
  }
}

@media (max-width: 380px) {
  .tw-bonus-primary { font-size: 1.05rem; }
  .tw-logo { max-width: 95px; }
}
