:root {
  --cherry-stroke: #e10b17;              /* Standard-Rahmenfarbe */
  --cherry-stroke-hover-color: #e10f1b;  /* Hover-Rahmenfarbe */
  --cherry-dur: 750ms;

  /* Standardstrichstärken */
  --cherry-stroke-standard: 0.125rem;
  --cherry-stroke-hover: 0.5rem;
  --cherry-stroke-click: 0.5rem;         /* Click-Flash Strichstärke */

  /* Standardfarbe für Content */
  --cherry-content-color: #e10b17;

  /* Click-Flash Farbe (kann pro Button überschrieben werden) */
  --cherry-click-color: #00ff00;
}

/* Verstecken bis Initialisierung */
cherrybutton {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 153.74 / 131.28;
  overflow: visible;
  opacity: 0;
}
cherrybutton.cb-ready { opacity: 1; }

/* Interaktive Fläche */
cherrybutton > button {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  overflow: visible;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
cherrybutton > button:focus-visible {
  filter: drop-shadow(0 0 .5rem rgba(225, 13, 26, .35));
}

/* Rahmen */
cherrybutton .cb-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: transform var(--cherry-dur) ease;
  z-index: 1;
  will-change: transform;
  backface-visibility: hidden;
}
cherrybutton[data-state="on"] .cb-frame { transform: scale(0.8); }

cherrybutton .cb-stroke {
  fill: none;
  stroke: var(--cherry-stroke);
  stroke-width: var(--cherry-stroke-standard);
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
  pointer-events: visibleStroke;
  transition:
    stroke-width var(--cherry-dur) ease,
    stroke var(--cherry-dur) ease;
}

/* HOVER NUR AUF HOVER-FÄHIGEN GERÄTEN! */
@media (hover: hover) and (pointer: fine) {
  cherrybutton:hover .cb-stroke {
    stroke-width: var(--cherry-stroke-hover);
    stroke: var(--cherry-stroke-hover-color);
  }
}

/* Content */
cherrybutton .cb-content {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform-origin: center;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  color: var(--cherry-content-color);
}

/* SVG-Bewegung durch JS */
cherrybutton .cb-content > svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: center;
  transition: none;
  transform: translate(-50%, -50%);
  will-change: transform;
  backface-visibility: hidden;
}

/* SVG ohne fill nutzen currentColor */
cherrybutton .cb-content svg *:not([fill]) { fill: currentColor; }

/* Fallback */
cherrybutton .cb-content .cls-1 { fill: #e10b17; }

/* CLICK-FLASH Keyframes */
@keyframes cbClickFlashStroke {
  0%   { stroke: var(--cherry-click-color); stroke-width: var(--cherry-stroke-click); }
  100% { stroke: var(--cherry-stroke);      stroke-width: var(--cherry-stroke-standard); }
}
@keyframes cbClickFlashColor {
  0%   { color: var(--cherry-click-color); }
  100% { color: var(--cherry-content-color); }
}
