/* ==========================================================================
   OVERLAYS, MODALS, FLYING FX LAYER, POPOVERS & SHORT-SCREEN OVERRIDES
   ========================================================================== */

/* Target Selection Dimmer */
#target-dimmer {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 20, 0.72);
  z-index: 40;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 14px 22px;
}

#target-dimmer.active {
  display: flex;
}

/* Modals & Spotlights */
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 18, 0.84);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.overlay-backdrop.active {
  display: flex;
  animation: fadeIn 0.35s ease;
}

#main-menu-overlay {
  z-index: 58;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  width: 100%;
  max-width: 356px;
  background: linear-gradient(180deg, #252f4a 0%, #151c2f 100%);
  border: 2px solid #e6ab3d;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  animation: modalPop 0.35s ease;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Flying FX Layer (Smooth Slow Flights) */
#fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  overflow: hidden;
}

.flying-card {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform var(--card-flight-ms) cubic-bezier(0.22, 0.88, 0.32, 1), opacity 0.36s ease;
}

.flying-coin {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform var(--coin-flight-ms) ease-in-out, opacity 0.36s ease;
}

/* Center-to-Player Action Callout (enlarges in center, then shrinks to acting player) */
.center-action-callout {
  position: absolute;
  width: 248px;
  padding: 10px 13px;
  border-radius: 15px;
  background: rgba(11, 17, 30, 0.96);
  border: 2px solid #f0b949;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.72), 0 0 24px rgba(250, 204, 21, 0.22);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  will-change: transform, opacity;
  transform-origin: center center;
}

.center-action-callout.tone-income { border-color: #eab308; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 20px rgba(234,179,8,0.28); }
.center-action-callout.tone-aid { border-color: #22c55e; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 20px rgba(34,197,94,0.28); }
.center-action-callout.tone-tax { border-color: #3b82f6; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 22px rgba(59,130,246,0.34); }
.center-action-callout.tone-steal { border-color: #ef4444; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 22px rgba(239,68,68,0.34); }
.center-action-callout.tone-assassinate { border-color: #10b981; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 22px rgba(16,185,129,0.34); }
.center-action-callout.tone-exchange { border-color: #a855f7; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 22px rgba(168,85,247,0.34); }
.center-action-callout.tone-raid { border-color: #f97316; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 24px rgba(249,115,22,0.38); }
.center-action-callout.tone-block { border-color: #38bdf8; box-shadow: 0 14px 32px rgba(0,0,0,0.72), 0 0 24px rgba(56,189,248,0.38); }

.callout-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.callout-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.callout-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #fef3c7;
  line-height: 1.15;
}

.callout-detail {
  font-size: 11px;
  font-weight: 800;
  color: #e2e8f0;
  line-height: 1.25;
}

/* Subtle Arena Shake on TERMINATED slam */
.shake-arena {
  animation: arenaShake 0.55s ease;
}

@keyframes arenaShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 3px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(2px, 1px); }
}

/* Quick Popovers */
.quick-popover {
  position: absolute;
  bottom: 130px;
  right: 12px;
  z-index: 50;
  background: #1e293b;
  border: 2px solid #f0b949;
  border-radius: 14px;
  padding: 7px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  display: none;
  animation: fadeScaleIn 0.18s ease;
}

.quick-popover.active {
  display: block;
}

.nice-scroll::-webkit-scrollbar { width: 4px; }
.nice-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 99px; }
.nice-scroll::-webkit-scrollbar-thumb { background: rgba(240, 185, 73, 0.45); border-radius: 99px; }

/* Extra safety for very short mobile screens */
@media (max-height: 660px) {
  .human-dock { height: 90px; }
  .role-card { width: 58px; height: 82px; }
  .human-avatar-wrap { width: 44px; height: 44px; }
  .bottom-tray { height: 112px; padding: 5px 8px 4px; }
  .action-dock-grid { height: 78px; }
  .action-grid-6 { grid-template-rows: repeat(2, 36px); }
  .act-btn { height: 36px; }
  .act-btn-main { font-size: 9.8px; }
  .raid-btn { height: 78px; }
}
