/* Voidscape: The Luck Altar (/odds). Extends landing.css; same tokens, same voice.
   A teaching toy: one coin, two authentic item sprites, and the geometric
   distribution made physical. Pixel sprites are cropped to their alpha box and
   scaled at whole multiples only (odds.js sizes them) - never fractionally. */

.odds {
	--slot: rgba(9, 5, 16, .78);
	--slot-line: rgba(143, 85, 223, .34);
	--glass: rgba(21, 16, 34, .66);
	--hat: #ef5fef;          /* the pink party hat's own sprite pink, lifted a step */
	--hat-deep: #b800b8;
	--bone: #ccd4dc;
	background-image:
		radial-gradient(1100px 640px at 50% 300px, var(--void-2) 0%, var(--void) 62%),
		radial-gradient(680px 420px at 50% 500px, rgba(143, 85, 223, .10) 0%, transparent 72%);
}

.skip-link {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 100;
	transform: translateY(-160%);
	border: 1px solid var(--line-strong);
	border-radius: 7px;
	background: var(--void-2);
	color: var(--text);
	padding: 9px 13px;
}

.skip-link:focus { transform: translateY(0); }

.px { image-rendering: pixelated; }

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Every numeral on the page is set in the game's own hand. */
.num { font-family: var(--display); font-weight: 400; letter-spacing: .02em; }

.panel {
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--glass);
	backdrop-filter: blur(7px);
	padding: 20px 20px 22px;
}

.panel-title {
	font-family: var(--display);
	font-size: 22px;
	font-weight: 400;
	letter-spacing: .02em;
	margin-bottom: 14px;
}

.panel-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--faint);
	margin-bottom: 8px;
}

.section-title {
	font-family: var(--display);
	font-size: clamp(26px, 4vw, 38px);
	font-weight: 400;
	letter-spacing: .02em;
	text-align: center;
}

.section-sub {
	max-width: 640px;
	margin: 10px auto 26px;
	text-align: center;
	color: var(--muted);
	font-size: 15px;
}

/* ======================= hero ======================= */
.odds-hero {
	max-width: 780px;
	margin: 0 auto;
	padding: 40px 24px 26px;
	text-align: center;
	position: relative;
	z-index: 2;
}

.odds-hero .hero-title { margin-bottom: 12px; }

.odds-hero .hero-sub {
	max-width: 620px;
	margin: 0 auto;
}

/* ======================= the altar ======================= */
.altar {
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 24px 12px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
	position: relative;
	z-index: 2;
}

/* ---- odds control ---- */
.rate-readout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.rate-step {
	width: 34px;
	height: 34px;
	flex: none;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: rgba(9, 5, 16, .6);
	color: var(--muted);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}

.rate-step:hover { border-color: var(--line-strong); color: var(--text); background: rgba(143, 85, 223, .14); }
.rate-step:active { transform: translateY(1px); }

.rate-value {
	display: flex;
	align-items: baseline;
	gap: 9px;
	min-width: 0;
}

.rate-lead {
	font-family: var(--display);
	font-size: 22px;
	color: var(--muted);
}

.rate-input {
	font-family: var(--display);
	font-size: clamp(38px, 6vw, 52px);
	line-height: 1;
	color: var(--gold-hi);
	background: transparent;
	border: 0;
	border-bottom: 1px dashed transparent;
	width: 4.2ch;
	padding: 0 0 2px;
	text-align: left;
	letter-spacing: .01em;
}

.rate-input:hover { border-bottom-color: var(--line); }
.rate-input:focus { outline: none; border-bottom-color: var(--gold); }

.rate-word {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .24em;
	text-transform: uppercase;
	color: var(--purple-hi);
	margin: 4px 0 16px;
}

.rate-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(143, 85, 223, .55), rgba(201, 164, 91, .6));
	outline: none;
	cursor: pointer;
}

.rate-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--gold-hi);
	border: 2px solid var(--void);
	box-shadow: 0 0 12px rgba(201, 164, 91, .6);
	cursor: pointer;
}

.rate-slider::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--gold-hi);
	border: 2px solid var(--void);
	box-shadow: 0 0 12px rgba(201, 164, 91, .6);
	cursor: pointer;
}

.rate-slider:focus-visible { box-shadow: 0 0 0 3px rgba(178, 140, 242, .35); }

.rate-scale {
	display: flex;
	justify-content: space-between;
	font-size: 10px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--faint);
	margin: 7px 0 20px;
}

.preset-row {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 20px;
}

.preset {
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(9, 5, 16, .5);
	color: var(--muted);
	font-family: inherit;
	font-size: 12px;
	padding: 6px 11px;
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}

