/* ==========================================================================
   Calculadora del jugador cripto — Satostaker
   Todo el CSS está scopeado bajo #sts-calc.
   Ajusta la paleta y la tipografía en el bloque de variables de abajo.
   ========================================================================== */

#sts-calc {
	/* Paleta */
	--sts-bg: #ffffff;
	--sts-bg-soft: #f5f7f9;
	--sts-bg-alt: #eef1f5;
	--sts-border: #dfe4ea;
	--sts-border-strong: #c6cedb;
	--sts-text: #16202c;
	--sts-muted: #5b6773;
	--sts-accent: #f7931a;
	--sts-accent-dark: #b96a05;
	--sts-accent-soft: #fdf1e0;
	--sts-ink: #0f2233;
	--sts-pos: #16794a;
	--sts-neg: #b3372a;
	--sts-warn: #8a5a00;
	--sts-warn-bg: #fdf6e3;

	/* Tipografía */
	--sts-font: inherit;
	--sts-fs-base: 1rem;
	--sts-fs-sm: 0.875rem;
	--sts-fs-xs: 0.8125rem;
	--sts-fs-value: 1.375rem;
	--sts-fs-hero: 2rem;
	--sts-lh: 1.6;

	/* Forma */
	--sts-radius: 14px;
	--sts-radius-sm: 9px;
	--sts-gap: 1rem;
	--sts-pad: 1.5rem;
	--sts-shadow: 0 1px 2px rgba(15, 34, 51, 0.05), 0 10px 28px rgba(15, 34, 51, 0.07);

	box-sizing: border-box;
	display: block;
	margin: 2.5rem 0;
	padding: var(--sts-pad);
	border: 1px solid var(--sts-border);
	border-radius: var(--sts-radius);
	background-color: var(--sts-bg);
	box-shadow: var(--sts-shadow);
	color: var(--sts-text);
	font-family: var(--sts-font);
	font-size: var(--sts-fs-base);
	line-height: var(--sts-lh);
}

#sts-calc *,
#sts-calc *::before,
#sts-calc *::after {
	box-sizing: border-box;
}

#sts-calc [hidden] {
	display: none;
}

/* --- Cabecera ------------------------------------------------------------ */

#sts-calc .sts-head {
	margin-bottom: 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--sts-border);
}

#sts-calc .sts-kicker {
	margin: 0 0 0.5rem;
	color: var(--sts-accent-dark);
	font-size: var(--sts-fs-xs);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

#sts-calc h3 {
	margin: 0 0 0.6rem;
	color: var(--sts-ink);
	font-size: 1.5rem;
	line-height: 1.25;
}

#sts-calc .sts-lead {
	margin: 0;
	color: var(--sts-muted);
	font-size: var(--sts-fs-sm);
}

/* --- Pestañas ------------------------------------------------------------ */

#sts-calc .sts-tabs {
	display: flex;
	gap: 0.4rem;
	margin-bottom: 1.25rem;
	padding-bottom: 0.25rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

#sts-calc .sts-tab {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.6rem 1rem;
	border: 1px solid var(--sts-border);
	border-radius: 999px;
	background-color: var(--sts-bg-soft);
	color: var(--sts-muted);
	font-family: inherit;
	font-size: var(--sts-fs-sm);
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

#sts-calc .sts-tab:hover {
	border-color: var(--sts-border-strong);
	color: var(--sts-ink);
}

#sts-calc .sts-tab.is-active {
	border-color: var(--sts-accent);
	background-color: var(--sts-accent);
	color: #ffffff;
}

/* --- Paneles ------------------------------------------------------------- */

#sts-calc .sts-panel-title {
	margin: 0 0 0.5rem;
	color: var(--sts-ink);
	font-size: 1.15rem;
	line-height: 1.3;
}

#sts-calc .sts-panel-intro {
	margin: 0 0 1.25rem;
	color: var(--sts-muted);
	font-size: var(--sts-fs-sm);
}

#sts-calc .sts-sub {
	margin: 1.5rem 0 0.6rem;
	color: var(--sts-ink);
	font-size: var(--sts-fs-sm);
	font-weight: 700;
	text-transform: none;
}

