.walenie-page {
  padding-bottom: 72px;
}

.walenie-intro {
  min-height: auto;
  padding-top: 56px;
  padding-bottom: 28px;
}

.walenie-intro h1 {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.walenie-layout {
  display: grid;
  place-items: center;
  padding-top: 28px;
}

.walenie-card {
  width: min(760px, 100%);
  margin-top: clamp(24px, 4vw, 40px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 28px;
}

.walenie-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.walenie-card-header h2 {
  margin: 4px 0 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.walenie-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.walenie-hud div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.28);
}

.walenie-hud span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.walenie-hud strong {
  color: var(--accent-color);
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-variant-numeric: tabular-nums;
}

.walenie-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 45%, var(--accent-faint), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.24));
  user-select: none;
  touch-action: manipulation;
}

.walenie-hole {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.walenie-hole:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
}

.hole-shadow,
.hole-lip {
  position: absolute;
  left: 7%;
  width: 86%;
  height: 31%;
  border-radius: 50%;
  pointer-events: none;
}

.hole-shadow {
  bottom: 12%;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #000;
  box-shadow:
    inset 0 12px 18px rgba(0, 0, 0, 0.94),
    0 0 20px var(--accent-faint);
}

.hole-lip {
  bottom: 7%;
  z-index: 4;
  height: 21%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(26, 31, 31, 0.98), rgba(4, 5, 5, 0.98));
  box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.6);
}

.walenie-target {
  position: absolute;
  left: 12%;
  bottom: 14%;
  z-index: 3;
  width: 76%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent-color) 68%, white 6%);
  border-radius: 50%;
  background: #111;
  box-shadow: 0 0 22px var(--accent-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(70%) scale(0.78);
  transition: transform 150ms cubic-bezier(0.2, 0.85, 0.32, 1.22), opacity 90ms ease;
}

.walenie-target[hidden] {
  display: none;
}

.target-half {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  will-change: transform;
}

.target-half img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.half-left {
  clip-path: polygon(0 0, 68% 0, 32% 100%, 0 100%);
}

.half-right {
  clip-path: polygon(68% 0, 100% 0, 100% 100%, 32% 100%);
}

.target-slash {
  position: absolute;
  top: -10%;
  left: 49%;
  width: 3px;
  height: 120%;
  background: linear-gradient(180deg, #ff4060, #ffffff 40%, #ff1744);
  transform: rotate(19.8deg);
  opacity: 0;
  box-shadow: 0 0 10px #ff1744, 0 0 18px #ff5252;
  pointer-events: none;
  z-index: 4;
}

.walenie-hole.is-up .walenie-target {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.walenie-hole.is-hit .walenie-target,
.walenie-hole.is-bedboj-hit .walenie-target {
  opacity: 1;
  transform: translateY(35%) scale(0.82, 0.68);
  transition-duration: 90ms;
}

/* Sliced target halves on hit */
.walenie-hole.is-hit .walenie-target:not(.is-bedboj) .half-left {
  animation: slice-left 250ms cubic-bezier(0.16, 0.82, 0.3, 1.2) forwards;
}

.walenie-hole.is-hit .walenie-target:not(.is-bedboj) .half-right {
  animation: slice-right 250ms cubic-bezier(0.16, 0.82, 0.3, 1.2) forwards;
}

.walenie-hole.is-hit .walenie-target:not(.is-bedboj) .target-slash {
  animation: slash-flash 220ms ease-out forwards;
}

@keyframes slice-left {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(-14%, -9%) rotate(-15deg);
  }
}

@keyframes slice-right {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  100% {
    transform: translate(14%, 11%) rotate(15deg);
  }
}

@keyframes slash-flash {
  0% {
    opacity: 0;
    transform: scaleY(0) rotate(19.8deg);
  }
  30% {
    opacity: 1;
    transform: scaleY(1.1) rotate(19.8deg);
  }
  100% {
    opacity: 0;
    transform: scaleY(1) rotate(19.8deg);
  }
}

/* Blood splatter effect */
.blood-container {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.blood-splash {
  position: absolute;
  left: 15%;
  top: 15%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185, 28, 28, 0.95) 0%, rgba(127, 29, 29, 0.7) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0.3);
  animation: blood-splat 360ms ease-out forwards;
}

@keyframes blood-splat {
  0% {
    opacity: 0.95;
    transform: scale(0.3);
  }
  40% {
    opacity: 0.85;
    transform: scale(1.08);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

.blood-drop {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--drop-size, 6px);
  height: var(--drop-size, 6px);
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 6px #991b1b, 0 0 10px rgba(220, 38, 38, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: blood-fly 400ms cubic-bezier(0.12, 0.8, 0.32, 1) var(--drop-delay, 0ms) forwards;
}

@keyframes blood-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  60% {
    opacity: 0.95;
    transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y))) scale(0.85);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drop-x)), calc(-50% + var(--drop-y) + 14px)) scale(0.3);
  }
}

.walenie-target.is-bedboj {
  border-color: #ff5e78;
  box-shadow: 0 0 22px rgba(255, 64, 96, 0.3);
}

.walenie-hole.is-hit {
  filter: drop-shadow(0 0 16px rgba(239, 68, 68, 0.95));
}

.walenie-hole.is-bedboj-hit {
  filter: drop-shadow(0 0 14px rgba(255, 64, 96, 0.88));
}