.preset:hover { border-color: var(--line-strong); color: var(--text); }

.preset.is-on {
	border-color: var(--gold);
	color: var(--gold-hi);
	background: rgba(201, 164, 91, .12);
}

/* Deliberately not Alagard: its slash glyph makes "1/900" read as struck
   through. The display face is reserved for standalone numerals here. */
.preset .preset-rate {
	margin-left: 5px;
	color: var(--faint);
}

.preset.is-on .preset-rate { color: var(--gold); }

.plain {
	border-top: 1px solid var(--line);
	padding-top: 16px;
}

.plain-lead {
	font-size: 14px;
	color: var(--text);
	margin-bottom: 12px;
}

.plain-list { list-style: none; display: grid; gap: 9px; }

.plain-list li {
	display: flex;
	align-items: baseline;
	gap: 9px;
	font-size: 13px;
	color: var(--muted);
	line-height: 1.4;
}

.plain-list strong {
	font-size: 19px;
	color: var(--purple-hi);
	min-width: 3.4ch;
	text-align: right;
	flex: none;
}

.plain-list em { font-style: normal; color: var(--text); }

/* ---- the coin ---- */
/* The coin is the centrepiece: sit it in the middle of the taller side
   panels rather than letting it hang off the top of the row. */
.stage-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	align-self: stretch;
	padding-top: 4px;
}

.coin-stage {
	position: relative;
	width: 100%;
	height: 268px;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 1000px;
}

.beam {
	position: absolute;
	left: 50%;
	top: -30px;
	width: 116px;
	height: 300px;
	margin-left: -58px;
	pointer-events: none;
	opacity: 0;
	background: linear-gradient(180deg, rgba(239, 95, 239, 0) 0%, rgba(239, 95, 239, .34) 30%, rgba(201, 164, 91, .30) 74%, rgba(201, 164, 91, 0) 100%);
	filter: blur(9px);
	transition: opacity .5s ease-out;
}

.beam.is-lit { opacity: 1; transition: opacity .12s ease-in; }

.coin {
	position: relative;
	width: 196px;
	height: 196px;
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

.coin:focus-visible { outline: 2px solid var(--purple-hi); outline-offset: 8px; border-radius: 50%; }

.coin-lift {
	display: block;
	width: 100%;
	height: 100%;
	will-change: transform;
}

.coin-inner {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	will-change: transform;
}

.coin-face {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	backface-visibility: hidden;
	overflow: hidden;
	border: 3px solid rgba(143, 85, 223, .55);
	background:
		radial-gradient(circle at 50% 34%, rgba(143, 85, 223, .22) 0%, transparent 62%),
		radial-gradient(circle at 50% 50%, #1b1430 0%, #0a0612 100%);
	box-shadow:
		inset 0 0 0 6px rgba(9, 5, 16, .55),
		inset 0 0 34px rgba(143, 85, 223, .28),
		0 18px 44px rgba(0, 0, 0, .6);
}

.coin-face.is-hat { transform: translateZ(7px); }
.coin-face.is-bones { transform: rotateX(180deg) translateZ(7px); }

.coin-face.is-hat {
	border-color: rgba(201, 164, 91, .68);
	background:
		radial-gradient(circle at 50% 32%, rgba(239, 95, 239, .26) 0%, transparent 60%),
		radial-gradient(circle at 50% 50%, #241338 0%, #0c0616 100%);
}

.face-art {
	position: relative;
	display: block;
	overflow: hidden;
	flex: none;
}

.face-art img {
	position: absolute;
	left: 0;
	top: 0;
	max-width: none;
	display: block;
}

.coin.is-spinning .coin-face { border-color: rgba(178, 140, 242, .85); }

.coin.is-hit .coin-face.is-hat {
	border-color: var(--gold-hi);
	box-shadow:
		inset 0 0 0 6px rgba(9, 5, 16, .45),
		inset 0 0 40px rgba(239, 95, 239, .45),
		0 0 42px rgba(201, 164, 91, .55),
		0 18px 44px rgba(0, 0, 0, .6);
}

.coin-shadow {
	position: absolute;
	bottom: 16px;
	left: 50%;
	width: 150px;
	height: 16px;
	margin-left: -75px;
	border-radius: 50%;
	background: radial-gradient(ellipse at center, rgba(0, 0, 0, .62) 0%, transparent 70%);
	pointer-events: none;
}

.coin-hint {
	font-size: 12px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--faint);
	margin-top: -6px;
}

.verdict {
	font-family: var(--display);
	font-size: 19px;
	text-align: center;
	color: var(--muted);
	margin: 14px 0 16px;
	min-height: 2.5em;
	max-width: 380px;
	line-height: 1.35;
}

.verdict.is-hit { color: var(--gold-hi); }
.verdict.is-hit .num { color: var(--hat); }

.fast-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.fast {
	border: 1px solid var(--line);
	border-radius: 9px;
	background: rgba(9, 5, 16, .55);
	color: var(--muted);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	padding: 8px 13px;
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}

.fast:hover { border-color: var(--line-strong); color: var(--text); background: rgba(143, 85, 223, .14); }
.fast:active { transform: translateY(1px); }
.fast[disabled] { opacity: .45; cursor: default; transform: none; }

.fast.is-primary {
	border-color: rgba(201, 164, 91, .5);
	color: var(--gold-hi);
}

.fast.is-primary:hover { background: rgba(201, 164, 91, .14); border-color: var(--gold); }

.fast.is-quiet { color: var(--faint); }

/* ---- tally ---- */
.tally-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 16px;
}

.tally-cell {
	border: 1px solid var(--line);
	border-radius: 11px;
	background: rgba(9, 5, 16, .45);
	padding: 12px 10px 10px;
	text-align: center;
}

.tally-cell.is-hat { border-color: rgba(201, 164, 91, .34); }

.tally-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 32px;
	margin-bottom: 2px;
}

