/*
 * The pay gauge (includes/pieces/gauge.php): a turned-brass bezel screwed to the board-black panel,
 * a cream enamel dial set back under it, the needle and its brass hub standing off the dial (each on
 * its own depth, so they shift against the dial as you move over it) with a soft shadow cast below.
 * Beside it the board: the pay, and flaps for the monthly amount at 62, full retirement age and 70.
 */

.gauge__top { display: grid; justify-items: center; gap: 20px; }
.gauge__dial { position: relative; width: min(100%, 320px); aspect-ratio: 1; perspective: 760px; perspective-origin: var(--px, 50%) var(--py, 42%); transition: perspective-origin .5s ease-out; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.gauge__dial.is-held { cursor: grabbing; transition: none; }
.gauge__dial::before { content: ""; position: absolute; inset: 1.5%; border-radius: 50%; box-shadow: 0 22px 34px -6px rgba(0, 0, 0, .8), 0 3px 6px rgba(0, 0, 0, .7); }
.gauge__stack { position: absolute; inset: 0; transform-style: preserve-3d; }

/* The dial: enamel, set back under the bezel (its rim in shadow). */
.gauge__face { position: absolute; inset: 7.5%; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #fdfaf1 0%, #f1ead8 55%, #ddd2b8 100%); box-shadow: inset 0 10px 18px rgba(0, 0, 0, .42), inset 0 -3px 8px rgba(255, 255, 255, .5); }
.gauge__svg { position: absolute; inset: -9.4%; width: 118.8%; height: 118.8%; max-width: none; overflow: visible; }
.gauge__red { fill: none; stroke: #c0271f; stroke-width: 12; }
.gauge__minor { fill: none; stroke: #2b2925; stroke-width: 1.8; }
.gauge__ticks { fill: none; stroke: #15171a; stroke-width: 4; }
.gauge__nums text { font: 700 27px var(--board-font); fill: #15171a; text-anchor: middle; }
.gauge__face-k { font: 700 23px var(--board-font); letter-spacing: .08em; fill: #3a3730; text-anchor: middle; }
.gauge__face-v { font: 700 48px var(--board-font); fill: #15171a; text-anchor: middle; font-variant-numeric: tabular-nums; }
.gauge__pin { fill: #7d6125; }

/* The needle, its shadow and the hub, each standing off the dial. */
.gauge__needle, .gauge__shadow { position: absolute; left: 47%; top: 10.5%; width: 6%; height: 48%; transform-origin: 50% 82.29%; pointer-events: none; }
.gauge__needle-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gauge__needle { transform: translateZ(22px) rotate(var(--a)); }
.gauge__needle path { fill: #15171a; }
.gauge__needle path:first-child { fill: #b51f18; }
.gauge__shadow { transform: translateZ(1px) translateY(5%) rotate(var(--a)); filter: blur(3px); opacity: .42; }
.gauge__shadow path { fill: #000; }
.gauge__hub { position: absolute; left: 45%; top: 45%; width: 10%; height: 10%; border-radius: 50%; transform: translateZ(28px);
	background: radial-gradient(circle at 36% 30%, #fff4cc 0, #e3b85a 32%, #9a6c1b 72%, #5e400c 100%); box-shadow: 0 4px 6px rgba(0, 0, 0, .55); }

/* The bezel: a ring of turned brass, proud of the dial, held by four screws. */
.gauge__bezel { position: absolute; inset: 0; border-radius: 50%; transform: translateZ(12px); pointer-events: none;
	background: radial-gradient(circle closest-side, transparent 85%, rgba(0, 0, 0, .55) 85.5%, transparent 88%, rgba(255, 246, 214, .7) 98%, rgba(0, 0, 0, .5) 100%),
		conic-gradient(from 200deg, #f7e6ae, #b98a33 12%, #f0d48a 24%, #8d6219 38%, #e8c675 52%, #a5761f 66%, #f4dd9c 80%, #9b6d1d 92%, #f7e6ae);
	-webkit-mask: radial-gradient(circle closest-side, transparent 84.5%, #000 85%); mask: radial-gradient(circle closest-side, transparent 84.5%, #000 85%); }
.gauge__bezel i { position: absolute; width: 4.4%; height: 4.4%; margin: -2.2% 0 0 -2.2%; border-radius: 50%; background: linear-gradient(135deg, transparent 42%, #4a330a 42% 58%, transparent 58%), radial-gradient(circle at 35% 30%, #fff1c2, #c4943b 55%, #6b4a10); box-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.gauge__bezel i:nth-child(1) { left: 17.3%; top: 17.3%; }
.gauge__bezel i:nth-child(2) { left: 82.7%; top: 17.3%; }
.gauge__bezel i:nth-child(3) { left: 17.3%; top: 82.7%; }
.gauge__bezel i:nth-child(4) { left: 82.7%; top: 82.7%; }

/* The board beside it. */
.gauge__read { width: 100%; min-width: 0; }
.piece p.gauge__pay-k { margin: 0; font: 700 .95rem/1.2 var(--board-font); letter-spacing: .14em; text-transform: uppercase; color: #c9c4ba; }
.piece p.gauge__pay { margin: 2px 0 12px; font: 700 3.2rem/1 var(--board-font); letter-spacing: .01em; color: var(--flap-ink); font-variant-numeric: tabular-nums; }
.gauge__board { display: grid; gap: 6px; margin: 0; padding: 8px; border-radius: 10px; background: #0a0b0d; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7), 0 1px 0 #2b2f35; }
.gauge__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 6px 8px; border-radius: 6px; }
.gauge__row.is-full { background: rgba(245, 194, 27, .1); box-shadow: inset 4px 0 0 var(--signal); }
.gauge__row dt { font: 700 1.1rem/1.2 var(--board-font); letter-spacing: .03em; color: var(--flap-ink); }
.gauge__row dd { display: flex; align-items: center; gap: 8px; margin: 0; }
.gauge__mo { font-size: .95rem; color: #c9c4ba; white-space: nowrap; }

.piece p.gauge__say { margin: 18px 0 0; font-size: 1.08rem; line-height: 1.5; color: var(--flap-ink); }
.piece p.gauge__key { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; font-size: .95rem; line-height: 1.45; color: #cfcac0; }
.piece p.gauge__key i { flex: 0 0 auto; width: 22px; height: 8px; margin-top: .45em; border-radius: 2px; background: #c0271f; box-shadow: 0 0 0 1px #000; }

/* The pay rail: a slider whose stretch past the taxable maximum is marked red. */
.js .gauge__ctrl.needs-js { display: block; }
.gauge__ctrl { margin-top: 16px; }
.gauge__drag { display: block; font: 700 .95rem/1.2 var(--board-font); letter-spacing: .1em; text-transform: uppercase; color: #c9c4ba; }
.gauge__rail { position: relative; padding-top: 30px; }
.gauge__cap { position: absolute; top: 4px; left: calc(14px + (100% - 28px) * var(--cap)); transform: translateX(-100%); padding-right: 8px; font-size: .95rem; line-height: 1.2; color: #ff9b8f; white-space: nowrap; }
.gauge__cap b { font: 700 1.05rem/1 var(--board-font); letter-spacing: .02em; }
.gauge__cap::after { content: ""; position: absolute; right: -1px; top: 0; height: 48px; width: 2px; background: #e0483f; }
.gauge__rail::after { content: ""; position: absolute; left: calc(14px + (100% - 28px) * var(--cap)); right: 14px; bottom: 6px; height: 4px; border-radius: 2px; background: repeating-linear-gradient(135deg, #e0483f 0 4px, transparent 4px 7px); }
.piece p.gauge__ends { display: flex; justify-content: space-between; margin: 0; font: 700 .95rem/1.4 var(--board-font); letter-spacing: .04em; color: #c9c4ba; }

@media (min-width: 700px) {
	.gauge__top { grid-template-columns: 330px minmax(0, 1fr); align-items: center; gap: 30px; }
	.gauge__dial { width: 330px; }
}
@media (prefers-reduced-motion: reduce) {
	.gauge__dial { transition: none; }
}
