@import url("https://fonts.googleapis.com/css2?family=Titillium+Web:ital,wght@0,400;0,600;0,700;0,800;0,900;1,600&display=swap");

/* =====================================================================
   Legacy GP — UI estilo consola F1 Manager (dark)
   Fondo #14161c · Paneles #1b1e26 · Sans condensada · Flat · Acento cian
   ===================================================================== */

:root {
	--c-f1-red: #e10600;
	--c-gold: #f7c948;

	--bg: #14161c;
	--panel: #1b1e26;
	--panel-2: #20242f;
	--row: #171a21;
	--row-alt: #1a1e27;
	--line: rgba(255, 255, 255, 0.07);
	--line-strong: rgba(255, 255, 255, 0.12);

	--text: #e8eaef;
	--text-mid: #b6bcc9;
	--text-dim: #9aa2b3;

	--cyan: #00d9ff;
	--cyan-bg: rgba(0, 217, 255, 0.14);
	--cyan-border: rgba(0, 217, 255, 0.4);
	--blue-tint: rgba(0, 150, 255, 0.12);
	--red: #ff5a5a;

	--team-color: var(--c-f1-red);

	--radius-sm: 4px;
	--radius-md: 8px;

	--pos-w: 34px;
	--driver-w: 200px;

	--primary-color: var(--c-f1-red);
	--primary-hover: #ff2419;
	--primary-ring: rgba(225, 6, 0, 0.3);
	--badge-color: var(--c-f1-red);
	--offer-bg: rgba(225, 6, 0, 0.07);
	--offer-border: rgba(225, 6, 0, 0.45);
	--offer-text: #ff5a52;
	--panel-bg: var(--panel);
	--panel-border: var(--line);
	--input-bg: #161921;
	--blob-1: radial-gradient(circle, rgba(225, 6, 0, 0.08) 0%, transparent 70%);
	--blob-2: radial-gradient(circle, rgba(57, 66, 84, 0.5) 0%, transparent 70%);
}

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

html,
body {
	height: 100%;
}

body {
	margin: 0;
	line-height: 1.45;
	min-height: 100vh;
	overflow-x: hidden;
	font-family: "Titillium Web", sans-serif;
	background-color: var(--bg);
	color: var(--text);
	display: flex;
	justify-content: center;
	align-items: center;
	transition: background-color 0.6s ease;
}

img {
	display: block;
	max-width: 100%;
}

button,
select,
input,
textarea {
	font: inherit;
}

a {
	color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul {
	margin: 0;
}

ul {
	padding-left: 1.25rem;
}

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background-color: #2c313d;
	border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
	background-color: #3a4150;
}
* {
	scrollbar-width: thin;
	scrollbar-color: #2c313d transparent;
}

/* ------------------------------- Utilidades ------------------------------- */

.hidden {
	display: none !important;
}

.fade-in {
	animation: fadeIn 0.35s ease both;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.pulse {
	animation: pulseGlow 1.6s ease-in-out infinite;
}

@keyframes pulseGlow {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.55;
	}
}

#team-fade {
	position: fixed;
	inset: 0;
	z-index: 2000;
	pointer-events: none;
	opacity: 0;
}

#team-fade.active {
	animation: teamFlash 1s ease both;
}

@keyframes teamFlash {
	0% {
		opacity: 0;
	}
	15% {
		opacity: 0.85;
	}
	100% {
		opacity: 0;
	}
}

/* ------------------------------- Botones ------------------------------- */

button {
	border-radius: var(--radius-sm);
	background-color: #232836;
	padding: 0.5em 1.5em;
	border: 1px solid transparent;
	color: var(--text);
	font-weight: 700;
	letter-spacing: 0.4px;
	transition: 0.2s ease;
	cursor: pointer;
}

button:hover,
button:focus {
	background-color: #2e3544;
}

button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.btn-success,
#btn-create,
#btn-advance,
#btn-view-summary {
	background-color: var(--primary-color);
	color: #ffffff;
	font-weight: 800;
	text-transform: uppercase;
	font-size: 0.85em;
	border-color: transparent;
}

.btn-success:hover,
#btn-create:hover,
#btn-advance:hover,
#btn-view-summary:hover {
	background-color: var(--primary-hover);
}

.btn-danger {
	background-color: transparent;
	border: 1px solid rgba(255, 107, 107, 0.4);
	color: var(--c-red-500, var(--red));
}

.btn-danger:hover,
.btn-danger:focus {
	background-color: rgba(255, 107, 107, 0.12);
}

.btn-subtle {
	background-color: transparent;
	border: 1px solid var(--line-strong);
	color: var(--text-mid);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.btn-subtle:hover,
.btn-subtle:focus {
	color: var(--text);
	border-color: var(--cyan-border);
}

input:focus,
select:focus,
a:focus,
textarea:focus,
button:focus {
	outline: 0;
	box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text-dim);
}

/* ------------------------- Barra superior (toolbar) ------------------------- */

.theme-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 0.5rem 0;
}

.game-title {
	font-family: "Titillium Web", sans-serif;
	font-size: 22px;
	font-weight: 900;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--text);
	margin-right: 0.75rem;
	white-space: nowrap;
}

.game-title-icon {
	display: inline-block;
	width: 50px;
	height: 40px;
	object-fit: contain;
	vertical-align: middle;
	margin-right: 0.4rem;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.theme-bar button {
	font-size: 0.7rem;
	padding: 0.4em 1.1em;
	border: 1px solid var(--line);
	background-color: var(--panel-2);
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.theme-bar button:hover,
.theme-bar button:focus {
	color: var(--text);
	background-color: #2a303d;
}

/* --------------------------- Paneles genéricos --------------------------- */

.panel {
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius-md);
	padding: 1.5rem;
	transition: background 0.6s ease, border-color 0.6s ease;
}

/* --------------------------- Pantalla de creación --------------------------- */

#screen-create {
	max-width: 1280px;
	margin-inline: auto;
	width: 100%;
	padding: 2rem;
}

