/* ==========================================================================
   WBF – Player page aligned with soft landing (430px) – v3 compact results
   ========================================================================== */
:root{
  --wbf-ink:#222;
  --wbf-muted:#5a6b66;
  --wbf-surface:#ffffff;
  --wbf-ring:rgba(20,111,132,.35);
  --wbf-teal1:#0c5241;
  --wbf-teal2:#146f84;
  --wbf-teal3:#2a88a6;
  --wbf-shadow:0 12px 32px rgba(0,0,0,.12);
}

.wbf-pf, .wbf-pf *{ box-sizing:border-box }

.wbf-pf.wbf-pf--430{
  width:430px; max-width:100%;
  background:var(--wbf-surface);
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  box-shadow:var(--wbf-shadow);
  color:var(--wbf-ink);
  font:400 14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial,sans-serif;
  overflow:hidden;
}

/* Header - VERDE SCURO */
.wbf-pf__head{ 
  padding:14px 16px; 
  background: linear-gradient(135deg, #0a1612 0%, #0d1f1a 50%, #0f2318 100%); 
  color:#fff 
}
.wbf-pf__title{ margin:0 0 2px; font-weight:800; font-size:15px; letter-spacing:.3px; text-transform:uppercase }
.wbf-pf__body{ background:#fff }
.wbf-pf__body--scroller{ max-height:none; overflow:visible }
.wbf-pf__foot{ text-align:center; padding:10px 14px; border-top:1px solid rgba(0,0,0,.06); background:#fff }
.wbf-pf__small{ font-size:11px; color:var(--wbf-muted) }
.wbf-pf__bar{ display:flex; align-items:center; justify-content:space-between; gap:12px }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; font-weight:800; font-size:12px; letter-spacing:.2px; padding:8px 12px; border-radius:999px; text-decoration:none; cursor:pointer; }
.btn--ghost{ color:#fff; background:transparent; border:1px solid rgba(255,255,255,.8) }
.btn--ghost:hover{ background:rgba(255,255,255,.12) }

/* Summary */
.pf-summary{ display:flex; gap:12px; padding:14px 16px }

/* FOTO - 96x130px */
.pf-photo{ 
  width:96px; 
  height:130px; 
  object-fit:cover; 
  border-radius:10px; 
  border:1px solid rgba(0,0,0,.08) 
}

.pf-meta{ flex:1; min-width:0 }
.pf-name{ margin:0 0 6px; font-size:18px; font-weight:800; letter-spacing:.2px }
.pf-rows div{ display:flex; gap:6px; font-size:13px }
.pf-rows span{ color:var(--wbf-muted); min-width:92px }
.flag{ width:18px; height:12px; object-fit:cover; vertical-align:-1px; margin-right:6px; border:1px solid rgba(0,0,0,.1) }
.plain-num{ font-weight:700 }

/* Accordion base */
.wbf-acc{ border-top:1px solid rgba(0,0,0,.06) }
.wbf-acc:last-of-type{ border-bottom:1px solid rgba(0,0,0,.06) }
.wbf-acc > summary{ list-style:none; cursor:pointer; position:relative; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:700; background:#fff }
.wbf-acc > summary::before{ content:""; position:absolute; inset:0 }
.wbf-acc > summary::-webkit-details-marker{ display:none }
.wbf-acc > summary:focus{ outline:2px solid var(--wbf-ring); outline-offset:2px }
.wbf-acc > summary:hover{ background:color-mix(in srgb, #fff 88%, var(--wbf-teal2) 12%) }
.wbf-acc > summary::after{ content:"▾"; font-size:12px; transform:rotate(0deg); transition:transform .2s ease }
.wbf-acc[open] > summary::after{ transform:rotate(180deg) }
.wbf-acc__panel{ padding:0 16px 12px 16px }
.wbf-acc__loading{ padding:10px 0; font-size:12px; color:var(--wbf-muted) }
.wbf-acc__error{ padding:10px 0; font-size:12px; color:#a04040 }

/* ==========================================================================
   RISULTATI SU DUE RIGHE - No scroll orizzontale
   Riga 1: Anno + Rank | Nome Evento
   Riga 2: Partner/Team
   ========================================================================== */

/* Table wrapper - no scroll */
.pf-table-wrap{ 
  overflow:visible; 
  border:1px solid rgba(0,0,0,.06); 
  border-radius:10px; 
  background:#fff;
  padding: 8px 0;
}

/* Compact results table - full width, no min-width */
table.pf-results{ 
  width:100%; 
  border-collapse:separate; 
  border-spacing:0; 
  font-size:13px;
  table-layout: fixed;
}

/* Nascondi header */
table.pf-results thead { 
  display: none; 
}

/* Ogni riga diventa un blocco flex */
table.pf-results tbody tr { 
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

table.pf-results tbody tr:last-child {
  border-bottom: none;
}

/* Zebra striping */
table.pf-results tbody tr:nth-child(odd) { 
  background: color-mix(in srgb,#fff 96%, var(--wbf-teal2) 4%);
}

/* Reset celle */
table.pf-results tbody td { 
  padding: 0;
  border: none;
  background: transparent;
}

/* === PRIMA RIGA: Anno + Rank | Evento === */

/* Anno - first */
table.pf-results td.year { 
  order: 1;
  font-weight: 800; 
  color: var(--wbf-teal1);
  width: 48px;
  flex-shrink: 0;
}

/* Rank - second, right after year */
table.pf-results td.rank { 
  order: 2;
  width: 48px;
  flex-shrink: 0;
  margin-right: 8px;
  text-align: center;
  align-self: flex-start;
}

/* Evento - third, takes remaining space */
table.pf-results td.event {
  order: 3;
  flex: 1;
  min-width: 0;
}

table.pf-results td.event .cell-main { 
  font-weight: 700;
}

table.pf-results td.event .cell-main a {
  color: #222;
  text-decoration: none;
}

table.pf-results td.event .cell-main a:hover {
  color: var(--wbf-teal1);
  text-decoration: underline;
}

/* Sottotitolo evento - nascosto */
table.pf-results td.event .cell-sub { 
  display: none;
}

/* === SECONDA RIGA: Partner/Team - sotto al nome evento === */

table.pf-results td.team {
  order: 4;
  width: 100%;
  margin-top: 4px;
  padding-left: 88px;
  margin-left: 88px;
}

table.pf-results td.team::before {
  content: "↳ ";
  color: #9ca3af;
  font-size: 12px;
}

table.pf-results td.team .cell-main { 
  display: inline;
  font-weight: 600;
  font-size: 12px;
  color: var(--wbf-muted);
}

table.pf-results td.team .cell-main a {
  color: var(--wbf-teal1);
  text-decoration: none;
}

table.pf-results td.team .cell-main a:hover {
  text-decoration: underline;
}

table.pf-results td.team .cell-sub {
  display: none;
}

/* ==========================================================================
   RANK PILLS
   ========================================================================== */

.rk{ 
  display: inline-block;
  min-width: 32px; 
  padding: 4px 6px; 
  border-radius: 6px; 
  font-weight: 800; 
  font-size: 9px; 
  line-height: 1.3;
  background: #eef3f4; 
  color: #15424a; 
  border: 1px solid rgba(0,0,0,.08);
  text-align: center;
}

/* First line (main rank) is bigger - use first-line pseudo */
.rk::first-line {
  font-size: 12px;
  font-weight: 800;
}

/* br creates the line break */
.rk br {
  display: block;
  content: "";
}

/* Secondary number in parentheses */
.rk i,
.rk em {
  font-style: normal;
  font-weight: 600;
  opacity: 0.7;
}

/* Oro */
.rk.r1{ 
  background: linear-gradient(135deg, #fef3c7, #fde68a); 
  border-color: #e9c770;
  color: #92400e;
}

/* Argento */
.rk.r2{ 
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb); 
  border-color: #bfc7de;
  color: #374151;
}

/* Bronzo */
.rk.r3{ 
  background: linear-gradient(135deg, #fed7aa, #fdba74); 
  border-color: #d9b49a;
  color: #9a3412;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width:480px){
  table.pf-results td.team {
    padding-left: 88px;
    margin-left: 0;
  }
}

/* ==========================================================================
   CUSTOM SCROLLBAR per iframe
   ========================================================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f4;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6ee7b7 0%, #5eead4 100%);
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #5eead4 0%, #6ee7b7 100%);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #6ee7b7 #f1f5f4;
}