#sts-calc .sts-noscript {
	margin: 0 0 1rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--sts-border-strong);
	border-radius: var(--sts-radius-sm);
	background-color: var(--sts-bg-soft);
	font-size: var(--sts-fs-sm);
}

/* --- Escenarios rápidos -------------------------------------------------- */

#sts-calc .sts-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
	margin-bottom: 1rem;
}

#sts-calc .sts-presets-label {
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	font-weight: 600;
}

#sts-calc .sts-presets-group {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

#sts-calc .sts-preset {
	margin: 0;
	padding: 0.35rem 0.75rem;
	border: 1px dashed var(--sts-border-strong);
	border-radius: var(--sts-radius-sm);
	background-color: transparent;
	color: var(--sts-ink);
	font-family: inherit;
	font-size: var(--sts-fs-xs);
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

#sts-calc .sts-preset:hover {
	border-color: var(--sts-accent);
	border-style: solid;
	background-color: var(--sts-accent-soft);
}

/* --- Campos -------------------------------------------------------------- */

#sts-calc .sts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: var(--sts-gap);
	margin-bottom: 1.5rem;
}

#sts-calc .sts-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0;
}

#sts-calc .sts-field-wide {
	grid-column: 1 / -1;
}

#sts-calc .sts-field label {
	color: var(--sts-ink);
	font-size: var(--sts-fs-xs);
	font-weight: 700;
	line-height: 1.35;
}

#sts-calc input[type="number"],
#sts-calc select {
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--sts-border-strong);
	border-radius: var(--sts-radius-sm);
	background-color: var(--sts-bg);
	color: var(--sts-text);
	font-family: inherit;
	/* 16px evita el zoom automático de iOS al enfocar el campo. */
	font-size: 16px;
	line-height: 1.3;
}

#sts-calc select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2rem;
	background-image: linear-gradient(45deg, transparent 50%, var(--sts-muted) 50%), linear-gradient(135deg, var(--sts-muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
}

#sts-calc input[type="number"]:hover,
#sts-calc select:hover {
	border-color: var(--sts-accent);
}

#sts-calc .sts-hint {
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	line-height: 1.4;
}

/* --- Resultados ---------------------------------------------------------- */

#sts-calc .sts-results {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

#sts-calc .sts-result {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.85rem 0.9rem;
	border: 1px solid var(--sts-border);
	border-radius: var(--sts-radius-sm);
	background-color: var(--sts-bg-soft);
}

#sts-calc .sts-result-label {
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	font-weight: 600;
	line-height: 1.35;
}

#sts-calc .sts-result-value {
	color: var(--sts-ink);
	font-size: var(--sts-fs-value);
	font-weight: 700;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

#sts-calc .sts-pos {
	color: var(--sts-pos);
}

#sts-calc .sts-neg {
	color: var(--sts-neg);
}

/* --- Bloque destacado ---------------------------------------------------- */

#sts-calc .sts-highlight {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--sts-border-strong);
	border-left: 4px solid var(--sts-accent);
	border-radius: var(--sts-radius-sm);
	background-color: var(--sts-bg-alt);
}

#sts-calc .sts-highlight-label {
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

#sts-calc .sts-highlight-value {
	color: var(--sts-ink);
	font-size: var(--sts-fs-hero);
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

#sts-calc .sts-highlight-note {
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
}

#sts-calc .sts-verdict {
	margin: 0.35rem 0 0;
	font-size: var(--sts-fs-sm);
	font-weight: 600;
	line-height: 1.45;
}

/* --- Barra --------------------------------------------------------------- */

#sts-calc .sts-bar {
	width: 100%;
	height: 10px;
	margin-top: 0.5rem;
	overflow: hidden;
	border-radius: 999px;
	background-color: var(--sts-border);
}

#sts-calc .sts-bar-fill {
	width: 0;
	height: 100%;
	border-radius: 999px;
	background-color: var(--sts-accent);
	transition: width 0.3s ease, background-color 0.3s ease;
}

/* --- Tabla --------------------------------------------------------------- */

#sts-calc .sts-tablewrap {
	width: 100%;
	margin-bottom: 1.25rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--sts-border);
	border-radius: var(--sts-radius-sm);
}