.tally-num {
	display: block;
	font-size: 30px;
	line-height: 1.05;
	color: var(--text);
}

.tally-cell.is-hat .tally-num { color: var(--gold-hi); }

.tally-label {
	display: block;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--faint);
	margin-top: 3px;
}

.dry-box {
	border: 1px solid var(--line);
	border-radius: 11px;
	background: rgba(9, 5, 16, .45);
	padding: 13px 14px 14px;
	margin-bottom: 16px;
	transition: border-color .3s, background .3s;
}

.dry-box.is-warm { border-color: rgba(201, 164, 91, .45); }
.dry-box.is-hot { border-color: rgba(224, 122, 109, .6); background: rgba(60, 14, 20, .3); }

.dry-num {
	display: block;
	font-size: 34px;
	line-height: 1.05;
	color: var(--text);
}

.dry-box.is-hot .dry-num { color: #e07a6d; }

.dry-note {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.4;
	margin-top: 2px;
	min-height: 2.8em;
}

.dry-bar {
	height: 4px;
	border-radius: 999px;
	background: rgba(9, 5, 16, .8);
	overflow: hidden;
	margin-top: 9px;
}

.dry-bar span {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--purple), var(--gold));
	transition: width .18s ease-out;
}

.mini-stats {
	display: grid;
	gap: 7px;
	font-size: 12px;
	margin-bottom: 16px;
}

.mini-stats > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	border-bottom: 1px solid rgba(143, 85, 223, .14);
	padding-bottom: 6px;
}

.mini-stats dt { color: var(--faint); letter-spacing: .04em; }
.mini-stats dd { color: var(--text); font-size: 14px; text-align: right; }
.mini-stats dd.is-lucky { color: var(--live); }
.mini-stats dd.is-dry { color: #e07a6d; }

.log-list {
	list-style: none;
	display: grid;
	gap: 5px;
	max-height: 168px;
	overflow-y: auto;
}

.log-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	font-size: 12px;
	color: var(--muted);
	border-left: 2px solid var(--gold);
	padding: 3px 0 3px 8px;
	animation: logIn .28s ease-out;
}

@keyframes logIn {
	from { opacity: 0; transform: translateX(-6px); }
	to { opacity: 1; transform: translateX(0); }
}

.log-took { font-family: var(--display); font-size: 14px; color: var(--gold-hi); }
.log-mult { font-size: 11px; color: var(--faint); }
.log-empty { font-size: 12px; color: var(--faint); font-style: italic; }

/* ======================= theory ======================= */
.theory {
	max-width: 1000px;
	margin: 0 auto;
	padding: 56px 24px 0;
	position: relative;
	z-index: 2;
}

.landmarks {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 22px;
}

.landmark {
	border: 1px solid var(--line);
	border-radius: 13px;
	background: var(--glass);
	padding: 18px 18px 20px;
}

.landmark.is-key { border-color: rgba(201, 164, 91, .42); }

.landmark-cap {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--faint);
}

.landmark-num {
	display: block;
	font-size: 42px;
	line-height: 1.1;
	color: var(--purple-hi);
	margin: 4px 0 8px;
}

.landmark.is-key .landmark-num { color: var(--gold-hi); }

.landmark-body { font-size: 13px; color: var(--muted); line-height: 1.5; }
.landmark-body strong { color: var(--text); }
.landmark-body em { font-style: normal; color: var(--text); }

