:root {
    --bs-heading-color: #f8f9fa;
}

body {
    background: #0b1220;
}

.container {
    max-width: 1400px;
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric {
    min-width: 220px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}

.metric .label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
}

.metric .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.table thead th {
    white-space: nowrap;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.12s ease-in-out;
}

.clickable-row:hover td {
	background: rgba(0, 0, 0, 0.04);
}


.text-mono {
    /*
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    */
}

.star-badge {
    padding-top: 2px;
    padding-bottom: 3px;
    padding-left: 6px;
    padding-right: 6px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.0rem;
    display: inline-block;
    width: 54px;
    text-align: center;
}

.stars-0 {
    background: #444;
    /*color: #ccc;*/
    color: gold;
}

.stars-1 {
    background: #b45309;
    /*color: white;*/
    color: gold;
}

.stars-2 {
    background: #2563eb;
    color: gold;
}

.stars-3 {
    background: #16a34a;
    color: gold;
}

td:has(span.star-badge) {
    /*padding: 30px 30px 30px 30px;*/
    padding-top: 2px;
    padding-bottom: 2px;
}


.accuracy {
    font-weight: 600;
}

.acc-high { color: #16a34a; }
.acc-mid  { color: #2563eb; }
.acc-low  { color: #dc2626; }


.best-run > td {
    background: rgba(34,197,94,0.10);
}

.best-run:hover > td {
    background: rgba(34,197,94,0.18);
}

th[role="columnheader"] {
    cursor: pointer;
}

/* sortable column headers */
table.sortable th {
    cursor: pointer;
    position: relative;
    padding-right: 18px;
}

/* default arrow */
table.sortable th::after {
    content: "↕";
    position: absolute;
    right: 6px;
    color: #aaa;
    font-size: 0.8rem;
}

/* ascending */
table.sortable th[aria-sort="ascending"]::after {
    content: "▲";
    color: #2563eb;
}

/* descending */
table.sortable th[aria-sort="descending"]::after {
    content: "▼";
    color: #2563eb;
}

table.sortable th[aria-sort] {
    background: rgba(37, 99, 235, 0.08);
}

/* level page header */
.level-title {
    color: #60a5fa;                 /* soft blue accent */
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* optional subtle glow for dark theme */
.level-title {
    text-shadow: 0 0 8px rgba(96,165,250,0.25);
}

/* dashboard header block */

.level-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.level-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.level-badge {
    background: linear-gradient(135deg, rgba(96,165,250,0.18), rgba(96,165,250,0.08));
    color: #93c5fd;
    border: 1px solid rgba(96,165,250,0.35);
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 1.1rem;
}

.stat-card {
    background: linear-gradient(145deg, #1f2937, #111827);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px 18px;
    min-width: 110px;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 600;
    color: #f9fafb;
}

a.plain, a.plain:visited {
    text-decoration: none;
}


.card.metric .card-body {
    padding: 0.6rem 0.9rem;
}

.card.metric .label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.card.metric .value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}



.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 1rem;
}

.dashboard-card {
	grid-column: span 6;
}

.dashboard-card-full {
	grid-column: 1 / -1;
}

.metrics-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.75rem;
}

.metric-tile {
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0.5rem;
	padding: 0.75rem 0.9rem;
	background: rgba(255, 255, 255, 0.02);
}

.metric-label {
	font-size: 0.85rem;
	color: #9aa4b2;
}

.metric-value {
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.2;
}

.chart-wrap {
	position: relative;
	height: 320px;
}


.heatmap-scroll {
	overflow-x: auto;
	padding-bottom: 0.25rem;
}

.heatmap-wrap {
	width: max-content;
	min-width: 100%;
}

.heatmap-months {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 12px;
	column-gap: 3px;
	margin-left: 40px;
	margin-bottom: 6px;
	height: 16px;
	position: relative;
}

.heatmap-month-label {
	font-size: 0.75rem;
	line-height: 1;
	color: #9aa4b2;
	white-space: nowrap;
	align-self: end;
}

.heatmap-body {
	display: flex;
	align-items: start;
	gap: 6px;
}

.heatmap-day-labels {
	display: grid;
	grid-template-rows: repeat(7, 12px);
	row-gap: 3px;
	width: 34px;
}

.heatmap-day-label {
	height: 12px;
	font-size: 0.72rem;
	line-height: 12px;
	text-align: right;
	padding-right: 2px;
	white-space: nowrap;
}

.heatmap-grid {
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: repeat(7, 12px);
	grid-auto-columns: 12px;
	gap: 3px;
	align-items: start;
	width: max-content;
}

.heatmap-cell {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	border: 1px solid rgba(255, 255, 255, 0.03);
	background: #1f2937;
	cursor: pointer;
	transition: transform 0.08s ease-in-out, box-shadow 0.08s ease-in-out;
}

.heatmap-cell:hover {
	transform: scale(1.08);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.heatmap-cell.out-of-range {
	opacity: 0.25;
}

.heatmap-legend {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

.heatmap-key {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

/* Level 0 — no activity */
.heatmap-cell.intensity-0,
.heatmap-key.intensity-0 {
	background: #1f2937;
}

/* Level 1 — very light */
.heatmap-cell.intensity-1,
.heatmap-key.intensity-1 {
	background: #1f7a3a;
}

/* Level 2 */
.heatmap-cell.intensity-2,
.heatmap-key.intensity-2 {
	background: #2da44e;
}

/* Level 3 */
.heatmap-cell.intensity-3,
.heatmap-key.intensity-3 {
	background: #3fb950;
}

/* Level 4 */
.heatmap-cell.intensity-4,
.heatmap-key.intensity-4 {
	background: #56d364;
}

/* Level 5 — peak */
.heatmap-cell.intensity-5,
.heatmap-key.intensity-5 {
	background: #7ee787;
}

/* Month boundary guide line */
.heatmap-cell.month-start-week {
	position: relative;
}

.heatmap-cell.month-start-week::before {
	content: "";
	position: absolute;
	left: -3px;
	top: -4px;
	height: 19px;
	width: 1px;
	background: rgba(0, 0, 0, 0.88);
	pointer-events: none;
}



@media (max-width: 1200px) {
	.dashboard-card {
		grid-column: 1 / -1;
	}
}

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

	.chart-wrap {
		height: 260px;
	}
}


.sparkline {
	width: 120px;
	height: 28px;
	flex: 0 0 auto;
}

.sparkline svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.sparkline path.sparkline-line {
	fill: none;
	stroke: #3b82f6;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.sparkline path.sparkline-area {
	fill: rgba(59, 130, 246, 0.10);
	stroke: none;
}


.clickable-row:hover .sparkline path.sparkline-line {
	stroke: #2563eb;
}

.clickable-row:hover .sparkline path.sparkline-area {
	fill: rgba(37, 99, 235, 0.16);
}

.clickable-row:hover .sparkline-total {
	color: #333;
}

#level-table td:first-child,
#level-table th:first-child {
	width: 1%;
	white-space: nowrap;
}

#level-table td:last-child,
#level-table th:last-child {
	padding-left: 14px;
}

/* Card H5 elements for header text were rendering light */
.dashboard-card {
	--bs-heading-color: var(--bs-body-color);
}


/* all-results page first-column timestamp width */
.results-table th:first-child,
.results-table td:first-child {
	white-space: nowrap;
	min-width: 12rem;
}

.all-results-page {
	max-width: 1700px;
	margin: 0 auto;
}

#dashboard-card-level-distribution.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

@media (min-width: 1200px) {
    .container-wide {
        max-width: 1400px;
    }
}