#screen-create h1 {
	font-size: 2.1rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 1.75rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

#screen-create h1::after {
	content: "";
	flex: 1;
	height: 2px;
	background: var(--c-f1-red);
	margin-left: 1rem;
	opacity: 0.6;
}

.create-layout {
	display: grid;
	grid-template-columns: 1fr 1.15fr;
	gap: 3rem;
}

.field {
	display: flex;
	flex-direction: column;
	margin-bottom: 1.3rem;
}

.field label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-dim);
	margin-bottom: 0.5rem;
}

input[type="text"],
select {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background-color: var(--input-bg);
	color: var(--text);
	transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.6s ease;
}

input::placeholder {
	color: var(--text-dim);
}

input:focus,
select:focus {
	border-color: var(--cyan);
	box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.15);
}

select {
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
		linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
	background-position: calc(100% - 20px) center, calc(100% - 15px) center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	cursor: pointer;
}

input.muted,
select.muted {
	opacity: 0.45;
}

.career-type-selector {
	display: flex;
	gap: 0.75rem;
}

.career-type-option {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 1.1rem 0.75rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--input-bg);
	cursor: pointer;
	font-size: 15px;
	color: var(--text-mid);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.career-type-option input {
	display: none;
}

.career-icon {
	height: 30px;
	width: auto;
	object-fit: contain;
	display: inline-block;
	vertical-align: middle;
}

.career-type-option:has(input:checked) {
	border-color: var(--cyan);
	background: var(--cyan-bg);
	box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.12);
	color: #ffffff;
}

.career-type-option:hover {
	transform: translateY(-2px);
}

#btn-create {
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.85em 1.5em;
	font-size: 1rem;
}

.create-inputs {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.create-style-section {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.create-style-section > label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-dim);
}

.style-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.9rem;
}

.style-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 1.3rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--input-bg);
	cursor: pointer;
	text-align: left;
	color: var(--text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.style-card:hover {
	transform: translateY(-3px);
	border-color: var(--text-dim);
}

.style-card.selected {
	border-color: var(--cyan);
	background: var(--cyan-bg);
	box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.1);
}

.style-card-icon {
	font-size: 34px;
}

.style-card-icon-img {
	height: 34px;
	width: auto;
	object-fit: contain;
	display: block;
}

.style-card-name {
	font-size: 15px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.style-card-desc {
	font-size: 12.5px;
	color: var(--text-dim);
	line-height: 1.45;
}

.style-card-stats {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.style-card-stats span {
	font-size: 12px;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--row);
	color: var(--text-mid);
}

#selected-style-label {
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--text-mid);
	padding: 6px 0;
}

/* =====================================================================
   PANTALLA DE JUEGO — consola F1 Manager
   ===================================================================== */

#app {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100vh;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

#screen-game {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.game-screen {
	flex: 1;
	min-height: 0;
	width: 100%;
	background: var(--panel);
	display: flex;
	flex-direction: column;
	padding: 12px;
	position: relative;
	overflow: hidden;
	user-select: none;
}

/* ------------------------------- Header ------------------------------- */

.top-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.main-nav {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.nav-tab {
	background: transparent;
	border: 0;
	color: var(--text-dim);
	font-family: "Titillium Web", sans-serif;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	padding: 5px 11px;
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
}

.nav-tab:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
	background: var(--cyan);
	color: #0a1418;
	font-weight: 900;
}

.header-stats {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	flex-wrap: wrap;
}

.stat-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-mid);
	padding: 3px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--panel-2);
}

.stat-chip b {
	font-size: 15px;
	font-weight: 900;
	color: #ffffff;
}

.stat-chip:first-child b {
	color: var(--c-gold);
}

.team-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px 4px 8px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--panel-2);
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.team-logo-dot {
	width: 22px;
	height: 22px;
	background: var(--team-color);
	border-radius: 50%;
	flex-shrink: 0;
	transition: background 0.4s ease;
}

#p-team-badge .team-badge-lg {
	height: 15px;
	width: auto;
}

#p-team {
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#rating-badge {
	font-weight: 900;
	font-size: 15px;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

/* ------------------------------ Subheader ------------------------------ */

.sub-header {
	display: flex;
	align-items: center;
	gap: 2px;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--line);
	padding-bottom: 2px;
	margin-bottom: 10px;
}

.sub-tab {
	background: transparent;
	border: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--text-dim);
	position: relative;
	padding: 6px 12px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	cursor: pointer;
	border-radius: 0;
}

.sub-tab:hover {
	color: var(--text);
	background: rgba(255, 255, 255, 0.04);
}

.sub-tab.active {
	color: #ffffff;
	font-weight: 900;
}

.sub-tab.active::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 8px;
	right: 8px;
	height: 2px;
	background-color: var(--cyan);
}

/* -------------------------- Selector de temporada -------------------------- */

.season-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-bottom: 10px;
}

.season-arrow {
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--line-strong);
	background: transparent;
	color: var(--text-mid);
	font-size: 1.2rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.season-arrow:hover:not(:disabled) {
	border-color: var(--cyan);
	color: var(--cyan);
	background: var(--cyan-bg);
}

.season-label {
	font-size: 20px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #ffffff;
	min-width: 140px;
	text-align: center;
}

/* ------------------------------ Contenido ------------------------------ */

.content-area {
	position: relative;
	flex: 1;
	min-height: 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.content-view {
	display: none;
	flex: 1;
	min-height: 0;
	min-width: 0;
}

.content-view.active {
	display: flex;
	flex-direction: column;
}

/* ============================== STANDINGS ============================== */

.standings-scroll {
	flex: 1;
	min-height: 0;
	min-width: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--row);
}

