.worm-panel {
  position: relative;
  width: min(46rem, calc(100% - 2rem));
  margin: clamp(2rem, 10vh, 6rem) auto 2rem;
  padding: clamp(1.25rem, 5vw, 2.75rem);
  border: 1px solid #ffadbf65;
  border-radius: 1.5rem;
  background: #3d1538;
  color: #fff4f8;
  box-shadow: 0 1.25rem 3rem #260a2860;
}
.worm-panel h1 {
  color: #f5ff72;
  font: 600 clamp(2rem, 7vw, 3.4rem)/1.1 'Worm Rush Tilt', sans-serif;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}
.worm-panel p { color: #f5dce9; }
.worm-mode-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.worm-panel button { background: #f5ff72; color: #3d1538; }
.worm-mode-actions button + button { background: #fed6e5; }
.worm-test-heading { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1rem; }
#speedClock { font: 700 1.25rem/1 system-ui; font-variant-numeric: tabular-nums; }
.worm-back { color: #fff4f8; font-weight: 700; }
.worm-race-back { position: fixed; z-index: 10; bottom: 1rem; left: 1rem; padding: .65rem .85rem; background: #3d1538; border-radius: .6rem; }
.worm-panel .worm-passage {
  min-height: 6rem;
  padding: 1rem;
  border-radius: .75rem;
  background: #290f29;
  font: 1.1rem/1.65 ui-monospace, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.worm-passage .typed-correct { color: #f5ff72; }
.worm-passage .typed-error { color: #ff97ae; text-decoration: underline; }
.worm-passage .current-char { background: #f5dce9; color: #290f29; border-radius: .15rem; }
#speedInput { width: 100%; border: 1px solid #f5dce9; border-radius: .65rem; resize: vertical; padding: .75rem; font: 1rem/1.5 ui-monospace, monospace; background: #fff4f8; color: #290f29; }
#speedResult:not(:empty) { margin: 1rem 0; color: #f5ff72; font-size: 1.25rem; font-weight: 700; }

.worm-speed-hud {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-variant-numeric: tabular-nums;
}
.worm-speed-hud strong { color: #f5ff72; }
.worm-speed-lane {
  padding: .35rem 0;
  border-block: 1px solid #ffadbf65;
  margin-top: .6rem;
  border-radius: .9rem;
  background: #290f29;
}
.worm-speed-marker {
  width: calc(100% - 3.5rem);
  margin-left: .25rem;
}
.worm-speed-body {
  position: relative;
  left: var(--worm-progress, 0%);
  display: flex;
  align-items: center;
  width: max-content;
  height: 1.25rem;
  filter: drop-shadow(0 .18rem .08rem #120819);
  transition: left .12s linear;
  transform-origin: right center;
}
.worm-speed-body i {
  display: block;
  width: .64rem;
  height: .78rem;
  margin-right: -.16rem;
  border: 1px solid #aaac1d;
  border-radius: 50%;
  background: linear-gradient(#fbffb2, #e9f547 60%, #adb722);
}
.worm-speed-body i:first-child { height: .5rem; }
.worm-speed-body i:nth-child(2) { height: .63rem; }
.worm-speed-body i:last-child {
  position: relative;
  width: .96rem;
  height: 1.05rem;
}
.worm-speed-body i:last-child::after {
  content: "";
  position: absolute;
  top: .22rem;
  right: .09rem;
  width: .26rem;
  height: .22rem;
  border-radius: 50%;
  background: #332b1d;
  box-shadow: 0 0 0 .09rem #fffdeb;
}
@media (prefers-reduced-motion: reduce) {
  .worm-speed-body { transition: none; }
}

.worm-menu {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: auto;
  padding: clamp(1rem, 4vw, 3rem);
  background: #53213f url("/worm-rush/art/menu-woodland.webp") center / cover no-repeat;
}
.worm-menu .worm-menu-card {
  width: min(100%, 38rem);
  margin: auto;
  padding: clamp(1.6rem, 5vw, 3.1rem);
  text-align: center;
  background: #30112ae8;
  border-color: #faa8bf90;
  box-shadow: 0 1.25rem 3rem #21071999;
}
.worm-menu .worm-mode-actions { justify-content: center; }
.worm-menu .worm-mode-actions button {
  min-height: 3rem;
  font: 700 1rem/1.25 system-ui, sans-serif;
}
@media (max-width: 440px) {
  .worm-menu { background-position: right center; }
  .worm-menu .worm-mode-actions {
    flex-direction: column;
    width: min(100%, 15rem);
    margin-inline: auto;
  }
}