.walenie-hole.is-miss .hole-lip {
  animation: hole-miss 130ms ease-out;
}

.knife-effect {
  position: absolute;
  top: 3%;
  right: 6%;
  z-index: 6;
  width: 18%;
  height: 62%;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-48deg) translate(55%, -45%);
  transform-origin: 50% 88%;
}

.knife-effect::before {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 68%;
  clip-path: polygon(50% 0, 100% 82%, 62% 100%, 17% 88%);
  background: linear-gradient(90deg, #6b7280 0%, #f8fafc 48%, #9ca3af 100%);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5));
  content: "";
}

.knife-effect::after {
  position: absolute;
  bottom: 0;
  left: 27%;
  width: 46%;
  height: 38%;
  border-top: 3px solid #111827;
  border-radius: 3px 3px 7px 7px;
  background: repeating-linear-gradient(90deg, #171717 0 4px, #3f3f46 4px 7px);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
  content: "";
}

.walenie-hole.is-hit .knife-effect,
.walenie-hole.is-bedboj-hit .knife-effect,
.walenie-hole.is-miss .knife-effect {
  animation: knife-strike 180ms ease-in;
}

.walenie-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.walenie-controls p {
  min-height: 1.4em;
  margin: 0;
  flex: 1 1 200px;
}

.walenie-controls-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.walenie-bet-label {
  display: grid;
  gap: 6px;
  width: 100px;
}

.walenie-bet-label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.walenie-bet-label input {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.walenie-bet-label input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-faint);
}

.walenie-controls-actions .button {
  min-width: 180px;
}

@keyframes knife-strike {
  0% { opacity: 0; transform: rotate(-58deg) translate(75%, -60%); }
  25% { opacity: 1; }
  72% { opacity: 1; transform: rotate(-17deg) translate(-8%, 24%); }
  100% { opacity: 0; transform: rotate(-17deg) translate(-8%, 24%); }
}

@keyframes hole-miss {
  50% { transform: translateY(3px) scaleX(0.96); }
}

@media (max-width: 640px) {
  .walenie-page {
    padding-bottom: 36px;
  }

  .walenie-intro {
    padding-top: 36px;
    padding-bottom: 22px;
  }

  .walenie-intro h1 {
    font-size: clamp(2.8rem, 15vw, 4rem);
  }

  .walenie-card {
    padding: 12px;
    border-radius: 22px;
  }

  .walenie-card-header {
    align-items: flex-end;
    margin: 4px 2px 14px;
  }

  .walenie-hud {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .walenie-hud div {
    padding: 9px 10px;
  }

  .walenie-board {
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
  }

  .walenie-hole {
    border-radius: 13px;
  }

  .walenie-controls {
    display: grid;
    gap: 12px;
  }

  .walenie-controls-actions {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    width: 100%;
  }

  .walenie-controls-actions .button {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .walenie-target,
  .walenie-hole.is-hit .walenie-target,
  .walenie-hole.is-bedboj-hit .walenie-target {
    transition: none;
  }

  .walenie-hole.is-hit .knife-effect,
  .walenie-hole.is-bedboj-hit .knife-effect,
  .walenie-hole.is-miss .knife-effect,
  .walenie-hole.is-miss .hole-lip {
    animation: none;
  }
}

/* Custom knife cursor following the hover pointer */
@media (pointer: fine) {
  .walenie-board,
  .walenie-board * {
    cursor: none !important;
  }

  .knife-effect {
    display: none !important;
  }
}

.walenie-cursor-knife {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 34px;
  height: 90px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 120ms ease;
  will-change: transform, opacity;
}

.walenie-cursor-knife.is-visible {
  opacity: 1;
}

.walenie-cursor-knife-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 32% 14%;
  transform: rotate(-38deg) translate(0%, -15%);
  transition: transform 60ms ease-out;
}

.walenie-cursor-knife-blade {
  position: absolute;
  top: 0;
  left: 12%;
  width: 76%;
  height: 68%;
  clip-path: polygon(50% 0, 100% 82%, 62% 100%, 17% 88%);
  background: linear-gradient(90deg, #6b7280 0%, #f8fafc 48%, #9ca3af 100%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.65));
}

.walenie-cursor-knife-handle {
  position: absolute;
  bottom: 0;
  left: 27%;
  width: 46%;
  height: 38%;
  border-top: 3px solid #111827;
  border-radius: 3px 3px 7px 7px;
  background: repeating-linear-gradient(90deg, #171717 0 4px, #3f3f46 4px 7px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
}

.walenie-cursor-knife.is-slashing .walenie-cursor-knife-inner {
  animation: cursor-knife-slash 150ms ease-in forwards;
}

@keyframes cursor-knife-slash {
  0% {
    transform: rotate(-52deg) translate(-10%, -30%);
  }
  50% {
    transform: rotate(12deg) translate(8%, 18%);
  }
  100% {
    transform: rotate(-38deg) translate(0%, -15%);
  }
}

.walenie-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.bonus-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 14px 20px;
  border: 1px solid var(--accent-color);
  border-radius: 16px;
  background: rgba(15, 23, 23, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 0 25px var(--accent-soft), 0 8px 32px rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.16, 0.85, 0.3, 1.2);
  pointer-events: none;
}

.bonus-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bonus-toast-icon {
  font-size: 1.5rem;
}

