/* WillowinWorlds CSS: Scooter Mechanic Simulator page (games/scooter-mechanic-simulator.html). Loaded after upcoming-game.css.
   Signature element: a workshop diagnostic under the capture. A gauge needle sweeps into the green zone, a wrench turns a nut
   with a few sparks, and a repair card slides in and ticks off its first job. The capture itself gets warm garage lighting.
   Without motion the dock is a finished still: needle in the green, card in place, first job ticked. */

body[data-game="scooter-mechanic-simulator"] {
  --sm-yellow: #FFD031;
  --sm-ink: #EDF1F6;
  --sm-dock-1: #272b31;
  --sm-dock-2: #171a1e;
  --sm-steel-1: #e6e9ed;
  --sm-steel-2: #8d949c;
  --sm-ok: #62d67d;
  --sm-hot: #ff6a55;
}

/* Hero: the capture in a bay with garage lighting, a service dock under it */
.sm-hero-media {
  container-type: inline-size;
  width: 100%;
  max-width: 600px;
  justify-self: end;
}

.sm-bay {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #3b4f6c;
}

.ug-hero-media .sm-capture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: 36% 80%;
}

.sm-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sm-fx > span {
  position: absolute;
}

.sm-glow {
  inset: 0;
  background:
    radial-gradient(ellipse 55% 62% at 22% 0%, rgb(255 184 90 / 0.3), transparent 72%),
    linear-gradient(180deg, rgb(255 170 60 / 0.03), rgb(255 150 50 / 0.12)),
    radial-gradient(ellipse 85% 85% at 50% 50%, transparent 58%, rgb(24 12 0 / 0.3) 100%);
}

/* A work lamp that sways a little */
.sm-lamp {
  left: 4%;
  top: -6%;
  width: 48%;
  height: 100%;
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgb(255 208 126 / 0.4), rgb(255 190 90 / 0.1) 55%, transparent 92%);
  transform-origin: 50% 0;
  rotate: -3deg;
}

/* The podium gets a scan ring */
.sm-ring {
  left: 22.5%;
  top: 84%;
  width: 27%;
  height: 15%;
  border: max(2px, 0.5cqw) solid var(--sm-yellow);
  border-radius: 50%;
  opacity: 0.55;
}

.sm-scan {
  left: 0;
  right: 0;
  top: 0;
  height: 16%;
  background: linear-gradient(180deg, transparent, rgb(255 208 49 / 0.2) 78%, rgb(255 226 140 / 0.55) 99%, transparent);
  opacity: 0;
}

/* The dock: gauge, wrench and nut, repair card. Fixed dark palette in both themes, so its text always has contrast. */
.sm-dock {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  padding: 24px 16px 16px;
  color: var(--sm-ink);
  background: linear-gradient(180deg, var(--sm-dock-1), var(--sm-dock-2));
}

.sm-dock::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: repeating-linear-gradient(135deg, var(--sm-yellow) 0 9px, #1a1d22 9px 18px);
}

.sm-dock svg {
  display: block;
  overflow: visible;
}

.sm-gauge,
.sm-tool {
  position: relative;
}

