/* FF Spielpraxis — baut auf den ffui-Tokens von FF Stats UI auf */

/* Richtungs-Farben: keine grau, höher grün, gleich blau, niedriger orange */
.ff-pr { --pr-keine:#828a82; --pr-hoeher:#3e8f4a; --pr-gleich:#4a90a4; --pr-niedriger:#F6701A; }

/* ── Tooltip über data-tip (ohne JS, ohne Zusatz-Elemente) ─────────── */
/* position:relative nur fuer statische Elemente — .ffp-dot ist absolut
   positioniert und darf hier NICHT ueberschrieben werden (Spezifitaet!) */
.ff-pr [data-tip]:not(.ffp-dot) { position: relative; }
.ff-pr [data-tip]:hover::after {
	content: attr(data-tip);
	position: absolute; left: 50%; bottom: calc(100% + 6px);
	transform: translateX(-50%);
	background: #1C1F1B; color: #fff;
	font-size: 11px; line-height: 1.35; font-weight: 500;
	padding: 5px 8px; border-radius: 4px;
	white-space: nowrap; z-index: 30; pointer-events: none;
}

/* ── 1. Korrelations-Kacheln ───────────────────────────────────────── */
.ffp-corrs {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px; margin: 16px 0;
}
.ffp-corr {
	background: var(--ffui-bg-soft, #f6f4ef);
	border: 1px solid var(--ffui-border-soft, #e2ddd2);
	border-left: 4px solid #828a82;
	border-radius: 6px; padding: 10px 12px;
	display: flex; flex-direction: column; gap: 3px;
}
.ffp-corr.is-pos  { border-left-color: var(--pr-hoeher); }
.ffp-corr.is-neg  { border-left-color: #ED1A3B; }
.ffp-corr-label   { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ffui-text-mid, #4a524a); }
.ffp-corr-rho     { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: #828a82; }
.ffp-corr.is-pos .ffp-corr-rho { color: var(--pr-hoeher); }
.ffp-corr.is-neg .ffp-corr-rho { color: #ED1A3B; }
.ffp-corr-text    { font-size: 11px; color: var(--ffui-text-mid, #4a524a); line-height: 1.35; }

/* ── 2./3. Balken-Charts ───────────────────────────────────────────── */
.ffp-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin: 8px 0 18px; }
.ffp-chart {
	background: var(--ffui-bg, #fff);
	border: 1px solid var(--ffui-border-soft, #e2ddd2);
	border-radius: 6px; padding: 12px;
}
.ffp-chart-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ffui-text-mid, #4a524a); text-align: center; margin-bottom: 10px; }
.ffp-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; height: 150px; padding-bottom: 34px; }
.ffp-bar-wrap { flex: 1 1 0; max-width: 110px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; position: relative; }
.ffp-bar { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: #b0833f; opacity: .9; transition: opacity .15s; }
.ffp-bar-wrap:hover .ffp-bar { opacity: 1; }
.ffp-bar.dir-keine     { background: var(--pr-keine); }
.ffp-bar.dir-hoeher    { background: var(--pr-hoeher); }
.ffp-bar.dir-gleich    { background: var(--pr-gleich); }
.ffp-bar.dir-niedriger { background: var(--pr-niedriger); }
.ffp-bar-value { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.ffp-bar-label {
	position: absolute; bottom: -34px; left: 50%; transform: translateX(-50%);
	width: 120%; text-align: center;
	font-size: 10px; color: var(--ffui-text-mid, #4a524a); line-height: 1.25;
}
.ffp-bar-label em { display: block; font-style: normal; color: var(--ffui-text-dim, #828a82); font-size: 9px; }

/* ── Abschnitte, Tabellen, Notizen ─────────────────────────────────── */
.ffp-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--ffui-text-mid, #4a524a); margin: 20px 0 8px; }
.ffp-table-scroll { overflow-x: auto; }
.ffp-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--ffui-bg, #fff); border: 1px solid var(--ffui-border-soft, #e2ddd2); }
.ffp-table th, .ffp-table td { padding: 6px 10px; border-bottom: 1px solid var(--ffui-border-soft, #e2ddd2); text-align: left; }
.ffp-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--ffui-text-mid, #4a524a); background: var(--ffui-bg-soft, #f6f4ef); }
.ffp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ffp-table td.is-pos { color: var(--pr-hoeher); font-weight: 600; }
.ffp-table td.is-neg { color: #ED1A3B; font-weight: 600; }
.ffp-note { font-size: 11px; color: var(--ffui-text-dim, #828a82); margin: 6px 0 0; }

/* ── 5. Streudiagramm ──────────────────────────────────────────────── */
.ffp-scatter {
	position: relative; height: 260px; margin: 4px 0 6px;
	background: var(--ffui-bg, #fff);
	border: 1px solid var(--ffui-border-soft, #e2ddd2);
	border-radius: 6px;
}
.ffp-scatter-baseline {
	position: absolute; left: 0; right: 0; height: 0;
	border-top: 1px dashed #b8b2a4;
}
.ffp-scatter-baseline span {
	position: absolute; right: 6px; top: -14px;
	font-size: 9px; color: var(--ffui-text-dim, #828a82);
}
.ffp-dot {
	position: absolute; width: 8px; height: 8px; border-radius: 50%;
	transform: translate(-50%, 50%);
	background: var(--pr-keine); opacity: .75; display: inline-block;
}
.ff-pr .ffp-scatter .ffp-dot { position: absolute; z-index: 2; }
.ffp-dot:hover { opacity: 1; z-index: 5; }
.ffp-dot.dir-hoeher    { background: var(--pr-hoeher); }
.ffp-dot.dir-gleich    { background: var(--pr-gleich); }
.ffp-dot.dir-niedriger { background: var(--pr-niedriger); }
.ffp-grid-x { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #eeeae1; }
.ffp-grid-y { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #eeeae1; }
.ffp-tick-x { position: absolute; bottom: 2px; transform: translateX(-50%); font-size: 9px; color: var(--ffui-text-dim, #828a82); font-variant-numeric: tabular-nums; }
.ffp-tick-y { position: absolute; left: 4px; transform: translateY(50%); font-size: 9px; color: var(--ffui-text-dim, #828a82); font-variant-numeric: tabular-nums; }
.ffp-scatter-caption { font-size: 12px; line-height: 1.55; color: var(--ffui-text-mid, #4a524a); margin: 2px 0 0; max-width: 860px; }
.ffp-scatter-x { position: absolute; bottom: 14px; right: 8px; font-size: 9px; color: var(--ffui-text-dim, #828a82); }
.ffp-scatter-y { position: absolute; top: 4px; left: 8px; font-size: 9px; color: var(--ffui-text-dim, #828a82); }
.ffp-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 12px; }
.ffp-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ffui-text-mid, #4a524a); }
.ffp-legend-item .ffp-dot { transform: none; }

/* ── Richtung als Badge ────────────────────────────────────────────── */
.ffp-dirbadge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; background: var(--pr-keine); white-space: nowrap; }
.ffp-dirbadge.dir-hoeher    { background: var(--pr-hoeher); }
.ffp-dirbadge.dir-gleich    { background: var(--pr-gleich); }
.ffp-dirbadge.dir-niedriger { background: var(--pr-niedriger); }

/* ── Erklärung + Einschränkungen ───────────────────────────────────── */
.ffp-explain {
	font-size: 12px; line-height: 1.5; color: var(--ffui-text-mid, #4a524a);
	background: var(--ffui-bg-soft, #f6f4ef);
	border: 1px solid var(--ffui-border-soft, #e2ddd2);
	border-radius: 6px; padding: 10px 14px; margin: 16px 0 0;
}
.ffp-caveats {
	font-size: 12px; line-height: 1.5; color: #7a5c1e;
	background: #fdf6e3; border: 1px solid #f0e0b0;
	border-left: 4px solid #F6701A;
	border-radius: 6px; padding: 10px 14px; margin: 12px 0 0;
}
.ffp-caveats ul { margin: 6px 0 0 18px; padding: 0; }
.ffp-caveats li { margin: 2px 0; }

/* ── Mobil ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.ffp-grid { grid-template-columns: 1fr; }
	.ffp-bars { height: 130px; }
	.ffp-scatter { height: 200px; }
	.ff-pr [data-tip]:hover::after { white-space: normal; min-width: 140px; }
}

/* Aufklappbare Ligen-Liste in der Vielspieler-Rangliste */
.ffp-leagues-details { display: inline; position: relative; }
.ffp-leagues-details summary {
	list-style: none; cursor: pointer; display: inline-block;
	font-variant-numeric: tabular-nums; font-weight: 600;
	color: var(--pr-gleich); border-bottom: 1px dotted var(--pr-gleich);
}
.ffp-leagues-details summary::-webkit-details-marker { display: none; }
.ffp-leagues-details[open] summary { color: var(--ffui-text, #1C1F1B); border-bottom-color: transparent; }
.ffp-leagues-pop {
	position: absolute; right: 0; top: calc(100% + 4px); z-index: 20;
	min-width: 260px; max-width: 340px; text-align: left;
	background: #fff; border: 1px solid var(--ffui-border, #cfc9bc);
	border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.12);
	padding: 8px 10px; font-size: 11px; font-weight: 400;
}
.ffp-leagues-pop ul { list-style: none; margin: 0; padding: 0; }
.ffp-leagues-pop li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed #eee9de; }
.ffp-leagues-pop li:last-child { border-bottom: none; }
.ffp-leagues-pop li span { white-space: nowrap; color: var(--ffui-text-dim, #828a82); font-variant-numeric: tabular-nums; }
.ffp-leagues-pop p { margin: 6px 0 0; color: var(--ffui-text-dim, #828a82); }
@media (max-width: 640px) { .ffp-leagues-pop { position: static; box-shadow: none; border: none; padding: 4px 0 0; min-width: 0; } }
