/* A deliberate adult action shared by all five games. Appearance is supplied by
   the game; its colors still come from the canonical design-system tokens. */
.end-session-control {
  --end-progress: 0;
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  color: var(--tf-text);
  font-family: var(--tf-font);
}

.end-session-control .end-session-button {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 64px;
  min-width: 64px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 10px 4px;
  border: 1px solid var(--tf-control-border);
  border-radius: var(--tf-radius);
  background: var(--tf-surface);
  color: var(--tf-text);
  font: 600 13px/1 var(--tf-font);
  letter-spacing: 0;
  appearance: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
  outline: none;
}

.end-session-button:focus-visible {
  outline: var(--tf-focus-ring);
  outline-offset: 3px;
}

.end-session-track {
  position: absolute;
  height: 3px;
  left: 10px;
  right: 10px;
  bottom: 7px;
  border-radius: var(--tf-radius-sm);
  background: var(--tf-border);
  overflow: hidden;
}

.end-session-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform: scaleX(var(--end-progress));
  transform-origin: left;
  background: var(--tf-accent-text);
}

.end-session-help {
  position: absolute;
  right: 76px;
  bottom: 0;
  box-sizing: border-box;
  width: min(248px, calc(100vw - 108px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius-sm);
  background: var(--tf-surface);
  color: var(--tf-text);
  font: 400 12px/1.5 var(--tf-font);
  text-align: left;
  pointer-events: none;
  opacity: 0;
}

.end-session-control:has(.end-session-button:focus-visible) .end-session-help { opacity: 1; }
@media (hover: hover) {
  .end-session-button:hover + .end-session-help { opacity: 1; }
}
