/* ============================================================
   RATING CARDS - Modern Casino Comparison Table
   rating-cards.css
   ------------------------------------------------------------
   Enhancements:
   - Corner ribbon for top-3 (gold #1, red #2-3)
   - Left accent bar + soft background highlight on top-3
   - Star rating + score (hardcoded by rank position, CSS only)
   - "Verificato" trust mark under the logo
   - "18+ Gioca responsabile" line under the CTA
   No PHP / markup changes required.
   ============================================================ */

/* ── Palette helpers ───────────────────────────────────────── */
:root{
  --rc-brand-1:#7c31f6;
  --rc-brand-2:#4b0dae;
  --rc-gold:#c8a020;
  --rc-gold-soft:#fdf8ec;
  --rc-hot:#c0392b;
  --rc-verify:#0f6e56;
  --rc-verify-soft:#e1f5ee;
  --rc-line:#eceaf6;
}

/* ── Container ─────────────────────────────────────────────── */
.rating-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 32px 0 48px;
}

/* ── Single Card ────────────────────────────────────────────── */
.rc-card {
  display: grid;
  grid-template-columns: 190px 1fr minmax(220px, 320px) 190px;
  align-items: center;
  gap: 0;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(20,18,40,.05), 0 0 0 1px rgba(20,18,40,.05);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .2s ease;
  position: relative;
}

.rc-card:hover {
  box-shadow: 0 10px 30px rgba(124,49,246,.12), 0 0 0 1px rgba(124,49,246,.14);
  transform: translateY(-2px);
}

/* ── Rank number (top-left corner) ──────────────────────────── */
.rc-card::before {
  content: attr(data-rank);
  position: absolute;
  top: 0;
  left: 0;
  background: #16142a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 11px 5px;
  border-radius: 0 0 10px 0;
  line-height: 1;
  z-index: 3;
}

/* ============================================================
   TOP-3 CORNER RIBBON  (rc-card::after)
   ============================================================ */
