/* TitoEffectHold — Stil des Halten-Buttons; Farben/Größe kommen aus den Optionen (titoeffect-hold.js),
   zusätzlich Größe "xs" für die kleinen Karten-Buttons des Command Centers. */
.titoeffect-hold {
  --te-hold-radius: 14px;
  --te-hold-bg: #27272a;
  --te-hold-fill: #5227ff;
  --te-hold-text: #f5f5f5;
  --te-hold-fill-text: #ffffff;
  --te-hold-hold: 2000ms;
  --te-hold-release: 200ms;
  --te-hold-press: 0.97;
  --te-hold-wave: 6px;
  --te-hold-w: 0px;
  --te-hold-h: 0px;
  --te-hold-cycles: 2;
  --te-hold-p: 0;
  --te-hold-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --te-hold-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --te-hold-glow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 32px -6px color-mix(in srgb, var(--te-hold-fill) 70%, transparent);

  position: relative;
  display: inline-grid;
  place-items: center;
  isolation: isolate;
  margin: 0;
  border: 0;
  border-radius: var(--te-hold-radius);
  background: var(--te-hold-bg);
  color: var(--te-hold-text);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  box-shadow: var(--te-hold-shadow);
  cursor: pointer;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 160ms var(--te-hold-ease-out),
    background-color 160ms ease,
    box-shadow var(--te-hold-release) var(--te-hold-ease-out);
}

.titoeffect-hold--xs { height: 30px; padding: 0 14px; font-size: 12px; }
.titoeffect-hold--sm { height: 36px; padding: 0 16px; font-size: 13px; }
.titoeffect-hold--md { height: 44px; padding: 0 22px; font-size: 15px; }
.titoeffect-hold--lg { height: 52px; padding: 0 28px; font-size: 17px; }

@media (hover: hover) and (pointer: fine) {
  .titoeffect-hold:not(:disabled):hover {
    background: color-mix(in srgb, var(--te-hold-bg) 92%, #fff);
  }
}

.titoeffect-hold[data-phase='holding'][data-input='pointer'] { transform: scale(var(--te-hold-press)); }

.titoeffect-hold[data-glow='true'][data-phase='holding'],
.titoeffect-hold[data-glow='true'][data-phase='done'] { box-shadow: var(--te-hold-glow); }

.titoeffect-hold[data-glow='true'][data-phase='holding'] {
  transition:
    transform 160ms var(--te-hold-ease-out),
    background-color 160ms ease,
    box-shadow var(--te-hold-hold) linear;
}

.titoeffect-hold:focus-visible { outline: 2px solid var(--te-hold-fill); outline-offset: 3px; }

.titoeffect-hold:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.titoeffect-hold__pulse {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: var(--te-hold-radius);
  pointer-events: none;
  opacity: 0;
}

.titoeffect-hold[data-glow='true'][data-phase='done'] .titoeffect-hold__pulse {
  animation: titoeffect-hold-pulse 600ms var(--te-hold-ease-out) forwards;
}

@keyframes titoeffect-hold-pulse {
  from { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--te-hold-fill) 55%, transparent); }
  to { opacity: 0; box-shadow: 0 0 0 14px color-mix(in srgb, var(--te-hold-fill) 0%, transparent); }
}

.titoeffect-hold__label {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
}

.titoeffect-hold__label > span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: opacity 200ms ease, filter 200ms ease;
}

.titoeffect-hold__icon { display: inline-flex; flex: none; }
.titoeffect-hold__icon > svg { display: block; }

.titoeffect-hold__done { opacity: 0; filter: blur(2px); }

.titoeffect-hold[data-phase='done'] .titoeffect-hold__idle { opacity: 0; filter: blur(2px); }
.titoeffect-hold[data-phase='done'] .titoeffect-hold__done { opacity: 1; filter: blur(0); }

.titoeffect-hold__clip {
  position: absolute;
  inset: 0;
  z-index: 3;
  clip-path: inset(0 round var(--te-hold-radius));
  pointer-events: none;
}

.titoeffect-hold__fill {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--te-hold-fill);
  color: var(--te-hold-fill-text);
  clip-path: inset(
    0 calc((1 - var(--te-hold-p)) * (100% + 0.75 * var(--te-hold-wave)) - var(--te-hold-p) * 0.25 * var(--te-hold-wave)) 0 0
  );
}

