/* =====================================================================================
   Dungeon Run world (12-worlds-b §B, docs/design/Dungeon.dc.html). All selectors are prefixed dg-.
   Reuses the shared keyframes from pointwalk.css (breathe/bob/step/swing/jump/wave/pop/cf0-5/pulse) untouched.
   ===================================================================================== */
@keyframes dg-flicker { 0%,100% { transform: scale(1,1) rotate(-3deg) } 25% { transform: scale(1.08,.9) rotate(2deg) } 50% { transform: scale(.94,1.1) rotate(4deg) } 75% { transform: scale(1.05,.95) rotate(-2deg) } }
.dg-flicker { animation: dg-flicker .9s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes dg-glow { 0%,100% { opacity: .8 } 50% { opacity: 1 } }
.dg-glow { animation: dg-glow 1.3s ease-in-out infinite; }
@keyframes dg-lootin { 0% { transform: scale(.3) rotate(-8deg); opacity: 0 } 60% { transform: scale(1.1) rotate(2deg); opacity: 1 } 100% { transform: scale(1) rotate(0) } }
.dg-lootin { animation: dg-lootin .55s cubic-bezier(.2,.8,.3,1) both; }
@keyframes dg-drain { from { width: 100%; } to { width: 0%; } }

.dg-page { min-height: 100vh; background-color: #23305A; background-image: radial-gradient(rgba(255,255,255,0.07) 2px, transparent 2px); background-size: 28px 28px; color: #1E1B2E; font-family: 'Nunito', 'Trebuchet MS', sans-serif; }
.dg-wrap { width: 100%; margin: 0 auto; overflow: hidden; box-sizing: border-box; padding-bottom: 8px; }
.dg-scene { position: relative; box-sizing: content-box; height: 560px; margin: 0; border: 3px solid #1E1B2E; border-radius: 28px; box-shadow: 0 8px 0 #1E1B2E; overflow: hidden; background: #D9B48A; transform-origin: 0 0; outline-offset: 4px; }
.dg-scene:focus-visible { outline: 3px solid #5AA9FF; }

/* my bean: the wrapper walks with left/top/transform transitions (set inline), the bean inside is a zero-size anchor */
.dg-actor { position: absolute; width: 0; height: 0; pointer-events: none; }
.dg-actor .dg-bubble { position: absolute; top: -168px; width: 210px; background: #FFFFFF; border: 3px solid #1E1B2E; border-radius: 16px; box-shadow: 0 4px 0 #1E1B2E; padding: 8px 12px; font: 800 14px/1.3 'Nunito', sans-serif; box-sizing: content-box; }
/* teammate replay wrapper: stands at its START spot; its keyframes (dgw0..) carry it along the floor and up into the doorway */
.dg-walker { position: absolute; width: 0; height: 0; pointer-events: none; }

.dg-door-leaf, .dg-door-in { transition: transform .7s cubic-bezier(.34,1.56,.64,1), background .5s ease; }
.dg-doorhit .dg-plaque { transition: transform .15s ease; }
.dg-doorhit:hover .dg-plaque { transform: translateX(-50%) translateY(-4px); }
.dg-doorhit:focus-visible { outline: 3px solid #5AA9FF; outline-offset: -3px; border-radius: 16px; }

.dg-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dg-quick button { min-width: 44px; height: 44px; padding: 0 10px; border: 3px solid #1E1B2E; border-radius: 12px; box-shadow: 0 3px 0 #1E1B2E; font-family: 'Lilita One', sans-serif; font-size: 18px; color: #1E1B2E; cursor: pointer; }
.dg-controls button[disabled] { cursor: not-allowed; opacity: .55; }
.dg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .dg-flicker, .dg-glow, .dg-lootin { animation: none; }
  .dg-door-leaf, .dg-door-in, .dg-doorhit .dg-plaque { transition: none; }
  .dg-actor, .dg-xpfill { transition: none !important; }
  .dg-walker { animation: none !important; left: var(--fx) !important; top: var(--fy) !important; transform: scale(.86) !important; z-index: var(--zf) !important; }
}
.rm .dg-flicker, .rm .dg-glow, .rm .dg-lootin { animation: none; }
.rm .dg-door-leaf, .rm .dg-door-in, .rm .dg-doorhit .dg-plaque { transition: none; }
.rm .dg-actor, .rm .dg-xpfill { transition: none !important; }
.rm .dg-walker { animation: none !important; left: var(--fx) !important; top: var(--fy) !important; transform: scale(.86) !important; z-index: var(--zf) !important; }
