* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1em;
  min-height: 100vh;
  margin: 0;
  font-family: 'Helvetica', sans-serif;
  font-weight: 500;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.egg-container {
  transform: scale(0.25);
  transition: transform 0.2s;
}

.egg-container.active {
  transform: scale(1);
}

.egg {
  --shadow-opacity: 1;
  border-radius: 100% 100% 76% 76% / 118% 118% 80% 80%;
  filter: drop-shadow(0 0px 2px rgb(0 0 0 / var(--shadow-opacity)));
  cursor: pointer;
}

.egg-container.active .egg {
  --shadow-opacity: 0;
  cursor: initial;
}

.egg.ringing {
  animation: ring 0.12s infinite;
}

@keyframes ring {
  0%,
  50%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(5deg);
  }
  75% {
    transform: rotate(-5deg);
  }
}

.egg-top,
.egg-bottom {
  background-color: #f4f4f4;
  /* Ersatz für das Original-PNG: wiederholtes "Speckle"-Pattern + Lichtverlauf */
  background-image: radial-gradient(circle at 12px 12px, rgb(0 0 0 / 0.06) 0 1px, transparent 1.2px), radial-gradient(circle at 36px 42px, rgb(0 0 0 / 0.05) 0 1px, transparent 1.2px), linear-gradient(to right, #e6e6e6, #fff, #e6e6e6);
  background-size: 60px 60px, 60px 60px, auto auto;
  background-blend-mode: multiply, multiply, normal;
}

.egg-top {
  --background-translation: 0px;
  position: relative;
  z-index: 1;
  border-radius: 50% 50% 50% 50% / 100% 100% 0% 0%;
  width: 274px;
  height: 210px;
  clip-path: inset(0 0 0 0 round 50% 50% 50% 50% / 100% 100% 0% 0%);
  background-position-x: var(--background-translation), var(--background-translation), 0%;
  box-shadow: inset 0 4px 8px rgb(0 0 0 / 0.05), inset 20px 0 16px rgb(0 0 0 / 0.05), inset -20px 0 16px rgb(0 0 0 / 0.05), inset 0 1px 1px rgb(0 0 0 / 0.05), inset 1px 0 1px rgb(0 0 0 / 0.05), inset -1px 0 1px rgb(0 0 0 / 0.05);
  transition: background-position-x 0.2s;
  touch-action: none;
}

.egg-top.dragged {
  transition-duration: 0s;
  transition-timing-function: ease-out;
}

.egg-container.active .egg:not(.ringing) .egg-top {
  cursor: ew-resize;
}

.time-ruler-faces-container {
  --initial-rotation: calc(180deg + (360deg / var(--face-count) / 2));
  --rotation: 0deg;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  bottom: 6px;
  transform: rotateY(calc(var(--rotation) + var(--initial-rotation)));
  transform-style: preserve-3d;
  aspect-ratio: 7.289 / 1;
  width: 100%;
  transition: transform 0.4s;
}

.egg-top.dragged .time-ruler-faces-container {
  transition-duration: 0s;
  transition-timing-function: ease-out;
}

.time-ruler-face-wrapper {
  position: absolute;
  backface-visibility: hidden;
  height: 100%;
  overflow: hidden;
}

.time-ruler-face {
  position: absolute;
  top: 0;
  left: calc(-100% * var(--i));
  height: 100%;
  fill: #484848;
  will-change: transform;
}

.egg-center {
  margin: 0 auto;
  height: 6px;
  width: calc(100% - 24px);
  background-color: #f4f4f4;
  box-shadow: inset 0 6px 2px rgb(0 0 0 / 0.2), inset 0 2px 2px rgb(0 0 0 / 0.2);
}

.egg-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 0% 0% 38% 38% / 0% 0% 100% 100%;
  width: 274px;
  height: 144px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.8), inset 0 -1px 1px rgb(0 0 0 / 0.05), inset 1px 0 1px rgb(0 0 0 / 0.05), inset -1px 0 1px rgb(0 0 0 / 0.05), inset 0 -12px 8px rgb(255 255 255 / 0.6), inset 0 -20px 8px rgb(0 0 0 / 0.1),
    inset 0 -60px 20px rgb(0 0 0 / 0.05);
}

.time-arrow {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  margin-bottom: -1px;
  width: 20px;
  height: 14px;
  background-color: #d15705;
  clip-path: polygon(50% 0, 0% 100%, 100% 100%);
}

.time-container {
  border-radius: 10px;
  padding: 4px 16px;
  transform: scale(0.125, 0);
  transform-origin: top;
  background-color: #d15705;
  box-shadow: inset 0 -2px rgb(0 0 0 / 0.2), 0 2px 4px rgb(0 0 0 / 0.2);
  font-size: 32px;
  color: #f4f4f4;
  transition: transform 0.2s;
}

.egg-container.active .time-container {
  transform: scale(1);
  transition-duration: 0.2s;
  transition-timing-function: cubic-bezier(0, 0, 0.3, 1.5);
  transition-delay: 0.1s;
}

.timer-button {
  margin-top: 1.5em;
  border-radius: 8px;
  padding: 10px 16px;
  transform: scale(0);
  width: 100%;
  background-image: linear-gradient(to bottom, #84b709, #46a100);
  box-shadow: inset 0 -2px rgb(0 0 0 / 0.2), 0 2px 4px rgb(0 0 0 / 0.2);
  text-align: center;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transition-property: transform, opacity;
  transition-duration: 0.4s, 0.2s;
  transition-timing-function: cubic-bezier(0.55, 1, 0.15, 1), ease-in-out;
  border: none;
}

.egg-container.active .timer-button {
  transform: scale(1);
  opacity: 1;
}

.timer-button.stop {
  background-image: linear-gradient(to bottom, #d53f0b, #b00000);
}

.timer-button:active:not(:disabled) {
  transform: scale(0.92);
}

.timer-button:disabled {
  background-image: linear-gradient(to bottom, #9f9f9f, #848484);
  cursor: not-allowed;
}

.egg-container.active .timer-button:disabled {
  opacity: 0.4;
}