.standings-table {
	width: max-content;
	min-width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-family: "Titillium Web", sans-serif;
	font-size: 15px;
}

/* el thead es el que pega arriba (top en th no funciona: su containing block es la fila) */
.standings-table thead {
	position: sticky;
	top: 0;
	z-index: 8;
}

.standings-table thead th {
	background: var(--panel-2);
	color: var(--text-mid);
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	padding: 8px 6px;
	border-bottom: 1px solid var(--line-strong);
	white-space: nowrap;
	vertical-align: middle;
}

.standings-table thead th.race-cell {
	padding-top: 4px;
	padding-bottom: 4px;
}

.standings-table thead th.race-cell .gp-code {
	display: block;
	font-size: 8px;
	font-weight: 700;
	letter-spacing: 0.4px;
	opacity: 0.7;
	margin-top: 1px;
	line-height: 1;
}

.standings-table thead th.pos-cell,
.standings-table thead th.driver-cell,
.standings-table thead th.tot-cell {
	z-index: 9;
}

.standings-table th.pos-cell,
.standings-table td.pos-cell {
	position: sticky;
	left: 0;
	width: var(--pos-w);
	min-width: var(--pos-w);
	text-align: center;
}

.standings-table th.driver-cell,
.standings-table td.driver-cell {
	position: sticky;
	left: var(--pos-w);
	width: var(--driver-w);
	min-width: var(--driver-w);
	text-align: left;
}

.standings-table th.tot-cell,
.standings-table td.tot-cell {
	position: sticky;
	right: 0;
	min-width: 64px;
	text-align: right;
	font-weight: 900;
	font-size: 17px;
	color: #ffffff;
	padding-right: 14px;
}

.standings-table th.tot-cell {
	font-size: 13px;
	color: var(--text-mid);
	padding-right: 14px;
}

/* Fondos de columnas sticky (sólidos para tapar el scroll) */
.standings-table th.pos-cell,
.standings-table td.pos-cell,
.standings-table th.driver-cell,
.standings-table td.driver-cell,
.standings-table th.tot-cell,
.standings-table td.tot-cell {
	background-color: var(--row);
}

/* Sticky del cuerpo por encima de las celdas de carrera al hacer scroll
   horizontal (las celdas con opacity<1 crean stacking context propio). */
.standings-table td.pos-cell,
.standings-table td.driver-cell,
.standings-table td.tot-cell {
	z-index: 1;
}

.standings-table thead th.pos-cell,
.standings-table thead th.driver-cell,
.standings-table thead th.tot-cell {
	background-color: var(--panel-2);
}

.standings-table tbody td {
	padding: 7px 6px;
	text-align: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	color: var(--text-mid);
	font-weight: 700;
	white-space: nowrap;
}

.standings-table tbody tr:nth-child(even) td {
	background-color: var(--row-alt);
}

.standings-table tbody tr:nth-child(even) td.pos-cell,
.standings-table tbody tr:nth-child(even) td.driver-cell,
.standings-table tbody tr:nth-child(even) td.tot-cell {
	background-color: var(--row-alt);
}

/* líneas divisorias sutiles cada 3 filas */
.standings-table tbody tr:nth-child(3n) td {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.standings-table td.pos-cell {
	color: var(--text-dim);
	font-weight: 800;
	font-size: 14px;
}

.standings-table .driver-cell {
	position: sticky;
	display: flex;
	align-items: center;
	gap: 8px;
	padding-left: 0;
}

.driver-cell .stripe {
	width: 3px;
	height: 30px;
	flex-shrink: 0;
	border-radius: 2px;
}

.driver-cell .d-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.05;
}

