/* Moonlit courtyard. Decorative layers never intercept a tap. */
.arena {
  --stone-light: #a296b2;
  background: #1b1227;
}
.arena-world {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #150d2410, #150c2224 45%, #10091f40),
    url('/play/assets/arena-courtyard-v2.webp') center top / 100% 100% no-repeat;
}
.arena::after {
  z-index: 1;
  background: linear-gradient(90deg, #08061480, transparent 13% 87%, #08061480),
    linear-gradient(0deg, #130b2760, transparent 30%);
  box-shadow: inset 0 0 32px #08041170;
  transition: background-color .8s, box-shadow .8s;
}
.arena > .moon, .arena > .cemetery { display: none; }
.arena .holes { z-index: 3; }
.arena .fog {
  z-index: 1;
  inset: 68% -20% -12%;
  filter: none;
  opacity: .44;
  background: radial-gradient(ellipse at 25% 70%, #b9a5d638, transparent 54%),
    radial-gradient(ellipse at 78% 40%, #8c78a638, transparent 52%);
  animation-duration: 20s;
}
.arena .fog-two { inset: 25% -20% 30%; opacity: .24; animation-duration: 27s; }
.arena .embers { z-index: 1; opacity: .5; }
.arena .lantern {
  z-index: 2;
  top: 2.5%;
  width: 7px;
  height: 13px;
  border: 1px solid #dba160;
  border-radius: 50% 50% 3px 3px;
  background: #ffe3a0;
  box-shadow: 0 0 8px #ffd38b, 0 0 28px 5px #ea91484d;
  animation: courtyard-candle 4s ease-in-out infinite alternate;
}
.arena .lantern-left { left: 3%; }
.arena .lantern-right { right: 3%; animation-delay: -2s; }
@keyframes courtyard-candle { to { opacity: .7; transform: scaleY(.88); } }

/* Stone openings retain the original target bounds and emergence point. */
.arena .hole::before {
  background: url('/play/assets/grave-rim-v2.svg') center / 100% 100% no-repeat;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 10px 14px #0006;
  transition: box-shadow .18s;
}
.arena .hole::after {
  bottom: 4%;
  height: 12%;
  left: 7%;
  width: 86%;
  background: linear-gradient(180deg, transparent 15%, #9e88b32b 45%, #241a31b3);
  border-bottom: 1px solid #b9a2cb40;
  border-radius: 0 0 60% 60%;
}
.grave-marker {
  position: absolute;
  z-index: 0;
  bottom: 26%;
  left: 33%;
  width: 34%;
  height: 30%;
  max-height: 65px;
  display: grid;
  place-items: center;
  pointer-events: none;
  border: 1px solid #a491b44d;
  border-top: 2px solid #b9a6c177;
  border-radius: 45% 45% 3px 3px;
  background: linear-gradient(115deg, #716179, #3b304a 55%, #2c2338);
  box-shadow: inset 3px 0 #ac98be17, inset -3px 0 #07041140, 2px 4px 7px #0005;
  color: #c2acc16b;
  font: 700 10px Georgia, serif;
  text-shadow: 0 1px #130d24;
  opacity: .82;
  transition: opacity .35s, border-color .35s;
}
.grave-marker::before {
  content: '';
  position: absolute;
  left: 48%;
  top: 5%;
  width: 1px;
  height: 18%;
  background: #18102277;
  transform: rotate(19deg);
}
.arena .hole kbd { color: #dcc9edb3; text-shadow: 0 1px 3px #000; }
.arena .hole.occupied::before { box-shadow: 0 0 15px 2px #ae80ed55, 0 10px 14px #0006; }
.arena .hole.gold-grave::before { box-shadow: 0 0 19px 3px #f8cd7770, 0 10px 14px #0006; }
.arena .hole.hit::before { box-shadow: 0 0 23px 4px #c5a3ff99; }
.arena .hole.bad::before { box-shadow: 0 0 22px 4px #ff6d8188; }
.arena .hole.sealed { opacity: .46; }
.arena .hole.sealed::before {
  background: linear-gradient(160deg, #7f6e8c, #483951 42%, #30283d 44%, #5a4966 48%, #30263a 82%);
  border: 2px solid #9f8bae66;
  border-bottom: 4px solid #241b30;
  box-shadow: 0 5px 8px #0007;
  border-radius: 36%;
}
.arena .hole.sealed::after { content: ''; background: none; border: 0; }
.arena .hole.sealed .grave-marker { opacity: .5; }
.arena .hole:not(.sealed) .grave-marker { border-top-color: #c4afd28c; }
.arena.combo-hot::after { box-shadow: inset 0 -24px 45px -15px #e9bd6955, inset 0 0 32px #08041170; }

/* Panic colors stay on the perimeter, underneath characters and hit effects. */
.arena.panic-warning::after { background-color: #8a23451a; box-shadow: inset 0 0 45px #ca5f6440; }
.arena.panic::after { background-color: #65152b22; box-shadow: inset 0 0 55px 9px #dc44585c; }
.arena.panic .lantern { background: #ffd2ab; box-shadow: 0 0 16px #ff8c74, 0 0 38px 8px #e24c5366; }
.arena.panic .hole::before { border: 0; }
.arena.panic .grave-marker { border-top-color: #e895aa88; }
.arena.panic .fog { opacity: .48; }
.arena .overlay { background: radial-gradient(ellipse at center, #1b1026ed 25%, #120b1de3 72%, #120b1d99); backdrop-filter: none; }
.arena #result { background: radial-gradient(ellipse at 50% 25%, #4a2b5eef, #150b21eb 75%); }
#combo-callout { top: 1%; font-size: clamp(15px, 3.8vw, 22px); }

@media (max-width: 520px) {
  .grave-marker { font-size: 8px; max-height: 48px; }
  .arena .lantern { width: 5px; height: 10px; }
}
@media (max-height: 580px) {
  .grave-marker { max-height: 32px; font-size: 7px; }
  .arena .fog-two { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .arena .fog, .arena .lantern { animation: none; }
  .arena::after, .arena .hole::before, .grave-marker { transition: none; }
}