.sm-gauge-face { fill: #101316; stroke: #444a52; stroke-width: 2; }
.sm-gauge-ticks { fill: none; stroke: #8b929b; stroke-width: 3; stroke-dasharray: 0.5 2.2; }
.sm-gauge-track,
.sm-zone { fill: none; stroke-width: 7; stroke-linecap: butt; }
.sm-gauge-track { stroke: #2a2f35; }
.sm-zone--low { stroke: #ffd031; stroke-dasharray: 55 100; }
.sm-zone--ok { stroke: var(--sm-ok); stroke-dasharray: 0 55 23 100; }
.sm-zone--hot { stroke: var(--sm-hot); stroke-dasharray: 0 78 22 100; }
.sm-needle { transform-origin: 60px 62px; rotate: 44deg; }
.sm-needle path { fill: #ffffff; }
.sm-hub { fill: #23272d; stroke: var(--sm-yellow); stroke-width: 2.4; }

.sm-steel { fill: url("#smSteel"); stroke: #565d65; stroke-width: 1.4; }
.sm-shine { fill: none; stroke: rgb(255 255 255 / 0.7); stroke-width: 2; stroke-linecap: round; }
.sm-hex { fill: url("#smBrass"); stroke: #8a6b00; stroke-width: 1.6; }
.sm-hole { fill: #14171b; stroke: #3a4048; stroke-width: 1; }
.sm-wrench { transform-origin: 50px 64px; rotate: -10deg; }
.sm-nut { transform-origin: 50px 64px; }

.sm-tool::after {
  content: "";
  position: absolute;
  left: 33.3%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: #fff1a8;
  box-shadow:
    0 -30px 0 0 #fff1a8, 22px -22px 0 0 #ffd031, 32px 0 0 0 #fff1a8, 22px 22px 0 0 #ff9b3d,
    0 32px 0 0 #fff1a8, -22px 22px 0 0 #ffd031, -32px 0 0 0 #fff1a8, -22px -22px 0 0 #ff9b3d;
  opacity: 0;
}

.sm-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #4a5058;
  border-inline-start: 4px solid var(--sm-yellow);
  border-radius: 12px;
  background: #1d2025;
  box-shadow: 0 10px 22px rgb(0 0 0 / 0.35);
}

.sm-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sm-card-head span {
  color: var(--sm-yellow);
}

.sm-card-head b {
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  color: #1a1d22;
  background: var(--sm-yellow);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.sm-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sm-job {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sm-ink);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.2;
}

.sm-job i {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid #7b828b;
  border-radius: 5px;
}

.sm-job--done i {
  border-color: var(--sm-yellow);
}

.sm-job--done i::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 5px;
  background: var(--sm-yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l3 3 5.8-6.4' fill='none' stroke='%231a1d22' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 76% no-repeat;
}

@container (max-width: 470px) {
  .sm-dock {
    grid-template-columns: auto auto;
    justify-content: center;
  }

  .sm-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .sm-hero-media {
    justify-self: center;
    max-width: 560px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ug-hero-media .sm-capture { animation: smKen 22s ease-in-out infinite alternate; }
  .sm-ring { animation: smRing 4.8s ease-out infinite; }
  .sm-scan { animation: smScan 8s ease-in-out infinite; }
  .sm-needle { animation: smNeedle 12s ease-in-out infinite; }
  .sm-wrench { animation: smWrench 4.8s ease-in-out infinite; }
  .sm-nut { animation: smNut 4.8s ease-in-out infinite; }
  .sm-tool::after { animation: smSparks 4.8s ease-out infinite; }
  .sm-card { animation: smCard 12s ease-in-out infinite; }
  .sm-job--done i::after { animation: smTick 12s ease-in-out infinite; }
}

@keyframes smKen {
  from { scale: 1; translate: 0 0; }
  to { scale: 1.07; translate: -0.8cqw -0.6cqw; }
}

@keyframes smRing {
  0% { opacity: 0.85; scale: 0.94; }
  70%, 100% { opacity: 0; scale: 1.28; }
}

@keyframes smScan {
  0%, 8% { opacity: 0; translate: 0 -100%; }
  12% { opacity: 1; }
  50% { opacity: 1; translate: 0 580%; }
  55%, 100% { opacity: 0; translate: 0 580%; }
}

@keyframes smNeedle {
  0%, 4% { rotate: -135deg; }
  24% { rotate: 116deg; }
  27% { rotate: 108deg; }
  36% { rotate: 28deg; }
  41% { rotate: 52deg; }
  45%, 88% { rotate: 44deg; }
  94%, 100% { rotate: -135deg; }
}

@keyframes smWrench {
  0%, 6% { rotate: -35deg; }
  38% { rotate: 15deg; }
  46% { rotate: 13deg; }
  80%, 100% { rotate: -35deg; }
}

@keyframes smNut {
  0%, 6% { rotate: 0deg; }
  38% { rotate: 50deg; }
  42%, 100% { rotate: 60deg; }
}

@keyframes smSparks {
  0%, 36% { opacity: 0; scale: 0.4; }
  40% { opacity: 1; scale: 0.8; }
  52%, 100% { opacity: 0; scale: 1.4; }
}

@keyframes smCard {
  0%, 2% { translate: 115% 0; }
  9% { translate: -2% 0; }
  11%, 86% { translate: 0 0; }
  93%, 100% { translate: 115% 0; }
}

@keyframes smTick {
  0%, 56% { scale: 0; }
  60% { scale: 1.25; }
  63%, 92% { scale: 1; }
  93%, 100% { scale: 0; }
}

/* ---- Sections: workshop plates. Brushed steel with rivets, a repair-card clip on the steps, taped photos, a hazard sign for the call to action.
   Section wrappers draw no box (a steel rail and a hazard underline on the heading), so the garage world shows between the plates.
   Hover and press use transitions, so a paused page still shows the final state. ---- */
body[data-game="scooter-mechanic-simulator"][data-theme="dark"] {
  --sm-plate: color-mix(in srgb, var(--ug-card-2) 95%, transparent);
  --sm-plate-2: color-mix(in srgb, var(--ug-card) 95%, transparent);
  --sm-brush: rgb(255 255 255 / 0.035);
  --sm-rv: #8f969e;
  --sm-rv-hi: #eef1f4;
  --sm-rv-lo: rgb(0 0 0 / 0.55);
  --sm-edge: rgb(255 255 255 / 0.1);
  --sm-edge-lo: rgb(0 0 0 / 0.32);
  --sm-rail: #5a5f66;
}

body[data-game="scooter-mechanic-simulator"][data-theme="light"] {
  --sm-plate: color-mix(in srgb, var(--ug-card-2) 96%, transparent);
  --sm-plate-2: color-mix(in srgb, var(--ug-card) 96%, transparent);
  --sm-brush: rgb(40 50 60 / 0.03);
  --sm-rv: #848c95;
  --sm-rv-hi: #ffffff;
  --sm-rv-lo: rgb(30 40 50 / 0.45);
  --sm-edge: rgb(255 255 255 / 0.9);
  --sm-edge-lo: rgb(30 40 50 / 0.18);
  --sm-rail: #9aa1a9;
}

body[data-game="scooter-mechanic-simulator"] {
  --sm-rivet-a: radial-gradient(circle at 10px 10px, var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.5px, var(--sm-rv-lo) 3px 3.4px, transparent 3.8px);
  --sm-rivet-b: radial-gradient(circle at calc(100% - 10px) 10px, var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.5px, var(--sm-rv-lo) 3px 3.4px, transparent 3.8px);
  --sm-rivet-c: radial-gradient(circle at 10px calc(100% - 10px), var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.5px, var(--sm-rv-lo) 3px 3.4px, transparent 3.8px);
  --sm-rivet-d: radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.5px, var(--sm-rv-lo) 3px 3.4px, transparent 3.8px);
  --sm-hazard: repeating-linear-gradient(135deg, var(--sm-yellow) 0 8px, #1a1d22 8px 16px);
}

/* The plate: brushed steel, four rivets, a lit top edge and a shaded bottom edge */
body[data-game="scooter-mechanic-simulator"] :is(.detail-card, .update-list li, .ug-next li, .lab-related-link) {
  border: 1px solid color-mix(in srgb, var(--ug-line) 88%, transparent);
  border-radius: 7px;
  background:
    var(--sm-rivet-a), var(--sm-rivet-b), var(--sm-rivet-c), var(--sm-rivet-d),
    repeating-linear-gradient(180deg, var(--sm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo), 0 8px 18px rgb(0 0 0 / 0.2);
}

.ug-steps li,
.ug-features .detail-card,
.ug-faq .detail-card,
.ug-next li,
.ug-facts .game-page-facts > div,
.ug-shot {
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

body[data-game="scooter-mechanic-simulator"] .btn:active {
  transform: translateY(1px) scale(0.98);
}

/* Section wrapper: no box, a steel rail with end rivets, and the heading on the world with a halo */
body[data-game="scooter-mechanic-simulator"] .game-page-section.soft-card {
  position: relative;
  padding-inline: 0;
  padding-top: clamp(30px, 4vw, 44px);
  border-color: transparent;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body[data-game="scooter-mechanic-simulator"] .game-page-section.soft-card:not(.ug-vote)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background:
    radial-gradient(circle at 5px 3px, var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.4px, transparent 2.8px),
    radial-gradient(circle at calc(100% - 5px) 3px, var(--sm-rv-hi) 0 0.8px, var(--sm-rv) 1.3px 2.4px, transparent 2.8px),
    linear-gradient(180deg, var(--sm-edge), var(--sm-rail) 30%, var(--sm-rail));
  box-shadow: 0 2px 0 var(--sm-edge-lo);
}

body[data-game="scooter-mechanic-simulator"] .game-page-section h2,
body[data-game="scooter-mechanic-simulator"] .lab-related-title {
  text-shadow: 0 0 20px color-mix(in srgb, var(--ug-bg) 92%, transparent), 0 0 6px color-mix(in srgb, var(--ug-bg) 78%, transparent);
}

body[data-game="scooter-mechanic-simulator"] .game-page-section h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 7px;
  margin-top: 12px;
  background: var(--sm-hazard);
  clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 7px 100%);
}

body[data-game="scooter-mechanic-simulator"] :is(.ug-lede, .ug-vote .ug-lede) {
  color: color-mix(in srgb, var(--ug-ink) 92%, var(--ug-muted));
  text-shadow: 0 0 12px color-mix(in srgb, var(--ug-bg) 88%, transparent);
}

/* Eyebrow: a stamped steel tag with a hex nut */
body[data-game="scooter-mechanic-simulator"] .eyebrow {
  border-radius: 4px;
  border-color: color-mix(in srgb, var(--sm-yellow) 42%, var(--ug-line));
  background: linear-gradient(180deg, var(--sm-plate), var(--sm-plate-2));
  box-shadow: inset 0 1px 0 var(--sm-edge), 0 2px 0 var(--sm-edge-lo);
}

body[data-game="scooter-mechanic-simulator"] .eyebrow::before {
  border-radius: 0;
  box-shadow: none;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

/* Hero notes: the status note is a plate with a corner of tape, the credit is a stamped label */
body[data-game="scooter-mechanic-simulator"] .ug-status-note {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--ug-line) 88%, transparent);
  border-inline-start-width: 1px;
  border-radius: 7px;
  background:
    var(--sm-rivet-c), var(--sm-rivet-d),
    repeating-linear-gradient(180deg, var(--sm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo);
}

body[data-game="scooter-mechanic-simulator"] .ug-status-note::before {
  content: "";
  position: absolute;
  top: -6px;
  left: -10px;
  width: 52px;
  height: 14px;
  background: var(--sm-hazard);
  opacity: 0.92;
  rotate: -36deg;
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 4px 100%);
}

body[data-game="scooter-mechanic-simulator"] .ug-collab {
  border: 2px solid var(--sm-yellow);
  border-radius: 5px;
  background: color-mix(in srgb, var(--ug-card) 90%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ug-card) 90%, transparent), inset 0 0 0 3px color-mix(in srgb, var(--sm-yellow) 55%, transparent);
  rotate: -0.8deg;
}

/* Facts: tool tags with two rivets and a tape tab. Six tags sit in two rows of three on wide screens. */
@media (min-width: 900px) {
  body[data-game="scooter-mechanic-simulator"] .ug-facts .game-page-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

body[data-game="scooter-mechanic-simulator"] .ug-facts .game-page-facts > div {
  position: relative;
  padding-top: 18px;
  border: 1px solid color-mix(in srgb, var(--ug-line) 88%, transparent);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo), 0 8px 18px rgb(0 0 0 / 0.2);
  background:
    var(--sm-rivet-a), var(--sm-rivet-b),
    repeating-linear-gradient(180deg, var(--sm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
}

.ug-facts .game-page-facts > div::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 20px);
  width: 40px;
  height: 5px;
  background: var(--sm-hazard);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 3px 100%);
  opacity: 0.9;
}

.ug-facts .game-page-facts > div:hover {
  transform: translateY(-2px);
  border-color: var(--ug-accent);
}

/* Steps: repair cards. A steel clip over the top edge, a hex nut at the corner that turns on hover or focus. */
.ug-steps li {
  position: relative;
  padding-top: 34px;
  padding-bottom: 28px;
}

.ug-steps li::before {
  content: "";
  position: absolute;
  top: -9px;
  left: calc(50% - 26px);
  width: 52px;
  height: 20px;
  border-radius: 5px 5px 3px 3px;
  background:
    radial-gradient(circle at 50% 50%, var(--sm-rv-lo) 0 3.5px, transparent 4px),
    linear-gradient(180deg, var(--sm-rv-hi), var(--sm-rv) 48%, color-mix(in srgb, var(--sm-rv) 70%, black));
  box-shadow: 0 3px 5px rgb(0 0 0 / 0.3);
}

.ug-steps li::after,
.ug-features .detail-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
  background:
    radial-gradient(circle, var(--ug-card-2) 0 24%, transparent 26%),
    linear-gradient(145deg, var(--sm-steel-1), var(--sm-steel-2));
  transition: rotate 0.5s var(--ease), scale 0.28s var(--ease);
}

.ug-steps li::after {
  right: 18px;
  bottom: 16px;
}

.ug-steps li:hover,
.ug-steps li:focus-within {
  transform: translateY(-4px);
  border-color: var(--ug-accent);
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo), 0 16px 32px var(--ug-shadow);
}

.ug-steps li:hover::after,
.ug-steps li:focus-within::after,
.ug-features .detail-card:hover::after {
  rotate: 60deg;
  scale: 1.1;
}

/* Features: spec plates with a bolt head in the corner */
.ug-features .detail-card {
  position: relative;
}

.ug-features .detail-card h3 {
  padding-right: 36px;
}

.ug-features .detail-card::after {
  top: 20px;
  right: 22px;
}

.ug-features .detail-card:hover,
.ug-faq .detail-card:hover {
  transform: translateY(-3px);
  border-color: var(--ug-accent);
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo), 0 14px 28px var(--ug-shadow);
}

/* FAQ: service tags. An eyelet at the top corner and a dashed tear line under the question. */
body[data-game="scooter-mechanic-simulator"] .ug-faq .detail-card {
  position: relative;
  background:
    repeating-linear-gradient(180deg, var(--sm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
}

.ug-faq .detail-card::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ug-bg) 0 3.5px, var(--sm-rv-lo) 4px 4.6px, var(--sm-rv) 5px 7px, var(--sm-rv-hi) 7.4px 8px, transparent 8.4px);
}

.ug-faq .detail-card h3 {
  margin-bottom: 12px;
  padding-right: 28px;
  padding-bottom: 12px;
  border-bottom: 1px dashed color-mix(in srgb, var(--ug-muted) 55%, transparent);
}

/* Next: a job list. A checkbox that is not ticked yet, like the open jobs on a repair card. */
.ug-next li {
  padding-left: 52px;
}

.ug-next li::before {
  top: 1rem;
  left: 22px;
  width: 17px;
  height: 17px;
  border: 2px solid var(--sm-yellow);
  border-radius: 4px;
  background: color-mix(in srgb, var(--sm-yellow) 10%, transparent);
  transform: none;
}

.ug-next li:hover {
  transform: translateX(3px);
  border-color: var(--ug-accent);
}

/* Gallery: photos taped to the pegboard */
.ug-shot {
  position: relative;
  overflow: visible;
  padding: 8px 8px 0;
  border: 1px solid color-mix(in srgb, var(--ug-line) 88%, transparent);
  border-radius: 4px;
  background: linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
  box-shadow: inset 0 1px 0 var(--sm-edge), 0 10px 20px rgb(0 0 0 / 0.26);
  rotate: -0.6deg;
}

.ug-shot:nth-child(even) {
  rotate: 0.5deg;
}

.ug-shot::before {
  content: "";
  position: absolute;
  top: -10px;
  left: calc(50% - 36px);
  z-index: 1;
  width: 72px;
  height: 20px;
  background: repeating-linear-gradient(135deg, rgb(255 208 49 / 0.86) 0 8px, rgb(30 33 38 / 0.86) 8px 16px);
  clip-path: polygon(0 0, 100% 0, calc(100% - 3px) 100%, 3px 100%);
  rotate: 2.5deg;
}

.ug-shot img {
  border-radius: 2px;
  transition: transform 0.4s var(--ease);
}

.ug-shot:hover {
  transform: translateY(-3px);
  rotate: 0deg;
  border-color: var(--ug-accent);
}

.ug-shot:hover img {
  transform: scale(1.03);
}

.ug-shot {
  transition: transform 0.28s var(--ease), rotate 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.ug-shot figcaption {
  padding-inline: 4px;
}

/* Vote: a closed plate with a hazard sign bar on top; tape crawls under it, very slowly ("work in progress") */
body[data-game="scooter-mechanic-simulator"] .game-page-section.ug-vote {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 5vw, 52px) clamp(24px, 4vw, 38px) calc(clamp(24px, 4vw, 38px) + 12px);
  border: 1px solid color-mix(in srgb, var(--ug-line) 88%, transparent);
  border-radius: 7px;
  background:
    var(--sm-rivet-c), var(--sm-rivet-d),
    repeating-linear-gradient(180deg, var(--sm-brush) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, var(--sm-plate), var(--sm-plate-2));
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -2px 0 var(--sm-edge-lo), 0 14px 30px rgb(0 0 0 / 0.26);
}

.ug-vote::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--sm-hazard);
}