.driver-cell .d-name {
	display: block;
	color: #ffffff;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.driver-cell .d-team {
	display: block;
	color: var(--text-dim);
	font-size: 12px;
	letter-spacing: 0.3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* celdas de carrera */
.standings-table td.race-cell {
	width: 44px;
	min-width: 44px;
	font-variant-numeric: tabular-nums;
}

.standings-table td.race-cell.clickable {
	cursor: pointer;
}
.standings-table td.race-cell.clickable:hover {
	background: var(--cyan-bg);
}

.standings-table td.race-cell.p1 {
	background: var(--c-gold);
	color: #14161c;
	font-weight: 900;
	font-size: 16px;
}

.standings-table td.race-cell.p2 {
	background: #c8ccd4;
	color: #14161c;
	font-weight: 900;
	font-size: 16px;
}

.standings-table td.race-cell.p3 {
	background: #c07a3c;
	color: #14161c;
	font-weight: 900;
	font-size: 16px;
}

.standings-table td.race-cell.dnf {
	color: #ff6b6b;
	opacity: 0.65;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.4px;
}

.standings-table td.race-cell.dns {
	color: #4a5163;
}

/* entrada animada de una carrera recién simulada (solo fade: sin salto vertical) */
@keyframes cellIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

td.race-cell.race-in {
	animation: cellIn 0.45s ease both;
}

/* fila del equipo del jugador */
.standings-table tbody tr.player-row td {
	background-color: var(--blue-tint);
}

.standings-table tbody tr.player-row td.pos-cell,
.standings-table tbody tr.player-row td.driver-cell,
.standings-table tbody tr.player-row td.tot-cell {
	background-color: #0e2236;
}

.standings-table tbody tr.player-row:nth-child(even) td.pos-cell,
.standings-table tbody tr.player-row:nth-child(even) td.driver-cell,
.standings-table tbody tr.player-row:nth-child(even) td.tot-cell {
	background-color: #0e2236;
}

.standings-table tbody tr.player-row td.tot-cell {
	color: var(--cyan);
	font-size: 19px;
}

/* =============================== OVERVIEW =============================== */

.ov-tile {
	position: relative;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 14px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-height: 64px;
}

/* detalle sutil: LED de esquina */
.ov-tile::before {
	content: "";
	position: absolute;
	top: 6px;
	left: 12px;
	width: 4px;
	height: 4px;
	background: var(--cyan);
	border-radius: 1px;
}

.ov-tile span {
	color: var(--text-dim);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	font-weight: 700;
}

.ov-tile b {
	font-size: 20px;
	font-weight: 900;
	color: #ffffff;
	line-height: 1.1;
}

/* ============================ SEASON RESULTS ============================ */

.summaries-block {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.sum-header-row {
	display: flex;
	align-items: flex-end;
	height: 24px;
	margin-bottom: 6px;
	font-size: 10px;
	font-weight: 800;
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding-right: 8px;
	padding-left: 4px;
}

.col-t {
	width: 34px;
	flex-shrink: 0;
	font-weight: 800;
	font-size: 12px;
	color: var(--text-dim);
}

.col-team {
	flex: 1;
	min-width: 120px;
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 12px;
	color: var(--text-mid);
	white-space: nowrap;
	overflow: hidden;
}

.col-team span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.col-cat {
	width: 34px;
	flex-shrink: 0;
	font-weight: 800;
	font-size: 12px;
	color: var(--text-dim);
}

.col-pos {
	width: 40px;
	flex-shrink: 0;
	font-weight: 900;
	font-size: 13px;
	color: #ffffff;
}

.col-n {
	width: 34px;
	flex-shrink: 0;
	text-align: center;
	font-weight: 700;
	font-size: 12px;
	color: #9aa0b0;
}

.col-n.win {
	color: var(--c-gold);
}

.col-tot {
	width: 50px;
	flex-shrink: 0;
	text-align: right;
	font-weight: 900;
	font-size: 14px;
	color: #ffffff;
}

.sum-header-row .col-tot {
	font-size: 11px;
}

#simplified-summaries {
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow-y: auto;
	min-height: 0;
	flex: 1;
	padding-right: 2px;
}

.season-wrapper {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 13px;
}

.season-row {
	cursor: pointer;
	gap: 0;
	font-size: 20px;
}

.season-row:hover {
	background: var(--panel-2);
}

.season-events {
	margin: 0 0 4px 4px;
	padding: 4px 0 4px 12px;
	border-left: 2px solid var(--cyan);
	background: rgba(22, 25, 33, 0.5);
	border-radius: 0 2px 2px 0;
}

.log-entry {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	font-size: 12px;
	padding: 2px 0;
	color: var(--text-mid);
}

.log-entry .tag {
	flex-shrink: 0;
	font-weight: 800;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #ffffff;
}

.log-entry.injury .tag {
	color: var(--red);
}

.log-entry.transfer .tag {
	color: var(--c-gold);
}

.log-entry.offer .tag {
	color: var(--text-dim);
}

.table-row {
	min-height: 28px;
	display: flex;
	align-items: center;
	background: var(--row);
	border-radius: 2px;
	font-size: 13px;
	padding: 0 8px;
	border-left: 2px solid transparent;
	transition: background 0.2s ease;
}

/* ================================ TROPHIES ================================ */

.trophies-view-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
	flex-wrap: wrap;
}

#view-trophies .shelf-container {
	flex: 1;
	min-height: 0;
}

.trophies-view-head h3 {
	font-size: 16px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.shelf-container {
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 0.75rem;
	padding: 0.25rem;
	align-content: start;
}

.trophy-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	padding: 1rem 0.6rem;
	border-radius: 4px;
	background: var(--row);
	border: 1px solid var(--line);
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.trophy-item:hover {
	transform: translateY(-4px);
	border-color: var(--cyan-border);
}

.trophy-icon {
	font-size: 2.2rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
}

.trophy-img {
	height: 52px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
}

.trophy-label {
	font-size: 0.7rem;
	text-align: center;
	color: var(--text-mid);
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-weight: 700;
}

.trophy-count {
	font-size: 0.8rem;
	font-weight: 900;
	color: var(--c-gold);
}

.vitrina-idolatria {
	grid-column: 1 / -1;
	margin-top: 0.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.vitrina-idolatria h3 {
	font-size: 0.85rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 0.75rem;
}

.vitrina-idolatry-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.8rem;
	padding: 0.3rem 0;
}

.vitrina-idolatry-row > span:first-child {
	min-width: 160px;
	color: var(--text-mid);
}

.vitrina-idolatry-row > span:last-child {
	font-weight: 800;
	color: var(--c-gold);
}

.idolatry-bar {
	height: 6px;
	border-radius: 999px;
	background: #2c313d;
	overflow: hidden;
}

.idolatry-bar div {
	height: 100%;
	width: 0%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--c-gold), var(--cyan));
	transition: width 0.6s ease;
}

/* ================================ RIVALS ================================ */

#rivals-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--row);
	padding: 4px 0;
}

.rivals-head,
.rival-row {
	display: grid;
	grid-template-columns: 40px 1fr 1.2fr 56px 72px;
	align-items: center;
	gap: 10px;
	padding: 7px 16px;
	font-family: "Titillium Web", sans-serif;
}

.rivals-head {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--text-dim);
	border-bottom: 1px solid var(--line);
}

.rival-row {
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	font-size: 15px;
}

.rival-row.player {
	background: var(--blue-tint);
}

.r-pos {
	color: var(--text-dim);
	font-weight: 800;
}

.r-name {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #ffffff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.r-name i {
	width: 3px;
	height: 22px;
	border-radius: 2px;
	flex-shrink: 0;
}

