/* =========================================================================
   Paroli page (/roulette-strategies/paroli/): the streak calculator and the
   page's charts. Loaded after sys.css.
   ========================================================================= */

/* ---------- Calculator ---------- */

.pr {
	margin-top: 28px;
	padding: 24px;
	background: var(--rw-white);
	border: 1px solid var(--rw-line);
	border-radius: 20px;
	box-shadow: 0 18px 40px -30px rgba(14, 16, 19, .35);
}

.pr__controls {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
	gap: 18px 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--rw-line);
}

.pr__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.pr__label {
	color: var(--rw-muted);
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.pr__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rw-home .pr__pills button {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 7px 14px;
	background: var(--rw-white);
	border: 1px solid var(--rw-line);
	border-radius: 12px;
	color: var(--rw-text);
	font-family: var(--rw-body);
	font-size: 14.5px;
	font-weight: 800;
	line-height: 1.15;
	cursor: pointer;
}

.rw-home .pr__pills button span {
	color: var(--rw-muted);
	font-size: 11px;
	font-weight: 700;
}

.rw-home .pr__pills button:hover,
.rw-home .pr__pills button:focus {
	background: var(--rw-white);
	border-color: var(--rw-ink);
	color: var(--rw-ink);
}

.rw-home .pr__pills button[aria-pressed="true"] {
	background: var(--rw-ink);
	border-color: var(--rw-ink);
	color: #FFFFFF;
}

.rw-home .pr__pills button[aria-pressed="true"] span {
	color: var(--rw-gold);
}

.rw-home .pr__pills button:focus-visible {
	outline: 3px solid var(--rw-gold);
	outline-offset: 2px;
}

/* The streak ladder: one card per bet, then the banked total. */
.pr__ladder {
	display: grid;
	grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
	gap: 10px;
	margin-top: 22px;
	padding: 16px;
	background: radial-gradient(120% 140% at 50% 0, #1E7A52 0, #145C3E 70%);
	border: 6px solid #3B2A17;
	border-radius: 18px;
}

.pr__step {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	padding: 12px 14px;
	background: rgba(0, 0, 0, .28);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 12px;
	color: rgba(255, 255, 255, .8);
	font-size: 12.5px;
	line-height: 1.35;
}

.pr__step:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -9px;
	width: 8px;
	height: 8px;
	border-top: 2px solid var(--rw-gold);
	border-right: 2px solid var(--rw-gold);
	transform: translateY(-50%) rotate(45deg);
}

.pr__step-k {
	color: rgba(255, 255, 255, .7);
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pr__step strong {
	color: #FFFFFF;
	font-family: var(--rw-display);
	font-size: 26px;
	font-weight: 800;
	line-height: 1.1;
}

.pr__step--bank {
	background: var(--rw-gold);
	border-color: #F3E6C4;
	color: var(--rw-ink);
}

.pr__step--bank .pr__step-k,
.pr__step--bank strong {
	color: var(--rw-ink);
}

.pr__kpis {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin-top: 16px;
}

.pr__kpi {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	padding: 14px 16px;
	background: var(--rw-paper);
	border: 1px solid var(--rw-line);
	border-radius: 14px;
}

.pr__kpi span {
	color: var(--rw-muted);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.pr__kpi strong {
	color: var(--rw-ink);
	font-family: var(--rw-display);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.1;
}

.pr__kpi em {
	color: var(--rw-muted);
	font-size: 13px;
	font-style: normal;
	line-height: 1.35;
}

.pr__kpi--good strong {
	color: var(--rw-green-ink);
}

.pr__kpi--bad strong {
	color: var(--rw-bad);
}

/* Session results */
.pr__sim {
	margin-top: 16px;
	padding: 22px;
	background: var(--rw-ink);
	border-radius: 18px;
	color: var(--rw-on-dark);
	transition: opacity .15s ease;
}

.pr.is-busy .pr__sim {
	opacity: .6;
}

.pr__sim-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin-bottom: 16px;
}

.rw-home .pr__sim-k {
	color: var(--rw-gold);
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.rw-home .pr__sim-t {
	color: #FFFFFF;
	font-family: var(--rw-display);
	font-size: 19px;
	font-weight: 800;
}

.pr__sim-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 22px;
	align-items: start;
}

.rw-home .pr__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
}

.pr__stats div {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
	padding: 12px;
	background: var(--rw-ink-3);
	border: 1px solid var(--rw-ink-line);
	border-radius: 12px;
}

.pr__stats dt {
	color: var(--rw-on-dark-2);
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pr__stats dd {
	margin: 0;
	color: #FFFFFF;
	font-family: var(--rw-display);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.15;
}

.pr__stats small {
	color: var(--rw-on-dark-3);
	font-size: 12.5px;
	line-height: 1.35;
}

.pr__hist {
	margin: 0;
	min-width: 0;
}

.rw-home .pr__hist figcaption {
	margin-bottom: 8px;
	color: var(--rw-on-dark-2);
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.pr__hist-box {
	height: 230px;
	padding: 10px 10px 4px;
	background: rgba(255, 255, 255, .03);
	border: 1px solid var(--rw-ink-line);
	border-radius: 12px;
}

.pr__hist-box {
	display: flex;
	flex-direction: column;
}

.pr__hist-plot {
	flex: 1 1 auto;
	min-height: 0;
}

.pr__hist-box svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.pr__axis {
	position: relative;
	flex: 0 0 auto;
	height: 20px;
	margin-top: 4px;
	color: var(--rw-on-dark-3);
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.pr__axis span {
	position: absolute;
	top: 2px;
	white-space: nowrap;
}

.pr__axis-lo {
	left: 0;
}

.pr__axis-hi {
	right: 0;
}

.pr__axis-zero {
	color: #FFFFFF;
	transform: translateX(-50%);
}

.pr__hist-box rect.is-down {
	fill: #E0485F;
}

.pr__hist-box rect.is-up {
	fill: #2FAE73;
}

.pr__hist-box rect.is-mid {
	fill: #A9AFB8;
}

.pr__hist-box .pr-zero {
	stroke: #FFFFFF;
	stroke-width: 1.5;
	stroke-dasharray: 4 4;
	vector-effect: non-scaling-stroke;
}

.rw-home .pr__hist-note {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	color: var(--rw-on-dark-3);
	font-size: 12.5px;
}

.pr__key {
	display: inline-block;
	width: 14px;
	height: 10px;
	border-radius: 3px;
}

.pr__key--down {
	background: #E0485F;
}

.pr__key--up {
	margin-left: 8px;
	background: #2FAE73;
}

.rw-home .pr__insight {
	margin-top: 16px;
	padding: 12px 14px;
	background: var(--rw-ink-3);
	border-left: 3px solid var(--rw-gold);
	border-radius: 0 10px 10px 0;
	color: var(--rw-on-dark);
	font-size: 14.5px;
	line-height: 1.55;
}

/* ---------- Tables and charts ---------- */

.pr-tag {
	display: inline-block;
	margin-left: 6px;
	padding: 2px 8px;
	background: var(--rw-gold-soft);
	border-radius: 999px;
	color: var(--rw-gold-ink);
	font-size: 11px;
	font-weight: 800;
	vertical-align: 1px;
	white-space: nowrap;
}

.rw-home .rw-table tr.pr-row-classic th,
.rw-home .rw-table tr.pr-row-classic td {
	background: #FBF6E8;
}

/* Losing run cost */
.rw-home .pr-cost__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pr-cost__row {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
}

.pr-cost__name {
	color: var(--rw-on-dark-2);
	font-size: 14px;
	font-weight: 700;
	text-align: right;
}

.pr-cost__row.is-hl .pr-cost__name {
	color: #FFFFFF;
	font-weight: 800;
}

.pr-cost__track {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.pr-cost__bar {
	flex: 0 0 auto;
	width: calc(var(--w) * .85);
	height: 18px;
	border-radius: 4px;
	background: #6B7280;
}

.pr-cost__bar--paroli {
	background: var(--rw-gold);
}

.pr-cost__bar--dalembert {
	background: #2FAE73;
}

.pr-cost__bar--labouchere {
	background: #7FA8E8;
}

.pr-cost__bar--fibonacci {
	background: #C9A2E8;
}

.pr-cost__track b {
	color: #FFFFFF;
	font-size: 14.5px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* Small goals */
.rw-home .pr-goals__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pr-goals__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 150px;
	gap: 18px;
	align-items: center;
	padding: 12px 14px;
	background: rgba(255, 255, 255, .03);
	border: 1px solid var(--rw-ink-line);
	border-radius: 12px;
}

.pr-goals__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pr-goals__name strong {
	color: #FFFFFF;
	font-family: var(--rw-display);
	font-size: 17px;
}

.pr-goals__name span,
.pr-goals__out span {
	color: var(--rw-on-dark-3);
	font-size: 12.5px;
	line-height: 1.35;
}

.pr-goals__bar {
	height: 12px;
	background: rgba(255, 255, 255, .06);
	border-radius: 999px;
	overflow: hidden;
}

.pr-goals__bar span {
	display: block;
	height: 100%;
	background: var(--rw-gold);
	border-radius: inherit;
}

.pr-goals__out {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	text-align: right;
}

.pr-goals__out strong {
	color: #FFFFFF;
	font-family: var(--rw-display);
	font-size: 22px;
	font-weight: 800;
	line-height: 1.05;
}

/* Three outcomes in the sessions grid */
.pr-three .scw__grid i.is-spin {
	background: #6B7280;
}

.pr-three .scw__stat.is-spin strong {
	color: #C3C8CF;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
	.pr__controls {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pr__controls .pr__field:first-child {
		grid-column: 1 / -1;
	}

	.pr__kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pr__sim-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 860px) {
	.pr-goals__row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 8px 14px;
	}

	.pr-goals__bar {
		grid-column: 1 / -1;
		grid-row: 2;
	}
}

@media (max-width: 640px) {
	.pr {
		padding: 16px;
		border-radius: 16px;
	}

	.pr__controls {
		grid-template-columns: minmax(0, 1fr);
	}

	.pr__ladder {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		padding: 12px;
		border-width: 5px;
	}

	.pr__step::after {
		display: none;
	}

	.pr__step strong {
		font-size: 22px;
	}

	.pr__kpi strong {
		font-size: 23px;
	}

	.pr__sim {
		padding: 16px;
	}

	.pr__hist-box {
		height: 190px;
	}

	.pr-cost__row {
		grid-template-columns: 84px minmax(0, 1fr);
		gap: 10px;
	}

	.pr-cost__name {
		font-size: 12.5px;
	}
}

/* ---------- Simpler calculator: streak, unit and bankroll up front ---------- */

.pr__more {
	grid-column: 1 / -1;
}

.pr__more > summary {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 12px;
	cursor: pointer;
	list-style: none;
}

.pr__more > summary::-webkit-details-marker {
	display: none;
}

.pr__more-t {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--rw-ink);
	font-size: 14.5px;
	font-weight: 800;
}

.pr__more-t::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-bottom: 3px;
	border-right: 2px solid var(--rw-ink);
	border-bottom: 2px solid var(--rw-ink);
	transform: rotate(45deg);
	transition: transform .15s ease;
}

.pr__more[open] .pr__more-t::after {
	margin-bottom: -3px;
	transform: rotate(-135deg);
}

.pr__more-s {
	color: var(--rw-muted);
	font-size: 13px;
}

.pr__more[open] .pr__more-s {
	display: none;
}

.pr__more > summary:focus-visible {
	outline: 3px solid var(--rw-gold);
	outline-offset: 2px;
}

.pr__more-body {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 28px;
	margin-top: 14px;
}

.pr__kpis {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pr__stats div:last-child {
	grid-column: 1 / -1;
}

@media (max-width: 1080px) {
	.pr__controls {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pr__kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.pr__kpi:last-child {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	.pr__controls,
	.pr__more-body {
		grid-template-columns: minmax(0, 1fr);
	}
}