.rc-card[data-rank="1"]::after,
.rc-card[data-rank="2"]::after,
.rc-card[data-rank="3"]::after {
  position: absolute;
  top: 16px;
  right: -40px;
  transform: rotate(45deg);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  padding: 5px 46px;
  text-align: center;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.rc-card[data-rank="1"]::after {
  content: "TOP";
  background: linear-gradient(135deg,#e0bd3e,var(--rc-gold));
}

.rc-card[data-rank="2"]::after {
  content: "HOT";
  background: linear-gradient(135deg,#e0bd3e,var(--rc-gold));
}

.rc-card[data-rank="3"]::after {
  content: "NEW";
  background: linear-gradient(135deg,#e0bd3e,var(--rc-gold));
}

/* ── Top-3 left accent bar + soft highlight ─────────────────── */
.rc-card[data-rank="1"],
.rc-card[data-rank="2"],
.rc-card[data-rank="3"] {
  border-radius: 0 14px 14px 0;
}

.rc-card[data-rank="1"] {
  border-left: 3px solid var(--rc-gold);
  background: linear-gradient(90deg,var(--rc-gold-soft),#ffffff 44%);
  box-shadow: 0 2px 10px rgba(200,160,32,.14), 0 0 0 1px rgba(200,160,32,.22);
}

.rc-card[data-rank="2"] {
  border-left: 3px solid var(--rc-gold);
  background: linear-gradient(90deg,var(--rc-gold-soft),#ffffff 44%);
}

.rc-card[data-rank="3"] {
  border-left: 3px solid var(--rc-gold);
  background: linear-gradient(90deg,var(--rc-gold-soft),#ffffff 44%);
}

/* ── Below top-3: all cards share one style (position 4+) ───── */
.rating-cards-wrap .rc-card:nth-of-type(n+4) {
  border-left: 3px solid #85b7eb;
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg,#eef4fb,#ffffff 42%);
}

/* ── Logo cell ──────────────────────────────────────────────── */
.rc-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 18px;
  min-height: 118px;
  border-right: 1px solid var(--rc-line);
}

.rc-logo a {
  display: block;
  line-height: 0;
}

.rc-logo img {
  width: 138px;
  height: auto;
  object-fit: contain;
  transition: transform .25s ease;
}

.rc-card:hover .rc-logo img {
  transform: scale(1.04);
}

/* ── Star rating + score under the logo ─────────────────────── */
.rc-logo::after {
  display: block;
  text-align: center;
  content: "★★★★★";
  color: var(--rc-gold);
  font-size: 13px;
  letter-spacing: 1.5px;
  line-height: 1;
}

/* Numeric score, hardcoded by list position (CSS only) */
.rating-cards-wrap .rc-card .rc-logo{ position: relative; }

.rating-cards-wrap .rc-card:nth-of-type(1) .rc-logo::after{ content: "★★★★★\A 9.8 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(2) .rc-logo::after{ content: "★★★★★\A 9.6 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(3) .rc-logo::after{ content: "★★★★★\A 9.4 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(4) .rc-logo::after{ content: "★★★★★\A 9.2 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(5) .rc-logo::after{ content: "★★★★★\A 9.1 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(6) .rc-logo::after{ content: "★★★★★\A 9.0 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(7) .rc-logo::after{ content: "★★★★★\A 8.9 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(8) .rc-logo::after{ content: "★★★★★\A 8.8 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(9) .rc-logo::after{ content: "★★★★★\A 8.7 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(10) .rc-logo::after{ content: "★★★★★\A 8.6 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(11) .rc-logo::after{ content: "★★★★★\A 8.5 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(12) .rc-logo::after{ content: "★★★★★\A 8.4 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(13) .rc-logo::after{ content: "★★★★★\A 8.3 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(14) .rc-logo::after{ content: "★★★★★\A 8.2 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(15) .rc-logo::after{ content: "★★★★★\A 8.1 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(16) .rc-logo::after{ content: "★★★★★\A 8.0 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(17) .rc-logo::after{ content: "★★★★★\A 7.9 / 10"; }
.rating-cards-wrap .rc-card:nth-of-type(n+18) .rc-logo::after{ content: "★★★★★\A 7.8 / 10"; }

.rc-logo::after{
  white-space: pre;
  color: var(--rc-gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.5;
  text-align: center;
}

/* ── "Verificato" trust mark under the score ────────────────── */
.rc-logo::before{
  content: "\2713  Verificato";
  order: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--rc-verify-soft);
  color: var(--rc-verify);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 9px;
  border-radius: 20px;
}

/* ── Features cell ──────────────────────────────────────────── */
.rc-features {
  padding: 18px 22px;
  border-right: 1px solid var(--rc-line);
}

.rc-features-list,
.rc-features ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rc-features-list li,
.rc-features ul li,
.rc-features .feature-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  font-weight: 400;
  color: #34333f;
  line-height: 1.45;
  white-space: normal;
  margin: 0;
}

.rc-features .feature-item{ margin-bottom: 8px; }
.rc-features .feature-item:last-child{ margin-bottom: 0; }

.rc-features-list li .fi,
.rc-features-list li img,
.rc-features ul li img {
  flex-shrink: 0;
  margin-top: 1px;
}

.rc-features span { white-space: normal !important; }

/* ── Bonus cell ─────────────────────────────────────────────── */
.rc-bonus {
  padding: 18px 20px;
  text-align: center;
  border-right: 1px solid var(--rc-line);
}

.rc-bonus-badge {
  display: inline-block;
  background: #f4f2fd;
  color: #4b0dae;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 9px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rc-card[data-rank="1"] .rc-bonus-badge{
  background: var(--rc-gold-soft);
  color: #7a5c05;
}

.rc-bonus-text,
.rc-bonus p,
.rc-bonus strong,
.rc-bonus span {
  font-size: 16px;
  font-weight: 700;
  color: #16142a;
  line-height: 1.35;
  white-space: normal;
}

/* ── CTA cell ───────────────────────────────────────────────── */
.rc-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px 20px;
}

.rc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg,var(--rc-brand-1),var(--rc-brand-2));
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 9px;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(124,49,246,.28);
  transition: box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.rc-btn::after{
  content: "\2192";
  font-size: 14px;
  font-weight: 700;
}

.rc-btn:hover {
  background: linear-gradient(135deg,#6b22e8,#3a0a9e) !important;
  box-shadow: 0 8px 24px rgba(124,49,246,.42);
  transform: translateY(-1px);
  color: #fff !important;
}

/* 18+ responsible-gaming line under the button */
.rc-cta::after{
  content: "18+";
  font-size: 10px;
  color: #9a99a6;
  letter-spacing: .01em;
  line-height: 1.3;
  text-align: center;
}

/* #1 CTA slightly richer */
.rc-card[data-rank="1"] .rc-btn {
  background: linear-gradient(135deg,#9c4fff,var(--rc-brand-1),var(--rc-brand-2));
  box-shadow: 0 6px 20px rgba(124,49,246,.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ── 1060-1199px: tighter 4-col ─────────────────────────────── */
@media (max-width: 1199px) {
  .rc-card {
    grid-template-columns: 156px 1fr 180px 156px;
  }
  .rc-logo           { padding: 16px 12px; }
  .rc-logo img       { width: 116px; }
  .rc-logo::after    { font-size: 11px; }
  .rc-features       { padding: 14px 15px; }
  .rc-features .feature-item,
  .rc-features ul li { font-size: 13px; flex-wrap: wrap; }
  .rc-bonus          { padding: 14px 12px; }
  .rc-bonus-text,
  .rc-bonus p,
  .rc-bonus span     { font-size: 14px; }
  .rc-cta            { padding: 14px 12px; }
  .rc-btn            { padding: 11px 16px; font-size: 12px; letter-spacing: .04em; }
}

/* ── ≤1059px: 2-row layout ──────────────────────────────────── */
@media (max-width: 1059px) {
  .rc-card {
    grid-template-columns: 156px 1fr auto;
    grid-template-rows: auto auto;
  }

  .rc-logo {
    grid-column: 1;
    grid-row: 1 / 3;
    border-right: 1px solid var(--rc-line);
    border-radius: inherit;
    align-self: stretch;
    padding: 20px 14px;
    min-height: auto;
  }
  .rc-logo img { width: 114px; }

  .rc-features {
    grid-column: 2;
    grid-row: 1;
    border-right: 1px solid var(--rc-line);
    border-bottom: 1px solid var(--rc-line);
    padding: 16px 16px;
    align-self: center;
  }

  .rc-bonus {
    grid-column: 2;
    grid-row: 2;
    border-right: 1px solid var(--rc-line);
    padding: 14px 16px;
    text-align: left;
  }

  .rc-cta {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: stretch;
    padding: 18px 16px;
  }
  .rc-btn { padding: 12px 18px; font-size: 12px; }
}

/* ── ≤767px: fully stacked ──────────────────────────────────── */
@media (max-width: 767px) {
  .rc-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    border-radius: 14px;
  }

  .rc-card[data-rank="1"],
  .rc-card[data-rank="2"],
  .rc-card[data-rank="3"]{
    border-radius: 14px;
    border-left-width: 4px;
  }

  .rc-card::after{ top: 15px; right: -42px; }

  .rc-logo, .rc-features, .rc-bonus, .rc-cta {
    grid-column: 1;
    border-right: none;
  }

  .rc-logo {
    grid-row: 1;
    border-bottom: 1px solid var(--rc-line);
    padding: 30px 20px 20px;
    min-height: auto;
  }
  .rc-logo img { width: 180px; }

  .rc-features {
    grid-row: 4;
    border-bottom: 1px solid var(--rc-line);
    padding: 18px 20px;
    align-items: center;
    text-align: center;
  }
  .rc-features ul,
  .rc-features-list { align-items: center; }
  .rc-features .feature-item,
  .rc-features ul li { justify-content: center; flex-wrap: wrap; }

  .rc-bonus {
    grid-row: 2;
    border-bottom: 1px solid var(--rc-line);
    padding: 18px 20px;
    text-align: center;
  }
  .rc-bonus-text,
  .rc-bonus p,
  .rc-bonus span { font-size: 20px; }

  .rc-cta {
    grid-row: 3;
    padding: 18px 20px 24px;
  }
  .rc-btn {
    width: 100%;
    max-width: 300px;
    padding: 15px 26px;
    font-size: 14px;
  }

  .rc-card:hover { transform: none; }
}