:root {
  --bg: #f6f8fb;
  --text: #222;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  background: linear-gradient(180deg, #eef3fb, #f6f8fb);
  color: var(--text);
}
.wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.ball {
  width: 880px;
  max-width: 96vw;
  cursor: pointer;
  display: inline-block;
  user-select: none;
}
.svg-ball {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 700ms ease;
  transform-origin: 50% 50%;
}
.ball.flipped .svg-ball {
  transform: rotate(180deg);
}

/* front/back visibility during flip */
#backFace {
  opacity: 0;
  transition: opacity 220ms linear;
}
.ball.flipped #backFace {
  opacity: 1;
}
#frontFace {
  opacity: 1;
  transition: opacity 220ms linear;
}
.ball.flipped #frontFace {
  opacity: 0;
}
.hint {
  margin: 0;
  color: #5a6b7a;
  font-size: 14px;
}
.answer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4px;
  color: #fff;
  font-weight: 700;
  text-align: center;
  padding: 2px 4px;
  line-height: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.shake {
  animation: shake 700ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes shake {
  0% {
    transform: translateX(0) rotate(0);
  }
  20% {
    transform: translateX(-8px) rotate(-8deg);
  }
  40% {
    transform: translateX(8px) rotate(8deg);
  }
  60% {
    transform: translateX(-6px) rotate(-6deg);
  }
  80% {
    transform: translateX(4px) rotate(4deg);
  }
  100% {
    transform: translateX(0) rotate(0);
  }
}

/* make the triangle answer area slightly bigger on wide screens */
@media (min-width: 480px) {
  .answer {
    font-size: 13px;
  }
}