.ug-vote::after {
  content: "";
  position: absolute;
  left: -60px;
  right: -60px;
  bottom: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--sm-yellow) 0 16px, #1a1d22 16px 32px);
  transform: skewX(-35deg);
}

body[data-game="scooter-mechanic-simulator"] .lab-related-all {
  background: var(--sm-plate);
}

/* Buttons: pressed-metal, a lit top edge and a shaded base */
body[data-game="scooter-mechanic-simulator"] .btn,
body[data-game="scooter-mechanic-simulator"].game-detail-page .btn:focus-visible {
  border-radius: 8px;
}

body[data-game="scooter-mechanic-simulator"] .btn-primary {
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 0.34), inset 0 -4px 0 rgb(0 0 0 / 0.22), 0 10px 22px rgb(255 208 49 / 0.22);
}

body[data-game="scooter-mechanic-simulator"] .btn-ghost {
  background: var(--sm-plate);
  box-shadow: inset 0 1px 0 var(--sm-edge), inset 0 -3px 0 var(--sm-edge-lo);
}

/* Scroll reveal for the steps: movement only, so the text stays fully readable while it settles. */
@media (prefers-reduced-motion: no-preference) {
  .ug-vote::after { animation: smTape 5.3s linear infinite; }

  @supports (animation-timeline: view()) {
    .ug-steps li {
      animation: smStepIn linear both;
      animation-timeline: view();
      animation-range: entry 4% entry 58%;
    }

    .ug-steps li:nth-child(2) { animation-range: entry 10% entry 64%; }
    .ug-steps li:nth-child(3) { animation-range: entry 16% entry 70%; }
  }
}

