:root {
	--ink: #18324a;
	--muted: #5b6b7a;
	--blue: #315efb;
	--teal: #14877d;
	--warn: #b4461f;
	--line: #d9e0e7;
	--bg: #f5f7fa;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

main {
	max-width: 720px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

header h1 { font-size: 28px; margin: 0 0 4px; }
.lede { margin: 0 0 16px; color: var(--muted); }
h2 { font-size: 20px; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 16px 0 8px; }

.card {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 20px;
	margin-bottom: 16px;
}
.card.muted { background: #fbfcfd; font-size: 15px; }

.steps li, .card ul li { margin-bottom: 6px; }
.small { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; margin-top: 14px; }

input[type="text"], input[type="number"], textarea {
	font: inherit;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
}
input[type="text"] { flex: 1; }
input[type="number"] { width: 110px; }
input[type="range"] { flex: 1; accent-color: var(--blue); }
textarea { width: 100%; margin-top: 6px; }

button {
	font: inherit;
	padding: 9px 16px;
	border-radius: 8px;
	border: 1px solid var(--line);
	background: #fff;
	color: var(--ink);
	cursor: pointer;
}
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, input:focus-visible { outline: 3px solid #9db4ff; outline-offset: 1px; }

.start { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.start label { display: block; margin-bottom: 6px; }

.status { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 14px; color: #fff; }
.badge.second { background: var(--teal); }
.badge.first { background: var(--blue); }
.rule-text { color: var(--muted); margin: 8px 0 12px; }

.cost-box {
	background: #eef3ff;
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	font-size: 17px;
}
#bidPanel label { display: block; margin-bottom: 6px; }
#bidBtn { margin-top: 10px; }
.error { color: var(--warn); min-height: 1em; margin: 6px 0 0; font-size: 14px; }

table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
th, td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
thead th { font-size: 14px; color: var(--muted); }
tr.win { background: #eaf7f4; font-weight: 600; }

.result { font-weight: 600; }
.profit { font-size: 17px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { padding: 14px; text-align: center; font-weight: 600; }
.choice.warn { border-color: #f0c2ae; background: #fff7f3; }

details { background: #f7f9fb; border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
summary { cursor: pointer; font-weight: 600; }

fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 4px; }
fieldset label { display: block; margin: 4px 0; }
.scale { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.scale label { display: inline-block; }

@media (max-width: 520px) {
	.choices { grid-template-columns: 1fr; }
	header h1 { font-size: 23px; }
}