.curve-panel { padding: 18px 18px 12px; }

.curve-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
}

.curve-title {
	font-family: var(--display);
	font-size: 18px;
	font-weight: 400;
}

.curve-sub { font-size: 12px; color: var(--faint); }

.curve-holder svg { display: block; width: 100%; height: auto; }

.curve-grid { stroke: rgba(143, 85, 223, .16); stroke-width: 1; }
.curve-axis { stroke: rgba(143, 85, 223, .38); stroke-width: 1; }
.curve-fill { fill: rgba(143, 85, 223, .16); }
.curve-line { fill: none; stroke: var(--purple-hi); stroke-width: 2.5; stroke-linejoin: round; }
.curve-tick { font-family: 'Alagard', serif; font-size: 12px; fill: var(--faint); }
.curve-mark { stroke: rgba(201, 164, 91, .55); stroke-width: 1; stroke-dasharray: 3 4; }
.curve-mark-label { font-family: 'Alagard', serif; font-size: 12px; fill: var(--gold); }
.curve-you { stroke: var(--gold-hi); stroke-width: 1.5; }
.curve-you-dot { fill: var(--gold-hi); }
.curve-you-label { font-family: 'Alagard', serif; font-size: 13px; fill: var(--gold-hi); }

.fallacy {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	border: 1px solid var(--line);
	border-left: 3px solid var(--purple);
	border-radius: 12px;
	background: rgba(21, 16, 34, .5);
	padding: 16px 18px;
	margin-top: 22px;
	transition: border-color .3s, background .3s;
}

.fallacy.is-hot {
	border-color: rgba(224, 122, 109, .5);
	border-left-color: #e07a6d;
	background: rgba(60, 14, 20, .24);
}

.fallacy-rune {
	flex: none;
	width: 10px;
	height: 10px;
	margin-top: 7px;
	border-radius: 50%;
	background: var(--purple-hi);
	box-shadow: 0 0 12px rgba(178, 140, 242, .8);
}

.fallacy.is-hot .fallacy-rune { background: #e07a6d; box-shadow: 0 0 12px rgba(224, 122, 109, .8); }

.fallacy-title {
	font-family: var(--display);
	font-size: 18px;
	font-weight: 400;
	margin-bottom: 4px;
}

.fallacy p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

/* ======================= hunters ======================= */
.hunters {
	max-width: 1000px;
	margin: 0 auto;
	padding: 56px 24px 0;
	position: relative;
	z-index: 2;
}

.hunters-panel { padding: 18px 18px 20px; }

.hunters-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.hunters-note { font-size: 12px; color: var(--faint); flex: 1 1 220px; }

.hist-holder { min-height: 40px; }
.hist-holder svg { display: block; width: 100%; height: auto; }

.hist-bar { fill: rgba(143, 85, 223, .55); }
.hist-bar.is-tail { fill: rgba(224, 122, 109, .55); }
.hist-bar.is-early { fill: rgba(201, 164, 91, .6); }
.hist-count { font-family: 'Alagard', serif; font-size: 12px; fill: var(--text); }
.hist-label { font-family: 'Alagard', serif; font-size: 12px; fill: var(--faint); }
.hist-base { stroke: rgba(143, 85, 223, .38); stroke-width: 1; }

.hunters-take {
	font-size: 13.5px;
	color: var(--muted);
	line-height: 1.55;
	margin-top: 12px;
	min-height: 1.5em;
}

.hunters-take strong { color: var(--text); }
.hunters-take .num { color: var(--gold-hi); font-size: 15px; }

/* ======================= closer ======================= */
.closer {
	max-width: 700px;
	margin: 0 auto;
	padding: 56px 24px 20px;
	text-align: center;
	position: relative;
	z-index: 2;
}

.closer p { font-size: 13.5px; color: var(--faint); line-height: 1.6; }

.closer code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12.5px;
	color: var(--muted);
}

.closer .quiet-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px;
	margin-top: 18px;
}

/* ======================= responsive ======================= */
@media (max-width: 1000px) {
	.altar { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
	.stage-wrap { order: -1; }
	.landmarks { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
	.odds-hero { padding: 28px 20px 20px; }
	.altar { padding: 0 16px 12px; }
	.theory, .hunters { padding: 44px 16px 0; }
	.coin { width: 168px; height: 168px; }
	.coin-stage { height: 232px; }
	.rate-input { font-size: 40px; }
	.tally-num { font-size: 26px; }
	.landmark-num { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
	.stars { animation: none; }
	.log-list li { animation: none; }
	.beam { transition: none; }
}