.titoeffect-hold[data-direction='up'] .titoeffect-hold__fill {
  clip-path: inset(
    calc((1 - var(--te-hold-p)) * (100% + 0.75 * var(--te-hold-wave)) - var(--te-hold-p) * 0.25 * var(--te-hold-wave)) 0 0 0
  );
}

.titoeffect-hold__crest {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--te-hold-fill);
  color: var(--te-hold-fill-text);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='200' viewBox='0 0 20 200' preserveAspectRatio='none'%3E%3Cpath d='M0 0H10C18 8 18 25.3 10 33.3S2 58.7 10 66.7S18 92 10 100S2 125.3 10 133.3S18 158.7 10 166.7S2 192 10 200H0Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='200' viewBox='0 0 20 200' preserveAspectRatio='none'%3E%3Cpath d='M0 0H10C18 8 18 25.3 10 33.3S2 58.7 10 66.7S18 92 10 100S2 125.3 10 133.3S18 158.7 10 166.7S2 192 10 200H0Z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-y;
  mask-repeat: repeat-y;
  -webkit-mask-size: var(--te-hold-wave) calc(var(--te-hold-h) * 2);
  mask-size: var(--te-hold-wave) calc(var(--te-hold-h) * 2);
  -webkit-mask-position-x: calc(-1 * var(--te-hold-wave) + var(--te-hold-p) * (var(--te-hold-w) + var(--te-hold-wave)));
  mask-position-x: calc(-1 * var(--te-hold-wave) + var(--te-hold-p) * (var(--te-hold-w) + var(--te-hold-wave)));
  -webkit-mask-position-y: calc(-1 * var(--te-hold-p) * var(--te-hold-cycles) * var(--te-hold-h));
  mask-position-y: calc(-1 * var(--te-hold-p) * var(--te-hold-cycles) * var(--te-hold-h));
}

.titoeffect-hold[data-direction='up'] .titoeffect-hold__crest {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='20' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V10C12 2 38 2 50 10S88 18 100 10S138 2 150 10S188 18 200 10V20Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='20' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V10C12 2 38 2 50 10S88 18 100 10S138 2 150 10S188 18 200 10V20Z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  -webkit-mask-size: calc(var(--te-hold-w) * 2) var(--te-hold-wave);
  mask-size: calc(var(--te-hold-w) * 2) var(--te-hold-wave);
  -webkit-mask-position-x: calc(-1 * var(--te-hold-p) * var(--te-hold-cycles) * var(--te-hold-w));
  mask-position-x: calc(-1 * var(--te-hold-p) * var(--te-hold-cycles) * var(--te-hold-w));
  -webkit-mask-position-y: calc(var(--te-hold-h) - var(--te-hold-p) * (var(--te-hold-h) + var(--te-hold-wave)));
  mask-position-y: calc(var(--te-hold-h) - var(--te-hold-p) * (var(--te-hold-h) + var(--te-hold-wave)));
}

.titoeffect-hold__label--fill { z-index: auto; }

.titoeffect-hold__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-contrast: more) {
  .titoeffect-hold { outline: 1px solid var(--te-hold-text); }
}

@media (prefers-reduced-motion: reduce) {
  .titoeffect-hold {
    transition: background-color 160ms ease, box-shadow var(--te-hold-release) ease;
    transform: none !important;
  }

  .titoeffect-hold__fill,
  .titoeffect-hold[data-direction='up'] .titoeffect-hold__fill {
    clip-path: inset(0);
    opacity: 0;
    transition: opacity var(--te-hold-release) ease;
  }

  .titoeffect-hold__crest { display: none; }

  .titoeffect-hold[data-phase='holding'] .titoeffect-hold__fill,
  .titoeffect-hold[data-phase='done'] .titoeffect-hold__fill {
    opacity: 1;
    transition: opacity var(--te-hold-hold) linear;
  }

  .titoeffect-hold__pulse { animation: none !important; }

  .titoeffect-hold__label > span { transition: opacity 200ms ease; filter: none !important; }
}