@keyframes smTape {
  from { translate: 0 0; }
  to { translate: -32px 0; }
}

@keyframes smStepIn {
  from { translate: 0 22px; }
  to { translate: 0 0; }
}

/* A paused page keeps everything at its resting pose */
body.animations-paused .ug-steps li {
  animation: none;
}

/* Hero copy sits directly on the world: a soft halo keeps it readable */
body[data-game="scooter-mechanic-simulator"] :is(.ug-hero-copy h1, .ug-tagline, .ug-hero-copy .hero-copy, .ug-genre) {
  text-shadow: 0 0 16px color-mix(in srgb, var(--ug-bg) 88%, transparent), 0 1px 3px color-mix(in srgb, var(--ug-bg) 60%, transparent);
}

/* ---- Page-wide world: the view out of the garage door. Fixed behind every section (z-index -1), back to front:
   dusk (or daylight) sky, the street from the capture, a swaying work lamp and warm glow pools, then one clock-driven group
   (a street with two scooters riding past, pegboard posts with hanging tools that swing, meshing gears), a text scrim,
   slow dust and an occasional weld spark.
   One registered number (--smt, 0 to 1 over 60 s) drives every continuous motion in the clock group, so wheels, gears, tools and
   scooters add a single infinite animation. Every motion uses a whole number of cycles per loop, so the loop has no seam.
   Without motion the clock stays at 0: a finished still with the scooters parked on the street. ---- */
