body { position: relative; }

.mascot-route {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: clip;
  pointer-events: none;
}

.mascot-runner {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--court-actor-w, var(--actor-w));
  height: var(--court-actor-h, var(--actor-h));
  transform: translate3d(var(--actor-x, 0px), var(--actor-y, 0px), 0) translate(-50%, -100%);
}

/* Keep the far edge of the table in front of the opponent's shoes. */
.mascot-runner:is([data-court="pickup"], [data-court="playing"], [data-court="leaving"]) .sv-mascot-art {
  clip-path: inset(0 0 13.5%);
}

.mascot-handle {
  position: absolute;
  z-index: 1;
  inset: 7% 19% 3%;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mascot-handle[data-pass-through] { pointer-events: none; }
.mascot-runner[data-interaction="held"] .mascot-handle { cursor: grabbing; }
.mascot-runner[data-interaction="seated"] .mascot-handle { cursor: pointer; }

.mascot-focus {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 6px;
  box-shadow: 0 0 0 2px #a36c25, 0 0 0 4px #efc77a50;
}

.mascot-grip {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #a36c25;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #efc77a77;
}

.mascot-chair {
  position: absolute;
  left: var(--chair-x, calc(100% - 84px));
  bottom: 10px;
  width: 80px;
  height: 85px;
  transform: translateX(-50%);
  pointer-events: none;
}
.mascot-chair[data-drop-ready]::before {
  content: "";
  position: absolute;
  inset: 9% 11% 1%;
  border: 2px dashed #a36c25;
  border-radius: 12px;
}

.mascot-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--forest);
  background: transparent;
}
.mascot-toggle:hover { background: var(--forest-soft); }
.mascot-toggle svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mascot-toggle[aria-pressed="true"] .mascot-toggle-off { display: none; }
.mascot-toggle[hidden], .mascot-route[hidden] { display: none !important; }

body:has(dialog[open], #site-nav.open) :is(.mascot-route, .mascot-chair) { visibility: hidden; }
@media (max-width: 680px) {
  .mascot-chair { width: 57px; height: 61px; }
}
@media (pointer: coarse) {
  .mascot-handle { pointer-events: none; }
}