.r-team {
	color: var(--text-dim);
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.r-tot {
	text-align: right;
	font-weight: 900;
	color: #ffffff;
}

.r-rating {
	text-align: center;
	font-weight: 900;
	color: var(--cyan);
}

/* ============================ PERFIL DEL PILOTO ============================ */

.profile-layout {
	flex: 1;
	min-height: 0;
	display: flex;
	gap: 14px;
}

.profile-main {
	flex: 1.6;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
	padding-right: 2px;
}

.profile-side {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overflow-y: auto;
}

.profile-head {
	display: flex;
	align-items: center;
	gap: 16px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 16px;
}

.p-avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	font-weight: 900;
	color: #ffffff;
	flex-shrink: 0;
	background: var(--panel-2);
	overflow: hidden;
}

.p-avatar .team-badge-xl {
	height: 44px;
	width: auto;
	object-fit: contain;
}

.p-id h2 {
	font-family: "Titillium Web", sans-serif;
	font-size: 30px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	line-height: 1;
}

.p-meta {
	color: var(--text-dim);
	font-size: 13px;
	margin-top: 4px;
}

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

.p-attr {
	flex: 1 1 100px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.p-attr span {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--text-dim);
}

.p-attr b {
	font-size: 18px;
	font-weight: 900;
	color: #ffffff;
}

.p-attr.star b {
	color: var(--cyan);
	font-size: 22px;
}

.profile-nums,
.profile-records {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
}

.profile-section {
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 12px;
}

.profile-section h3 {
	font-size: 13px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
}

#profile-offers .offer-item {
	margin-bottom: 6px;
}

.dim {
	color: var(--text-dim);
	font-size: 13px;
}

/* ============================ NEWSLETTER ============================ */

#news-list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.news-title {
	font-family: "Titillium Web", sans-serif;
	font-size: 18px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 12px;
}

.news-item {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 9px 12px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--panel-2);
	margin-bottom: 6px;
	font-size: 14px;
}

.news-tag {
	flex-shrink: 0;
	font-weight: 900;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--cyan);
}

.news-text {
	color: var(--text-mid);
}

@media (max-width: 860px) {
	.profile-layout {
		flex-direction: column;
	}
}

.chest-btn {
	width: fit-content;
	margin-bottom: 4px;
	padding: 0.45em 1.2em;
	border-radius: 4px;
	border: 0;
	background: linear-gradient(120deg, var(--c-gold), var(--cyan));
	color: #0b0c10;
	font-weight: 900;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.chest-btn:hover {
	transform: translateY(-2px);
}

/* =============================== PLACEHOLDER =============================== */

.placeholder-panel {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	border: 1px dashed var(--line-strong);
	border-radius: 4px;
	background: var(--row);
	padding: 30px;
	text-align: center;
}

.ph-led {
	width: 6px;
	height: 6px;
	background: var(--cyan);
	border-radius: 1px;
}

.placeholder-panel h3 {
	font-family: "Titillium Web", sans-serif;
	font-size: 34px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 6px;
	color: var(--text-mid);
}

/* =============================== VEHICLE (coche F1) =============================== */

.vehicle-panel {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--row);
	padding: 18px;
}

.vehicle-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.vehicle-head h3 {
	font-family: "Titillium Web", sans-serif;
	font-size: 24px;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--text-main);
	margin: 0;
}

.vehicle-rating {
	font-family: "Titillium Web", sans-serif;
	font-size: 30px;
	font-weight: 900;
	color: var(--cyan);
}

.vehicle-budget {
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--text-dim);
}

.vehicle-budget b {
	color: var(--text-main);
	font-family: "Titillium Web", sans-serif;
	font-size: 16px;
}

.vehicle-auto {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--text-dim);
}

.veh-auto-btn {
	font-family: "Titillium Web", sans-serif;
	font-size: 14px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 6px 14px;
	border: 1px solid var(--line-strong);
	border-radius: 4px;
	background: var(--panel-2);
	color: var(--text-main);
	cursor: pointer;
	transition: background 0.15s ease;
}

.veh-auto-btn:hover {
	background: var(--row-alt);
}

.vehicle-comps {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.veh-comp {
	display: grid;
	grid-template-columns: 110px 1fr 42px 1fr 64px;
	align-items: center;
	gap: 12px;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 8px 12px;
}

.veh-comp-name {
	font-family: "Titillium Web", sans-serif;
	font-size: 15px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-main);
}

.veh-bar {
	height: 8px;
	border-radius: 4px;
	background: var(--row-alt);
	overflow: hidden;
}

.veh-bar > div {
	height: 100%;
	background: var(--primary-color, var(--cyan));
	border-radius: 4px;
}

.veh-comp-val {
	font-family: "Titillium Web", sans-serif;
	font-size: 20px;
	font-weight: 900;
	color: var(--cyan);
	text-align: center;
}

.veh-comp-meta {
	font-size: 12px;
	color: var(--text-dim);
	text-align: right;
}

.veh-btn {
	font-family: "Titillium Web", sans-serif;
	font-size: 15px;
	font-weight: 900;
	text-transform: uppercase;
	padding: 6px 0;
	border: 1px solid var(--line-strong);
	border-radius: 4px;
	background: var(--primary-color, var(--cyan));
	color: #ffffff;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.veh-btn:hover:not(:disabled) {
	background: var(--primary-hover, var(--cyan));
	transform: translateY(-1px);
}

.veh-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.vehicle-note {
	font-size: 12px;
	color: var(--text-dim);
	margin: 0;
}

.car-cell {
	text-align: center;
	font-family: "Titillium Web", sans-serif;
	font-size: 15px;
	font-weight: 800;
	color: var(--cyan);
}

/* =============================== OFERTAS =============================== */

.offer-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	background: var(--panel-2);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 8px 12px;
}

.offer-item + .offer-item {
	margin-top: 4px;
}

