/* CowBull custom styles, loaded after the generated daisyui styles */

/* Soft glow behind the header so pages feel less flat */
body {
  background:
    radial-gradient(
      50rem 24rem at 50% -8rem,
      color-mix(in oklab, var(--color-primary) 16%, transparent),
      transparent
    ),
    var(--color-base-200);
  background-attachment: fixed;
}

/* Gentle card outline instead of heavy shadows */
.card,
.collapse {
  border: 1px solid color-mix(in oklab, var(--color-base-content) 8%, transparent);
}

/* --- shake on a bad guess --- */
@keyframes cb-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.animate-shake {
  animation: cb-shake 0.5s both;
}

/* --- letter corral --- */
.letter-off {
  opacity: 0.25;
  text-decoration: line-through;
}

/* --- confetti drop on a win --- */
.confetti {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 10;
}
.confetti span {
  position: absolute;
  top: -1rem;
  width: 0.45rem;
  height: 0.7rem;
  border-radius: 2px;
  background: var(--color-primary);
  animation: cb-confetti-fall 3.2s ease-in forwards;
}
.confetti span:nth-child(3n) {
  background: var(--color-secondary);
}
.confetti span:nth-child(4n) {
  background: var(--color-accent);
  border-radius: 50%;
  width: 0.5rem;
  height: 0.5rem;
}
.confetti span:nth-child(5n) {
  background: var(--color-info);
}
@keyframes cb-confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(70vh) rotate(660deg); opacity: 0.2; }
}
.confetti span:nth-child(1)  { left: 4%;  animation-delay: 0s; }
.confetti span:nth-child(2)  { left: 12%; animation-delay: 0.5s; }
.confetti span:nth-child(3)  { left: 20%; animation-delay: 0.2s; }
.confetti span:nth-child(4)  { left: 28%; animation-delay: 0.9s; }
.confetti span:nth-child(5)  { left: 36%; animation-delay: 0.1s; }
.confetti span:nth-child(6)  { left: 44%; animation-delay: 0.7s; }
.confetti span:nth-child(7)  { left: 52%; animation-delay: 0.3s; }
.confetti span:nth-child(8)  { left: 60%; animation-delay: 1.1s; }
.confetti span:nth-child(9)  { left: 68%; animation-delay: 0.4s; }
.confetti span:nth-child(10) { left: 76%; animation-delay: 0.8s; }
.confetti span:nth-child(11) { left: 84%; animation-delay: 0.15s; }
.confetti span:nth-child(12) { left: 92%; animation-delay: 0.6s; }
.confetti span:nth-child(13) { left: 32%; animation-delay: 1.3s; }
.confetti span:nth-child(14) { left: 72%; animation-delay: 1.5s; }

/* --- htmx view transition for guess swaps --- */
@keyframes cb-fade-in {
  from { opacity: 0; }
}
::view-transition-new(root) {
  animation: 180ms ease-out both cb-fade-in;
}

/* --- minimal prose fallback (no typography plugin in the build) --- */
.prose h2 { font-size: 1.25rem; font-weight: 800; margin: 0.5rem 0; }
.prose h3 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 0.25rem; }
.prose h4 { font-weight: 700; margin: 1rem 0 0.25rem; }
.prose p { margin: 0.4rem 0; }
.prose ul { list-style: disc; padding-left: 1.4rem; margin: 0.4rem 0; }
.prose li { margin: 0.25rem 0; }

/* --- brand horn: black on light, white on dark --- */
.cb-horn {
  fill: #000;
}
html[data-theme="cowbull-dark"] .cb-horn {
  fill: #fff;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="cowbull"]) .cb-horn {
    fill: #fff;
  }
}

/* --- level picker: checked = light grey, not primary --- */
input.level-pick:checked {
  background-color: color-mix(in oklab, var(--color-base-content) 14%, var(--color-base-100));
  border-color: color-mix(in oklab, var(--color-base-content) 10%, var(--color-base-100));
  color: var(--color-base-content);
  box-shadow: none;
}

/* --- single latest-activity flash on the game screen --- */
.cb-flash {
  position: fixed;
  top: 4.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
  background: color-mix(in oklab, var(--color-base-content) 88%, transparent);
  color: var(--color-base-100);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.18);
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- rounds slider + indicator: same light grey as the level picker --- */
.range-grey {
  color: color-mix(in oklab, var(--color-base-content) 30%, var(--color-base-100));
}
.badge-grey {
  background-color: color-mix(in oklab, var(--color-base-content) 14%, var(--color-base-100));
  border-color: color-mix(in oklab, var(--color-base-content) 10%, var(--color-base-100));
  color: var(--color-base-content);
}

/* --- htmx spinner: hidden entirely until a request is in flight, so
   button labels stay centered --- */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* --- brand wordmark: Lilita One (OFL), self-hosted --- */
@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/lilita-one.woff2") format("woff2");
}
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/baloo2.woff2") format("woff2");
}

/* Baloo 2 for body text (rounded but built for reading); Lilita One for
   titles. Guessed words and codes keep monospace (font-mono wins). */
body {
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
}
h1,
h2,
h3,
.card-title,
.stat-value,
.cb-wordmark {
  font-family: "Lilita One", ui-rounded, system-ui, sans-serif;
  font-weight: 400;
}
.cb-wordmark {
  letter-spacing: 0.01em;
}

/* --- slightly larger paragraph text --- */
p {
  font-size: 1.08em;
}
