*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: rgb(48, 48, 73);
}

.yusu-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  padding: 2rem 1rem;
}

.yusu-text {
  text-align: center;
  font-family: "Pinyon Script", cursive;
  font-weight: 900;
  font-style: normal;
  font-size: 7rem;
  color: antiquewhite;
}

/* Counter */

.counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: antiquewhite;
  font-family: "Cormorant Garamond", Garamond, serif;
  text-align: center;
}

.counter-number {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.counter-number.bump {
  animation: bump 0.35s ease-out;
}

@keyframes bump {
  40% { transform: scale(1.1); color: #e8c77a; }
}

.counter-label {
  font-size: 1.5rem;
  font-style: italic;
  opacity: 0.8;
}

.counter-button {
  margin-top: 1rem;
  padding: 0.6rem 2.2rem;
  font-family: "Pinyon Script", cursive;
  font-size: 2.5rem;
  color: rgb(48, 48, 73);
  background-color: antiquewhite;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.counter-button:hover {
  background-color: #fff6e8;
}

.counter-button:active {
  transform: scale(0.95);
}

.counter-button:focus-visible {
  outline: 3px solid #e8c77a;
  outline-offset: 4px;
}

.counter-reset {
  font-size: 1.1rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.counter-status {
  min-height: 1.5em;
  font-size: 1.1rem;
  color: #f0a0a0;
}

/* History */

.history {
  list-style: none;
  width: min(100%, 22rem);
  color: antiquewhite;
  font-family: "Cormorant Garamond", Garamond, serif;
  font-size: 1.2rem;
}

.history li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted rgba(250, 235, 215, 0.3);
  opacity: 0.8;
}

.history-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Bij 20: vo */

.counter-number.vo-mode {
  color: #fa6b20;
  text-shadow: 0 0 1.5rem rgba(250, 107, 32, 0.6);
}

.vo-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
  animation: vo-flash 1.2s ease-out;
  transition: opacity 1s ease;
}

.vo-overlay.vo-out {
  opacity: 0;
}

@keyframes vo-flash {
  0% { background-color: rgba(250, 107, 32, 0.85); }
  100% { background-color: rgba(250, 107, 32, 0); }
}

.vo-word {
  position: absolute;
  translate: -50% -50%;
  font-family: "Pinyon Script", cursive;
  line-height: 1;
  color: #fa6b20;
  text-shadow: 0 0 1rem rgba(250, 107, 32, 0.7);
  opacity: 0;
  animation: vo-pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) forwards,
             vo-wobble 1.6s ease-in-out 0.6s infinite alternate;
}

@keyframes vo-pop {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  100% { opacity: 1; transform: scale(1) rotate(var(--r)); }
}

@keyframes vo-wobble {
  from { transform: scale(1) rotate(var(--r)); }
  to { transform: scale(1.15) rotate(calc(var(--r) * -1)); }
}

@media (max-width: 600px) {
  .yusu-text { font-size: 4rem; }
  .counter-number { font-size: 6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .counter-number.bump { animation: none; }
  .vo-overlay { animation: none; }
  .vo-word { animation: none; opacity: 1; transform: rotate(var(--r)); }
}