.offer-item-body {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.offer-item-club {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 800;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.offer-cat {
	font-size: 11px;
	font-weight: 900;
	color: #ffffff;
	background: var(--primary-color);
	border-radius: 999px;
	padding: 1px 7px;
	letter-spacing: 0.6px;
}

.offer-item-salary {
	font-size: 13px;
	color: var(--text-mid);
}

.offer-power {
	font-size: 12px;
	color: var(--text-dim);
}

.offer-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.offer-actions button {
	font-size: 12px;
	padding: 0.4em 1em;
}

/* ------------------------------ Footer ------------------------------ */

.game-footer {
	border-top: 1px solid var(--line);
	margin-top: 8px;
	padding-top: 8px;
	display: flex;
	justify-content: flex-end;
	min-height: 46px;
}

#action-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

#action-bar button {
	padding: 0.5em 1.4em;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.retired-notice {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(247, 201, 72, 0.08);
	border: 1px solid rgba(247, 201, 72, 0.35);
	color: var(--c-gold);
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

/* =====================================================================
   Retiro
   ===================================================================== */

#screen-retire {
	width: 100%;
}

.retire-panel {
	max-width: 640px;
	margin-inline: auto;
}

.retire-panel h1 {
	font-size: 1.75rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 0.5rem;
}

.retire-panel > p {
	color: var(--text-dim);
	margin-bottom: 1.5rem;
}

.stat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.4rem 0;
	font-size: 0.85rem;
	border-bottom: 1px solid var(--line);
}

.stat-row span:first-child {
	color: var(--text-dim);
	text-transform: uppercase;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.5px;
}

.stat-row span:last-child {
	font-weight: 800;
	text-align: right;
}

.stat-row:last-child {
	border-bottom: 0;
}

.retire-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

/* =====================================================================
   Modales
   ===================================================================== */

/* ---- Card de presentación de Gran Premio (modo carrera a carrera) ---- */

.gp-overlay {
	position: fixed;
	inset: 0;
	z-index: 2000;
	background: rgba(0, 0, 0, 0.78);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.gp-overlay.active {
	opacity: 1;
}

.gp-card {
	width: min(92vw, 640px);
	display: flex;
	background: linear-gradient(160deg, var(--panel-2), var(--bg));
	border: 1px solid var(--line-strong);
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
	transform: translateY(20px) scale(0.96);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.gp-overlay.active .gp-card {
	transform: translateY(0) scale(1);
}

.gp-card-img-wrap {
	flex: 0 0 40%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background: rgba(255, 255, 255, 0.03);
}

.gp-card-img-wrap img {
	width: 100%;
	object-fit: contain;
	filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}

.gp-card-body {
	flex: 1;
	padding: 1.75rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.5rem;
}

.gp-card-round {
	font-family: "Titillium Web", sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 3px;
	color: var(--primary-color, #e10600);
	text-transform: uppercase;
}

.gp-card-flag {
	font-size: 40px;
	line-height: 1;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.gp-card-flag #gp-card-code {
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 2px;
	color: var(--text-mid);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 2px 8px;
}

.gp-card-name {
	font-family: "Titillium Web", sans-serif;
	font-size: 30px;
	font-weight: 900;
	letter-spacing: 1px;
	line-height: 1.05;
	text-transform: uppercase;
}

.gp-card-meta,
.gp-card-meta2 {
	display: flex;
	gap: 0.5rem 1rem;
	flex-wrap: wrap;
	font-size: 13px;
	color: var(--text-mid);
}

.gp-card-meta span + span::before,
.gp-card-meta2 span + span::before {
	content: "·";
	margin-right: 1rem;
	opacity: 0.5;
}

.result-body {
	align-items: center;
	text-align: center;
	gap: 0.75rem;
}

.result-emote {
	font-size: 64px;
	line-height: 1;
}

.result-trophy {
	height: 84px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

/* --- Vista en vivo vuelta a vuelta --- */
.live-panel {
	flex-direction: column;
	width: min(94vw, 560px);
	max-height: 88vh;
}
.live-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	padding: 0.9rem 1.1rem;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	color: var(--text-mid);
	border-bottom: 1px solid var(--line-strong);
}
.live-head #live-lap {
	color: var(--primary-color, #e10600);
}
.live-table {
	overflow-y: auto;
	padding: 0.35rem 0.6rem;
	flex: 1;
}
.live-colhead,
.live-row {
	display: grid;
	grid-template-columns: 34px 1fr 64px 70px 40px;
	align-items: center;
	gap: 0.4rem;
	padding: 0.3rem 0.5rem;
	font-size: 13px;
}
.live-colhead {
	color: var(--text-dim);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: sticky;
	top: 0;
	background: var(--panel);
}
.live-row {
	border-bottom: 1px solid var(--line);
	color: var(--text-mid);
}
.live-row .live-name {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.live-row .live-name i {
	width: 4px;
	height: 16px;
	border-radius: 2px;
	flex-shrink: 0;
}
.live-row.player {
	background: var(--cyan-bg);
	color: var(--text-main);
	font-weight: 600;
}
.live-row.out {
	opacity: 0.45;
}
.live-row .live-pos {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}
.live-foot {
	padding: 0.7rem 1rem;
	display: flex;
	justify-content: flex-end;
	border-top: 1px solid var(--line-strong);
}

.vitrina-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.vitrina-panel {
	width: 100%;
	max-width: 760px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	background: var(--panel);
	border: 1px solid var(--line-strong);
	border-radius: 6px;
	padding: 1.5rem;
}

.vitrina-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
}

.vitrina-header h2 {
	font-size: 1.15rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.vitrina-header button {
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--text-dim);
	background-color: transparent;
	color: var(--text);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
}

.vitrina-header button:hover,
.vitrina-header button:focus {
	background-color: var(--panel-2);
}

/* ------------------------- Configuración (switches) ------------------------- */

.settings-panel {
	max-width: 560px;
}

.settings-body {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.settings-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0.8rem;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 6px;
}

.settings-label {
	font-size: 0.95rem;
	font-weight: 600;
}

/* Interruptor */
.switch {
	position: relative;
	display: inline-block;
	width: 46px;
	height: 24px;
	flex-shrink: 0;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.switch .slider {
	position: absolute;
	inset: 0;
	background: var(--panel-2);
	border: 1px solid var(--line-strong);
	border-radius: 24px;
	transition: background 0.2s ease;
	cursor: pointer;
}

.switch .slider::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--text-mid);
	transition: transform 0.2s ease, background 0.2s ease;
}

.switch input:checked + .slider {
	background: var(--primary-color, #e10600);
	border-color: var(--primary-color, #e10600);
}

.switch input:checked + .slider::before {
	transform: translateX(22px);
	background: #fff;
}

/* Selector de modo segmentado */
.seg {
	display: flex;
	gap: 0.35rem;
}

.seg button {
	padding: 0.35rem 0.7rem;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: 6px;
	border: 1px solid var(--line-strong);
	background: var(--panel-2);
	color: var(--text-mid);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.seg button.active {
	background: var(--primary-color, #e10600);
	color: #fff;
	border-color: var(--primary-color, #e10600);
}

@media (max-width: 480px) {
	.settings-row {
		flex-direction: column;
		align-items: stretch;
	}
	.settings-label {
		text-align: left;
	}
	.seg {
		justify-content: space-between;
	}
	.seg button {
		flex: 1;
	}
}

/* ------------------------------ Escuderías ------------------------------ */

.clubs-panel {
	max-width: 900px;
}

.clubs-viewport {
	overflow: hidden;
	padding: 1rem 0;
}

.clubs-track {
	display: flex;
	gap: 30px;
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: transform;
}

.club-card {
	width: 270px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 1rem;
}

.club-card-face {
	height: 130px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 0.9rem;
	background: var(--input-bg);
}

.club-card-name {
	font-weight: 800;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 0.6rem;
}

.club-card-stats {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.club-card-stats .row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.75rem;
	padding: 0.4rem 0;
	border-bottom: 1px dashed var(--line);
	color: var(--text-dim);
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.club-card-stats .row b {
	color: #ffffff;
}

.club-card-btn {
	margin-top: 0.9rem;
	font-size: 0.75rem;
	border: 1px solid var(--line);
	background: transparent;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.club-card-btn:hover {
	border-color: var(--cyan);
	color: #ffffff;
}

.clubs-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.25rem;
	margin-top: 0.75rem;
}

.clubs-nav span {
	font-size: 0.85rem;
	color: var(--text-dim);
	min-width: 3.5rem;
	text-align: center;
	font-weight: 700;
}

.clubs-arrow {
	width: 36px;
	height: 36px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid var(--text-dim);
	background: transparent;
	color: var(--text);
	font-size: 1.3rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.clubs-arrow:hover:not(:disabled) {
	background-color: var(--panel-2);
}

/* ------------------------------- Ranking ------------------------------- */

.ranking-panel {
	max-width: 640px;
}

.ranking-submit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	padding-bottom: 1rem;
}

.ranking-submit p {
	font-size: 0.85rem;
	color: var(--text-dim);
	text-align: center;
}

.ranking-tabs {
	display: flex;
	justify-content: space-between;
	border-bottom: 1px solid var(--line);
}

.ranking-tab {
	flex: 1;
	background: transparent;
	border: 0;
	border-top: 2px solid transparent;
	border-radius: 0;
	padding: 0.85rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-dim);
	transition: 0.25s ease;
}

.ranking-tab:hover,
.ranking-tab:focus,
.ranking-tab.active {
	background: transparent;
	color: #ffffff;
	border-top-color: var(--cyan);
}

.ranking-list {
	overflow-y: auto;
	max-height: 46vh;
	margin-top: 0.5rem;
}

.ranking-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.6rem 0.5rem;
	border-bottom: 1px solid var(--line);
}

.ranking-pos {
	width: 2.5rem;
	flex-shrink: 0;
	font-weight: 900;
	font-size: 1rem;
	color: var(--c-gold);
}

.ranking-player {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.ranking-player .name {
	font-weight: 700;
	font-size: 0.9rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ranking-player .team {
	font-size: 0.72rem;
	color: var(--text-dim);
}

.ranking-value {
	font-weight: 900;
	font-size: 1.05rem;
	flex-shrink: 0;
}

/* -------------------------------- Tienda -------------------------------- */

.shop-modal-panel {
	max-width: 680px;
}

.shop-items-body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	overflow-y: auto;
	padding: 0.25rem;
}

.shop-item {
	display: flex;
	flex-direction: column;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 1rem;
	transition: border-color 0.2s ease;
}

.shop-item:hover {
	border-color: var(--text-dim);
}

.shop-item-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	font-weight: 800;
	font-size: 0.82rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.shop-item-desc {
	font-size: 0.75rem;
	color: var(--text-dim);
	margin: 0.5rem 0 0.9rem;
	flex: 1;
}

.shop-btn {
	background: var(--primary-color);
	color: #ffffff;
	font-weight: 800;
	font-size: 0.72rem;
	padding: 0.55em 1em;
	text-transform: uppercase;
	letter-spacing: 0.6px;
}

.shop-btn:hover:not(:disabled) {
	background: var(--primary-hover);
}

/* ------------------------- Instrucciones / Update ------------------------- */

.instructions-panel {
	max-width: 760px;
}

.instructions-body {
	overflow-y: auto;
	max-height: 68vh;
	padding-right: 0.75rem;
}

.instructions-body section + section {
	margin-top: 1.75rem;
}

.instructions-body h3 {
	font-size: 0.95rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #ff5a52;
	margin-bottom: 0.6rem;
}

.instructions-body p {
	font-size: 0.875rem;
	color: var(--text-mid);
}

.instructions-body p + p {
	margin-top: 0.5rem;
}

.instructions-body ul {
	margin-top: 0.5rem;
}

.instructions-body li {
	font-size: 0.85rem;
	color: var(--text-mid);
	margin-top: 0.35rem;
}

.instructions-body li::marker {
	color: var(--cyan);
}

.instructions-body strong {
	color: #ffffff;
}

/* --------------------------------- Cofre --------------------------------- */

.chest-modal-panel {
	max-width: 480px;
}

.chest-modal-body {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

.chest-modal-body p {
	font-size: 0.9rem;
	color: var(--text-mid);
}

.chest-modal-body ul {
	margin-top: 0.25rem;
}

.chest-modal-body li {
	font-size: 0.85rem;
	color: var(--text-mid);
	margin-top: 0.35rem;
}

.chest-modal-body .offer-actions {
	margin-top: 1rem;
	justify-content: flex-end;
}

/* --------------------------------- Escudos --------------------------------- */

.team-badge {
	height: 16px;
	width: auto;
	object-fit: contain;
	display: inline-block;
	vertical-align: middle;
	opacity: 0;
	transition: opacity 0.3s ease;
	flex-shrink: 0;
}

.team-badge.loaded {
	opacity: 1;
}

.team-badge-lg {
	height: 48px;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 1000px) {
	.create-layout {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.shop-items-body {
		grid-template-columns: 1fr;
	}

	.offer-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.standings-table th.driver-cell,
	.standings-table td.driver-cell {
		width: 160px;
		min-width: 160px;
		--driver-w: 160px;
	}
}

@media (max-width: 560px) {
	body {
		padding-top: 0;
		padding-bottom: 0;
	}

	.style-cards {
		grid-template-columns: 1fr;
	}

	.career-type-selector {
		flex-direction: column;
	}

	.theme-bar {
		gap: 0.5rem;
	}

	.theme-bar button {
		flex: 1 1 45%;
	}

	.col-team {
		min-width: 90px;
	}

	.season-label {
		min-width: 110px;
		font-size: 17px;
	}
}

/* --------------------------- Logros 🏅 --------------------------- */

.ach-counter {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-size: 0.7rem;
	color: var(--c-gold);
	background: var(--panel-2);
	border: 1px solid var(--line);
	padding: 0.4em 0.9em;
	border-radius: 4px;
	white-space: nowrap;
}

.ach-counter .ach-counter-pending {
	color: #4ade80;
	font-weight: 700;
}

.ach-counter .hidden {
	display: none;
}

.achievements-panel {
	max-width: 760px;
}

.achievements-progress {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
	padding: 0.75rem 1rem;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 6px;
	font-size: 0.85rem;
	color: var(--text-mid);
}

.achievements-progress .ach-points-total {
	color: var(--c-gold);
	font-weight: 800;
}

.achievements-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.6rem;
	overflow-y: auto;
	padding: 0.25rem;
}

.ach-card {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0.6rem 0.75rem;
	transition: border-color 0.2s ease, opacity 0.2s ease;
}

.ach-card:hover {
	border-color: var(--text-dim);
}

.ach-card-locked {
	opacity: 0.55;
}

.ach-card-unlocked {
	border-color: var(--cyan-border);
	background: var(--cyan-bg);
}

.ach-icon {
	font-size: 1.4rem;
	flex-shrink: 0;
}

.ach-body {
	flex: 1;
	min-width: 0;
}

.ach-name {
	font-weight: 800;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: var(--text);
}

.ach-desc {
	font-size: 0.72rem;
	color: var(--text-dim);
	margin-top: 0.15rem;
}

.ach-right {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
	flex-shrink: 0;
}

.ach-badge {
	font-size: 0.9rem;
}

.ach-pts {
	font-size: 0.7rem;
	font-weight: 800;
	color: var(--c-gold);
}

@media (max-width: 600px) {
	.achievements-list {
		grid-template-columns: 1fr;
	}
}

/* --------------------------- Piloto favorito 👤 --------------------------- */

.favorite-picker-btn {
	font-size: 0.8rem;
	padding: 0.55em 1.2em;
	border: 1px solid var(--line-strong);
	border-radius: 4px;
	background-color: var(--panel-2);
	color: var(--text);
	cursor: pointer;
	width: 100%;
	text-align: center;
}

.favorite-picker-btn:hover,
.favorite-picker-btn:focus {
	background-color: #2a303d;
}

.favorite-selected {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.6rem;
	padding: 0.45rem 0.75rem;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 6px;
	font-size: 0.85rem;
	color: var(--text);
}

.favorite-selected img {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: 50%;
	background: var(--panel-2);
}

.favorite-panel {
	max-width: 720px;
}

.favorite-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.6rem;
	overflow-y: auto;
	padding: 0.25rem;
}

.favorite-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	background: var(--row);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0.75rem 0.5rem;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.favorite-card:hover {
	border-color: var(--text-dim);
	background: var(--row-alt);
}

.favorite-card.selected {
	border-color: var(--cyan-border);
	background: var(--cyan-bg);
}

.favorite-card-avatar {
	width: 56px;
	height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	overflow: hidden;
	background: var(--panel-2);
}

.favorite-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.favorite-card-fb {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 900;
	font-size: 1.1rem;
	color: var(--text-mid);
}

.favorite-card-name {
	font-size: 0.78rem;
	font-weight: 800;
	color: var(--text);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.favorite-card-team {
	font-size: 0.68rem;
	color: var(--text-dim);
}

.favorite-card.favorite-locked {
	opacity: 0.6;
	filter: grayscale(0.6);
	position: relative;
}

.favorite-card.favorite-locked:hover {
	border-color: var(--line);
	background: var(--row);
}

.favorite-card-lock {
	margin-top: 0.2rem;
	font-size: 0.72rem;
	font-weight: 800;
	color: var(--c-gold);
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

@media (max-width: 600px) {
	.favorite-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	}
}


