.bug-shield-panel[hidden],
.bug-shield-controls[hidden],
.bug-shield-target[hidden],
.bug-shield-controls button[hidden] {
  display: none;
}
.bug-shield-panel {
  position: absolute;
  z-index: 31;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--jaw-size) * 0.52);
  display: grid;
  gap: 5px;
  text-align: center;
  color: #fff9cf;
  pointer-events: none;
}
.bug-shield-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.bug-shield-heading strong {
  font-size: clamp(13px, 3.8cqw, 20px);
  line-height: 1.15;
}
#bugShieldTimer {
  font-size: clamp(13px, 3.5cqw, 18px);
  font-variant-numeric: tabular-nums;
}
.shield-bug {
  position: relative;
  display: inline-block;
  flex: 0 0 24px;
  width: 24px;
  height: 28px;
  border-radius: 45%;
  background: linear-gradient(#ffe84b 50%, #15171e 50%);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px #000;
}
.shield-bug::before,
.shield-bug::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  top: 5px;
  background: #fff;
  border: 1px solid #15171e;
}
.shield-bug::before {
  left: 3px;
}
.shield-bug::after {
  right: 3px;
}
.bug-shield-segments {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.bug-shield-segments span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #ffe56c;
  border-radius: 8px 8px 14px 14px;
  color: #ffe56c;
  background: #273645;
  font-weight: 800;
}
.bug-shield-segments .broken {
  background: #153e35;
  border-color: #9ff5ca;
  color: #9ff5ca;
}
.bug-shield-segments .partial {
  background: linear-gradient(90deg, #28725a 50%, #273645 50%);
  border-color: #9ff5ca;
}
#bugShieldStrokes {
  margin: 0;
  min-height: 1.5em;
  border-radius: 8px;
  padding: 2px 4px;
  font-size: clamp(12px, 3.5cqw, 16px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  color: #c1ffe3;
}
.bug-shield-panel.stroke-accepted #bugShieldStrokes {
  color: #effff6;
  background: #215943;
  box-shadow: 0 0 0 1px #9ff5ca;
}
.bug-shield-target.stroke-accepted {
  border-color: #9ff5ca;
  color: #c1ffe3;
  box-shadow: 0 0 0 4px #4ceb9b70;
}
#bugShieldCue {
  margin: 0;
  min-height: 3.9em;
  font-size: clamp(0.6875rem, 3cqw, 0.875rem);
  line-height: 1.3;
}
.bug-shield-controls {
  position: absolute;
  inset: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  align-content: center;
  gap: 6px;
}
.bug-shield-session .position-status > :not(.bug-shield-controls) {
  visibility: hidden;
}
.bug-shield-session .position-status {
  position: relative;
}
.bug-shield-controls button {
  padding: 4px 12px;
  min-height: 44px;
  color: #fff;
  border: 1px solid #8b8863;
  border-radius: 12px;
  background: #172e3e;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.bug-shield-controls button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.bug-shield-controls button:disabled {
  opacity: 0.55;
  cursor: wait;
}
#bugShieldPause {
  width: 44px;
  border-radius: 50%;
  padding: 0;
}
#bugShieldSkip {
  grid-column: 3;
}
#bugShieldContinue {
  grid-column: 1 / -1;
}
#bugShieldContinue {
  background: #ffe56c;
  color: #172734;
}
.bug-shield-target {
  position: absolute;
  z-index: 24;
  transform: translate(-50%, -50%) scale(var(--shield-scale, 1));
  width: 28px;
  height: 28px;
  border: 2px solid #fff079;
  border-radius: 50%;
  outline: 2px solid #15171e;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #fff079;
  font: bold 16px/1 sans-serif;
  text-shadow: 0 1px 3px #000;
}
.bug-shield-target span:first-child {
  margin-left: -14px;
}
.bug-shield-target span:last-child {
  margin-right: -14px;
}
.bug-shield-mouth .progress-core,
.bug-shield-mouth .technique-meter,
.bug-shield-mouth .mouse-hint,
.bug-shield-mouth .brushing-resume,
.bug-shield-mouth .brushing-pause-status,
.bug-shield-mouth #pauseBrushingButton,
.bug-shield-mouth #rewardLayer {
  visibility: hidden;
  pointer-events: none;
}
.bug-shield-mouth[data-shield-phase="outcome"] .smart-brush,
.bug-shield-mouth[data-shield-phase="outcome"] .bug-shield-target {
  visibility: hidden;
}
.bug-shield-demonstrating .smart-brush {
  animation: shield-demo 1s ease-in-out infinite;
}
.bug-shield-demonstrating .bug-shield-target span {
  animation: shield-arrow 1s steps(1) infinite;
}
.bug-shield-demonstrating .bug-shield-target span:last-child {
  animation-delay: 500ms;
}
.bug-shield-mouth[data-shield-phase="active"] .bug-shield-target span {
  opacity: 0.55;
}
.bug-shield-mouth[data-shield-phase="active"]
  .bug-shield-target
  span:first-child {
  opacity: calc(1 - var(--shield-beat, 0) * 0.5);
}
.bug-shield-mouth[data-shield-phase="active"]
  .bug-shield-target
  span:last-child {
  opacity: calc(0.5 + var(--shield-beat, 0) * 0.5);
}
.bug-shield-mouth[data-shield-cue="slow"] #bugShieldCue,
.bug-shield-mouth[data-shield-cue="target"] #bugShieldCue {
  color: #ffda8c;
}
@keyframes shield-demo {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: var(--shield-stroke, 12px) 0;
  }
}
@keyframes shield-arrow {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bug-shield-demonstrating .smart-brush,
  .bug-shield-demonstrating .bug-shield-target span {
    animation: none;
  }
}