/* Background motion uses independent GPU transform/opacity animations per element (no inherited clock). */

/* main becomes the stacking context, so the world (z-index -1) paints above the page background and below the sections */
body[data-game="scooter-mechanic-simulator"] .game-detail-shell {
  position: relative;
  z-index: 0;
}

/* the related-worlds row sits outside main; lift it above main's stacking context so the world never covers it */
body[data-game="scooter-mechanic-simulator"] .lab-related {
  position: relative;
  z-index: 1;
}

body[data-game="scooter-mechanic-simulator"][data-theme="dark"] {
  --sm-sky: linear-gradient(180deg, #0a0e14 0%, #131b26 34%, #2b2630 62%, #5b3b25 100%);
  --sm-city: 0.5;
  --sm-road-1: #2a2c32;
  --sm-road-2: #14161a;
  --sm-dash: rgb(255 208 49 / 0.5);
  --sm-sil: #06070a;
  --sm-spoke: rgb(255 255 255 / 0.28);
  --sm-beam: rgb(255 214 130 / 0.5);
  --sm-peg-1: #33281d;
  --sm-peg-2: #17120e;
  --sm-peg-dot: rgb(255 235 200 / 0.12);
  --sm-post: rgb(255 208 49 / 0.55);
  --sm-tool: rgb(255 208 49 / 0.46);
  --sm-hook: #8d949c;
  --sm-gear: rgb(150 160 172 / 0.5);
  --sm-dustc: rgb(255 226 160 / 0.9);
  --sm-pool-a: 0.5;
  --sm-pool-b: 0.32;
  --sm-cone: 0.3;
}

body[data-game="scooter-mechanic-simulator"][data-theme="light"] {
  --sm-sky: linear-gradient(180deg, #b7d3ec 0%, #d6e6f3 38%, #efe4cd 78%, #f0d9ae 100%);
  --sm-city: 0.55;
  --sm-road-1: #a3a8af;
  --sm-road-2: #858b93;
  --sm-dash: rgb(255 255 255 / 0.7);
  --sm-sil: #23272d;
  --sm-spoke: rgb(255 255 255 / 0.5);
  --sm-beam: rgb(255 236 170 / 0.55);
  --sm-peg-1: #d9c7a6;
  --sm-peg-2: #bba983;
  --sm-peg-dot: rgb(60 45 25 / 0.22);
  --sm-post: rgb(168 118 12 / 0.65);
  --sm-tool: rgb(70 52 28 / 0.46);
  --sm-hook: #6b7480;
  --sm-gear: rgb(92 102 114 / 0.42);
  --sm-dustc: rgb(176 118 18 / 0.75);
  --sm-pool-a: 0.4;
  --sm-pool-b: 0.28;
  --sm-cone: 0.36;
}

.sm-world {
  --sm-road-h: clamp(92px, 19vh, 200px);
  --sm-g: clamp(1.3px, 0.19vw, 2.7px);
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  contain: layout paint;
  pointer-events: none;
}

.sm-world > * {
  position: absolute;
}

.sm-w-defs {
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.sm-w-sky {
  inset: 0;
  background: var(--sm-sky);
}

/* The street from the capture, soft behind the scooters */
.sm-w-city {
  left: 0;
  right: 0;
  bottom: calc(var(--sm-road-h) - 8px);
  height: 46vh;
  background: url("../assets/upcoming/scooter-mechanic-simulator/hero-1280.webp") center 41% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 40%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 40%, #000 86%, transparent 100%);
  opacity: calc(var(--sm-city) * 0.86);
}

.sm-w-pools {
  inset: 0;
  background:
    radial-gradient(ellipse 36% 42% at 14% 4%, rgb(255 176 70 / var(--sm-pool-a)), transparent 70%),
    radial-gradient(ellipse 30% 38% at 90% 46%, rgb(255 160 50 / var(--sm-pool-b)), transparent 72%),
    radial-gradient(ellipse 46% 30% at 34% 100%, rgb(255 150 40 / var(--sm-pool-b)), transparent 70%);
}

.sm-w-lamp {
  left: 3%;
  top: -6%;
  width: 40vw;
  height: 96vh;
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgb(255 208 126 / var(--sm-cone)), transparent 80%);
  transform-origin: 50% 0;
  rotate: -3deg;
}

/* ---- The clock group ---- */
.sm-w-clock {
  inset: 0;
}

.sm-w-clock > * {
  position: absolute;
}

/* The street: curb tape, asphalt, a lane line */
.sm-w-road {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sm-road-h);
  background: linear-gradient(180deg, var(--sm-road-1), var(--sm-road-2));
}

.sm-w-road::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: repeating-linear-gradient(135deg, #ffd031 0 10px, #1a1d22 10px 20px);
  opacity: 0.5;
}

.sm-w-lane {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--sm-dash) 0 46px, transparent 46px 92px);
}

