/* 競馬マエストロ レースシミュレーション */
/* ============ レースシミュレーション ============ */

.km-sim {
	margin-bottom: 1.1em;
}

.km-sim-btn {
	display: block;
	width: 100%;
	padding: 0.6em 1em;
	border: none;
	border-radius: 10px;
	background: linear-gradient(135deg, #1b7a43, #145c33);
	color: #fff;
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(20, 92, 51, 0.35);
}

.km-sim-btn:hover {
	filter: brightness(1.08);
}

.km-simw-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(4, 20, 12, 0.72);
	padding: 12px;
}

.km-simw {
	width: 100%;
	max-width: 640px;
	max-height: 94vh;
	overflow-y: auto;
	background: #0e2e1f;
	color: #eaf6ee;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 18px;
	padding: 14px 16px 12px;
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
	font-size: 14px;
	line-height: 1.6;
}

.km-simw-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	margin-bottom: 8px;
}

.km-simw-title {
	font-size: 1.05em;
	font-weight: 700;
}

.km-simw-close {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.1);
	color: #eaf6ee;
	font-size: 18px;
	cursor: pointer;
}

.km-simw-canvaswrap {
	background: #0a2417;
	border-radius: 14px;
	overflow: hidden;
}

.km-simw-canvaswrap canvas {
	display: block;
	width: 100%;
}

.km-simw-course {
	margin: 6px 2px 10px;
	font-size: 0.8em;
	color: rgba(234, 246, 238, 0.7);
	text-align: center;
}

.km-simw-controls {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
}

.km-simw-play {
	flex: 1.6;
	padding: 0.7em;
	border: none;
	border-radius: 12px;
	background: linear-gradient(135deg, #e8b64f, #cf9a2e);
	color: #2b1d00;
	font-size: 1.05em;
	font-weight: 700;
	cursor: pointer;
}

.km-simw-play.is-running {
	filter: saturate(0.85) brightness(1.05);
	cursor: default;
}

.km-simw-speed {
	flex: 1;
	padding: 0.7em;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 12px;
	background: transparent;
	color: #eaf6ee;
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
}

.km-simw-pacerow {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.km-simw-pacelabel {
	font-weight: 700;
	color: #8fd4a8;
}

.km-simw-pace {
	width: 52px;
	padding: 0.45em 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 10px;
	background: transparent;
	color: #eaf6ee;
	font-weight: 700;
	cursor: pointer;
}

.km-simw-pace.is-active {
	border-color: #58d08a;
	background: rgba(88, 208, 138, 0.16);
	color: #8fe9b4;
}

.km-simw-pacenote {
	font-size: 0.82em;
	color: rgba(234, 246, 238, 0.65);
}

.km-simw-trend {
	margin-bottom: 10px;
	font-size: 0.88em;
	color: rgba(234, 246, 238, 0.85);
}

.km-simw-mc {
	display: block;
	width: 100%;
	padding: 0.8em;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.06);
	color: #eaf6ee;
	font-size: 1em;
	font-weight: 700;
	cursor: pointer;
}

.km-simw-mc:hover {
	background: rgba(255, 255, 255, 0.12);
}

.km-simw-result {
	margin-top: 10px;
}

.km-simw-result table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.km-simw-result th,
.km-simw-result td {
	padding: 0.32em 0.5em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	text-align: center;
}

.km-simw-result .km-simw-hname {
	text-align: left;
	font-weight: 700;
}

.km-simw-result tr.is-top td {
	background: rgba(232, 182, 79, 0.12);
}

.km-simw-mark {
	color: #ff9c9c;
}

.km-simw-mcnote {
	margin: 6px 0 0;
	font-size: 0.78em;
	color: rgba(234, 246, 238, 0.6);
}

.km-simw-note {
	margin: 10px 0 0;
	font-size: 0.75em;
	color: rgba(234, 246, 238, 0.55);
}

/* シミュレーション着順（1〜5着） */
.km-simw-finish {
	margin-top: 10px;
	padding: 0.7em 0.8em;
	background: rgba(232, 182, 79, 0.10);
	border: 1px solid rgba(232, 182, 79, 0.25);
	border-radius: 12px;
}

.km-simw-finish-title {
	font-weight: 700;
	color: #f0cf8a;
	margin-bottom: 0.4em;
}

.km-simw-ftable {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.km-simw-ftable th,
.km-simw-ftable td {
	padding: 0.35em 0.5em;
	text-align: center;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.km-simw-ftable thead th {
	color: rgba(234, 246, 238, 0.7);
	font-size: 0.85em;
	font-weight: 700;
	border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.km-simw-ftable .km-simw-fname {
	text-align: left;
	font-weight: 700;
}

.km-simw-ftable .km-simw-fpos {
	font-weight: 700;
	color: #f0cf8a;
}

.km-simw-ftable tr.is-top td {
	background: rgba(232, 182, 79, 0.14);
}