#sts-calc .sts-table {
	width: 100%;
	min-width: 480px;
	margin: 0;
	border-collapse: collapse;
	font-size: var(--sts-fs-sm);
}

#sts-calc .sts-table caption {
	padding: 0.75rem 0.9rem;
	border-bottom: 1px solid var(--sts-border);
	background-color: var(--sts-bg-soft);
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	font-weight: 600;
	text-align: left;
	caption-side: top;
}

#sts-calc .sts-table th,
#sts-calc .sts-table td {
	padding: 0.6rem 0.9rem;
	border-bottom: 1px solid var(--sts-border);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

#sts-calc .sts-table th[scope="col"] {
	background-color: var(--sts-bg-soft);
	color: var(--sts-ink);
	font-size: var(--sts-fs-xs);
	font-weight: 700;
}

#sts-calc .sts-table th[scope="col"]:first-child,
#sts-calc .sts-table th[scope="row"],
#sts-calc .sts-table td:first-child {
	text-align: left;
}

#sts-calc .sts-table tbody tr:last-child th,
#sts-calc .sts-table tbody tr:last-child td {
	border-bottom: 0;
}

#sts-calc .sts-table tbody tr.is-current th,
#sts-calc .sts-table tbody tr.is-current td {
	background-color: var(--sts-accent-soft);
	font-weight: 700;
}

/* --- Tramos y avisos ----------------------------------------------------- */

#sts-calc .sts-tramos {
	margin: 0 0 1.25rem;
	padding: 0;
	list-style: none;
	border: 1px solid var(--sts-border);
	border-radius: var(--sts-radius-sm);
	overflow: hidden;
}

#sts-calc .sts-tramos li {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0.55rem 0.9rem;
	border-bottom: 1px solid var(--sts-border);
	font-size: var(--sts-fs-sm);
	font-variant-numeric: tabular-nums;
}

#sts-calc .sts-tramos li:last-child {
	border-bottom: 0;
}

#sts-calc .sts-tramos li:nth-child(odd) {
	background-color: var(--sts-bg-soft);
}

#sts-calc .sts-alert {
	margin: 0 0 1.25rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--sts-border-strong);
	border-left: 4px solid var(--sts-warn);
	border-radius: var(--sts-radius-sm);
	background-color: var(--sts-warn-bg);
	color: var(--sts-warn);
	font-size: var(--sts-fs-sm);
	font-weight: 600;
	line-height: 1.5;
}

#sts-calc .sts-note {
	margin: 0;
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	line-height: 1.55;
}

#sts-calc .sts-note strong {
	color: var(--sts-ink);
}

/* --- Pie ----------------------------------------------------------------- */

#sts-calc .sts-foot {
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--sts-border);
}

#sts-calc .sts-foot p {
	margin: 0 0 0.4rem;
	color: var(--sts-muted);
	font-size: var(--sts-fs-xs);
	line-height: 1.5;
}

#sts-calc .sts-foot p:last-child {
	margin-bottom: 0;
}

#sts-calc .sts-foot a {
	color: var(--sts-accent-dark);
	text-decoration: underline;
}

/* --- Accesibilidad ------------------------------------------------------- */

#sts-calc :focus {
	outline: 3px solid var(--sts-accent-dark);
	outline-offset: 2px;
}

#sts-calc :focus:not(:focus-visible) {
	outline: none;
}

#sts-calc :focus-visible {
	outline: 3px solid var(--sts-accent-dark);
	outline-offset: 2px;
}

/* --- Adaptación móvil ---------------------------------------------------- */

@media (max-width: 640px) {

	#sts-calc {
		--sts-pad: 1.1rem;
		--sts-fs-value: 1.25rem;
		--sts-fs-hero: 1.65rem;

		margin: 1.75rem 0;
		border-radius: var(--sts-radius-sm);
	}

	#sts-calc h3 {
		font-size: 1.25rem;
	}

	#sts-calc .sts-grid,
	#sts-calc .sts-results {
		grid-template-columns: 1fr;
	}

	#sts-calc .sts-highlight {
		padding: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {

	#sts-calc .sts-tab,
	#sts-calc .sts-preset,
	#sts-calc .sts-bar-fill {
		transition: none;
	}
}