/* Scooters: a rider on an electric scooter, seen from the side. The near one rolls right, the far one rolls left. */
.sm-w-sc {
  --w: clamp(116px, 13vw, 230px);
  position: absolute;
  left: 0;
  width: var(--w);
  height: auto;
  overflow: visible;
  color: var(--sm-sil);
  fill: currentColor;
}

.sm-w-sc--near {
  bottom: 7%;
  transform: translate3d(38vw, 0, 0);
}

.sm-w-sc--far {
  --w: clamp(70px, 7.6vw, 132px);
  bottom: 46%;
  opacity: 0.8;
  transform: translate3d(68vw, 0, 0) scaleX(-1);
}

.sm-w-sc :is(.sm-sc-stem, .sm-sc-leg, .sm-sc-torso, .sm-sc-arm, .sm-sc-fender) {
  fill: none;
  stroke: currentColor;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sm-sc-leg { stroke-width: 9; }
.sm-sc-torso { stroke-width: 14; }
.sm-sc-fender { stroke-width: 3; }
.sm-sc-deck { fill: var(--sc, #ff7a3d); }
.sm-sc-helmet { fill: var(--sc, #ff7a3d); }
.sm-sc-tail { fill: #ff5440; }
.sm-w-sc--far { --sc: #35c2c9; }
.sm-sc-beam { fill: url(#smBeam); opacity: 0.85; }

.sm-sc-wheel {
  transform-box: view-box;
}

.sm-sc-wheel circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 6;
}

.sm-sc-wheel path {
  fill: none;
  stroke: var(--sm-spoke);
  stroke-width: 2.4;
}

.sm-sc-wheel--r { transform-origin: 24px 82px; }
.sm-sc-wheel--f { transform-origin: 108px 82px; }

/* Pegboard posts at both sides: hanging tools that swing on their pegs, and gears that mesh */
.sm-w-side {
  top: 0;
  bottom: 0;
  width: clamp(60px, 8vw, 136px);
  background:
    radial-gradient(circle at 50% 50%, var(--sm-peg-dot) 0 1.7px, transparent 2.6px) 0 0 / 28px 28px,
    linear-gradient(180deg, var(--sm-peg-1), var(--sm-peg-2));
}

.sm-w-side--l {
  left: 0;
  box-shadow: inset -3px 0 0 var(--sm-post), 8px 0 22px rgb(0 0 0 / 0.28);
}

.sm-w-side--r {
  right: 0;
  box-shadow: inset 3px 0 0 var(--sm-post), -8px 0 22px rgb(0 0 0 / 0.28);
}

.sm-w-tool {
  --o: 0;
  position: absolute;
  left: 26%;
  width: 46%;
  color: var(--sm-tool);
  transform-origin: 50% 0;
}

.sm-w-tool::before {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sm-hook);
}

.sm-w-tool svg {
  display: block;
  width: 100%;
  height: auto;
  fill: currentColor;
}

.sm-w-side--l .sm-w-tool--1 { top: 5%; }
.sm-w-side--l .sm-w-tool--2 { top: 20%; --o: 0.27; }
.sm-w-side--l .sm-w-tool--3 { top: 36%; --o: 0.55; }
.sm-w-side--l .sm-w-tool--4 { top: 49%; --o: 0.8; }
.sm-w-side--r .sm-w-tool--1 { top: 36%; --o: 0.12; }
.sm-w-side--r .sm-w-tool--2 { top: 44%; --o: 0.4; }
.sm-w-side--r .sm-w-tool--3 { top: 58%; --o: 0.66; }
.sm-w-side--r .sm-w-tool--4 { top: 68%; --o: 0.93; }

.sm-gear {
  position: absolute;
  overflow: visible;
  fill: var(--sm-gear);
}

/* Left train: A (24 teeth) drives B (12, up and to the right) and C (6). Right train: D drives E. One tooth module is --sm-g. */
.sm-gear--a {
  width: calc(104 * var(--sm-g));
  height: calc(104 * var(--sm-g));
  left: calc(-52 * var(--sm-g) - 34px);
  top: calc(90% - 52 * var(--sm-g));
}

.sm-gear--b {
  width: calc(56 * var(--sm-g));
  height: calc(56 * var(--sm-g));
  left: calc(-34px - 28 * var(--sm-g) + 72 * var(--sm-g) * cos(-50deg));
  top: calc(90% - 28 * var(--sm-g) + 72 * var(--sm-g) * sin(-50deg));
  transform: rotate(15deg);
}

.sm-gear--c {
  width: calc(32 * var(--sm-g));
  height: calc(32 * var(--sm-g));
  left: calc(-34px - 16 * var(--sm-g) + 72 * var(--sm-g) * cos(-50deg) + 36 * var(--sm-g) * cos(-100deg));
  top: calc(90% - 16 * var(--sm-g) + 72 * var(--sm-g) * sin(-50deg) + 36 * var(--sm-g) * sin(-100deg));
}

.sm-gear--d {
  width: calc(104 * var(--sm-g));
  height: calc(104 * var(--sm-g));
  right: calc(-52 * var(--sm-g) - 34px);
  top: calc(16% - 52 * var(--sm-g));
}

.sm-gear--e {
  width: calc(56 * var(--sm-g));
  height: calc(56 * var(--sm-g));
  right: calc(-34px - 28 * var(--sm-g) - 72 * var(--sm-g) * cos(-130deg));
  top: calc(16% - 28 * var(--sm-g) + 72 * var(--sm-g) * sin(-130deg));
  transform: rotate(15deg);
}

.sm-w-veil {
  inset: 0;
}

.sm-w-dust::before,
.sm-w-spark::before {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}

.sm-w-dust::before {
  left: 8vw;
  top: 0;
  width: 3px;
  height: 3px;
  background: var(--sm-dustc);
  box-shadow:
    12vw 18vh 3px 0 var(--sm-dustc), 22vw 62vh 3px 0 var(--sm-dustc), 31vw 8vh 3px 0 var(--sm-dustc), 41vw 84vh 3px 0 var(--sm-dustc),
    49vw 36vh 3px 0 var(--sm-dustc), 58vw 120vh 3px 0 var(--sm-dustc), 66vw 52vh 3px 0 var(--sm-dustc), 74vw 98vh 3px 0 var(--sm-dustc),
    83vw 22vh 3px 0 var(--sm-dustc), 91vw 70vh 3px 0 var(--sm-dustc), 17vw 112vh 3px 0 var(--sm-dustc), 36vw 140vh 3px 0 var(--sm-dustc),
    62vw 6vh 3px 0 var(--sm-dustc), 95vw 132vh 3px 0 var(--sm-dustc);
}

/* A weld spark: invisible for most of a 16 s loop */
.sm-w-spark {
  left: 12vw;
  top: 62vh;
}

.sm-w-spark::before {
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  background: #fff1a8;
  box-shadow:
    0 -26px 0 0 #fff1a8, 18px -18px 0 0 #ffd031, 26px 0 0 0 #fff1a8, 18px 18px 0 0 #ff9b3d,
    0 26px 0 0 #fff1a8, -18px 18px 0 0 #ffd031, -26px 0 0 0 #fff1a8, -18px -18px 0 0 #ff9b3d,
    0 0 22px 8px rgb(255 160 60 / 0.5);
}

/* A scrim keeps the hero copy, which sits directly on the world, above 4.5:1 */
body[data-game="scooter-mechanic-simulator"][data-theme="dark"] .sm-w-veil {
  background:
    radial-gradient(ellipse 58% 74% at 27% 56%, rgb(10 11 14 / 0.8), rgb(10 11 14 / 0.52) 62%, transparent 100%),
    linear-gradient(180deg, rgb(8 10 14 / 0.3), transparent 26%);
}

body[data-game="scooter-mechanic-simulator"][data-theme="light"] .sm-w-veil {
  background:
    radial-gradient(ellipse 60% 82% at 27% 58%, rgb(244 247 251 / 0.74), rgb(242 246 250 / 0.5) 66%, transparent 100%),
    linear-gradient(180deg, rgb(244 247 251 / 0.3), transparent 26%);
}

@media (max-width: 920px) {
  body[data-game="scooter-mechanic-simulator"][data-theme="dark"] .sm-w-veil {
    background: linear-gradient(180deg, rgb(10 11 14 / 0.8), rgb(10 11 14 / 0.58) 70%, rgb(10 11 14 / 0.4));
  }

  body[data-game="scooter-mechanic-simulator"][data-theme="light"] .sm-w-veil {
    background: linear-gradient(180deg, rgb(244 247 251 / 0.9), rgb(242 246 250 / 0.7) 70%, rgb(238 242 248 / 0.4));
  }
}

/* Phones: one scooter, no far lane, no gears or tools, a narrow pegboard post, no spark and no lamp cone. */
@media (max-width: 760px) {
  .sm-w-city {
    background-image: url("../assets/upcoming/scooter-mechanic-simulator/hero-720.webp");
    filter: none;
  }

  .sm-w-sc--far,
  .sm-w-sc--far .sm-sc-wheel,
  .sm-gear,
  .sm-w-tool,
  .sm-w-spark,
  .sm-w-lamp {
    animation: none;
  }

  .sm-w-sc--far,
  .sm-gear,
  .sm-w-tool,
  .sm-w-spark,
  .sm-w-lamp {
    display: none;
  }

  .sm-w-side {
    width: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sm-w-sc--near { animation: smScooterNear 30s linear -10.2s infinite; }
  .sm-w-sc--far { animation: smScooterFar 60s linear -16.8s infinite; }
  .sm-sc-wheel { animation: smWheelSpin 2.14s linear infinite; }
  .sm-gear--a { animation: smGearCw 30s linear infinite; }
  .sm-gear--b { animation: smGearCcwOffset 15s linear infinite; }
  .sm-gear--c { animation: smGearCw 7.5s linear infinite; }
  .sm-gear--d { animation: smGearCcw 30s linear infinite; }
  .sm-gear--e { animation: smGearCwOffset 15s linear infinite; }
  .sm-w-side--l .sm-w-tool--1 { animation: smToolSwing 10s ease-in-out infinite alternate; }
  .sm-w-lamp { animation: smWorldLamp 12s ease-in-out infinite alternate; }
  .sm-w-dust::before { animation: smWorldDust 38s linear infinite; }
  .sm-w-spark::before { animation: smWorldSpark 16s ease-out infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-world,
  .sm-world *,
  .sm-world *::before,
  .sm-world *::after {
    animation: none !important;
  }
}

@keyframes smScooterNear {
  from { transform: translate3d(calc(-1 * var(--w)), 0, 0); }
  to { transform: translate3d(calc(100vw + var(--w)), 0, 0); }
}

@keyframes smScooterFar {
  from { transform: translate3d(calc(100vw + var(--w)), 0, 0) scaleX(-1); }
  to { transform: translate3d(calc(-1 * var(--w)), 0, 0) scaleX(-1); }
}

@keyframes smWheelSpin {
  to { transform: rotate(360deg); }
}

@keyframes smGearCw {
  to { transform: rotate(360deg); }
}

@keyframes smGearCcw {
  to { transform: rotate(-360deg); }
}

@keyframes smGearCwOffset {
  from { transform: rotate(15deg); }
  to { transform: rotate(375deg); }
}

@keyframes smGearCcwOffset {
  from { transform: rotate(15deg); }
  to { transform: rotate(-345deg); }
}

@keyframes smToolSwing {
  from { transform: rotate(-2.4deg); }
  to { transform: rotate(2.4deg); }
}

@keyframes smWorldLamp {
  from { rotate: -4.5deg; opacity: 0.8; }
  to { rotate: 3.5deg; opacity: 1; }
}

@keyframes smWorldDust {
  0% { opacity: 0; translate: 0 3vh; }
  12%, 84% { opacity: 0.9; }
  100% { opacity: 0; translate: 2vw -55vh; }
}

@keyframes smWorldSpark {
  0%, 88% { opacity: 0; scale: 0.3; }
  90% { opacity: 1; scale: 0.5; }
  98%, 100% { opacity: 0; scale: 1.5; }
}
